X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/c3e2a93527a137fbeb3e2bb13c5ab344a95ab47f..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 b1d758b8f2..feab5d8eb4 100644 --- a/apps/workbench/app/models/proxy_work_unit.rb +++ b/apps/workbench/app/models/proxy_work_unit.rb @@ -23,27 +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.andand.class == String) + 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 @@ -51,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' @@ -71,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' @@ -129,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' @@ -322,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