rbbt-rest 1.8.139 → 1.8.145
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 +11 -6
- data/lib/rbbt/rest/common/misc.rb +15 -0
- data/lib/rbbt/rest/common/render.rb +5 -0
- data/lib/rbbt/rest/file_server.rb +6 -3
- data/share/views/compass/card_templates.sass +9 -0
- data/share/views/entity_partials/action_controller.haml +1 -1
- data/share/views/entity_partials/entity_card.haml +2 -1
- data/share/views/public/js/rbbt.basic.js +2 -2
- data/share/views/public/js/rbbt/actions.js +21 -12
- data/share/views/public/plugins/js-cookie/js/js.cookie.js +83 -65
- metadata +2 -3
- data/share/views/main.haml +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 312766692a55969cc09bb092ff4b7e6d4984187c968585b8e704c883fa2f69f9
|
4
|
+
data.tar.gz: 4e6dcbe9238daea5ad9296067526086bc31a01b2b16f1f2cd35127b4e6ad8f44
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e7b72817fa8b7a3480891c71e7b3bf0333eddf1c8332a6893bed82e8d351d2c86b3a26f9803d830d722975a204d3a40b62a094716d919d22589fce82e2978e1e
|
7
|
+
data.tar.gz: 5b94f09eba05284b878a87e5908d05efc30bf6bbde1297e8dbecdd62929b4ef03208dc328243da72795a770d1cb3bda4ada8a41b61aa08e94f9616ab4e0a24b2
|
@@ -80,7 +80,7 @@ module RbbtRESTHelpers
|
|
80
80
|
|
81
81
|
step.instance_variable_set(:@url, clean_url)
|
82
82
|
step.instance_variable_set(:@url_path, URI(clean_url).path)
|
83
|
-
step.clean if step.error?
|
83
|
+
step.clean if step.error? || step.aborted?
|
84
84
|
|
85
85
|
Thread.current["step_path"] = step.path
|
86
86
|
# Issue
|
@@ -128,7 +128,7 @@ module RbbtRESTHelpers
|
|
128
128
|
|
129
129
|
halt 200, hash.to_json
|
130
130
|
when "table"
|
131
|
-
|
131
|
+
halt_html tsv2html(fragment_file)
|
132
132
|
when "json"
|
133
133
|
content_type "application/json"
|
134
134
|
halt 200, tsv_process(load_tsv(fragment_file).first).to_json
|
@@ -181,7 +181,6 @@ module RbbtRESTHelpers
|
|
181
181
|
require 'rbbt/tsv/excel'
|
182
182
|
tsv, tsv_options = load_tsv(fragment_file)
|
183
183
|
tsv = tsv_process(tsv)
|
184
|
-
content_type "text/html"
|
185
184
|
data = nil
|
186
185
|
excel_file = TmpFile.tmp_file
|
187
186
|
tsv.excel(excel_file, :sort_by => @excel_sort_by, :sort_by_cast => @excel_sort_by_cast, :name => true, :remove_links => true)
|
@@ -235,6 +234,8 @@ data = NULL
|
|
235
234
|
rescue
|
236
235
|
end
|
237
236
|
end
|
237
|
+
else
|
238
|
+
txt = nil
|
238
239
|
end
|
239
240
|
|
240
241
|
if mime
|
@@ -243,10 +244,14 @@ data = NULL
|
|
243
244
|
content_type "text/plain"
|
244
245
|
end
|
245
246
|
|
246
|
-
if
|
247
|
-
|
247
|
+
if mime && mime.to_s.include?("text/html")
|
248
|
+
halt_html txt || Open.read(fragment_file)
|
248
249
|
else
|
249
|
-
|
250
|
+
if File.exists?(fragment_file)
|
251
|
+
send_file fragment_file
|
252
|
+
else
|
253
|
+
halt 200, Open.read(fragment_file)
|
254
|
+
end
|
250
255
|
end
|
251
256
|
end
|
252
257
|
elsif Open.exists?(fragment_file + '.error')
|
@@ -298,6 +298,21 @@ module RbbtRESTHelpers
|
|
298
298
|
FileUtils.ln_s(path, dest)
|
299
299
|
"/permalink/#{ id }"
|
300
300
|
end
|
301
|
+
|
302
|
+
def fix_html(html)
|
303
|
+
if html !~ /^\s*<html/i
|
304
|
+
"<html><meta charset=#{html.encoding.to_s}/><body>" + html + "<body/><html/>"
|
305
|
+
else
|
306
|
+
html
|
307
|
+
end
|
308
|
+
end
|
309
|
+
|
310
|
+
def halt_html(html, response = 200)
|
311
|
+
content_type "text/html; charset=#{html.encoding.to_s}"
|
312
|
+
html = fix_html html
|
313
|
+
halt response, html
|
314
|
+
end
|
315
|
+
|
301
316
|
end
|
302
317
|
|
303
318
|
require 'haml'
|
@@ -147,6 +147,11 @@ module RbbtRESTHelpers
|
|
147
147
|
|
148
148
|
pid = @step.child{
|
149
149
|
begin
|
150
|
+
class << @step
|
151
|
+
def status=(message)
|
152
|
+
nil
|
153
|
+
end
|
154
|
+
end
|
150
155
|
Log.low("Fragment started: #{ fragment_file } - #{Process.pid}")
|
151
156
|
res = capture_haml fragment_code, &block
|
152
157
|
Log.low("Fragment writing: #{ fragment_file } - #{Process.pid}")
|
@@ -63,9 +63,12 @@ module Sinatra
|
|
63
63
|
Log.debug{"Resource: #{[resource, file, path, path.find] * " | "}"}
|
64
64
|
|
65
65
|
raise "File does not exist and can not create it" unless path.exists?
|
66
|
-
|
67
|
-
|
68
|
-
|
66
|
+
|
67
|
+
if path.directory?
|
68
|
+
directory_url = File.join("/resource", resource.to_s , 'get_directory') << '?' << "create=#{create}" << '&' << "directory=#{file}"
|
69
|
+
Log.debug{"Redirect to directory: #{[resource, file, path, path.find] * " | "} => #{directory_url}"}
|
70
|
+
redirect to(directory_url)
|
71
|
+
end
|
69
72
|
|
70
73
|
send_file path.find, :filename => path.find
|
71
74
|
end
|
@@ -23,7 +23,6 @@
|
|
23
23
|
- info = card.entity.info
|
24
24
|
- info.delete :annotation_types
|
25
25
|
- if info.any? or card.meta or card.list_container
|
26
|
-
- empty = false
|
27
26
|
.meta
|
28
27
|
- if info.any?
|
29
28
|
%h3 Meta data
|
@@ -33,8 +32,10 @@
|
|
33
32
|
- case card.meta
|
34
33
|
- when nil
|
35
34
|
- when Hash
|
35
|
+
- empty = false
|
36
36
|
= hash2dl(card.meta)
|
37
37
|
- when Proc
|
38
|
+
- empty = false
|
38
39
|
= fragment :meta, &card.meta
|
39
40
|
|
40
41
|
- if card.list_container
|
@@ -160,7 +160,7 @@ rbbt.post = function(url, data, params){
|
|
160
160
|
// Cookies
|
161
161
|
|
162
162
|
rbbt.set_cookie = function(name,value){
|
163
|
-
Cookies.set(name, value)
|
163
|
+
Cookies.set(name, value, { sameSite: 'strict'})
|
164
164
|
}
|
165
165
|
|
166
166
|
rbbt.get_cookie = function(name){
|
@@ -171,7 +171,7 @@ rbbt.get_cookie = function(name){
|
|
171
171
|
}
|
172
172
|
|
173
173
|
rbbt.remove_cookie = function(name){
|
174
|
-
Cookies.remove(name)
|
174
|
+
Cookies.remove(name, { sameSite: 'strict'})
|
175
175
|
}
|
176
176
|
|
177
177
|
// LocalStorage
|
@@ -89,7 +89,7 @@ $.widget("rbbt.action_controller", {
|
|
89
89
|
this.options.complete = function(jqXHR, textStatus){
|
90
90
|
var action_controller = tool.options.controller
|
91
91
|
var action_list_item = action_controller.find('.action_menu > .loading, .action_menu > .active')
|
92
|
-
var action_div =
|
92
|
+
var action_div = tool._loader();
|
93
93
|
|
94
94
|
if (jqXHR.status == 202){
|
95
95
|
if (action_div.attr('reload-attempts') != '0'){
|
@@ -101,18 +101,18 @@ $.widget("rbbt.action_controller", {
|
|
101
101
|
var progress = response.find('.step.progress')
|
102
102
|
|
103
103
|
text = [$('<div class="header">').html(stat), $('<div class="content">').html(message)]
|
104
|
-
action_controller.
|
104
|
+
action_controller.siblings('.action_progress').html("").append(text).append(progress);
|
105
105
|
update_rbbt()
|
106
106
|
}
|
107
107
|
}else{
|
108
|
-
action_controller.
|
108
|
+
action_controller.siblings('.action_progress').html("");
|
109
109
|
action_controller.removeClass('loading').removeClass('disabled');
|
110
110
|
action_list_item.removeClass('loading').removeClass('disabled');
|
111
111
|
|
112
112
|
action_controller.find('.controls > .reload').removeClass('disabled');
|
113
113
|
}
|
114
114
|
|
115
|
-
var action_div =
|
115
|
+
var action_div = tool._loader();
|
116
116
|
action_controller.find('.controls > .url').removeClass('disabled');
|
117
117
|
if (action_div.find('> .action_card > .action_parameters').length > 0){
|
118
118
|
action_controller.find('.controls > .parameters').removeClass('disabled');
|
@@ -147,6 +147,9 @@ $.widget("rbbt.action_controller", {
|
|
147
147
|
link = action_list_item
|
148
148
|
|
149
149
|
|
150
|
+
var action_controller = this.options.controller;
|
151
|
+
action_controller.find('.controls > .reload').addClass('disabled');
|
152
|
+
|
150
153
|
this._load_action(link);
|
151
154
|
|
152
155
|
var action = link.html()
|
@@ -173,7 +176,7 @@ $.widget("rbbt.action_controller", {
|
|
173
176
|
_pin_parameters: function(){
|
174
177
|
var controller = $(this.element)
|
175
178
|
var action = $(this.element).find('.action_menu .active a').first().html()
|
176
|
-
var loader =
|
179
|
+
var loader = this._loader();
|
177
180
|
this.options.saved[action] = loader.attr('form-params')
|
178
181
|
controller.find('> .controls > .pin').addClass('saved')
|
179
182
|
this._dump()
|
@@ -190,7 +193,7 @@ $.widget("rbbt.action_controller", {
|
|
190
193
|
},
|
191
194
|
|
192
195
|
_loader: function(){
|
193
|
-
return $(this.element).
|
196
|
+
return $(this.element).siblings('.action_loader').first();
|
194
197
|
},
|
195
198
|
|
196
199
|
_url: function(){
|
@@ -200,8 +203,8 @@ $.widget("rbbt.action_controller", {
|
|
200
203
|
},
|
201
204
|
|
202
205
|
_open_url: function(){
|
203
|
-
var action_controller = this.element
|
204
|
-
var action_div =
|
206
|
+
var action_controller = this.element;
|
207
|
+
var action_div = this._loader();
|
205
208
|
|
206
209
|
if (this._url() !== undefined){
|
207
210
|
window.location = this._url();
|
@@ -216,7 +219,11 @@ $.widget("rbbt.action_controller", {
|
|
216
219
|
var action_list_item = $(e);
|
217
220
|
var action_list = action_list_item.parent('.controls');
|
218
221
|
var action_controller = action_list.parent('.action_controller');
|
219
|
-
var action_div =
|
222
|
+
var action_div = this._loader();
|
223
|
+
|
224
|
+
action_div.html("");
|
225
|
+
|
226
|
+
action_controller.find('.controls > .reload').addClass('disabled');
|
220
227
|
|
221
228
|
if (action_div.attr('target-href') != undefined){
|
222
229
|
update_embedded(action_div, true, this.options.complete)
|
@@ -229,7 +236,7 @@ $.widget("rbbt.action_controller", {
|
|
229
236
|
if(! $(e).hasClass('active')){ return false}
|
230
237
|
var link = $(e);
|
231
238
|
var action_controller = link.parents('.action_controller').first()
|
232
|
-
var action_loader =
|
239
|
+
var action_loader = this._loader();
|
233
240
|
var action_parameters = action_loader.find('.action_parameters').first();
|
234
241
|
var action_description = action_loader.find('.action_description').first();
|
235
242
|
var action_content = action_parameters.next('.action_content').first();
|
@@ -247,7 +254,7 @@ $.widget("rbbt.action_controller", {
|
|
247
254
|
if(! $(e).hasClass('active')){ return false}
|
248
255
|
var link = $(e);
|
249
256
|
var action_controller = link.parents('.action_controller').first()
|
250
|
-
var action_loader =
|
257
|
+
var action_loader = this._loader();
|
251
258
|
var action_parameters = action_loader.find('.action_parameters').first();
|
252
259
|
var action_description = action_loader.find('.action_description').first();
|
253
260
|
var action_content = action_parameters.next('.action_content').first();
|
@@ -266,9 +273,11 @@ $.widget("rbbt.action_controller", {
|
|
266
273
|
action_list_item = link
|
267
274
|
var action_list = action_list_item.parent('.action_menu');
|
268
275
|
var action_controller = action_list.parents('.action_controller').first();
|
269
|
-
var action_div =
|
276
|
+
var action_div = this._loader();
|
270
277
|
var href = link.attr('href')
|
271
278
|
href = add_parameter(href, '_layout', 'false')
|
279
|
+
|
280
|
+
action_div.html("");
|
272
281
|
|
273
282
|
var action = link.html()
|
274
283
|
var saved = this.options.saved[action]
|
@@ -1,20 +1,25 @@
|
|
1
1
|
/*!
|
2
|
-
* JavaScript Cookie v2.1
|
2
|
+
* JavaScript Cookie v2.2.1
|
3
3
|
* https://github.com/js-cookie/js-cookie
|
4
4
|
*
|
5
5
|
* Copyright 2006, 2015 Klaus Hartl & Fagner Brack
|
6
6
|
* Released under the MIT license
|
7
7
|
*/
|
8
|
-
(function (factory) {
|
8
|
+
;(function (factory) {
|
9
|
+
var registeredInModuleLoader;
|
9
10
|
if (typeof define === 'function' && define.amd) {
|
10
11
|
define(factory);
|
11
|
-
|
12
|
+
registeredInModuleLoader = true;
|
13
|
+
}
|
14
|
+
if (typeof exports === 'object') {
|
12
15
|
module.exports = factory();
|
13
|
-
|
14
|
-
|
16
|
+
registeredInModuleLoader = true;
|
17
|
+
}
|
18
|
+
if (!registeredInModuleLoader) {
|
19
|
+
var OldCookies = window.Cookies;
|
15
20
|
var api = window.Cookies = factory();
|
16
21
|
api.noConflict = function () {
|
17
|
-
window.Cookies =
|
22
|
+
window.Cookies = OldCookies;
|
18
23
|
return api;
|
19
24
|
};
|
20
25
|
}
|
@@ -31,111 +36,124 @@
|
|
31
36
|
return result;
|
32
37
|
}
|
33
38
|
|
39
|
+
function decode (s) {
|
40
|
+
return s.replace(/(%[0-9A-Z]{2})+/g, decodeURIComponent);
|
41
|
+
}
|
42
|
+
|
34
43
|
function init (converter) {
|
35
|
-
function api
|
36
|
-
var result;
|
44
|
+
function api() {}
|
37
45
|
|
38
|
-
|
46
|
+
function set (key, value, attributes) {
|
47
|
+
if (typeof document === 'undefined') {
|
48
|
+
return;
|
49
|
+
}
|
39
50
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
}, api.defaults, attributes);
|
51
|
+
attributes = extend({
|
52
|
+
path: '/'
|
53
|
+
}, api.defaults, attributes);
|
44
54
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
55
|
+
if (typeof attributes.expires === 'number') {
|
56
|
+
attributes.expires = new Date(new Date() * 1 + attributes.expires * 864e+5);
|
57
|
+
}
|
58
|
+
|
59
|
+
// We're using "expires" because "max-age" is not supported by IE
|
60
|
+
attributes.expires = attributes.expires ? attributes.expires.toUTCString() : '';
|
61
|
+
|
62
|
+
try {
|
63
|
+
var result = JSON.stringify(value);
|
64
|
+
if (/^[\{\[]/.test(result)) {
|
65
|
+
value = result;
|
49
66
|
}
|
67
|
+
} catch (e) {}
|
50
68
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
}
|
56
|
-
} catch (e) {}
|
69
|
+
value = converter.write ?
|
70
|
+
converter.write(value, key) :
|
71
|
+
encodeURIComponent(String(value))
|
72
|
+
.replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent);
|
57
73
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
74
|
+
key = encodeURIComponent(String(key))
|
75
|
+
.replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent)
|
76
|
+
.replace(/[\(\)]/g, escape);
|
77
|
+
|
78
|
+
var stringifiedAttributes = '';
|
79
|
+
for (var attributeName in attributes) {
|
80
|
+
if (!attributes[attributeName]) {
|
81
|
+
continue;
|
82
|
+
}
|
83
|
+
stringifiedAttributes += '; ' + attributeName;
|
84
|
+
if (attributes[attributeName] === true) {
|
85
|
+
continue;
|
63
86
|
}
|
64
87
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
attributes.domain && '; domain=' + attributes.domain,
|
74
|
-
attributes.secure ? '; secure' : ''
|
75
|
-
].join(''));
|
88
|
+
// Considers RFC 6265 section 5.2:
|
89
|
+
// ...
|
90
|
+
// 3. If the remaining unparsed-attributes contains a %x3B (";")
|
91
|
+
// character:
|
92
|
+
// Consume the characters of the unparsed-attributes up to,
|
93
|
+
// not including, the first %x3B (";") character.
|
94
|
+
// ...
|
95
|
+
stringifiedAttributes += '=' + attributes[attributeName].split(';')[0];
|
76
96
|
}
|
77
97
|
|
78
|
-
|
98
|
+
return (document.cookie = key + '=' + value + stringifiedAttributes);
|
99
|
+
}
|
79
100
|
|
80
|
-
|
81
|
-
|
101
|
+
function get (key, json) {
|
102
|
+
if (typeof document === 'undefined') {
|
103
|
+
return;
|
82
104
|
}
|
83
105
|
|
106
|
+
var jar = {};
|
84
107
|
// To prevent the for loop in the first place assign an empty array
|
85
|
-
// in case there are no cookies at all.
|
86
|
-
// calling "get()"
|
108
|
+
// in case there are no cookies at all.
|
87
109
|
var cookies = document.cookie ? document.cookie.split('; ') : [];
|
88
|
-
var rdecode = /(%[0-9A-Z]{2})+/g;
|
89
110
|
var i = 0;
|
90
111
|
|
91
112
|
for (; i < cookies.length; i++) {
|
92
113
|
var parts = cookies[i].split('=');
|
93
|
-
var name = parts[0].replace(rdecode, decodeURIComponent);
|
94
114
|
var cookie = parts.slice(1).join('=');
|
95
115
|
|
96
|
-
if (cookie.charAt(0) === '"') {
|
116
|
+
if (!json && cookie.charAt(0) === '"') {
|
97
117
|
cookie = cookie.slice(1, -1);
|
98
118
|
}
|
99
119
|
|
100
120
|
try {
|
101
|
-
|
102
|
-
|
103
|
-
cookie
|
121
|
+
var name = decode(parts[0]);
|
122
|
+
cookie = (converter.read || converter)(cookie, name) ||
|
123
|
+
decode(cookie);
|
104
124
|
|
105
|
-
if (
|
125
|
+
if (json) {
|
106
126
|
try {
|
107
127
|
cookie = JSON.parse(cookie);
|
108
128
|
} catch (e) {}
|
109
129
|
}
|
110
130
|
|
131
|
+
jar[name] = cookie;
|
132
|
+
|
111
133
|
if (key === name) {
|
112
|
-
result = cookie;
|
113
134
|
break;
|
114
135
|
}
|
115
|
-
|
116
|
-
if (!key) {
|
117
|
-
result[name] = cookie;
|
118
|
-
}
|
119
136
|
} catch (e) {}
|
120
137
|
}
|
121
138
|
|
122
|
-
return
|
139
|
+
return key ? jar[key] : jar;
|
123
140
|
}
|
124
141
|
|
125
|
-
api.
|
126
|
-
api.
|
127
|
-
return
|
128
|
-
|
129
|
-
|
142
|
+
api.set = set;
|
143
|
+
api.get = function (key) {
|
144
|
+
return get(key, false /* read as raw */);
|
145
|
+
};
|
146
|
+
api.getJSON = function (key) {
|
147
|
+
return get(key, true /* read as json */);
|
130
148
|
};
|
131
|
-
api.defaults = {};
|
132
|
-
|
133
149
|
api.remove = function (key, attributes) {
|
134
|
-
|
150
|
+
set(key, '', extend(attributes, {
|
135
151
|
expires: -1
|
136
152
|
}));
|
137
153
|
};
|
138
154
|
|
155
|
+
api.defaults = {};
|
156
|
+
|
139
157
|
api.withConverter = init;
|
140
158
|
|
141
159
|
return api;
|
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.145
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miguel Vazquez
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-11-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -269,7 +269,6 @@ files:
|
|
269
269
|
- share/views/layout/top_menu/favourites.haml
|
270
270
|
- share/views/layout/top_menu/finder.haml
|
271
271
|
- share/views/layout/top_menu/user.haml
|
272
|
-
- share/views/main.haml
|
273
272
|
- share/views/monitor/jobs.haml
|
274
273
|
- share/views/monitor/locks.haml
|
275
274
|
- share/views/partials/dependencies.haml
|
data/share/views/main.haml
DELETED
File without changes
|