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 550ae3e560..0caedc0d3a 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 @@ -271,6 +271,15 @@ define(function(require) { }); that.initrdFilesTable.refreshResourceTableSelect(); + $("input[name='firmware_type']", context).change(function() { + if ($("input[name='firmware_type']:checked", context).val() === "custom") { + $("#customFirmware", context).show(); + } + else{ + $("#customFirmware", context).hide(); + } + }); + fillMachineTypesAndCPUModel(context); } @@ -340,6 +349,13 @@ define(function(require) { osJSON["BOOT"] = ""; } + if ($("input[name='firmware_type']:checked", context).val() === "custom") { + osJSON["FIRMWARE"] = $("#customFirmwarePath", context).val(); + } + else{ + osJSON["FIRMWARE"] = $("input[name='firmware_type']:checked", context).val(); + } + if (!$.isEmptyObject(osJSON)) { templateJSON["OS"] = osJSON; } @@ -377,9 +393,13 @@ define(function(require) { WizardFields.fill(context, osJSON); - if (osJSON && osJSON["BOOT"]) { + if (osJSON["BOOT"]) { _fillBootValue(context, osJSON["BOOT"]); } + + if (osJSON["FIRMWARE"]){ + _fillFirmwareValue(context, osJSON["FIRMWARE"]); + } } var featuresJSON = templateJSON["FEATURES"]; @@ -513,4 +533,18 @@ define(function(require) { _refreshBootValue(context); } } + + //---------------------------------------------------------------------------- + // Firmware options + //---------------------------------------------------------------------------- + + function _fillFirmwareValue(context, value) { + if ($("input[name='firmware_type'][value='" + value + "']", context).length){ + $("input[name='firmware_type'][value='" + value + "']", context).click(); + } + else { + $("input[name='firmware_type'][value='custom']", context).click(); + $("#customFirmwarePath", context).val(value); + } + } }); 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 4e05eae81a..62a0978e9c 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 @@ -105,6 +105,34 @@ +
+
+ +
+ + + + + + + + + + + + +
+ +
+