rbbt-rest 1.8.73 → 1.8.74

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d0a85202110e13c7cef87c4603a66276664ae3ec
4
- data.tar.gz: 789f9c4df0237c49e55cdeffce393edcc6aeceb8
3
+ metadata.gz: 26f50bb97e2ddbf2a2ec6e1ffb4c364b0e8214c6
4
+ data.tar.gz: f95b31690cd68e0af0c6ffaf999188f0e6a24deb
5
5
  SHA512:
6
- metadata.gz: 55b368b27199e1101b051555b342e89d025cfd92f5c51176e07f7d9668dc3cbb9ca13a1fbc35da69c3bb3505a43b1055731c743186d815795513185490adef59
7
- data.tar.gz: 980e2ad32343654a84932c6b472e8eca571f5dd3874219401c62818e8bf46b9cdcdb81d4842f6775701016b9812853801812cf036215532a8b5fcfb4580992ec
6
+ metadata.gz: c394da16c8e9a26fec93a45a1cec75bc46a59a90066bf162c99f8c6c94c863223c5ced2c40d5b09c45f261826b48312c2ed4d6a81b45b621f53e55d523d1baee
7
+ data.tar.gz: 42c006207252cd964ded888f579662f1281c739d0242025b79ec5a3928abcee1a094b741be195bef4d486ae0aa4b05dc637e76ae3ce6bc0e290a4f1e879ac945
@@ -130,6 +130,7 @@ module RbbtRESTHelpers
130
130
  when "table"
131
131
  halt 200, tsv2html(fragment_file)
132
132
  when "json"
133
+ content_type "application/json"
133
134
  halt 200, tsv_process(load_tsv(fragment_file).first).to_json
134
135
  when "tsv"
135
136
  content_type "text/tab-separated-values"
@@ -153,13 +153,15 @@ module Sinatra
153
153
 
154
154
  begin
155
155
  started = job.started?
156
+ waiting = job.waiting?
156
157
  done = job.done?
157
158
  error = job.error? || job.aborted?
159
+ started = started || done || error
158
160
 
159
161
  if done
160
162
  show_result job, workflow, task, params
161
163
  else
162
- if started
164
+ if started || waiting
163
165
  exec_type = execution_type(workflow, task)
164
166
  case
165
167
  when error
@@ -194,7 +196,7 @@ module Sinatra
194
196
 
195
197
  job = workflow.load_id(File.join(task, job))
196
198
 
197
- raise RbbtException.new "Job not found: #{job.path}" unless job.started?
199
+ raise RbbtException.new "Job not found: #{job.path}" unless job.started? or job.waiting? or job.error? or job.aborted?
198
200
 
199
201
  begin
200
202
  check_step job unless job.done?
@@ -129,7 +129,7 @@ dl > dd
129
129
  margin-left: 1em
130
130
 
131
131
 
132
- .dependencies
132
+ .dependencies, .job_info
133
133
  .status
134
134
  color: gold
135
135
  .status.waiting, .status.noinfo
@@ -12,22 +12,26 @@
12
12
  - clean_url = add_GET_param(remove_GET_param(request.env["REQUEST_URI"], "_layout"), "_update", "reload")
13
13
  %a.ui.blue.button.reload(href=clean_url) Reload
14
14
 
15
+ - info_url = request.env["REQUEST_URI"].sub(/\?.*/,'') + '/info'
16
+ %a.ui.blue.button.reload(href=info_url) Info
17
+
15
18
  - backtrace = job.info[:backtrace]
16
19
  - if backtrace and backtrace.any?
17
20
 
18
- %ul.error_backtrace.clean_list.ui.segment
21
+ .error_backtrace.clean_list.ui.segment
19
22
  .ui.header Backtrace
20
23
  %pre.ui.content
21
24
  - require 'rbbt/util/colorize'
22
25
  - pallete = {}
