rbbt-rest 1.8.2 → 1.8.3
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/knowledge_base/helpers.rb +4 -2
- data/share/views/error.haml +24 -11
- data/share/views/public/js/rbbt.exception.js +5 -2
- data/share/views/public/js/rbbt.plots/rbbt.plots.aes.js +19 -4
- data/share/views/public/js/rbbt.plots/rbbt.plots.graph.adapters.js +3 -2
- data/share/views/public/js/rbbt.plots/rbbt.plots.graph.js +2 -0
- data/share/views/public/js/rbbt.plots/rbbt.plots.graph.kb.js +8 -2
- data/share/views/wait.haml +23 -22
- 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: 8bc8c84dbe3d17dfa0f63f7a513da1d52ed7e150
|
4
|
+
data.tar.gz: fc73cf5e1d13d176ab35fa2e5f065d9756033cc7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 384ceaf737b835b8cba9e49b631b78f2d4b8b2d16c0f1d74b9cb532912daf6599491e22f67d63ddd6c6eb276501d43eb323233daf0c17d54f4544fe632a9b610
|
7
|
+
data.tar.gz: e96e260ef7ee2bfc4f78d46367c3a2a6f1785991a4978dab3b974ebf92a954472d57fa2bcfd72ed847cc46a398b35daff9c9ab3b38a075b7dd940774db740c15
|
@@ -54,8 +54,10 @@ module KnowledgeBaseRESTHelpers
|
|
54
54
|
def get_knowledge_base(name=:user, namespace = nil)
|
55
55
|
kb = case name.to_s
|
56
56
|
when 'step'
|
57
|
-
|
58
|
-
|
57
|
+
step_path = cookies[:step_path]
|
58
|
+
step_path = params[:step_path] if step_path.nil?
|
59
|
+
raise "No step_path" if step_path.nil?
|
60
|
+
dir = step_path + '.files/knowledge_base'
|
59
61
|
KnowledgeBase.load(dir)
|
60
62
|
when "user"
|
61
63
|
user_kb(user)
|
data/share/views/error.haml
CHANGED
@@ -1,20 +1,33 @@
|
|
1
|
-
.error
|
2
|
-
%h5 Error on #{format_name File.basename(job.name)}
|
1
|
+
.error.ui.segment.error.message
|
2
|
+
%h5.ui.header Error on #{format_name File.basename(job.name)}
|
3
3
|
- if job.messages and job.messages.any?
|
4
|
-
%
|
5
|
-
|
4
|
+
%pre.error_message.ui.basic.segment.content
|
5
|
+
= CGI.escapeHTML(job.messages[-1] || "")
|
6
6
|
|
7
7
|
|
8
8
|
- if defined? job.info_file and File.exists? job.info_file and request.env["REQUEST_URI"].include? job.name
|
9
9
|
- clean_url = add_GET_param(request.env["REQUEST_URI"], "_update", "clean")
|
10
|
-
%a(href=clean_url) Clean
|
10
|
+
%a.ui.button.blue(href=clean_url) Clean
|
11
11
|
- else
|
12
12
|
- clean_url = add_GET_param(request.env["REQUEST_URI"], "_update", "reload")
|
13
|
-
%a(href=clean_url) Reload
|
13
|
+
%a.ui.blue.button(href=clean_url) Reload
|
14
14
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
15
|
+
- backtrace = job.info[:backtrace]
|
16
|
+
- if backtrace and backtrace.any?
|
17
|
+
|
18
|
+
%ul.error_backtrace.clean_list.ui.segment
|
19
|
+
.ui.header Backtrace
|
20
|
+
%pre.ui.content
|
21
|
+
- require 'rbbt/util/colorize'
|
22
|
+
- pallete = {}
|
23
|
+
- matches = %w(views workflows rbbt).collect{|w| /\/#{w}/ }
|
24
|
+
- colors = Colorize.distinct(matches)
|
19
25
|
- backtrace.each do |line|
|
20
|
-
|
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
|
31
|
+
|
32
|
+
- style = color ? ';color:'+color : ""
|
33
|
+
%li(style="font-size:0.9em;font-family:monospace#{style}")= line.sub('`',"'")
|
@@ -18,12 +18,15 @@ rbbt.exception.report = function(err){
|
|
18
18
|
}
|
19
19
|
}
|
20
20
|
|
21
|
-
rbbt.try = function(func){
|
21
|
+
rbbt.try = function(func, catch_function){
|
22
22
|
var f = function(){
|
23
23
|
try {
|
24
24
|
return func.apply(this, arguments)
|
25
25
|
}catch(err){
|
26
|
-
|
26
|
+
if (catch_function)
|
27
|
+
catch_function(err)
|
28
|
+
else
|
29
|
+
rbbt.exception.report(err)
|
27
30
|
}
|
28
31
|
}
|
29
32
|
return f
|
@@ -52,7 +52,7 @@ rbbt.plots.aes.get_properties = function(list, rules){
|
|
52
52
|
eval('extract='+extract)
|
53
53
|
}
|
54
54
|
|
55
|
-
if (rule.entity_type && rule.entity_type != list.type) return
|
55
|
+
if (rule.entity_type && rule.entity_type != list.type && rule.entity_type != list.format) return
|
56
56
|
|
57
57
|
if (rule.info){
|
58
58
|
var property = rule.property
|
@@ -66,6 +66,14 @@ rbbt.plots.aes.get_properties = function(list, rules){
|
|
66
66
|
|
67
67
|
deferred.resolve(value)
|
68
68
|
promise = deferred.promise
|
69
|
+
if (extract){
|
70
|
+
promise = promise.then(function(res){
|
71
|
+
if (typeof res == 'object')
|
72
|
+
return res.map(function(elem){ return extract.call(null, elem)})
|
73
|
+
else
|
74
|
+
return extract.call(null, res)
|
75
|
+
})
|
76
|
+
}
|
69
77
|
}
|
70
78
|
|
71
79
|
if (rule.value){
|
@@ -79,8 +87,15 @@ rbbt.plots.aes.get_properties = function(list, rules){
|
|
79
87
|
var property = rule.property
|
80
88
|
var args = rule.args
|
81
89
|
if (undefined === name) name = property
|
82
|
-
|
83
|
-
|
90
|
+
|
91
|
+
var deferred = m.deferred()
|
92
|
+
var tmp_promise = rbbt.entity_array.property(list.codes, list.type, list.info, property, args)
|
93
|
+
|
94
|
+
if (extract){ tmp_promise = tmp_promise.then(function(res){ return res.map(extract)}) }
|
95
|
+
|
96
|
+
tmp_promise.then(deferred.resolve, function(){ deferred.resolve(undefined)})
|
97
|
+
|
98
|
+
promise = deferred.promise
|
84
99
|
}
|
85
100
|
|
86
101
|
if (rule.workflow){
|
@@ -163,7 +178,7 @@ rbbt.plots.aes.get_properties = function(list, rules){
|
|
163
178
|
}
|
164
179
|
}
|
165
180
|
|
166
|
-
promises.push(promise.then(function(res){list.properties[name] = res}))
|
181
|
+
promises.push(promise.then(function(res){ if (undefined !== res) list.properties[name] = res}))
|
167
182
|
})
|
168
183
|
|
169
184
|
return m.sync(promises)
|
@@ -137,7 +137,7 @@ rbbt.plots.graph.view_cytoscape = function(graph_model, elem, style, layout, ext
|
|
137
137
|
var dataset = rbbt.plots.graph.build_cytoscape(updated_model)
|
138
138
|
|
139
139
|
require_js(['/js/cytoscape/js/src/AC_OETags.js', '/js/cytoscape/js/src/cytoscapeweb.js', '/js/cytoscape'], function(){
|
140
|
-
var tool = $(
|
140
|
+
var tool = $(elem).cytoscape_tool({
|
141
141
|
knowledge_base: 'user',
|
142
142
|
namespace: 'Hsa/feb2014',
|
143
143
|
entities: dataset.nodes,
|
@@ -159,7 +159,8 @@ rbbt.plots.graph.view_cytoscape = function(graph_model, elem, style, layout, ext
|
|
159
159
|
|
160
160
|
var url = target.data.url;
|
161
161
|
|
162
|
-
|
162
|
+
if (url)
|
163
|
+
rbbt.modal.controller.show_url(url)
|
163
164
|
return(false)
|
164
165
|
},
|
165
166
|
|
@@ -11,12 +11,14 @@ rbbt.plots.graph.get_entities = function(graph_model){
|
|
11
11
|
source_entities.codes = unique(list.info.source)
|
12
12
|
source_entities.info = list.source_info
|
13
13
|
source_entities.type = list.source_type
|
14
|
+
source_entities.format = list.source_format
|
14
15
|
|
15
16
|
var target_type = list.target_type
|
16
17
|
var target_entities = {}
|
17
18
|
target_entities.codes = unique(list.info.target)
|
18
19
|
target_entities.info = list.target_info
|
19
20
|
target_entities.type = list.target_type
|
21
|
+
target_entities.format = list.target_format
|
20
22
|
|
21
23
|
if (entities[source_entities.type])
|
22
24
|
entities[source_entities.type].codes = unique(entities[source_entities.type].codes.concat(source_entities.codes))
|
@@ -11,8 +11,14 @@ rbbt.plots.graph.prepare_associations = function(db, associations, info){
|
|
11
11
|
var edges = {}
|
12
12
|
edges.codes = []
|
13
13
|
edges.database = db
|
14
|
-
|
15
|
-
edges.
|
14
|
+
|
15
|
+
edges.source_type = info.source_type
|
16
|
+
edges.target_type = info.target_type
|
17
|
+
edges.source_format = info.source
|
18
|
+
edges.target_format = info.target
|
19
|
+
if (undefined === edges.source_type || null === edges.source_type) edges.source_type = edges.source_format
|
20
|
+
if (undefined === edges.target_type || null === edges.target_type) edges.target_type = edges.target_format
|
21
|
+
|
16
22
|
edges.source_info = info.source_entity_options
|
17
23
|
edges.target_info = info.target_entity_options
|
18
24
|
edges.info = {}
|
data/share/views/wait.haml
CHANGED
@@ -1,32 +1,33 @@
|
|
1
1
|
- @reload_page = true
|
2
2
|
|
3
|
-
.wait
|
4
|
-
%
|
3
|
+
.wait.ui.segment.info.message
|
4
|
+
%h3.ui.header Waiting on #{format_name File.basename(job.name)}
|
5
5
|
|
6
|
-
%span.status= job.status
|
6
|
+
%span.ui.basic.segment.content.status= job.status
|
7
7
|
|
8
8
|
|
9
9
|
- if job.file(:progress).exists?
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
.
|
14
|
-
.
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
-
|
20
|
-
|
21
|
-
|
22
|
-
.
|
23
|
-
.
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
%hr
|
10
|
+
.footer.ui.basic.segment
|
11
|
+
- progress = job.file(:progress).yaml
|
12
|
+
- if progress[:last_percent]
|
13
|
+
.ui.teal.step.percent.progress.indicating.meta(data-percent="#{progress[:last_percent]}" data-total=100)
|
14
|
+
.bar
|
15
|
+
.progress
|
16
|
+
.label= progress[:desc]
|
17
|
+
:deferjs
|
18
|
+
$('.step.progress').progress()
|
19
|
+
- else
|
20
|
+
- ticks = progress[:ticks]
|
21
|
+
- max_ticks = ticks * 1.2
|
22
|
+
.ui.teal.step.progress.meta(data-value=ticks data-total=max_ticks data-percent="#{ticks.to_f * 100.0 / max_ticks}")
|
23
|
+
.bar
|
24
|
+
.progress
|
25
|
+
.label= progress[:desc]
|
26
|
+
:deferjs
|
27
|
+
$('.step.progress').progress({label: 'ratio',text:{ratio: '{value}'}})
|
29
28
|
|
29
|
+
.ui.segment
|
30
|
+
%h3.ui.header Log
|
30
31
|
%ul.step_messages.clean_list
|
31
32
|
- job.messages.reverse.each do |line|
|
32
33
|
- next if line.nil? or line.strip.empty?
|
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.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miguel Vazquez
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|