From 758a29df3abfca58b28c0f97de924f5cf6174471 Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Mon, 1 Jun 2015 18:53:07 +0200 Subject: [PATCH] feature #3748: Add vcenter PUBLIC_CLOUD section --- .../form-panels/create/wizard-tabs/hybrid.js | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/hybrid.js b/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/hybrid.js index 23e53bc738..385e8eb180 100644 --- a/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/hybrid.js +++ b/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/hybrid.js @@ -314,11 +314,6 @@ define(function(require) { this.wizardTabId = WIZARD_TAB_ID; this.icon = 'fa-cloud'; this.title = Locale.tr("Hybrid"); - - /* TODO - this.kernelFilesTable = new FilesTable(this.wizardTabId + 'KernelTable', {'select': true}); - this.initrdFilesTable = new FilesTable(this.wizardTabId + 'InitrdTable', {'select': true}); - */ } WizardTab.prototype.constructor = WizardTab; @@ -386,6 +381,13 @@ define(function(require) { vm_json["PUBLIC_CLOUD"] = []; }*/ + if ($("[wizard_field='HYPERVISOR']:checked").val() == 'vcenter') { + publicCloudJSON.push({ + 'TYPE': 'vcenter', + 'VM_TEMPLATE': $("#vcenter_template_uuid").val() + }); + } + $('.provider', context).each(function() { var hash = WizardFields.retrieve(this); if (!$.isEmptyObject(hash)) { @@ -436,7 +438,7 @@ define(function(require) { if (providers instanceof Array) { $.each(providers, function(index, provider) { - clickButton = index > 0; + clickButton = clickButton || index > 0; that.fillProviderTab(context, provider, "ec2", clickButton); }); } else if (providers instanceof Object) { @@ -519,17 +521,15 @@ define(function(require) { function _fillProviderTab(context, provider, providerType, clickButton) { var that = this; if (providerType == "vcenter") { - $("#vcenter_template_uuid", context).val(provider["VM_TEMPLATE"]) + $("#vcenter_template_uuid").val(provider["VM_TEMPLATE"]) } else { if (clickButton) { $("#tf_btn_hybrid", context).trigger("click"); } + + var providerContext = $(".provider", context).last(); + $("input.hybridRadio[value='" + providerType + "']", providerContext).trigger("click"); + WizardFields.fill(providerContext, provider); } - - var providerContext = $(".provider", context).last(); - - $("input.hybridRadio[value='" + providerType + "']", providerContext).trigger("click"); - - WizardFields.fill(providerContext, provider); } });