rbbt-rest 1.8.95 → 1.8.96
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rbbt/rest/common/cache.rb +13 -0
- data/lib/rbbt/rest/common/table.rb +5 -2
- data/lib/rbbt/rest/workflow/jobs.rb +13 -0
- data/share/views/form.haml +26 -0
- data/share/views/job_info.haml +17 -1
- data/share/views/job_result/tsv.haml +14 -8
- data/share/views/partials/table.haml +2 -1
- data/share/views/partials/table/files.haml +3 -0
- data/share/views/public/js/rbbt.basic.js +5 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0429c45627c2177b14bb51e6a648f162394873db'
|
4
|
+
data.tar.gz: c96ed9340c6998578a371cdcf899a39bf1ae9434
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 93ecbc69ba55b7607a092fa84ec846dff70970cda74580e52c7538737df3be15478229cdb2b527cee4dbbced7afda99246c5c0e66ad39a788b0a57b6e1147447
|
7
|
+
data.tar.gz: 8a1c4ecc6ba94b28348f7f0f784bca9d702415baf36b6aad0580a387e6e986a6788c94345caee5e1d9c4dafaa13f5d533fdf3c6fc0a70df632ffd65be5fc9d6e
|
@@ -183,6 +183,19 @@ module RbbtRESTHelpers
|
|
183
183
|
excel_file = TmpFile.tmp_file
|
184
184
|
tsv.excel(excel_file, :sort_by => @excel_sort_by, :sort_by_cast => @excel_sort_by_cast, :name => true, :remove_links => true)
|
185
185
|
send_file excel_file, :type => 'application/vnd.ms-excel', :filename => 'table.xls'
|
186
|
+
when "heatmap"
|
187
|
+
tsv, tsv_options = load_tsv(fragment_file)
|
188
|
+
content_type "text/html"
|
189
|
+
data = nil
|
190
|
+
png_file = TmpFile.tmp_file
|
191
|
+
width = tsv.fields.length * 10 + 500
|
192
|
+
height = tsv.size * 10 + 500
|
193
|
+
width = 10000 if width > 10000
|
194
|
+
height = 10000 if height > 10000
|
195
|
+
tsv.R <<-EOF
|
196
|
+
rbbt.pheatmap(file='#{png_file}', data, width=#{width}, height=#{height})
|
197
|
+
EOF
|
198
|
+
send_file png_file, :type => 'image/png', :filename => fragment_file + ".heatmap.png"
|
186
199
|
else
|
187
200
|
content_type "text/html"
|
188
201
|
|
@@ -451,10 +451,13 @@ module RbbtRESTHelpers
|
|
451
451
|
tsv, table_options = load_tsv(file)
|
452
452
|
end
|
453
453
|
|
454
|
-
|
455
|
-
rows, length = tsv_rows(tsv)
|
454
|
+
table_options[:heatmap] = tsv.cast && %w(to_i to_f).include?(tsv.cast.to_s) unless table_options.include? :heatmap
|
456
455
|
|
457
456
|
table_options = default_table_options.merge(table_options)
|
457
|
+
|
458
|
+
content_type "text/html"
|
459
|
+
rows, length = tsv_rows(tsv, @page || table_options[:page], @filter || table_options[:filter], @column || table_options[:column])
|
460
|
+
|
458
461
|
partial_render('partials/table', {:total_size => length, :rows => rows, :header => tsv.all_fields, :table_options => table_options})
|
459
462
|
end
|
460
463
|
end
|
@@ -166,6 +166,19 @@ module WorkflowRESTHelpers
|
|
166
166
|
result = job.load
|
167
167
|
result.excel(excel_file, :name => @excel_use_name,:sort_by => @excel_sort_by, :sort_by_cast => @excel_sort_by_cast, :remove_links => true)
|
168
168
|
send_file excel_file, :type => 'application/vnd.ms-excel', :filename => job.clean_name + '.xls'
|
169
|
+
when :heatmap
|
170
|
+
tsv = job.load
|
171
|
+
content_type "text/html"
|
172
|
+
data = nil
|
173
|
+
png_file = TmpFile.tmp_file
|
174
|
+
width = tsv.fields.length * 10 + 500
|
175
|
+
height = tsv.size * 10 + 500
|
176
|
+
width = 10000 if width > 10000
|
177
|
+
height = 10000 if height > 10000
|
178
|
+
tsv.R <<-EOF
|
179
|
+
rbbt.pheatmap(file='#{png_file}', data, width=#{width}, height=#{height})
|
180
|
+
EOF
|
181
|
+
send_file png_file, :type => 'image/png', :filename => job.name + ".heatmap.png"
|
169
182
|
else
|
170
183
|
raise "Unsupported format: #{ format }"
|
171
184
|
end
|
data/share/views/form.haml
CHANGED
@@ -59,3 +59,29 @@
|
|
59
59
|
return false
|
60
60
|
})
|
61
61
|
})
|
62
|
+
|
63
|
+
:deferjs
|
64
|
+
var autofill = rbbt.LS.load('autofill')
|
65
|
+
var workflow = '#{workflow}'
|
66
|
+
var task_name = '#{task}'
|
67
|
+
var key = [workflow, task_name].join("#")
|
68
|
+
|
69
|
+
if (autofill != undefined && autofill[key]){
|
70
|
+
var inputs = autofill[key]
|
71
|
+
var form = $('.workflow_task[id=#{id}] > .form > form')
|
72
|
+
forHash(inputs, function(name,value){
|
73
|
+
var input = form.find('[name=' + name + ']');
|
74
|
+
if (input.length > 0 && typeof value == 'string' && value.match(/TRUNCATED/)){
|
75
|
+
var err= "Error loading input " + name + ". It was truncated due to it length.";
|
76
|
+
rbbt.modal.controller.error(m('.ui.error.message', [m('.header', err), m('.description', m('pre', m.trust(value)))]), "Form entry not loaded correctly")
|
77
|
+
}
|
78
|
+
if (input.is('[type=checkbox]')){
|
79
|
+
input.prop('checked', value);
|
80
|
+
}else{
|
81
|
+
input.val(value);
|
82
|
+
}
|
83
|
+
})
|
84
|
+
}
|
85
|
+
rbbt.LS.delete('autofill')
|
86
|
+
|
87
|
+
|
data/share/views/job_info.haml
CHANGED
@@ -14,8 +14,24 @@
|
|
14
14
|
.ui.header
|
15
15
|
%h3 Inputs (recursive)
|
16
16
|
.ui.content
|
17
|
+
- inputs = job.recursive_inputs
|
18
|
+
- autofill_id = "autofill_" << Misc.digest(job.name)
|
19
|
+
.ui.button.autofill(id=autofill_id) Auto-fill form with inputs
|
20
|
+
:deferjs
|
21
|
+
$('##{autofill_id}').click(function(){
|
22
|
+
var inputs = #{inputs.to_hash.to_json};
|
23
|
+
inputs['jobname'] = '#{job.clean_name}';
|
24
|
+
var workflow = '#{job.workflow.to_s}';
|
25
|
+
var task_name = '#{job.task_name.to_s}';
|
26
|
+
var key = [workflow, task_name].join("#");
|
27
|
+
|
28
|
+
var info = {};
|
29
|
+
info[key] = inputs;
|
30
|
+
rbbt.LS.store('autofill', info);
|
31
|
+
var url = '/' + workflow + '/' + task_name;
|
32
|
+
window.location = rbbt.url_add_script_name(url);
|
33
|
+
})
|
17
34
|
%dl
|
18
|
-
- inputs = job.recursive_inputs
|
19
35
|
- inputs.zip(inputs.fields).each do |i,f|
|
20
36
|
%dt= f
|
21
37
|
%dd
|
@@ -1,16 +1,22 @@
|
|
1
1
|
- if result.any?
|
2
2
|
- table_id = [workflow.to_s, task, jobname] * "_"
|
3
3
|
- table_class = 'workflow_tsv_result'
|
4
|
-
-
|
5
|
-
- page = result.size > 50 ? "1" : nil
|
6
|
-
- rescue
|
7
|
-
- page = "1"
|
4
|
+
- page = result.size > 50 ? "1" : nil
|
8
5
|
|
9
|
-
|
10
|
-
|
6
|
+
= table :table_id => table_id, :page => page, :table_class => table_class, :row_ids => :use, :table_url => jobname ? to(File.join('/', workflow.to_s, task, jobname)) : nil do
|
7
|
+
- result
|
11
8
|
|
12
|
-
|
13
|
-
|
9
|
+
-#
|
10
|
+
- begin
|
11
|
+
- page = result.size > 50 ? "1" : nil
|
12
|
+
- rescue
|
13
|
+
- page = "1"
|
14
|
+
|
15
|
+
- rows, total_size = tsv_rows(result, page)
|
16
|
+
- header = result.all_fields
|
17
|
+
|
18
|
+
= workflow_partial('partials/table', workflow, task,
|
19
|
+
locals.merge(:table_id => table_id, :page => page, :table_class => table_class, :rows => rows, :total_size => total_size, :header => result.all_fields, :row_ids => :use, :table_url => jobname ? to(File.join('/', workflow.to_s, task, jobname)) : nil))
|
14
20
|
|
15
21
|
- else
|
16
22
|
|
@@ -11,6 +11,7 @@
|
|
11
11
|
- total_size = table_options[:total_size] unless defined? total_size and total_size
|
12
12
|
- filters = table_options[:filters] unless defined? filters and filters
|
13
13
|
- span = table_options[:span] unless defined? span and not span.nil?
|
14
|
+
- heatmap = table_options[:heatmap] unless defined? heatmap and not heatmap.nil?
|
14
15
|
|
15
16
|
- list_links = table_options[:list_links] unless defined? list_links and list_links
|
16
17
|
|
@@ -76,7 +77,7 @@
|
|
76
77
|
|
77
78
|
= partial_render('partials/table/column', :table_url => table_url, :header => header, :entity_headers => entity_headers)
|
78
79
|
|
79
|
-
= partial_render('partials/table/files', :table_url => table_url)
|
80
|
+
= partial_render('partials/table/files', :table_url => table_url, :heatmap => heatmap)
|
80
81
|
|
81
82
|
|
82
83
|
|
@@ -2,3 +2,6 @@
|
|
2
2
|
%a(href="#{add_GET_param(table_url, "_format", "tsv")}") tsv
|
3
3
|
.excel.ui.wrap.compact.button
|
4
4
|
%a(href="#{add_GET_param(table_url, "_format", "excel")}") excel
|
5
|
+
- if heatmap
|
6
|
+
.excel.ui.wrap.compact.button
|
7
|
+
%a(href="#{add_GET_param(table_url, "_format", "heatmap")}") heatmap
|
@@ -168,7 +168,11 @@ rbbt.LS.load = function(key){
|
|
168
168
|
}
|
169
169
|
|
170
170
|
rbbt.LS.store = function(key, value){
|
171
|
-
localStorage[key] = JSON.stringify(value)
|
171
|
+
localStorage[key] = JSON.stringify(value);
|
172
|
+
}
|
173
|
+
|
174
|
+
rbbt.LS.delete = function(key){
|
175
|
+
delete(localStorage[key]);
|
172
176
|
}
|
173
177
|
|
174
178
|
|
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.
|
4
|
+
version: 1.8.96
|
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-05-
|
11
|
+
date: 2018-05-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|