Yoshie Muranaka | c11d389 | 2020-02-19 08:07:40 -0800 | [diff] [blame^] | 1 | <template> |
| 2 | <b-container fluid> |
| 3 | <page-title /> |
| 4 | <b-row> |
| 5 | <b-col md="8" lg="8" xl="6"> |
| 6 | <page-section> |
| 7 | {{ $t('pageRebootBmc.rebootInformation') }} |
| 8 | <b-button variant="primary" class="d-block mt-5" @click="onClick"> |
| 9 | {{ $t('pageRebootBmc.rebootBmc') }} |
| 10 | </b-button> |
| 11 | </page-section> |
| 12 | </b-col> |
| 13 | </b-row> |
| 14 | </b-container> |
| 15 | </template> |
| 16 | |
| 17 | <script> |
| 18 | import PageTitle from '../../../components/Global/PageTitle'; |
| 19 | import PageSection from '../../../components/Global/PageSection'; |
| 20 | import BVToastMixin from '../../../components/Mixins/BVToastMixin'; |
| 21 | |
| 22 | export default { |
| 23 | name: 'RebootBmc', |
| 24 | components: { PageTitle, PageSection }, |
| 25 | mixins: [BVToastMixin], |
| 26 | methods: { |
| 27 | onClick() { |
| 28 | this.$bvModal |
| 29 | .msgBoxConfirm(this.$t('pageRebootBmc.modal.confirmMessage'), { |
| 30 | title: this.$t('pageRebootBmc.modal.confirmTitle'), |
| 31 | okTitle: this.$t('global.actions.confirm') |
| 32 | }) |
| 33 | .then(confirmed => { |
| 34 | if (confirmed) this.rebootBmc(); |
| 35 | }); |
| 36 | }, |
| 37 | rebootBmc() { |
| 38 | this.$store |
| 39 | .dispatch('controls/rebootBmc') |
| 40 | .then(message => this.successToast(message)) |
| 41 | .catch(({ message }) => this.errorToast(message)); |
| 42 | } |
| 43 | } |
| 44 | }; |
| 45 | </script> |
| 46 | |
| 47 | <style lang="scss" scoped></style> |