From 4924779fa0064271af404fc2d4d9aadd9b69c40e Mon Sep 17 00:00:00 2001 From: juanmont Date: Tue, 18 Dec 2018 10:06:55 +0100 Subject: [PATCH] F #2652: Allow boot order for vcenter in Sunstone --- .../form-panels/create/wizard-tabs/general.js | 12 ++++++++---- .../form-panels/create/wizard-tabs/os.js | 2 +- .../form-panels/create/wizard-tabs/os/html.hbs | 16 ++++++++-------- 3 files changed, 17 insertions(+), 13 deletions(-) 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 dd9e471829..0661114f5b 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 @@ -207,20 +207,20 @@ define(function(require) { }); context.on("change", "input[name='hypervisor']", function() { - // TODO define context (for example: this.closest('form')) - $(".hypervisor").hide(); - $(".only_" + this.value).show(); - if (this.value == "vcenter"){ $("#vcenter_template_ref", context).attr("required", ""); $("#vcenter_instance_id", context).attr("required", ""); $("#vcenter_ccr_ref", context).attr("required", ""); $("#MEMORY", context).attr("pattern", "^([048]|\\d*[13579][26]|\\d*[24680][048])$"); + $('.only_kvm').hide(); + $('.only_vcenter').show(); } else { $("#vcenter_template_ref", context).removeAttr("required"); $("#vcenter_instance_id", context).removeAttr("required"); $("#vcenter_ccr_ref", context).removeAttr("required"); $("#MEMORY", context).removeAttr("pattern"); + $('.only_kvm').show(); + $('.only_vcenter').hide(); } // There is another listener in context.js setup }); @@ -236,9 +236,13 @@ define(function(require) { if (config["mode"] === "kvm"){ $("#kvmRadio", context).click(); $("#template_hypervisor_form", context).hide(); + $('.only_kvm').show(); + $('.only_vcenter').hide(); } else if (config["mode"] === "vcenter"){ $("#vcenterRadio", context).click(); $("#template_hypervisor_form", context).hide(); + $('.only_kvm').hide(); + $('.only_vcenter').show(); } } diff --git a/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/os.js b/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/os.js index 46e2fa3e59..2e9589947b 100644 --- a/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/os.js +++ b/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/os.js @@ -146,7 +146,7 @@ define(function(require) { this.wizardTabId = WIZARD_TAB_ID + UniqueId.id(); this.icon = "fa-power-off"; this.title = Locale.tr("OS & CPU"); - this.classes = "hypervisor only_kvm"; + this.classes = "hypervisor" this.kernelFilesTable = new FilesTable( this.wizardTabId + UniqueId.id(), diff --git a/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/os/html.hbs b/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/os/html.hbs index de211d2e30..6d897d74eb 100644 --- a/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/os/html.hbs +++ b/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/os/html.hbs @@ -19,16 +19,16 @@
  • {{tr "Boot"}}
  • -
  • +
  • {{tr "Kernel"}}
  • -
  • +
  • {{tr "Ramdisk"}}
  • -
  • +
  • {{tr "Features"}}
  • -
  • +
  • {{tr "CPU Model"}}
  • @@ -37,7 +37,7 @@
    -
    +

    -
    +
    -
    +