From 4f49bf6770c384d1bc017413afb6f63514108bf8 Mon Sep 17 00:00:00 2001 From: ernjvr Date: Wed, 1 Aug 2018 13:06:11 +0200 Subject: [PATCH] ui: hide hvm tickbox for vmware, otherwise display (#2781) On the 'Register Template From URL' screen, when a user selects the VMware option from the Hypervisor dropdown: It incorrectly displays the 'HVM' checkbox. This checkbox must be hidden in the VMware context. This checkbox must still be visible in any other hypervisor context. To Reproduce: Go to the 'Register Template From URL' screen by clicking the 'Templates' tab on the lefthand side. On the 'Templates' screen click the 'Add' button to display the 'Register Template From URL' screen. On the 'Register Template From URL' screen, select the VMware option from the Hypervisor dropdown: Actual Behaviour: It incorrectly displays the 'HVM' checkbox. Expected behaviour: This checkbox must be hidden in the VMware context. This checkbox must still be visible in any other hypervisor context. --- ui/scripts/templates.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ui/scripts/templates.js b/ui/scripts/templates.js index 6dba18b4f96..96660fac680 100755 --- a/ui/scripts/templates.js +++ b/ui/scripts/templates.js @@ -251,12 +251,14 @@ $form.find('.form-item[rel=xenserverToolsVersion61plus]').hide(); $form.find('.form-item[rel=rootDiskControllerTypeKVM]').hide(); $form.find('.form-item[rel=directdownload]').hide(); + $form.find('.form-item[rel=requireshvm]').hide(); } else if ($(this).val() == "XenServer") { $form.find('.form-item[rel=rootDiskControllerType]').hide(); $form.find('.form-item[rel=nicAdapterType]').hide(); $form.find('.form-item[rel=keyboardType]').hide(); $form.find('.form-item[rel=rootDiskControllerTypeKVM]').hide(); $form.find('.form-item[rel=directdownload]').hide(); + $form.find('.form-item[rel=requireshvm]').css('display', 'inline-block'); if (isAdmin()) { $form.find('.form-item[rel=xenserverToolsVersion61plus]').css('display', 'inline-block'); @@ -268,6 +270,7 @@ $form.find('.form-item[rel=xenserverToolsVersion61plus]').hide(); $form.find('.form-item[rel=rootDiskControllerTypeKVM]').css('display', 'inline-block'); $('#label_root_disk_controller').prop('selectedIndex', 2); + $form.find('.form-item[rel=requireshvm]').css('display', 'inline-block'); if (isAdmin()) { $form.find('.form-item[rel=directdownload]').css('display', 'inline-block'); } @@ -278,6 +281,7 @@ $form.find('.form-item[rel=xenserverToolsVersion61plus]').hide(); $form.find('.form-item[rel=rootDiskControllerTypeKVM]').hide(); $form.find('.form-item[rel=directdownload]').hide(); + $form.find('.form-item[rel=requireshvm]').css('display', 'inline-block'); } });