23
26
  - matches = %w(views workflows rbbt).collect{|w| /\/#{w}/ }
24
27
  - colors = Colorize.distinct(matches)
25
- - backtrace.each do |line|
26
- - color = nil
27
- - matches.each_with_index do |m,i|
28
- - if m.match(line)
29
- - color = colors[i].darken(0.3).to_s
30
- - break
28
+ %ul
29
+ - backtrace.each do |line|
30
+ - color = nil
31
+ - matches.each_with_index do |m,i|
32
+ - if m.match(line)
33
+ - color = colors[i].darken(0.3).to_s
34
+ - break
31
35
 
32
- - style = color ? ';color:'+color : ""
33
- %li(style="font-size:0.9em;font-family:monospace#{style}")= line.sub('`',"'")
36
+ - style = color ? ';color:'+color : ""
37
+ %li(style="font-size:0.9em;font-family:monospace#{style}")= line.sub('`',"'")
@@ -1,10 +1,38 @@
1
1
  - new_info = {}
2
- - info.each{|k,v| new_info[k] = v unless k.to_s == 'dependencies'}
3
- = hash2dl(new_info)
2
+ - info.each{|k,v| new_info[k] = v unless k.to_s == 'dependencies' || k.to_s == 'exception' || k.to_s == 'backtrace'}
3
+ - exception = info[:exception]
4
+
5
+ - status = info[:status]
6
+ .job_info.clean_list.ui.segment
7
+ .ui.header
8
+ Info:
9
+ %span.status(class=status)= job.name
10
+ = hash2dl(new_info)
11
+
12
+ - if exception
13
+ - backtrace = exception[:backtrace]
14
+ .error_backtrace.clean_list.ui.segment
15
+ .ui.header Backtrace
16
+ %pre.ui.content
17
+ - require 'rbbt/util/colorize'
18
+ - pallete = {}
19
+ - matches = %w(views workflows rbbt).collect{|w| /\/#{w}/ }
20
+ - colors = Colorize.distinct(matches)
21
+ %ul
22
+ - backtrace.each do |line|
23
+ - color = nil
24
+ - matches.each_with_index do |m,i|
25
+ - if m.match(line)
26
+ - color = colors[i].darken(0.3).to_s
27
+ - break
28
+
29
+ - style = color ? ';color:'+color : ""
30
+ %li(style="font-size:0.9em;font-family:monospace#{style}")= line.sub('`',"'")
4
31
 
5
32
  - if info[:dependencies] and info[:dependencies].any?
6
- %h3 Dependencies
7
- = partial_render('partials/dependencies', :job => job)
33
+ .ui.segment
34
+ %h3 Dependencies
35
+ = partial_render('partials/dependencies', :job => job)
8
36
  -#%ul
9
37
 
10
38
  - task_exports = workflow.synchronous_exports + workflow.asynchronous_exports
@@ -32,7 +32,7 @@
32
32
  - url = path.split("?").first
33
33
  %a(href=url) #{ name }
34
34
 
35
- - elsif wf and wf.task_exports.include? dep.task_name.to_sym
35
+ - elsif wf and Sinatra::RbbtRESTWorkflow::WORKFLOWS.include?(wf) and wf.task_exports.include? dep.task_name.to_sym
36
36
  - url = "/" + [dep_workflow.to_s, dep.task_name.to_s, dep.name.to_s] * "/"
37
37
  %a(href=url) #{ name }
38
38
 
@@ -98,6 +98,7 @@ function require_js(url, success, script){
98
98
  var _success = function(script_text){ required_js.push(url); console.log("Required and loaded JS: " + url); if (typeof success == 'function'){ success(script) }; }
99
99
  if (typeof rbbt.proxy != 'undefined')
100
100
  url = rbbt.proxy + url
101
+ url = rbbt.url_add_script_name(url)
101
102
  $.ajax({url: url, cache:cache, dataType:'script', async: async, success: _success} ).fail(function(jqxhr, settings, exception){ console.log('Failed to load ' + url + ': ' + exception)});
102
103
  }
103
104
  }
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.73
4
+ version: 1.8.74
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Vazquez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-17 00:00:00.000000000 Z
11
+ date: 2017-10-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake