cockpit/js/instance.js in cpee-1.3.176 vs cockpit/js/instance.js in cpee-1.3.177

- old
+ new

@@ -100,11 +100,11 @@ } }); });// }}} function check_subscription() { // {{{ - var url = $("input[name=current-instance]").val(); + var url = $("#current-instance").text(); var num = 0; if ($("input[name=votecontinue]").is(':checked')) num += 1; if (num > 0 && subscription_state == 'less') { $.ajax({ type: "PUT", @@ -164,20 +164,23 @@ $.ajax({ type: "GET", url: url + "/properties/schema/", success: function(res){ - $(".tabbed.hidden").removeClass("hidden"); - $(".tabbed .tab.hidden").removeClass("hidden"); + $("ui-tabbed.hidden, ui-rest.hidden").removeClass("hidden"); + $("ui-resizehandle.hidden").removeClass("hidden"); + $("ui-tabbed ui-tab.hidden, ui-rest ui-tab.hidden").removeClass("hidden"); // Change url to return to current instance when reloading - $("input[name=current-instance]").val(url); $("#current-instance").text(url); $("#current-instance").attr('href',url); $("#current-instance-properties").attr('href',url + 'properties/'); + $("#current-instance-properties").text('P'); $("#current-instance-subscriptions").attr('href',url + 'subscriptions/'); + $("#current-instance-subscriptions").text('S'); $("#current-instance-callbacks").attr('href',url + 'callbacks/'); + $("#current-instance-callbacks").text('C'); history.replaceState({}, '', '?monitor='+url); // Change url to return to current instance when reloading (because new subscription is made) $("input[name=votecontinue]").removeAttr('checked'); subscription_state = 'less'; @@ -253,11 +256,11 @@ } }); }// }}} function monitor_instance_dataelements() {// {{{ - var url = $("input[name=current-instance]").val(); + var url = $("#current-instance").text(); $.ajax({ type: "GET", url: url + "/properties/values/dataelements/", success: function(res){ var values = $("value > *",res); @@ -281,11 +284,11 @@ } }); } // }}} function monitor_instance_endpoints() {// {{{ - var url = $("input[name=current-instance]").val(); + var url = $("#current-instance").text(); $.ajax({ type: "GET", url: url + "/properties/values/endpoints/", success: function(res){ var values = $("value > *",res); @@ -310,11 +313,11 @@ } }); }// }}} function monitor_instance_dsl() {// {{{ - var url = $("input[name=current-instance]").val(); + var url = $("#current-instance").text(); $.ajax({ type: "GET", dataType: "text", url: url + "/properties/values/dsl/", success: function(res){ @@ -335,37 +338,35 @@ success: function(res){ graphrealization = new WfAdaptor(CPEE); graphrealization.set_svg_container($('#graphcanvas')); graphrealization.set_description($(res), true); graphrealization.notify = function(svgid) { + console.log('rrr'); save_description(); manifestation.events.click(svgid,undefined); }; - $('#graphcanvas').redraw(); - $('#graphcolumn div').redraw(); - monitor_instance_pos(); } }); } } }); }// }}} function monitor_instance_state() {// {{{ - var url = $("input[name=current-instance]").val(); + var url = $("#current-instance").text(); $.ajax({ type: "GET", url: url + "/properties/values/state/", dataType: "text", success: function(res){ monitor_instance_state_change(res); } }); }// }}} function monitor_instance_transformation() {// {{{ - var url = $("input[name=current-instance]").val(); + var url = $("#current-instance").text(); $.ajax({ type: "GET", url: url + "/properties/values/attributes/modeltype", success: function(res){ $("#currentmodel").text($(res.documentElement).text()); @@ -375,11 +376,11 @@ } }); }// }}} function monitor_instance_pos() {// {{{ - var url = $("input[name=current-instance]").val(); + var url = $("#current-instance").text(); $.ajax({ type: "GET", url: url + "/properties/values/positions/", success: function(res){ var values = $("value > *",res); @@ -457,11 +458,11 @@ astr += "<button id='vote_to_continue-" + parts.activity + "-" + parts.callback + "' onclick='$(this).attr(\"disabled\",\"disabled\");monitor_instance_vote_remove(\"" + parts.activity + "\",\"" + parts.callback + "\",\"true\");'>" + parts.activity + "</button>"; ctv.append(astr); format_visual_add(parts.activity,"vote") }// }}} function monitor_instance_vote_remove(activity,callback,value) {//{{{ - var url = $("input[name=current-instance]").val(); + var url = $("#current-instance").text(); $.ajax({ type: "PUT", url: url + "/callbacks/" + callback, data: ({'continue': value}), error: report_failure @@ -469,39 +470,39 @@ format_visual_remove(activity,"vote"); $('#vote_to_continue-' + activity + '-' + callback).remove(); }//}}} function start_instance() {// {{{ - var url = $("input[name=current-instance]").val(); + var url = $("#current-instance").text(); $.ajax({ type: "PUT", url: url + "/properties/values/state", data: ({value: "running"}), error: report_failure }); }// }}} function sim_instance() {// {{{ - var url = $("input[name=current-instance]").val(); + var url = $("#current-instance").text(); $.ajax({ type: "PUT", url: url + "/properties/values/state", data: ({value: "simulating"}), error: report_failure }); }// }}} function stop_instance() {// {{{ - var url = $("input[name=current-instance]").val(); + var url = $("#current-instance").text(); $.ajax({ type: "PUT", url: url + "/properties/values/state", data: ({value: "stopping"}), error: report_failure }); }// }}} function save_testset() {// {{{ - var base = $("input[name=current-instance]").val(); + var base = $("#current-instance").text(); var testset = $X('<testset/>'); $.ajax({ type: "GET", url: base + "/properties/values/dataelements/", @@ -567,11 +568,11 @@ }, error: report_failure }); }// }}} function save_svg() {// {{{ - var base = $("input[name=current-instance]").val(); + var base = $("#current-instance").text(); var params = { mimetype: 'image/svg+xml' }; var gc = $('#graphcanvas').clone(); $.ajax({ type: "GET", @@ -592,11 +593,11 @@ }); } }); }// }}} function set_testset(testset) {// {{{ - var url = $("input[name=current-instance]").val(); + var url = $("#current-instance").text(); $.ajax({ type: "GET", url: url + "/notifications/subscriptions/", success: function(res){ @@ -682,11 +683,11 @@ return; } var files = $('#modelfile').get(0).files; var reader = new FileReader(); reader.onload = function(){ - var url = $("input[name=current-instance]").val(); + var url = $("#current-instance").text(); load_des(url,reader.result); running = false; } reader.onerror = function(){ running = false; } reader.onabort = function(){ running = false; } @@ -719,11 +720,11 @@ } }); }// }}} function load_modeltype() {// {{{ if (running) return; - var url = $("input[name=current-instance]").val(); + var url = $("#current-instance").text(); running = true; var name = $("#modeltypes div.menuitem[data-selected=selected]").text(); $.ajax({ cache: false, @@ -995,9 +996,9 @@ message = message.replace(/,\{/g,', {'); message = message.replace(/,\[/g,', ['); message = message.replace(/:\"/g,': "'); message = message.replace(/:\{/g,': {'); message = message.replace(/:\[/g,': ['); - $("#dat_log").append("<tr><td class='fixed'><a title=\"" + d.strftime("[%d/%b/%Y %H:%M:%S]") + "\">D</a></td><td class='fixed'>&#160;-&#160;</td><td class='fixed'><a title=\"" + what + "\">T</a></td><td class='fixed'>&#160;-&#160;</td><td class='fixed'>" + type + "</td><td class='fixed'>&#160;-&#160;</td><td class='long'>" + message + "</td></tr>"); + $("#dat_log").append("<tr><td class='fixed top'><a title=\"" + d.strftime("[%d/%b/%Y %H:%M:%S]") + "\">D</a></td><td class='fixed'>&#160;-&#160;</td><td class='fixed'><a title=\"" + what + "\">T</a></td><td class='fixed'>&#160;-&#160;</td><td class='fixed'>" + type + "</td><td class='fixed'>&#160;-&#160;</td><td class='long'>" + message + "</td></tr>"); }//}}} function report_failure(){}