projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' into 6277-manifest-validation
[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 1006660696d000f7ed8f85cfc63cc09148fe36e8..3ece865959f10aabf70acfab6cde1dd9145cf6d5 100644
(file)
--- a/
apps/workbench/app/models/job.rb
+++ b/
apps/workbench/app/models/job.rb
@@
-7,16
+7,8
@@
class Job < ArvadosBase
"#{script} job"
end
"#{script} job"
end
- def attribute_editable? attr, *args
- if attr.to_sym == :description
- super && attr.to_sym == :description
- else
- false
- end
- end
-
- def self.creatable?
- false
+ def editable_attributes
+ %w(description)
end
def default_name
end
def default_name
@@
-42,24
+34,8
@@
class Job < ArvadosBase
arvados_api_client.api("jobs/", "queue_size", {"_method"=> "GET"})[:queue_size] rescue 0
end
arvados_api_client.api("jobs/", "queue_size", {"_method"=> "GET"})[:queue_size] rescue 0
end
- def state
- Job::state(self)
- 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
def textile_attributes
end
def textile_attributes