2013-08-27 16:43:30 +01:00
|
|
|
module FileStoreHelper
|
2013-08-21 12:00:22 +01:00
|
|
|
|
|
|
|
def file_store_results_url(sha1, file_name)
|
|
|
|
url = "#{APP_CONFIG['file_store_url']}/api/v1/file_stores/#{sha1}"
|
|
|
|
url << '.log?show=true' if file_name =~ /.*\.(log|txt)$/
|
|
|
|
url
|
|
|
|
end
|
|
|
|
|
2013-08-27 16:43:30 +01:00
|
|
|
def link_to_file_store(file_name, sha1)
|
|
|
|
if sha1.present?
|
|
|
|
link_to file_name, file_store_results_url(sha1, file_name)
|
|
|
|
else
|
|
|
|
I18n.t('layout.no_')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2013-08-21 12:00:22 +01:00
|
|
|
end
|