rbbt-rest 1.8.102 → 1.8.103

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f16494209da8fb67e9c50d88a83c7c7dbe43fa5e
4
- data.tar.gz: 45f99f411f935649369407f20f5bcb2beecfd94e
3
+ metadata.gz: 72db9cac8d95433bd7eaa8ceaa4751642898af76
4
+ data.tar.gz: 5749497c739b60c8f07517009b46a45824736e05
5
5
  SHA512:
6
- metadata.gz: 3bd350989880dd42ebf31be8918f21501330c1fa8810fced0517b3b3e06b4fc6edaac954b740b31f346661f795aaee70183469e60432eafc33c5169a1e119f5c
7
- data.tar.gz: e6a20d51c05a748fbe047bbd2bdf304dbc9a285f19cebcc2646994f0f8fa6ffb771f6bc24538c7e540ff8cc86bfa6d17388d5619ee23c73d10d6020efe68fe61
6
+ metadata.gz: 6c7de30acecf251bb220d557f67f5b81cdc91db7c11a74e17518823918b3788a96d17c8d46ea7b6b560a9a49dc126089f97f038515ab9fb903dbd658763f1a94
7
+ data.tar.gz: 0f6da7889bcd4095811b4a66b478b5cd5f8fd8c44099ab52f4b3322ff3a7ba482b3a16a275fe62b933277ffcb83bcb7479b6a6856578a943ee74967bf491bf57
@@ -153,7 +153,7 @@ module Sinatra
153
153
 
154
154
  execution_type = execution_type(workflow, task)
155
155
 
156
- job = workflow.load_id(File.join(task, job))
156
+ job = workflow.fast_load_id(File.join(task, job))
157
157
 
158
158
  halt 404, "Job not found: #{job.path} (#{job.status})" if job.status == :noinfo and not job.done?
159
159
 
@@ -230,6 +230,28 @@ module Sinatra
230
230
  case format
231
231
  when :html
232
232
  workflow_render('job_info', workflow, task, :job => job, :info => job.info)
233
+ when :input_bundle
234
+ task_info = workflow.task_info(task)
235
+ input_types = task_info[:input_types]
236
+ task_inputs = task_info[:inputs]
237
+ TmpFile.with_file do |basedir|
238
+ dir = File.join(basedir, 'inputs')
239
+ job.recursive_inputs.zip(job.recursive_inputs.fields).each do |value,name|
240
+ next unless task_inputs.include? name
241
+ next if value.nil?
242
+ path = File.join(dir, name.to_s)
243
+ type = input_types[name]
244
+ if type == :array
245
+ Open.write(path, value * "\n")
246
+ else
247
+ Open.write(path, value.to_s)
248
+ end
249
+ end
250
+ filename = File.join(basedir, job.clean_name + '.input_bundle.tar.gz')
251
+ content_type "application/tar+gzip"
252
+ Misc.consume_stream(Misc.tarize(dir), false, filename)
253
+ send_file filename, :filename => File.basename(filename)
254
+ end
233
255
  when :json
234
256
  halt 200, {}.to_json if not_started
235
257
  content_type "application/json"
@@ -263,7 +285,7 @@ module Sinatra
263
285
 
264
286
  execution_type = execution_type(workflow, task)
265
287
 
266
- job = workflow.load_id(File.join(task, job))
288
+ job = workflow.fast_load_id(File.join(task, job))
267
289
 
268
290
  case format
269
291
  when :html
@@ -285,7 +307,7 @@ module Sinatra
285
307
 
286
308
  execution_type = execution_type(workflow, task)
287
309
 
288
- job = workflow.load_id(File.join(task, job))
310
+ job = workflow.fast_load_id(File.join(task, job))
289
311
 
290
312
  path = job.file(filename)
291
313
  #require 'mimemagic'
@@ -313,7 +335,7 @@ module Sinatra
313
335
  delete "/#{workflow.to_s}/:task/:job" do
314
336
  task = consume_parameter(:task)
315
337
  job = consume_parameter(:job)
316
- job = workflow.load_id(File.join(task, job))
338
+ job = workflow.fast_load_id(File.join(task, job))
317
339
 
318
340
  raise Workflow::TaskNotFoundException.new workflow, task unless workflow.tasks.include? task.to_sym
319
341
 
@@ -1,3 +1,4 @@
1
+ - done = job.done? || job.status == :done
1
2
  .error.ui.segment.error.message
2
3
  %h5.ui.header Error on #{format_name File.basename(job.name)}
3
4
  - if job.status == :error
@@ -5,7 +6,7 @@
5
6
  %pre.error_message.ui.basic.segment.content
6
7
  = CGI.escapeHTML(job.messages[-1] || "")
7
8
  - else
8
- - if (dirty_files = job.dirty_files).any?
9
+ - if done && (dirty_files = job.dirty_files).any?
9
10
  %pre.error_message.ui.basic.segment.content
10
11
  Job dirty. Dependencies: #{dirty_files.collect{|d| d.path} * ", "}
11
12
 
@@ -15,7 +16,7 @@
15
16
  Job out of date. Dependencies: #{job.out_of_date.collect{|d| d.path} * ", "}
16
17
  - else
17
18
  %pre.error_message.ui.basic.segment.content
18
- Unknown Error
19
+ Unknown Error (status: #{job.status})
19
20
 
20
21
 
21
22
 
@@ -19,9 +19,13 @@
19
19
  .ui.header
20
20
  %h3 Inputs (recursive)
21
21
  .ui.content
22
+ - task_info = workflow.task_info(job.task_name)
23
+ - task_inputs = task_info[:inputs]
22
24
  - inputs = job.recursive_inputs
23
25
  - autofill_id = "autofill_" << Misc.digest(job.name)
24
26
  .ui.button.autofill(id=autofill_id) Auto-fill form with inputs
27
+ .ui.button.autofill(id=autofill_id)
28
+ %a(href="#{@ajax_path}?_format=input_bundle") Download input bundle
25
29
  :deferjs
26
30
  $('##{autofill_id}').click(function(){
27
31
  var inputs = #{inputs.to_hash.to_json};
@@ -38,6 +42,7 @@
38
42
  })
39
43
  %dl
40
44
  - inputs.zip(inputs.fields).each do |i,f|
45
+ - next unless task_inputs.include?(f)
41
46
  %dt= f
42
47
  %dd
43
48
  - case i
@@ -7,6 +7,7 @@
7
7
  overflow: auto
8
8
  text-overflow: ellipsis
9
9
 
10
+ - progress = false
10
11
  .wait.ui.segment.info.message
11
12
  %h3.ui.header Waiting on #{format_name File.basename(job.name)}
12
13
 
@@ -80,6 +81,17 @@
80
81
  - files_url = request.env["REQUEST_URI"].sub(/\?.*/,'') + '/files'
81
82
  %a.ui.blue.button.reload(href=files_url) Files
82
83
 
84
+ - if ! progress
85
+ :deferjs
86
+ var title = $('head title');
87
+ var current = title.text();
88
+ var newtext;
89
+ var pos = current.indexOf('%');
90
+ if (pos != -1){
91
+ newtext = current.slice(pos+1)
92
+ title.text(newtext)
93
+ }
94
+
83
95
 
84
96
  .ui.segment
85
97
  %h3.ui.header Log
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbbt-rest
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.102
4
+ version: 1.8.103
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Vazquez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-11-23 00:00:00.000000000 Z
11
+ date: 2018-11-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake