summaryrefslogtreecommitdiff
path: root/src/store
diff options
context:
space:
mode:
Diffstat (limited to 'src/store')
-rw-r--r--src/store/index.js2
-rw-r--r--src/store/modules/Control/ControlStore.js44
-rw-r--r--src/store/modules/GlobalStore.js16
-rw-r--r--src/store/plugins/WebSocketPlugin.js2
4 files changed, 32 insertions, 32 deletions
diff --git a/src/store/index.js b/src/store/index.js
index 93386b1a..82efab91 100644
--- a/src/store/index.js
+++ b/src/store/index.js
@@ -44,7 +44,7 @@ export default new Vuex.Store({
ldap: LdapStore,
localUsers: LocalUserManagementStore,
firmware: FirmwareStore,
- hostBootSettings: BootSettingsStore,
+ serverBootSettings: BootSettingsStore,
controls: ControlStore,
powerControl: PowerControlStore,
powerPolicy: PowerPolicyStore,
diff --git a/src/store/modules/Control/ControlStore.js b/src/store/modules/Control/ControlStore.js
index 5f532d0e..9b8bf73d 100644
--- a/src/store/modules/Control/ControlStore.js
+++ b/src/store/modules/Control/ControlStore.js
@@ -2,23 +2,23 @@ import api from '@/store/api';
import i18n from '@/i18n';
/**
- * Watch for hostStatus changes in GlobalStore module
+ * Watch for serverStatus changes in GlobalStore module
* to set isOperationInProgress state
* Stop watching status changes and resolve Promise when
- * hostStatus value matches passed argument or after 5 minutes
- * @param {string} hostStatus
+ * serverStatus value matches passed argument or after 5 minutes
+ * @param {string} serverStatus
* @returns {Promise}
*/
-const checkForHostStatus = function (hostStatus) {
+const checkForServerStatus = function (serverStatus) {
return new Promise((resolve) => {
const timer = setTimeout(() => {
resolve();
unwatch();
}, 300000 /*5mins*/);
const unwatch = this.watch(
- (state) => state.global.hostStatus,
+ (state) => state.global.serverStatus,
(value) => {
- if (value === hostStatus) {
+ if (value === serverStatus) {
resolve();
unwatch();
clearTimeout(timer);
@@ -82,42 +82,42 @@ const ControlStore = {
throw new Error(i18n.t('pageRebootBmc.toast.errorRebootStart'));
});
},
- async hostPowerOn({ dispatch, commit }) {
+ async serverPowerOn({ dispatch, commit }) {
const data = { ResetType: 'On' };
- dispatch('hostPowerChange', data);
- await checkForHostStatus.bind(this, 'on')();
+ dispatch('serverPowerChange', data);
+ await checkForServerStatus.bind(this, 'on')();
commit('setOperationInProgress', false);
dispatch('getLastPowerOperationTime');
},
- async hostSoftReboot({ dispatch, commit }) {
+ async serverSoftReboot({ dispatch, commit }) {
const data = { ResetType: 'GracefulRestart' };
- dispatch('hostPowerChange', data);
- await checkForHostStatus.bind(this, 'on')();
+ dispatch('serverPowerChange', data);
+ await checkForServerStatus.bind(this, 'on')();
commit('setOperationInProgress', false);
dispatch('getLastPowerOperationTime');
},
- async hostHardReboot({ dispatch, commit }) {
+ async serverHardReboot({ dispatch, commit }) {
const data = { ResetType: 'ForceRestart' };
- dispatch('hostPowerChange', data);
- await checkForHostStatus.bind(this, 'on')();
+ dispatch('serverPowerChange', data);
+ await checkForServerStatus.bind(this, 'on')();
commit('setOperationInProgress', false);
dispatch('getLastPowerOperationTime');
},
- async hostSoftPowerOff({ dispatch, commit }) {
+ async serverSoftPowerOff({ dispatch, commit }) {
const data = { ResetType: 'GracefulShutdown' };
- dispatch('hostPowerChange', data);
- await checkForHostStatus.bind(this, 'off')();
+ dispatch('serverPowerChange', data);
+ await checkForServerStatus.bind(this, 'off')();
commit('setOperationInProgress', false);
dispatch('getLastPowerOperationTime');
},
- async hostHardPowerOff({ dispatch, commit }) {
+ async serverHardPowerOff({ dispatch, commit }) {
const data = { ResetType: 'ForceOff' };
- dispatch('hostPowerChange', data);
- await checkForHostStatus.bind(this, 'off')();
+ dispatch('serverPowerChange', data);
+ await checkForServerStatus.bind(this, 'off')();
commit('setOperationInProgress', false);
dispatch('getLastPowerOperationTime');
},
- hostPowerChange({ commit }, data) {
+ serverPowerChange({ commit }, data) {
commit('setOperationInProgress', true);
api
.post('/redfish/v1/Systems/system/Actions/ComputerSystem.Reset', data)
diff --git a/src/store/modules/GlobalStore.js b/src/store/modules/GlobalStore.js
index 6e9bd962..fdfdc93f 100644
--- a/src/store/modules/GlobalStore.js
+++ b/src/store/modules/GlobalStore.js
@@ -7,7 +7,7 @@ const HOST_STATE = {
diagnosticMode: 'xyz.openbmc_project.State.Host.HostState.DiagnosticMode',
};
-const hostStateMapper = (hostState) => {
+const serverStateMapper = (hostState) => {
switch (hostState) {
case HOST_STATE.on:
case 'On': // Redfish PowerState
@@ -31,7 +31,7 @@ const GlobalStore = {
state: {
assetTag: null,
bmcTime: null,
- hostStatus: 'unreachable',
+ serverStatus: 'unreachable',
languagePreference: localStorage.getItem('storedLanguage') || 'en-US',
isUtcDisplay: localStorage.getItem('storedUtcDisplay')
? JSON.parse(localStorage.getItem('storedUtcDisplay'))
@@ -41,7 +41,7 @@ const GlobalStore = {
},
getters: {
assetTag: (state) => state.assetTag,
- hostStatus: (state) => state.hostStatus,
+ serverStatus: (state) => state.serverStatus,
bmcTime: (state) => state.bmcTime,
languagePreference: (state) => state.languagePreference,
isUtcDisplay: (state) => state.isUtcDisplay,
@@ -51,8 +51,8 @@ const GlobalStore = {
mutations: {
setAssetTag: (state, assetTag) => (state.assetTag = assetTag),
setBmcTime: (state, bmcTime) => (state.bmcTime = bmcTime),
- setHostStatus: (state, hostState) =>
- (state.hostStatus = hostStateMapper(hostState)),
+ setServerStatus: (state, serverState) =>
+ (state.serverStatus = serverStateMapper(serverState)),
setLanguagePreference: (state, language) =>
(state.languagePreference = language),
setUsername: (state, username) => (state.username = username),
@@ -75,7 +75,7 @@ const GlobalStore = {
})
.catch((error) => console.log(error));
},
- getHostStatus({ commit }) {
+ getServerStatus({ commit }) {
api
.get('/redfish/v1/Systems/system')
.then(
@@ -85,9 +85,9 @@ const GlobalStore = {
// OpenBMC's host state interface is mapped to 2 Redfish
// properties "Status""State" and "PowerState". Look first
// at State for certain cases.
- commit('setHostStatus', State);
+ commit('setServerStatus', State);
} else {
- commit('setHostStatus', PowerState);
+ commit('setServerStatus', PowerState);
}
}
)
diff --git a/src/store/plugins/WebSocketPlugin.js b/src/store/plugins/WebSocketPlugin.js
index 5780d749..c9f7a89e 100644
--- a/src/store/plugins/WebSocketPlugin.js
+++ b/src/store/plugins/WebSocketPlugin.js
@@ -38,7 +38,7 @@ const WebSocketPlugin = (store) => {
if (eventInterface === 'xyz.openbmc_project.State.Host') {
const { properties: { CurrentHostState } = {} } = data;
- store.commit('global/setHostStatus', CurrentHostState);
+ store.commit('global/setServerStatus', CurrentHostState);
} else if (path === '/xyz/openbmc_project/logging') {
store.dispatch('eventLog/getEventLogData');
}