From db72f7a37f05973a9ce4fe12418affaa6f107ac2 Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Tue, 26 Aug 2014 12:14:10 +0200 Subject: [PATCH] feature #2812: Add hypervisor attr to the update form --- .../public/js/plugins/templates-tab.js | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/src/sunstone/public/js/plugins/templates-tab.js b/src/sunstone/public/js/plugins/templates-tab.js index e53426f5e8..f36f8d8e3a 100644 --- a/src/sunstone/public/js/plugins/templates-tab.js +++ b/src/sunstone/public/js/plugins/templates-tab.js @@ -494,14 +494,18 @@ function updateTemplatesView(request, templates_list){ function generate_capacity_tab_content() { var html = - '
'+ + '
'+ '
'+ ''+ - ''+ - ''+ - ''+ + ''+ + ''+ + ''+ '
'+ '
'+ + ''+ + ''+ + ''+ + ''+ '
'+ '
'+ '
'+ @@ -620,7 +624,7 @@ function setup_capacity_tab_content(capacity_section) { capacity_section.on("change", "input[name='hypervisor']", function(){ var context = $(this).closest("#create_template_form_wizard"); $(".hypervisor", context).hide(); - $("." + this.value, context).show(); + $(".only_" + this.value, context).show(); }); setup_capacity_inputs(capacity_section); @@ -3665,6 +3669,7 @@ function build_template(dialog){ addSectionJSON(vm_json,$('#capacityTab',dialog)); vm_json["DESCRIPTION"] = $('#DESCRIPTION',$('#capacityTab',dialog)).val(); vm_json["LOGO"] = $('#LOGO',$('#capacityTab',dialog)).val(); + vm_json["HYPERVISOR"] = $('input[name="hypervisor"]:checked', $('#capacityTab',dialog)).val(); // // OS @@ -3864,6 +3869,12 @@ var fillTemplatePopUp = function(template, dialog){ $("#DESCRIPTION", capacity_section).val(escapeDoubleQuotes(htmlDecode(template["DESCRIPTION"]))); delete template["DESCRIPTION"]; + if (template["HYPERVISOR"]) { + $("input[name='hypervisor'][value='"+template["HYPERVISOR"]+"']", capacity_section).trigger("click") + delete template["HYPERVISOR"]; + } + + // // DISKS //