diff --git a/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/general.js b/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/general.js index fa23fe92cf..b5dbc47f7b 100644 --- a/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/general.js +++ b/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/general.js @@ -51,6 +51,10 @@ define(function(require) { this.wizardTabId = WIZARD_TAB_ID + UniqueId.id(); this.icon = 'fa-laptop'; this.title = Locale.tr("General"); + + if(opts.listener != undefined){ + this.listener = opts.listener; + } } WizardTab.prototype.constructor = WizardTab; @@ -94,6 +98,8 @@ define(function(require) { } function _setup(context) { + var that = this; + $(document).on('click', "[href='#" + this.wizardTabId + "']", function(){ //context.foundation('slider', 'reflow'); }); @@ -114,6 +120,12 @@ define(function(require) { }); CapacityCreate.setup($("div.capacityCreate", context)); + + if(that.listener != undefined){ + $(context).on("change", "input[wizard_field=VROUTER]", function(){ + that.listener.notify(); + }); + } } function _retrieve(context) { diff --git a/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/network.js b/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/network.js index e9b76d4aee..a9aae90abc 100644 --- a/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/network.js +++ b/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/network.js @@ -68,6 +68,7 @@ define(function(require) { WizardTab.prototype.fill = _fill; WizardTab.prototype.renameTabLinks = _renameTabLinks; WizardTab.prototype.addNicTab = _addNicTab; + WizardTab.prototype.notify = _notify; return WizardTab; @@ -265,4 +266,18 @@ define(function(require) { this.listener.notify(); } } + + function _notify(context, templateJSON) { + if (templateJSON.VROUTER == "YES"){ + while($("i.remove-tab", context).length > 0){ + $("i.remove-tab", context).click(); + } + + $("#tf_btn_nics", context).hide(); + $(".vrouter_no_nics", context).show(); + } else { + $("#tf_btn_nics", context).show(); + $(".vrouter_no_nics", context).hide(); + } + } }); diff --git a/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/network/html.hbs b/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/network/html.hbs index 9da7f05192..8c169ba4b1 100644 --- a/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/network/html.hbs +++ b/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/network/html.hbs @@ -25,6 +25,14 @@
+