rbbt-rest 1.8.94 → 1.8.95

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: 1f8e071798aafcc038b3fb053a0f052bd527e2e5
4
- data.tar.gz: 8d44d86417f78dce1465ddce3e813ecd9bf32492
3
+ metadata.gz: 6b9fc8304ee87e46f7d53b1807e0de225632bd9b
4
+ data.tar.gz: e9f65fd208eca9c0c18e1c47c6f5f08c0ffdf8e7
5
5
  SHA512:
6
- metadata.gz: f74b8e9c3740e7c16f5ce57669674dbcf8bb807f8f8c10f02dca48b3959ed117ddc878c7dea879c60a4c51a2aceb58b81172044b89fcec46a403313164a7d4fd
7
- data.tar.gz: be06edf375f660f5fa837a7eb10073e92c7860609ca0c331f238ec98487e7b975955f3de2034864afcaf2a27863c046b9f77449d281ecd61adafd7ad4daf9f51
6
+ metadata.gz: b236b0cc741d0f47b0772761f1814578905dff43658545ff1220c04654f458fadef836ec5618b8cd380dd7e82cb2646987546c2cb25cb4cd0082c34c9926520b
7
+ data.tar.gz: 8500666f11d539c3281836e3168be7d5b0d5a9cb0d79e2024b0816902846f9ae4b0cda89a8604c92fc44a1c894d4ce35623005514fb75c7f61246007f431caae
@@ -53,6 +53,11 @@ module EntityRESTHelpers
53
53
  input_value = values[input]
54
54
  input_default = input_defaults[input]
55
55
  input_option = input_options[input]
56
+ input_option ||= {}
57
+ if form_options[:method] != 'POST' && ! input_option.include?(:no_file)
58
+ input_option[:no_file] = true
59
+ input_options[input] = input_option
60
+ end
56
61
  end
57
62
 
58
63
  locals = {}
@@ -183,6 +183,7 @@ module Sinatra
183
183
  when 'json', 'raw', 'binary'
184
184
  halt 202
185
185
  else
186
+ @title = [[job.workflow, job.task_name] * "#", job.clean_name] * " "
186
187
  wait_on job
187
188
  end
188
189
  else
@@ -24,6 +24,7 @@ module WorkflowRESTHelpers
24
24
  if job
25
25
  locals[:job] = job
26
26
  @step = job
27
+ @title = [[workflow,task] * "#", job.clean_name] * " "
27
28
  cache_type = execution_type(workflow, task)
28
29
  server_key = $app_name
29
30
  html_dir = job.file('.html')
@@ -148,7 +148,7 @@ $cyan: rgba(50, 211, 255, 1)
148
148
  color: $cyan
149
149
  .status.done
150
150
  color: $green
151
- .status.error
151
+ .status.error, .status.aborted
152
152
  color: $red
153
153
  .workflow
154
154
  font-weight: bold
@@ -25,6 +25,21 @@
25
25
  - eta = Misc.format_seconds(eta)
26
26
  - ellapsed = Misc.format_seconds(ellapsed)
27
27
  - pgr_str = " - " + pgr[:last_percent].to_s + "%" + " " + eta
28
+
29
+ :deferjs
30
+ var percent = '#{pgr[:last_percent]}';
31
+ var task = '#{dep.task_name}';
32
+ var title = $('head title');
33
+ var current = title.text();
34
+ var newtext;
35
+ var pos = current.indexOf('%');
36
+ if (pos == -1){
37
+ newtext = task + " - " + percent + "% " + current
38
+ }else{
39
+ newtext = task + " - " + percent + "% " + current.slice(pos+1)
40
+ }
41
+ title.text(newtext)
42
+
28
43
  - else
29
44
  - pgr_str = " - " + pgr[:ticks].to_s
30
45
  - status = dep_status.to_s + pgr_str
@@ -19,16 +19,55 @@
19
19
  - types = consume_parameter(:input_types, info) || {}
20
20
  - defaults = consume_parameter(:input_defaults, info) || {}
21
21
  - descriptions = consume_parameter(:input_descriptions, info) || {}
