X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/91fe76f4a3f8e5f59d12343ae69d2ba5a43d8e55..e3e54264e8bc767e1ec773cff4e5bdf4c4934a36:/apps/workbench/app/models/job.rb diff --git a/apps/workbench/app/models/job.rb b/apps/workbench/app/models/job.rb index 9e9c096787..c59bb89fe8 100644 --- a/apps/workbench/app/models/job.rb +++ b/apps/workbench/app/models/job.rb @@ -7,12 +7,8 @@ class Job < ArvadosBase "#{script} job" end - def attribute_editable? attr, *args - if attr.to_sym == :description - super && attr.to_sym == :description - else - false - end + def editable_attributes + %w(description) end def self.creatable? @@ -38,6 +34,14 @@ class Job < ArvadosBase arvados_api_client.api "jobs/#{self.uuid}/", "cancel", {} end + def self.queue_size + arvados_api_client.api("jobs/", "queue_size", {"_method"=> "GET"})[:queue_size] rescue 0 + end + + def self.queue + arvados_api_client.unpack_api_response arvados_api_client.api("jobs/", "queue", {"_method"=> "GET"}) + end + def textile_attributes [ 'description' ] end