From 3c773bbf3ee96624edfdc8020cfd8cc04c53b434 Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Thu, 13 Dec 2012 10:51:50 +0100 Subject: [PATCH] feature #1664: Autofill VNC parameters --- .../public/js/plugins/templates-tab.js | 32 ++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/src/sunstone/public/js/plugins/templates-tab.js b/src/sunstone/public/js/plugins/templates-tab.js index 6270e796a7..faad9712f7 100644 --- a/src/sunstone/public/js/plugins/templates-tab.js +++ b/src/sunstone/public/js/plugins/templates-tab.js @@ -2325,6 +2325,10 @@ function setupCreateTemplateDialog(){ // Append the new div containing the tab and add the tab to the list tabs.append(html_tab_content).tabs('add', '#io_tab', 'INPUT/OUTPUT', temp_index); + $("input[name='graphics_type']").change(function(){ + $("#LISTEN", $('div#io_tab')).val("0.0.0.0") + }); + $('#add_input', $('div#io_tab')).click(function() { var table = $('#input_table', $('div#io_tab'))[0]; console.log(table) @@ -3267,7 +3271,9 @@ function setupCreateTemplateDialog(){ var vm_json = {}; var name,value,boot_method; - //process capacity options + // + // CAPACITY + // var scope = section_capacity; if (!mandatory_filter(scope)){ @@ -3290,6 +3296,10 @@ function setupCreateTemplateDialog(){ // notifyError(tr("There are mandatory fields missing in the OS Boot options section")); // return false; //}; + // + // OS + // + vm_json["OS"] = {}; addSectionJSON(vm_json["OS"],$('div#os_tab',dialog)); // @@ -3299,6 +3309,10 @@ function setupCreateTemplateDialog(){ //addSectionJSON(vm_json["FEATURES"],scope); // ////process disks -> fetch from box + // + // DISK + // + vm_json["DISK"] = []; $('div.disk div#disk_type.vm_param',dialog).each(function(){ @@ -3307,6 +3321,10 @@ function setupCreateTemplateDialog(){ vm_json["DISK"].push(hash); }); + // + // NIC + // + vm_json["NIC"] = []; $('div.nic',dialog).each(function(){ @@ -3315,9 +3333,17 @@ function setupCreateTemplateDialog(){ vm_json["NIC"].push(hash); }); + // + // GRAPHICS + // + vm_json["GRAPHICS"] = {}; addSectionJSON(vm_json["GRAPHICS"],$('div#io_tab .graphics',dialog)); + // + // INPUT + // + vm_json["INPUT"] = []; $('#input_table tr', $('div#io_tab')).each(function(){ var hash = {}; @@ -3367,6 +3393,10 @@ function setupCreateTemplateDialog(){ }); }; + // + // PLACEMENT + // + addSectionJSON(vm_json,$('div#placement_tab .requirements',dialog)); console.log(vm_json)