X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/1f18112293b02114b4dc5b279f18b15e4b9a6655..695702b379a7be5abd96742ffee7f4f4bfcef2a8:/apps/workbench/app/models/proxy_work_unit.rb diff --git a/apps/workbench/app/models/proxy_work_unit.rb b/apps/workbench/app/models/proxy_work_unit.rb index 7cf0a1b455..feab5d8eb4 100644 --- a/apps/workbench/app/models/proxy_work_unit.rb +++ b/apps/workbench/app/models/proxy_work_unit.rb @@ -23,21 +23,31 @@ class ProxyWorkUnit < WorkUnit get(:modified_by_user_uuid) end + def owner_uuid + get(:owner_uuid) + end + def created_at t = get(:created_at) - t = Time.parse(t) if (t.andand.class == String) + t = Time.parse(t) if (t.is_a? String) t end def started_at t = get(:started_at) - t = Time.parse(t) if (t.andand.class == String) + t = Time.parse(t) if (t.is_a? String) + t + end + + def modified_at + t = get(:modified_at) + t = Time.parse(t) if (t.is_a? String) t end def finished_at t = get(:finished_at) - t = Time.parse(t) if (t.andand.class == String) + t = Time.parse(t) if (t.is_a? String) t end @@ -45,13 +55,15 @@ class ProxyWorkUnit < WorkUnit state = get(:state) if ["Running", "RunningOnServer", "RunningOnClient"].include? state "Running" + elsif state == 'New' + "Not started" else state end end def state_bootstrap_class - state = get(:state) + state = state_label case state when 'Complete' 'success' @@ -65,7 +77,7 @@ class ProxyWorkUnit < WorkUnit end def success? - state = get(:state) + state = state_label if state == 'Complete' true elsif state == 'Failed' or state == 'Cancelled' @@ -123,7 +135,7 @@ class ProxyWorkUnit < WorkUnit end def progress - state = get(:state) + state = state_label if state == 'Complete' return 1.0 elsif state == 'Failed' or state == 'Cancelled' @@ -149,6 +161,10 @@ class ProxyWorkUnit < WorkUnit [] end + def outputs + [] + end + def title "process" end @@ -312,13 +328,17 @@ class ProxyWorkUnit < WorkUnit resp end + def log_object_uuids + [uuid] + end + protected - def get key - if @proxied.respond_to? key - @proxied.send(key) - elsif @proxied.is_a?(Hash) - @proxied[key] + def get key, obj=@proxied + if obj.respond_to? key + obj.send(key) + elsif obj.is_a?(Hash) + obj[key] end end end