| Yoshie Muranaka | c11d389 | 2020-02-19 08:07:40 -0800 | [diff] [blame] | 1 | <template> | 
| Yoshie Muranaka | 3111b6f | 2020-04-21 19:48:38 -0700 | [diff] [blame] | 2 |   <b-container fluid="xl"> | 
| Yoshie Muranaka | c11d389 | 2020-02-19 08:07:40 -0800 | [diff] [blame] | 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'), | 
| Yoshie Muranaka | 547b5fc | 2020-02-24 15:42:40 -0800 | [diff] [blame] | 31 |           okTitle: this.$t('global.action.confirm') | 
| Yoshie Muranaka | c11d389 | 2020-02-19 08:07:40 -0800 | [diff] [blame] | 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> |