projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
4036: when files in a collection are combined, create the new collection in the origi...
[arvados.git]
/
apps
/
workbench
/
app
/
models
/
job.rb
diff --git
a/apps/workbench/app/models/job.rb
b/apps/workbench/app/models/job.rb
index 309cadeb69554e1aac0a6dbeaa10b92d7adee30f..977eef91bf278ac5e9a528e935262dce478e4fa5 100644
(file)
--- a/
apps/workbench/app/models/job.rb
+++ b/
apps/workbench/app/models/job.rb
@@
-8,7
+8,11
@@
class Job < ArvadosBase
end
def attribute_editable? attr, *args
end
def attribute_editable? attr, *args
- false
+ if attr.to_sym == :description
+ super && attr.to_sym == :description
+ else
+ false
+ end
end
def self.creatable?
end
def self.creatable?
@@
-34,24
+38,15
@@
class Job < ArvadosBase
arvados_api_client.api "jobs/#{self.uuid}/", "cancel", {}
end
arvados_api_client.api "jobs/#{self.uuid}/", "cancel", {}
end
- def s
tat
e
- Job::state(self)
+ def s
elf.queue_siz
e
+ arvados_api_client.api("jobs/", "queue_size", {"_method"=> "GET"})[:queue_size] rescue 0
end
end
- def self.state job
- if not job[:cancelled_at].nil?
- "Canceled"
- elsif not job[:finished_at].nil? or not job[:success].nil?
- if job[:success]
- "Completed"
- else
- "Failed"
- end
- elsif job[:running]
- "Running"
- else
- "Queued"
- end
+ def self.queue
+ arvados_api_client.unpack_api_response arvados_api_client.api("jobs/", "queue", {"_method"=> "GET"})
end
end
+ def textile_attributes
+ [ 'description' ]
+ end
end
end