summaryrefslogtreecommitdiff
path: root/src/store
diff options
context:
space:
mode:
authorDixsie Wolmers <dixsie@ibm.com>2020-08-26 21:25:43 +0300
committerYoshie Muranaka <yoshiemuranaka@gmail.com>2020-08-28 18:18:13 +0300
commitca0be486d925e5f196159784785aa230324cf5f9 (patch)
tree38e3d3362639a1ee01b85fbafd75071793004f63 /src/store
parent949cdd51631b79de34cdbbb2a988ed1e9b610798 (diff)
downloadwebui-vue-ca0be486d925e5f196159784785aa230324cf5f9.tar.xz
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 <dixsie@ibm.com> Change-Id: Ie3fc38b55e75532fa703a45d5d598d4f80514f1a
Diffstat (limited to 'src/store')
-rw-r--r--src/store/modules/Control/ControlStore.js8
1 files changed, 6 insertions, 2 deletions
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);