cockpit/js/instance.js in cpee-2.0.24 vs cockpit/js/instance.js in cpee-2.0.25
- old
+ new
@@ -95,16 +95,17 @@
$("input[name=votecontinue]").click(check_subscription);
$("input[name=testsetfile]").change(load_testsetfile_after);
$("input[name=modelfile]").change(load_modelfile_after);
$.ajax({
- url: $('body').attr('current-templates') + ".templates.xml",
- dataType: 'xml',
+ url: $('body').attr('current-templates'),
+ dataType: 'json',
success: function(res){
- $('testset',res).each(function(){
- var ts = $(this).text();
- $('#templates').append($("<div class='menuitem'></div>").text(ts));
+ $(res).each(function(){
+ if (this.type == 'file') {
+ $('#templates').append($("<div class='menuitem'></div>").text(this.name.replace(/\.xml/,'')));
+ }
});
var q = $.parseQuerySimple();
if (q.min || q.min == "") {
ui_toggle_vis_tab($('#instance'));
ui_toggle_vis_tab($('#parameters'));
@@ -154,11 +155,11 @@
create_instance($("body").attr('current-base'),q.exec,true,true);
}
}
});
$.ajax({
- url: $('body').attr('current-templates') + ".transformations.xml",
+ url: "transformations.xml",
dataType: 'xml',
success: function(res){
$('transformation',res).each(function(){
var ts = $(this).text();
$('#modeltypes').append($("<div class='menuitem'></div>").text(ts));
@@ -626,12 +627,10 @@
}
});
}// }}}
function monitor_instance_transformation() {// {{{
var url = $('body').attr('current-instance');
- console.log('hallo');
- console.log(url);
$.ajax({
type: "GET",
url: url + "/properties/attributes/modeltype/",
success: function(res){
$("#currentmodel").text(res);
@@ -656,22 +655,26 @@
}// }}}
function monitor_instance_running(content,event) {// {{{
if (save['state'] == "stopping") return;
if (event == "calling") {
- save['activity_states'][content.activity_uuid] = true
- format_visual_add(content.activity,"active")
- }
- if (event == "manipulating") {
- if (!save['activity_states'][content.activity_uuid]) {
+ if (!save['activity_states'][content['activity-uuid']]) {
+ save['activity_states'][content['activity-uuid']] = true
format_visual_add(content.activity,"active")
}
+ } else if (event == "manipulating") {
+ if (!save['activity_states'][content['activity-uuid']]) {
+ save['activity_states'][content['activity-uuid']] = true
+ format_visual_add(content.activity,"active")
+ }
+ } else if (event == "done") {
+ if (save['activity_states'][content['activity-uuid']]) {
+ save['activity_states'][content['activity-uuid']] = true
+ format_visual_remove(content.activity,"active")
+ setTimeout(() => {delete save['activity_states'][content['activity-uuid']]},5000);
+ }
}
- if (event == "done") {
- delete save['activity_states'][content.activity_uuid];
- format_visual_remove(content.activity,"active")
- }
} // }}}
function monitor_instance_state_change(notification) { //{{{
if ($('#trackcolumn').length > 0) {
if (notification == "finished" || notification == "abandoned") {
parent.closeIFrame(window.location.search);
@@ -716,10 +719,12 @@
// disable all input, also check themes
format_visual_forms();
// remove all markings with state change
if (save['graph_adaptor'] && save['graph_adaptor'].illustrator) {
save['graph_adaptor'].illustrator.get_elements().removeClass('marked');
+ localStorage.removeItem('marked');
+ localStorage.removeItem('marked_from');
}
if (notification != "ready" && notification != "stopped" && notification != "running") {
$('.tabbehind button').hide();
$('#state_any').hide();
@@ -1002,11 +1007,15 @@
loading = true;
var name = $("#templates div.menuitem[data-selected=selected]").text();
var url;
if (name) {
- url = $('body').attr('current-templates') + name + ".xml";
+ if ($('body').attr('current-templates').match(/\?/)) {
+ url = $('body').attr('current-templates').replace(/\?/,name + '.xml?');
+ } else {
+ url = $('body').attr('current-templates') + name + ".xml";
+ }
} else {
if ($('body').attr('load-testset').length > 0) {
url = $('body').attr('load-testset');
}
}
@@ -1036,10 +1045,10 @@
var name = $("#modeltypes div.menuitem[data-selected=selected]").text();
$.ajax({
cache: false,
dataType: 'xml',
- url: $('body').attr('current-templates') + "." + name + ".xml",
+ url: name + ".xml",
success: function(res){
$.ajax({
type: "PUT",
url: url + "/properties/attributes/modeltype/",
data: ({value: name}),