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/views/Control/RebootBmc/RebootBmc.vue b/src/views/Control/RebootBmc/RebootBmc.vue
new file mode 100644
index 0000000..e301f0d
--- /dev/null
+++ b/src/views/Control/RebootBmc/RebootBmc.vue
@@ -0,0 +1,47 @@
+<template>
+ <b-container fluid>
+ <page-title />
+ <b-row>
+ <b-col md="8" lg="8" xl="6">
+ <page-section>
+ {{ $t('pageRebootBmc.rebootInformation') }}
+ <b-button variant="primary" class="d-block mt-5" @click="onClick">
+ {{ $t('pageRebootBmc.rebootBmc') }}
+ </b-button>
+ </page-section>
+ </b-col>
+ </b-row>
+ </b-container>
+</template>
+
+<script>
+import PageTitle from '../../../components/Global/PageTitle';
+import PageSection from '../../../components/Global/PageSection';
+import BVToastMixin from '../../../components/Mixins/BVToastMixin';
+
+export default {
+ name: 'RebootBmc',
+ components: { PageTitle, PageSection },
+ mixins: [BVToastMixin],
+ methods: {
+ onClick() {
+ this.$bvModal
+ .msgBoxConfirm(this.$t('pageRebootBmc.modal.confirmMessage'), {
+ title: this.$t('pageRebootBmc.modal.confirmTitle'),
+ okTitle: this.$t('global.actions.confirm')
+ })
+ .then(confirmed => {
+ if (confirmed) this.rebootBmc();
+ });
+ },
+ rebootBmc() {
+ this.$store
+ .dispatch('controls/rebootBmc')
+ .then(message => this.successToast(message))
+ .catch(({ message }) => this.errorToast(message));
+ }
+ }
+};
+</script>
+
+<style lang="scss" scoped></style>