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 60c04aebc8..3d4c964994 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 @@ -25,6 +25,7 @@ define(function(require) { var Tips = require('utils/tips'); var WizardFields = require('utils/wizard-fields'); var UniqueId = require('utils/unique-id'); + var CustomTagsTable = require('utils/custom-tags-table'); /* TEMPLATES @@ -109,24 +110,23 @@ define(function(require) { var publicCloudJSON = []; $('.provider', context).each(function() { - var hash = WizardFields.retrieve(this); - if (!$.isEmptyObject(hash)) { - var hybrid = $("input.hybridRadio:checked", this).val(); - switch (hybrid) { - case 'ec2': - hash["TYPE"] = "ec2"; - publicCloudJSON.push(hash); - break; - case 'azure': - hash["TYPE"] = hybrid.toUpperCase(); - publicCloudJSON.push(hash); - break; - case 'opennebula': - hash["TYPE"] = "opennebula"; - publicCloudJSON.push(hash); - break; + var hypervisor = $("input.hybridRadio:checked", this).val(); + + var hash; + + if (hypervisor == "custom"){ + hash = CustomTagsTable.retrieve(this); + } else { + hash = WizardFields.retrieve(this); + + if (!$.isEmptyObject(hash)) { + hash["TYPE"] = hypervisor; } - }; + } + + if (!$.isEmptyObject(hash)) { + publicCloudJSON.push(hash); + } }); if (!$.isEmptyObject(publicCloudJSON)) { templateJSON['PUBLIC_CLOUD'] = publicCloudJSON; }; @@ -143,10 +143,10 @@ define(function(require) { if (providers instanceof Array) { $.each(providers, function(index, provider) { clickButton = index > 0; - that.fillProviderTab(context, provider, provider.TYPE.toLowerCase(), clickButton); + that.fillProviderTab(context, provider, provider.TYPE, clickButton); }); } else if (providers instanceof Object) { - that.fillProviderTab(context, providers, providers.TYPE.toLowerCase(), clickButton); + that.fillProviderTab(context, providers, providers.TYPE, clickButton); clickButton = true; } @@ -168,8 +168,9 @@ define(function(require) { '