blob: dbe17621a912450c82b8fb06db72c7b97dfea2d9 [file] [log] [blame]
Yoshie Muranakac11d3892020-02-19 08:07:40 -08001<template>
Yoshie Muranaka3111b6f2020-04-21 19:48:38 -07002 <b-container fluid="xl">
Yoshie Muranakac11d3892020-02-19 08:07:40 -08003 <page-title />
4 <b-row>
5 <b-col md="8" lg="8" xl="6">
6 <page-section>
7 {{ $t('pageRebootBmc.rebootInformation') }}
Yoshie Muranakadb7aae22020-07-14 16:03:35 -07008 <b-button
9 variant="primary"
10 class="d-block mt-5"
11 data-test-id="rebootBmc-button-reboot"
12 @click="onClick"
13 >
Yoshie Muranakac11d3892020-02-19 08:07:40 -080014 {{ $t('pageRebootBmc.rebootBmc') }}
15 </b-button>
16 </page-section>
17 </b-col>
18 </b-row>
19 </b-container>
20</template>
21
22<script>
23import PageTitle from '../../../components/Global/PageTitle';
24import PageSection from '../../../components/Global/PageSection';
25import BVToastMixin from '../../../components/Mixins/BVToastMixin';
26
27export default {
28 name: 'RebootBmc',
29 components: { PageTitle, PageSection },
30 mixins: [BVToastMixin],
31 methods: {
32 onClick() {
33 this.$bvModal
34 .msgBoxConfirm(this.$t('pageRebootBmc.modal.confirmMessage'), {
35 title: this.$t('pageRebootBmc.modal.confirmTitle'),
Yoshie Muranaka547b5fc2020-02-24 15:42:40 -080036 okTitle: this.$t('global.action.confirm')
Yoshie Muranakac11d3892020-02-19 08:07:40 -080037 })
38 .then(confirmed => {
39 if (confirmed) this.rebootBmc();
40 });
41 },
42 rebootBmc() {
43 this.$store
44 .dispatch('controls/rebootBmc')
45 .then(message => this.successToast(message))
46 .catch(({ message }) => this.errorToast(message));
47 }
48 }
49};
50</script>
51
52<style lang="scss" scoped></style>