From 85443e0c1ebc21bad0407c08b0fd6a02f4828bfb Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Thu, 28 Aug 2014 16:13:16 +0200 Subject: [PATCH] feature #3162: Add update hybrid section --- .../public/js/plugins/templates-tab.js | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/src/sunstone/public/js/plugins/templates-tab.js b/src/sunstone/public/js/plugins/templates-tab.js index 74a6cedf70..1a32873f94 100644 --- a/src/sunstone/public/js/plugins/templates-tab.js +++ b/src/sunstone/public/js/plugins/templates-tab.js @@ -4411,6 +4411,49 @@ var fillTemplatePopUp = function(template, dialog){ delete template.NIC_DEFAULT; } + // + // HYBRID + // + + function fillProviderTab(provider, provider_type){ + $("#tf_btn_hybrid").trigger("click"); + var context = $(".provider", dialog).last(); + + $("input.hybridRadio[value='"+provider_type+"']", context).trigger("click"); + + autoFillInputs(provider, context); + } + + if (template.PUBLIC_CLOUD) { + var providers = template.PUBLIC_CLOUD + + if (providers instanceof Array) { + $.each(providers, function(){ + fillProviderTab(this, this.TYPE.toLowerCase()); + }); + } + else if (providers instanceof Object) { + fillProviderTab(providers, this.TYPE.toLowerCase()); + } + + delete template.PUBLIC_CLOUD + } + + if (template.EC2) { + var providers = template.EC2 + + if (providers instanceof Array) { + $.each(providers, function(){ + fillProviderTab(this, "ec2"); + }); + } + else if (providers instanceof Object) { + fillProviderTab(providers, "ec2"); + } + + delete template.EC2 + } + // // OS //