From a9d60bb1b1110e32cdb24c0ab36dfe0d93d61a7e Mon Sep 17 00:00:00 2001 From: Maksim Zakharov Date: Wed, 17 Aug 2022 15:26:58 +0300 Subject: add boot mode choice --- src/store/modules/Operations/BootSettingsStore.js | 27 ++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) (limited to 'src/store') diff --git a/src/store/modules/Operations/BootSettingsStore.js b/src/store/modules/Operations/BootSettingsStore.js index 7a36dd84..ae527d14 100644 --- a/src/store/modules/Operations/BootSettingsStore.js +++ b/src/store/modules/Operations/BootSettingsStore.js @@ -6,12 +6,16 @@ const BootSettingsStore = { state: { bootSourceOptions: [], bootSource: null, + bootModeOptions: null, + bootMode: null, overrideEnabled: null, tpmEnabled: null, }, getters: { bootSourceOptions: (state) => state.bootSourceOptions, bootSource: (state) => state.bootSource, + bootModeOptions: (state) => state.bootModeOptions, + bootMode: (state) => state.bootMode, overrideEnabled: (state) => state.overrideEnabled, tpmEnabled: (state) => state.tpmEnabled, }, @@ -19,6 +23,9 @@ const BootSettingsStore = { setBootSourceOptions: (state, bootSourceOptions) => (state.bootSourceOptions = bootSourceOptions), setBootSource: (state, bootSource) => (state.bootSource = bootSource), + setBootModeOptions: (state, bootModeOptions) => + (state.bootModeOptions = bootModeOptions), + setBootMode: (state, bootMode) => (state.bootMode = bootMode), setOverrideEnabled: (state, overrideEnabled) => { if (overrideEnabled === 'Once') { state.overrideEnabled = true; @@ -38,14 +45,23 @@ const BootSettingsStore = { 'setBootSourceOptions', Boot['BootSourceOverrideTarget@Redfish.AllowableValues'] ); + commit( + 'setBootModeOptions', + Boot['BootSourceOverrideMode@Redfish.AllowableValues'] + ); commit('setOverrideEnabled', Boot.BootSourceOverrideEnabled); commit('setBootSource', Boot.BootSourceOverrideTarget); + commit('setBootMode', Boot.BootSourceOverrideMode); }) .catch((error) => console.log(error)); }, - saveBootSettings({ commit, dispatch }, { bootSource, overrideEnabled }) { + saveBootSettings( + { commit, dispatch }, + { bootSource, overrideEnabled, bootMode } + ) { const data = { Boot: {} }; data.Boot.BootSourceOverrideTarget = bootSource; + data.Boot.BootSourceOverrideMode = bootMode; if (overrideEnabled) { data.Boot.BootSourceOverrideEnabled = 'Once'; @@ -60,6 +76,7 @@ const BootSettingsStore = { .then((response) => { // If request success, commit the values commit('setBootSource', data.Boot.BootSourceOverrideTarget); + commit('setBootMode', data.Boot.BootSourceOverrideMode); commit('setOverrideEnabled', data.Boot.BootSourceOverrideEnabled); return response; }) @@ -101,13 +118,17 @@ const BootSettingsStore = { }, async saveSettings( { dispatch }, - { bootSource, overrideEnabled, tpmEnabled } + { bootSource, overrideEnabled, tpmEnabled, bootMode } ) { const promises = []; if (bootSource !== null || overrideEnabled !== null) { promises.push( - dispatch('saveBootSettings', { bootSource, overrideEnabled }) + dispatch('saveBootSettings', { + bootSource, + overrideEnabled, + bootMode, + }) ); } if (tpmEnabled !== null) { -- cgit v1.2.3