mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-16 22:50:10 +03:00
F #2481: Change UEFI radio buttons to select
Signed-off-by: Frederick Borges <fborges@opennebula.io> (cherry picked from commit 079e58f2978385db2d0471579736c2fefe09b192)
This commit is contained in:
parent
03d43d399c
commit
609eed7667
@ -133,6 +133,12 @@ define(function(require) {
|
||||
"winXPPro64Guest",
|
||||
"winXPProGues"
|
||||
];
|
||||
var FIRMWARE_VALUES = [
|
||||
"BIOS",
|
||||
"EFI",
|
||||
"/usr/share/OVMF/OVMF_CODE.fd",
|
||||
"/usr/share/OVMF/OVMF_CODE.secboot.fd",
|
||||
];
|
||||
|
||||
var distinct = function(value, index, self){
|
||||
return self.indexOf(value)===index;
|
||||
@ -205,7 +211,7 @@ define(function(require) {
|
||||
_refreshBootValue(context);
|
||||
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
||||
context.on("click", "button.boot-order-down", function(){
|
||||
var tr = $(this).closest("tr");
|
||||
@ -271,8 +277,8 @@ define(function(require) {
|
||||
});
|
||||
that.initrdFilesTable.refreshResourceTableSelect();
|
||||
|
||||
$("input[name='firmware_type']", context).change(function() {
|
||||
if ($("input[name='firmware_type']:checked", context).val() === "custom") {
|
||||
$("#firmwareType", context).change(function() {
|
||||
if ($("#firmwareType", context).val() === "custom") {
|
||||
$("#customFirmware", context).show();
|
||||
}
|
||||
else{
|
||||
@ -345,15 +351,19 @@ define(function(require) {
|
||||
|
||||
if (boot && boot.length > 0) {
|
||||
osJSON["BOOT"] = boot;
|
||||
} else {
|
||||
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 (osJSON["FIRMWARE"]){
|
||||
switch (osJSON["FIRMWARE"]) {
|
||||
case "custom":
|
||||
osJSON["FIRMWARE"] = $("#customFirmwarePath", context).val();
|
||||
break;
|
||||
case "":
|
||||
delete osJSON["FIRMWARE"];
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$.isEmptyObject(osJSON)) {
|
||||
@ -391,15 +401,19 @@ define(function(require) {
|
||||
$("input[value=\"initrd_path\"]", context).click();
|
||||
}
|
||||
|
||||
|
||||
if (!FIRMWARE_VALUES.includes(osJSON["FIRMWARE"])){
|
||||
$("#firmwareType", context).val("custom");
|
||||
$("#customFirmware", context).show();
|
||||
$("#customFirmwarePath", context).val(osJSON["FIRMWARE"]);
|
||||
delete osJSON["FIRMWARE"];
|
||||
}
|
||||
|
||||
WizardFields.fill(context, osJSON);
|
||||
|
||||
if (osJSON["BOOT"]) {
|
||||
_fillBootValue(context, osJSON["BOOT"]);
|
||||
}
|
||||
|
||||
if (osJSON["FIRMWARE"]){
|
||||
_fillFirmwareValue(context, osJSON["FIRMWARE"]);
|
||||
}
|
||||
}
|
||||
|
||||
var featuresJSON = templateJSON["FEATURES"];
|
||||
@ -533,18 +547,4 @@ 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);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -111,20 +111,14 @@
|
||||
{{tr "Firmware"}}
|
||||
{{{tip (tr "This attribute allows to define the type of firmware used to boot the VM")}}}
|
||||
</label>
|
||||
<div class="large-12 columns text-center">
|
||||
<input id="none{{uniqueId}}" type="radio" name="firmware_type" value="" checked/>
|
||||
<label for="none{{uniqueId}}">{{tr "None"}}</label>
|
||||
<input id="bios{{uniqueId}}" type="radio" name="firmware_type" value="BIOS"/>
|
||||
<label for="bios{{uniqueId}}">{{tr "BIOS"}}</label>
|
||||
<input id="ovmfCode{{uniqueId}}" type="radio" name="firmware_type" value="/usr/share/OVMF/OVMF_CODE.fd" class="only_kvm"/>
|
||||
<label for="ovmfCode{{uniqueId}}" class="only_kvm">{{tr "OVMF_CODE.fd"}}</label>
|
||||
<input id="ovmfCodeSecboot{{uniqueId}}" type="radio" name="firmware_type" value="/usr/share/OVMF/OVMF_CODE.secboot.fd" class="only_kvm"/>
|
||||
<label for="ovmfCodeSecboot{{uniqueId}}" class="only_kvm">{{tr "OVMF_CODE.secboot.fd"}}</label>
|
||||
<input id="custom{{uniqueId}}" type="radio" name="firmware_type" value="custom" class="only_kvm"/>
|
||||
<label for="custom{{uniqueId}}" class="only_kvm">{{tr "Custom"}}</label>
|
||||
<input id="efi{{uniqueId}}" type="radio" name="firmware_type" value="EFI" class="only_vcenter"/>
|
||||
<label for="efi{{uniqueId}}" class="only_vcenter">{{tr "EFI"}}</label>
|
||||
</div>
|
||||
<select id="firmwareType" wizard_field="FIRMWARE">
|
||||
<option value="">{{tr "None"}}</option>
|
||||
<option value="BIOS">{{tr "BIOS"}}</option>
|
||||
<option value="/usr/share/OVMF/OVMF_CODE.fd" class="only_kvm">UEFI: /usr/share/OVMF/OVMF_CODE.fd</option>
|
||||
<option value="/usr/share/OVMF/OVMF_CODE.secboot.fd" class="only_kvm">UEFI: /usr/share/OVMF/OVMF_CODE.secboot.fd</option>
|
||||
<option value="custom" class="only_kvm">{{tr "Custom"}}</option>
|
||||
<option value="EFI" class="only_vcenter">{{tr "EFI"}}</option>
|
||||
</select>
|
||||
<div id="customFirmware" hidden>
|
||||
<label>
|
||||
{{tr "Custom Firmware Path"}}
|
||||
|
Loading…
x
Reference in New Issue
Block a user