From a55ca915d2e0d447cc82bc601fc3f846773751ec Mon Sep 17 00:00:00 2001 From: Frederick Borges Date: Tue, 28 Sep 2021 16:44:39 +0200 Subject: [PATCH] F #2481: UEFI firmware secure on Custom (#1489) --- .../form-panels/create/wizard-tabs/os.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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 6c364c2f2f..f14965987a 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 @@ -138,6 +138,7 @@ define(function(require) { "EFI": false, "/usr/share/OVMF/OVMF_CODE.fd": false, "/usr/share/OVMF/OVMF_CODE.secboot.fd": true, + "custom": true }; var distinct = function(value, index, self){ @@ -278,6 +279,7 @@ define(function(require) { that.initrdFilesTable.refreshResourceTableSelect(); $("#firmwareType", context).change(function() { + console.log($(this).val()) if (FIRMWARE_VALUES[$(this).val()]){ $("#firmwareSecure", context).show(); } @@ -360,6 +362,10 @@ define(function(require) { osJSON["BOOT"] = boot; } + if (FIRMWARE_VALUES[osJSON["FIRMWARE"]]){ + osJSON["FIRMWARE_SECURE"] = $("#secureFirmwareValue", context).is(':checked') ? "YES" : "NO"; + } + if (osJSON["FIRMWARE"]){ switch (osJSON["FIRMWARE"]) { case "custom": @@ -373,10 +379,6 @@ define(function(require) { } } - if (FIRMWARE_VALUES[osJSON["FIRMWARE"]]){ - osJSON["FIRMWARE_SECURE"] = $("#secureFirmwareValue", context).is(':checked') ? "YES" : "NO"; - } - if (!$.isEmptyObject(osJSON)) { templateJSON["OS"] = osJSON; } @@ -412,10 +414,10 @@ define(function(require) { $("input[value=\"initrd_path\"]", context).click(); } - if (!Object.keys(FIRMWARE_VALUES).includes(osJSON["FIRMWARE"])){ $("#firmwareType", context).val("custom"); $("#customFirmware", context).show(); + $("#firmwareSecure", context).show(); $("#customFirmwarePath", context).val(osJSON["FIRMWARE"]); delete osJSON["FIRMWARE"]; }