From e6807a4e540a5176928103c5c5697a2803c2afe2 Mon Sep 17 00:00:00 2001
From: Lei YU <yulei.sh@bytedance.com>
Date: Tue, 29 Jun 2021 09:13:22 +0800
Subject: boot: Send current settings on every boot operation

In the boot page, it did not allowed to send the same options.
However, there is a case that it is needed to send the boot options
anyway.

In typical x86 systems, when the BIOS is rebooted, it will clear the
boot options during the boot, so the settings in the web page does not
reflect to the BMC's boot option settings.

This patch allows to send the options anyway, so as long as user
"applies" the settings, the boot options are set to BMC.

Tested:
    Verify the same boot options settings are set to BMC after BIOS
    boots.

Signed-off-by: Lei YU <yulei.sh@bytedance.com>
Change-Id: I18ce341bbf9d968a78e8d818b005d1774936a48b
---
 src/views/Operations/ServerPowerOperations/BootSettings.vue | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

(limited to 'src/views/Operations/ServerPowerOperations/BootSettings.vue')

diff --git a/src/views/Operations/ServerPowerOperations/BootSettings.vue b/src/views/Operations/ServerPowerOperations/BootSettings.vue
index efd8d347..4896286b 100644
--- a/src/views/Operations/ServerPowerOperations/BootSettings.vue
+++ b/src/views/Operations/ServerPowerOperations/BootSettings.vue
@@ -104,20 +104,12 @@ export default {
   methods: {
     handleSubmit() {
       this.startLoader();
-      const bootSettingsChanged =
-        this.$v.form.bootOption.$dirty || this.$v.form.oneTimeBoot.$dirty;
       const tpmPolicyChanged = this.$v.form.tpmPolicyOn.$dirty;
       let settings;
-      let bootSource = null;
-      let overrideEnabled = null;
+      let bootSource = this.form.bootOption;
+      let overrideEnabled = this.form.oneTimeBoot;
       let tpmEnabled = null;
 
-      if (bootSettingsChanged) {
-        // If bootSource or overrideEnabled changed get
-        // both current values to send with request
-        bootSource = this.form.bootOption;
-        overrideEnabled = this.form.oneTimeBoot;
-      }
       if (tpmPolicyChanged) tpmEnabled = this.form.tpmPolicyOn;
       settings = { bootSource, overrideEnabled, tpmEnabled };
 
-- 
cgit v1.2.3

