Revision 42134
Added by Michele Artini about 8 years ago
wf_process_viewer.js | ||
---|---|---|
14 | 14 |
link: function (scope, element, attrs, ctrl) { |
15 | 15 |
scope.currentParam = {}; |
16 | 16 |
scope.current = {}; |
17 |
scope.contentToShow = ''; |
|
17 | 18 |
|
18 | 19 |
$(element).modal({'show': false}); |
19 | 20 |
|
... | ... | |
28 | 29 |
|
29 | 30 |
showSpinner(); |
30 | 31 |
|
31 |
$http.get("wf/journal.get?id=" + scope.procId).success( |
|
32 |
function (data) { |
|
33 |
scope.proc = data; |
|
34 |
hideSpinner(); |
|
35 |
} |
|
36 |
).error( |
|
37 |
function () { |
|
38 |
showError('Something really bad must have happened to our fellow hamster..'); |
|
39 |
hideSpinner(); |
|
40 |
} |
|
41 |
); |
|
32 |
scope.refresh(); |
|
42 | 33 |
} |
43 | 34 |
}); |
44 | 35 |
|
36 |
scope.showContent = function(c) { |
|
37 |
scope.contentToShow = c; |
|
38 |
}; |
|
39 |
|
|
45 | 40 |
scope.to_trusted = function (html_code) { |
46 | 41 |
return $sce.trustAsHtml(html_code); |
47 |
} |
|
42 |
};
|
|
48 | 43 |
|
49 | 44 |
scope.refresh = function () { |
50 | 45 |
showSpinner(); |
51 |
$http.get('wf/journal.get?id=' + scope.proc.procId).success(function (data) {
|
|
46 |
$http.get('wf/journal.get?id=' + scope.procId).success(function (data) { |
|
52 | 47 |
scope.proc = data; |
48 |
if (data.processNodes.length > 0) { |
|
49 |
scope.contentToShow = 'nodes'; |
|
50 |
} else if (data.outputParams.length > 0) { |
|
51 |
scope.contentToShow = 'journal'; |
|
52 |
} else { |
|
53 |
scope.contentToShow = ''; |
|
54 |
} |
|
53 | 55 |
hideSpinner(); |
54 | 56 |
}).error(function (e) { |
55 | 57 |
show_notification('error', 'Error fetching process info: ' + e); |
Also available in: Unified diff