summaryrefslogtreecommitdiff
path: root/src/store
diff options
context:
space:
mode:
authorYoshie Muranaka <yoshiemuranaka@gmail.com>2020-02-19 19:07:40 +0300
committerGunnar Mills <gmills@us.ibm.com>2020-02-22 00:28:30 +0300
commitc11d38945b8a51e4181142c2b8852ffcb30338d9 (patch)
tree5c13c0b058214e273100bacb06232f7daff2f831 /src/store
parent4ee8d290a5d45ce93419c819a6e7544d3a009b99 (diff)
downloadwebui-vue-c11d38945b8a51e4181142c2b8852ffcb30338d9.tar.xz
Add Reboot BMC page
Created a ControlStore with the intention to consolidate actions across multiple subnav pages under the 'Control' tab, instead of creating a dedicated RebootBmc store with one action. - Update PageSection component to make sectionTitle prop optional - Changed PageTitle computed property to data since the value doesn't change during the component lifecycle - Change PageSection <section> element to <div> to avoid accessibility issues Signed-off-by: Yoshie Muranaka <yoshiemuranaka@gmail.com> Change-Id: I2877e2a7b9bfee245c48d52c70859978b74be7f3
Diffstat (limited to 'src/store')
-rw-r--r--src/store/index.js2
-rw-r--r--src/store/modules/Control/ControlStore.js22
2 files changed, 24 insertions, 0 deletions
diff --git a/src/store/index.js b/src/store/index.js
index cb63e545..8a444a63 100644
--- a/src/store/index.js
+++ b/src/store/index.js
@@ -6,6 +6,7 @@ import AuthenticationStore from './modules/Authentication/AuthenticanStore';
import LocalUserManagementStore from './modules/AccessControl/LocalUserMangementStore';
import OverviewStore from './modules/Overview/OverviewStore';
import FirmwareStore from './modules/Configuration/FirmwareStore';
+import ControlStore from './modules/Control/ControlStore';
import PowerConsumptionStore from './modules/Control/PowerConsumptionStore';
import PowerCapStore from './modules/Control/PowerCapStore';
import NetworkSettingStore from './modules/Configuration/NetworkSettingsStore';
@@ -25,6 +26,7 @@ export default new Vuex.Store({
localUsers: LocalUserManagementStore,
overview: OverviewStore,
firmware: FirmwareStore,
+ controls: ControlStore,
powerConsumption: PowerConsumptionStore,
powerCap: PowerCapStore,
networkSettings: NetworkSettingStore,
diff --git a/src/store/modules/Control/ControlStore.js b/src/store/modules/Control/ControlStore.js
new file mode 100644
index 00000000..f6415771
--- /dev/null
+++ b/src/store/modules/Control/ControlStore.js
@@ -0,0 +1,22 @@
+import api from '../../api';
+import i18n from '../../../i18n';
+
+const ControlStore = {
+ namespaced: true,
+ actions: {
+ async rebootBmc() {
+ const data = { ResetType: 'GracefulRestart' };
+ return await api
+ .post('/redfish/v1/Managers/bmc/Actions/Manager.Reset', data)
+ .then(() => i18n.t('pageRebootBmc.toastMessages.successRebootStart'))
+ .catch(error => {
+ console.log(error);
+ throw new Error(
+ i18n.t('pageRebootBmc.toastMessages.errorRebootStart')
+ );
+ });
+ }
+ }
+};
+
+export default ControlStore;