cockpit/js/instance.js in cpee-1.4.28 vs cockpit/js/instance.js in cpee-1.4.29

- old
+ new

@@ -33,10 +33,12 @@ 'events' + '=' + 'change' + '&' + 'topic' + '=' + 'endpoints' + '&' + 'events' + '=' + 'change' + '&' + 'topic' + '=' + 'attributes' + '&' + 'events' + '=' + 'change' + '&' + + 'topic' + '=' + 'task' + '&' + + 'events' + '=' + 'instantiation' + '&' + 'topic' + '=' + 'transformation' + '&' + 'events' + '=' + 'change' + '&' + 'topic' + '=' + 'handlerwrapper' + '&' + 'events' + '=' + 'error,change' + '&' + 'topic' + '=' + 'handlers' + '&' + @@ -53,10 +55,12 @@ 'events' + '=' + 'change' + '&' + 'topic' + '=' + 'endpoints' + '&' + 'events' + '=' + 'change' + '&' + 'topic' + '=' + 'attributes' + '&' + 'events' + '=' + 'change' + '&' + + 'topic' + '=' + 'task' + '&' + + 'events' + '=' + 'instantiation' + '&' + 'topic' + '=' + 'transformation' + '&' + 'events' + '=' + 'change' + '&' + 'topic' + '=' + 'handlerwrapper' + '&' + 'events' + '=' + 'error,change' + '&' + 'topic' + '=' + 'handlers' + '&' + @@ -88,21 +92,21 @@ ui_toggle_vis_tab($('#instance')); ui_toggle_vis_tab($('#parameters')); } if (q.monitor && q.load) { if (q.load.match(/https?:\/\//)) { - $("#predefinedtestsets").attr('data-other',q.load); + $('body').attr('load-testset',q.load); } else { $("#predefinedtestsets div.menuitem").each(function(k,v){ if ($(v).text() == q.load) { $(v).attr('data-selected','selected'); } }); } ui_activate_tab("#tabexecution"); monitor_instance(q.monitor,$("body").attr('current-repo'),true,false); } else if (q.load) { if (q.load.match(/https?:\/\//)) { - $("#predefinedtestsets").attr('data-other',q.load); + $('body').attr('load-testset',q.load); } else { $("#predefinedtestsets div.menuitem").each(function(k,v){ if ($(v).text() == q.load) { $(v).attr('data-selected','selected'); } }); } @@ -114,11 +118,11 @@ } else if (q.monitor) { ui_activate_tab("#tabexecution"); monitor_instance(q.monitor,$("body").attr('current-repo'),false,false); } else if (q.exec) { if (q.exec.match(/https?:\/\//)) { - $("#predefinedtestsets").attr('data-other',q.load); + $('body').attr('load-testset',q.load); } else { $("#predefinedtestsets div.menuitem").each(function(k,v){ if ($(v).text() == q.exec) { $(v).attr('data-selected','selected'); } }); } @@ -232,10 +236,16 @@ monitor_instance_transformation(); if (!suspended_monitoring) { // or else it would load twice, because dsl changes also monitor_graph_change(true); } break; + case 'task': + if ($('#trackcolumn').length > 0) { + var details = JSON.parse($('event > notification',data).text()); + $('#trackcolumn').append($('<iframe src="track.html?monitor=' + details.received['CPEE-INSTANCE-URL'].replace(/\/*$/,'/') + '"></iframe>')); + } + break; case 'state': monitor_instance_state_change(JSON.parse($('event > notification',data).text()).state); break; case 'position': monitor_instance_pos_change($('event > notification',data).text()); @@ -370,11 +380,13 @@ }); } }); }); } else if(val == "attributes") { - document.title = $(" > value > info",res).text() + " (" + url.replace(/\/$/,'').split(/[\\/]/).pop() + ")"; + var text = $(" > value > info",res).text() + " (" + url.replace(/\/$/,'').split(/[\\/]/).pop() + ")"; + $('#title').text(text); + document.title = text; } } }); } // }}} @@ -513,13 +525,19 @@ format_visual_add(parts.activity,"active") if (event == "done") format_visual_remove(parts.activity,"active") } // }}} function monitor_instance_state_change(notification) { //{{{ + if ($('#trackcolumn').length > 0) { + if (notification == "finished") { + parent.closeIFrame(window.location.search); + } + } if (notification == "ready" || notification == "stopped" || notification == "running") { $("#state button").removeAttr('disabled'); } + // sometimes, out of sheer network routingness, stopping comes after stopped, which fucks the UI hard // thus, we are having none of it if (notification == 'stopping' && save['state'] == 'stopped') return; if (notification != save['state']) { @@ -535,13 +553,13 @@ format_visual_clear(); } var but = ""; if (notification == "ready" || notification == "stopped") { - but = " ⇒ <button onclick='$(this).attr(\"disabled\",\"disabled\");start_instance();'>start</button> / <button onclick='$(this).attr(\"disabled\",\"disabled\");sim_instance();'>simulate</button> / <button onclick='aba_instance();'>abandon</button>"; + but = " ⇒ <button onclick='$(this).attr(\"disabled\",\"disabled\");start_instance();' title='start'>⏵</button> / <button onclick='$(this).attr(\"disabled\",\"disabled\");sim_instance();' title='simulate'>🎜</button> / <button onclick='aba_instance();' title='abandon'>⛌</button>"; } else if (notification == "running") { - but = " ⇒ <button onclick='$(this).attr(\"disabled\",\"disabled\");stop_instance();'>stop</button>"; + but = " ⇒ <button onclick='$(this).attr(\"disabled\",\"disabled\");stop_instance();' title='stop'>⏸</button>"; } // disable all input, also check themes format_visual_forms(); // remove all markings with state change @@ -708,11 +726,11 @@ gc.prepend($X('<style xmlns="http://www.w3.org/2000/svg" type="text/css"><![CDATA[' + res + ']]></style>')); $(window.document.styleSheets).each(function(i,x){ if (x && x.href && x.href.match(/wfadaptor\.css$/)) { $(x.cssRules).each(function(j,y){ var loc = $(gc).find(y.selectorText.replace(/^svg /,'')); - loc.attr('style',y.style.cssText); + loc.attr('style',y.style.cssText + loc.attr('style') + ';'); }); var loc = $(gc).find('text.super'); loc.attr('style',loc.attr('style') + ' display: none'); } }); @@ -852,10 +870,12 @@ var name = $("#predefinedtestsets div.menuitem[data-selected=selected]").text(); var url; if (name) { url = $('body').attr('current-testsets') + name + ".xml"; } else { - url = $("#predefinedtestsets").attr('data-other'); + if ($('body').attr('load-testset').length > 0) { + url = $('body').attr('load-testset'); + } } if (url) { $.ajax({ cache: false, dataType: 'xml',