summaryrefslogtreecommitdiff
path: root/src/store
diff options
context:
space:
mode:
authorDerick Montague <derick.montague@ibm.com>2021-05-07 02:17:34 +0300
committerDerick Montague <derick.montague@ibm.com>2021-05-18 16:39:36 +0300
commit71114feb9a800d42f6eeddfa477077a8ab8e44f6 (patch)
treeccce7dac478ea28e03936d996f4af367b4f92158 /src/store
parent6b5ff101c2141dbb43d02c4327be3a55de69dd51 (diff)
downloadwebui-vue-71114feb9a800d42f6eeddfa477077a8ab8e44f6.tar.xz
Replace use of the term host with server
This patchset focuses on the global store use for server power operations and impacts several pages in the interface. For consistency, both in the UI and the code base, we are replacing the term host with server. This change impacts both the user and the developer experience. Maintaining consistency in naming allows both developers and users to form a mental model of the overall system and will help remove confusion when interacting with the UI and editing the interface. Testing: 1. Tested shutdown, power on, and reboot and verified the icons and page sections in the site header and the server power operations page update as expected during power operations. 2. Verified the one-time boot operations alert is displayed to the user when changing the boot settings on the server power operations page 3 Tested factory reset and validated the correct information message is displayed to the user with the server power off and on when performing the factory reset functions. 4. Verified the SOL Console status icon updates correctly during power operations. 5. Verified the alert message is displayed on the firmware update page when the server is powered on. Signed-off-by: Derick Montague <derick.montague@ibm.com> Change-Id: I88499a746364ab80f16a8b350d550407d094e95d
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');
}