From ca0be486d925e5f196159784785aa230324cf5f9 Mon Sep 17 00:00:00 2001 From: Dixsie Wolmers Date: Wed, 26 Aug 2020 13:25:43 -0500 Subject: Fix last power operation time bug - To display updated time in the UI, `getLastPowerOperationTime` must be dispatched after each async power operation Signed-off-by: Dixsie Wolmers Change-Id: Ie3fc38b55e75532fa703a45d5d598d4f80514f1a --- src/store/modules/Control/ControlStore.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/store/modules/Control') diff --git a/src/store/modules/Control/ControlStore.js b/src/store/modules/Control/ControlStore.js index f27f5a69..82dbdcc1 100644 --- a/src/store/modules/Control/ControlStore.js +++ b/src/store/modules/Control/ControlStore.js @@ -85,36 +85,40 @@ const ControlStore = { dispatch('hostPowerChange', data); await checkForHostStatus.bind(this, 'on')(); commit('setOperationInProgress', false); + dispatch('getLastPowerOperationTime'); }, async hostSoftReboot({ dispatch, commit }) { const data = { ResetType: 'GracefulRestart' }; dispatch('hostPowerChange', data); await checkForHostStatus.bind(this, 'on')(); commit('setOperationInProgress', false); + dispatch('getLastPowerOperationTime'); }, async hostHardReboot({ dispatch, commit }) { const data = { ResetType: 'ForceRestart' }; dispatch('hostPowerChange', data); await checkForHostStatus.bind(this, 'on')(); commit('setOperationInProgress', false); + dispatch('getLastPowerOperationTime'); }, async hostSoftPowerOff({ dispatch, commit }) { const data = { ResetType: 'GracefulShutdown' }; dispatch('hostPowerChange', data); await checkForHostStatus.bind(this, 'off')(); commit('setOperationInProgress', false); + dispatch('getLastPowerOperationTime'); }, async hostHardPowerOff({ dispatch, commit }) { const data = { ResetType: 'ForceOff' }; dispatch('hostPowerChange', data); await checkForHostStatus.bind(this, 'off')(); commit('setOperationInProgress', false); + dispatch('getLastPowerOperationTime'); }, - hostPowerChange({ commit, dispatch }, data) { + hostPowerChange({ commit }, data) { commit('setOperationInProgress', true); api .post('/redfish/v1/Systems/system/Actions/ComputerSystem.Reset', data) - .then(() => dispatch('getLastPowerOperationTime')) .catch(error => { console.log(error); commit('setOperationInProgress', false); -- cgit v1.2.3