cockpit/js/instance.js in cpee-2.1.70 vs cockpit/js/instance.js in cpee-2.1.71
- old
+ new
@@ -5,10 +5,12 @@
var paths = '#dat_details input, #dat_details textarea, #dat_details select, #dat_details button, #dat_details [contenteditable], #dat_dataelements input, #dat_dataelements textarea, #dat_dataelements select, #dat_dataelements button, #dat_dataelements [contenteditable], #dat_endpoints input, #dat_endpoints textarea, #dat_endpoints select, #dat_endpoints button, #dat_endpoints [contenteditable], #dat_attributes input, #dat_attributes textarea, #dat_attributes select, #dat_attributes button, #dat_attributes [contenteditable]';
var loading = false;
var subscription;
var subscription_state = 'less';
var graph_changed = new Event("graph:changed", {"bubbles":true, "cancelable":false});
+var graph_theme = null;
+var graph_position = null;
var model_loaded = new Event("model:loaded", {"bubbles":true, "cancelable":false});
var save = {};
save['endpoints'] = undefined;
save['dataelements'] = undefined;
save['attributes'] = undefined;
@@ -123,10 +125,12 @@
var q = $.parseQuerySimple();
if (q.min || q.min == "") {
uidash_toggle_vis_tab($('#instance'));
uidash_toggle_vis_tab($('#parameters'));
}
+ if (q.theme) { graph_theme = q.theme; }
+ if (q.position) { graph_position = q.position; }
if (q.monitor && q.load) {
if (q.load.match(/https?:\/\//)) {
$('body').attr('load-testset',q.load);
} else {
$("#templates div.menuitem").each(function(k,v){
@@ -369,11 +373,11 @@
$("#current-graph").show();
$("#current-graph").attr('href','graph.html?monitor=' + url);
$("#current-track").show();
$("#current-track").attr('href','track.html?monitor=' + url);
var q = $.parseQuerySimple();
- history.replaceState({}, '', '?' + (q.min || q.min=="" ? "min&" : "") + 'monitor='+url);
+ history.replaceState({}, '', '?' + (graph_position ? "position=" + graph_position + "&" : "") + (graph_theme ? "theme=" + graph_theme + "&" : "") + (q.min || q.min=="" ? "min&" : "") + 'monitor='+url);
// Change url to return to current instance when reloading (because new subscription is made)
$("input[name=votecontinue]").prop( "checked", false );
$.ajax({
@@ -550,10 +554,11 @@
});
} //}}}
function adaptor_init(url,theme,dslx) { //{{{
// while inside and svgs are reloaded, do nothing here
if (suspended_redrawing) { return; }
+ if (graph_theme) { theme = graph_theme; }
if (save['graph_theme'] != theme) {
// while inside and svgs are reloaded, do nothing here
suspended_redrawing = true;
save['graph_theme'] = theme;
save['graph_adaptor'] = new WfAdaptor($('body').data('theme-base') + '/' + theme + '/theme.js',function(graphrealization){
@@ -855,10 +860,16 @@
}
});
}// }}}
function monitor_instance_pos() {// {{{
+ if (graph_position) {
+ save['instance_pos'] = $X('<' + graph_position + '>after</' + graph_position + '>');
+ format_visual_clear();
+ format_instance_pos();
+ return;
+ };
var url = $('body').attr('current-instance');
$.ajax({
type: "GET",
url: url + "/properties/positions/",
success: function(res){
@@ -887,9 +898,10 @@
save['activity_red_states'][content['activity-uuid']] = true
setTimeout(() => {delete save['activity_red_states'][content['activity-uuid']]},5000);
}
} // }}}
function monitor_instance_pos_change(content) {// {{{
+ if (graph_position) { return } ;
if (content['at']) {
$.each(content['at'],function(a,b){
if (!save['activity_blue_states'][b.uuid]) {
save['activity_blue_states'][b.uuid] = true
format_visual_add(b.position,"passive");