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
diff --git a/src/store/modules/Control/ControlStore.js b/src/store/modules/Control/ControlStore.js
new file mode 100644
index 0000000..f641577
--- /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;