22
+ - use = consume_parameter(:input_use, info) || {}
22
23
  - options = consume_parameter(:input_options, info) || {}
23
24
  - values = consume_parameter(:values, info) || {}
24
25
 
26
+ - workflows = use.values.collect{|i| i.keys}.flatten.collect{|v| v.to_s}.uniq
27
+ - if workflows.length > 1 && use && use.any?
28
+ - ws_id = 'workflow_select_' << id
29
+ .ui.very.basic.segment
30
+ .header
31
+ Select workflow inputs to show
32
+ .description
33
+ .ui.buttons.workflow_select(id=ws_id)
34
+ - workflows.each do |wfname|
35
+ .ui.tiny.button.view_workflow.active= wfname
36
+ %hr
37
+ :sass
38
+ form
39
+ .ui.buttons.workflow_select
40
+ margin-bottom: 2em
41
+ :deferjs
42
+ $('##{ws_id}').find('.view_workflow').click(function(){
43
+ var button = $(this);
44
+ var workflow = button.text()
45
+ button.toggleClass('active')
46
+ if (!button.hasClass('active'))
47
+ $('##{id}').find('div.field[attr-use_tags*=' + workflow + ']').hide()
48
+ if (button.hasClass('active'))
49
+ $('##{id}').find('div.field[attr-use_tags*=' + workflow + ']').show()
50
+ })
51
+
25
52
  - inputs.each do |input|
53
+ - uses = use.nil? ? nil : use[input]
54
+ - use_tags = []
55
+ - if uses
56
+ - uses.each do |workflow, tasks|
57
+ - tasks.each do |task|
58
+ - use_tags << [workflow, task] * "#"
26
59
  - input_id = id.nil? ? nil : id + "__" << input.to_s
27
60
  - hide = (options[input] != nil and options[input][:hide])
28
- %div(class="field #{types[input]} #{input} #{hide ? 'hide' : ''}")
61
+ %div(class="field #{types[input]} #{input} #{hide ? 'hide' : ''}" attr-use_tags='#{use_tags * " "}')
29
62
  - input_options = options[input]
30
63
  - input_options = input_options.dup unless input_options.nil?
31
- !~ form_input(input, types[input], defaults[input], values[input] || locals[input], descriptions[input], input_id, input_options)
64
+ - description = descriptions[input]
65
+ - if use[input]
66
+ - description += "\n\nUsed in:\n"
67
+ - uses.each do |workflow, tasks|
68
+ - tasks.each do |task|
69
+ - description << " * " << [workflow.to_s, task] * "#" << "\n"
70
+ !~ form_input(input, types[input], defaults[input], values[input] || locals[input], description, input_id, input_options)
32
71
 
33
72
 
34
73
  .input.field.submit
@@ -1,8 +1,9 @@
1
1
  - filename = 'R-png_' << rand(10000).to_s unless defined? filename and filename
2
2
  - text = filename unless defined? text and text
3
3
 
4
- - width = 500 unless defined? width and width
5
- - height = 500 unless defined? height and height
4
+ - size = 500 unless defined? size and size
5
+ - width = size unless defined? width and width
6
+ - height = size unless defined? height and height
6
7
  - plot = block.call unless (defined? plot and plot) or not defined? block
7
8
 
8
9
  - filename += '.png' unless filename =~ /\.png$/i
@@ -29,6 +29,18 @@
29
29
  - eta = ellapsed * (1 - ratio)
30
30
  - eta = Misc.format_seconds(eta)
31
31
  - ellapsed = Misc.format_seconds(ellapsed)
32
+ :deferjs
33
+ var percent = '#{progress[:last_percent]}';
34
+ var title = $('head title');
35
+ var current = title.text();
36
+ var newtext;
37
+ var pos = current.indexOf('%');
38
+ if (pos == -1){
39
+ newtext = percent + "% " + current
40
+ }else{
41
+ newtext = percent + "% " + current.slice(pos+1)
42
+ }
43
+ title.text(newtext)
32
44
  - else
33
45
  - ellapsed = '?'
34
46
  - eta = '?'
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.94
4
+ version: 1.8.95
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-03-08 00:00:00.000000000 Z
11
+ date: 2018-05-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake