From cfe2d8f6a6848416ee00e10a2240f143d1e5eee3 Mon Sep 17 00:00:00 2001
From: SimonFair <39065407+SimonFair@users.noreply.github.com>
Date: Wed, 2 Nov 2022 08:22:35 +0000
Subject: [PATCH 1/2] Add Boot Order field clear if USB Boot selected.
---
.../templates/Custom.form.php | 24 ++++++++++++++-----
.../templates/LibreELEC.form.php | 20 ++++++++++++----
.../templates/OpenELEC.form.php | 18 +++++++++++---
3 files changed, 49 insertions(+), 13 deletions(-)
diff --git a/plugins/dynamix.vm.manager/templates/Custom.form.php b/plugins/dynamix.vm.manager/templates/Custom.form.php
index fa374e2cd..ec866f1fb 100644
--- a/plugins/dynamix.vm.manager/templates/Custom.form.php
+++ b/plugins/dynamix.vm.manager/templates/Custom.form.php
@@ -452,7 +452,7 @@
?>
>_(Enable USB boot)_:
-
_(Boot Order)_:
-
+
@@ -819,7 +819,7 @@
_(Boot Order)_:
-
+
@@ -1247,7 +1247,7 @@
?>
}
@@ -1290,7 +1290,7 @@
$intAvailableOtherPCIDevices++;
?>
}
@@ -1403,6 +1403,18 @@ function BIOSChange(bios) {
}
}
+function USBBootChange(usbboot) {
+ // Remove all boot orders if changed to Yes
+ var value = usbboot.value ;
+ if (value == "Yes") {
+ var elements = document.getElementsByClassName("bootorder");
+ var names = '';
+ for(var i = 0; i < elements.length; i++) {
+ elements[i].value = "";
+ }
+ }
+}
+
function AutoportChange(autoport) {
if (autoport.value == "yes") {
document.getElementById("port").style.visibility="hidden";
diff --git a/plugins/dynamix.vm.manager/templates/LibreELEC.form.php b/plugins/dynamix.vm.manager/templates/LibreELEC.form.php
index 2c9e0e25c..a52d00a02 100644
--- a/plugins/dynamix.vm.manager/templates/LibreELEC.form.php
+++ b/plugins/dynamix.vm.manager/templates/LibreELEC.form.php
@@ -672,7 +672,7 @@ $hdrXML = "\n"; // XML encoding declaratio
?>
>_(Enable USB boot)_:
- >
+ onchange="USBBootChange(this)">
echo mk_option($arrConfig['domain']['usbboot'], 'No', 'No');
echo mk_option($arrConfig['domain']['usbboot'], 'Yes', 'Yes');
@@ -1014,7 +1014,7 @@ $hdrXML = "\n"; // XML encoding declaratio
?>
}
@@ -1057,7 +1057,7 @@ $hdrXML = "\n"; // XML encoding declaratio
$intAvailableOtherPCIDevices++;
?>
}
@@ -1136,7 +1136,7 @@ $hdrXML = "\n"; // XML encoding declaratio