cockpit/js/instance.js in cpee-1.3.164 vs cockpit/js/instance.js in cpee-1.3.166

- old
+ new

@@ -48,27 +48,27 @@ $(document).ready(function() {// {{{ $("input[name=base-url]").val(location.protocol + "//" + location.host + ":" + $('body').data('defaultport')); $("button[name=base]").click(function(){ create_instance(null); }); $("button[name=instance]").click(function(){ ui_tab_click("#tabinstance"); monitor_instance(false); }); $("button[name=loadtestset]").click(load_testset); - $("button[name=loadtestsetfile]").click(load_testsetfile); $("button[name=loadmodelfile]").click(load_modelfile); $("button[name=savetestset]").click(function(){ save_testset(); }); $("button[name=savesvg]").click(function(){ save_svg(); }); $("input[name=votecontinue]").click(check_subscription); + $("input[name=testsetfile]").change(load_testsetfile); - $.ajax({ - url: "testsets/index.xml", + url: "testsets/testsets.xml", dataType: 'xml', success: function(res){ $('testset',res).each(function(){ var ts = $(this).text(); - $('select[name=testset-names]').append( + $('select[name=testset-names] optgroup:last-child').append( $("<option></option>").attr("value",ts).text(ts) ); }); + $('select[name=testset-names] optgroup:last-child option:first-child').attr('selected','selected'); var q = $.parseQuery(); if (q.monitor && q.load) { $("input[name=instance-url]").val(q.monitor); $("select[name=testset-names]").val(q.load) ui_tab_click("#tabexecution"); @@ -83,10 +83,22 @@ // ui_toggle_vis_tab($("#instance td.switch")); monitor_instance(false); } } }); + $.ajax({ + url: "testsets/transformations.xml", + dataType: 'xml', + success: function(res){ + $('transformation',res).each(function(){ + var ts = $(this).text(); + $('select[name=transformation-names]').append( + $("<option></option>").attr("value",ts).text(ts) + ); + }); + } + }); });// }}} function check_subscription() { // {{{ var url = $("input[name=current-instance]").val(); var num = 0; @@ -619,10 +631,11 @@ } }); }// }}} function load_testsetfile() { //{{{ if (running) return; + running = true; if (typeof window.FileReader !== 'function') { alert('FileReader not yet supportet'); return; } var files = $('#testsetfile').get(0).files; @@ -660,19 +673,26 @@ $('#main .tabbehind button').hide(); $('#dat_details').empty(); var name = $("select[name=testset-names]").val(); - $.ajax({ - cache: false, - dataType: 'xml', - url: "testsets/" + name + ".xml", - success: function(res){ - document.title = name; - set_testset(res); - } - }); - running = false; + if (name == '###') { + running = false; + document.getElementById('testsetfile').click(); + } else { + $.ajax({ + cache: false, + dataType: 'xml', + url: "testsets/" + name + ".xml", + success: function(res){ + document.title = name; + set_testset(res); + }, + complete: function() { + running = false; + } + }); + } }// }}} function load_des(url,model) { //{{{ model = model.replace(/<\?[^\?]+\?>/,''); var val = "<content>" + model + "</content>";