File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66 <v-btn block color =" warning" :disabled =" printerBusy" @click =" sendGcode('FIRMWARE_RESTART')" class =" me-2 mb-2" >Firmware Restart</v-btn >
77 </v-col >
88 <v-col >
9- <v-btn block color =" error" :disabled =" printerBusy" @click =" sendGcode('HOST_REBOOT') " class =" me-2 mb-2" >Host Reboot</v-btn >
10- <v-btn block color =" error" :disabled =" printerBusy" @click =" sendGcode('HOST_RESTART') " class =" me-2 mb-2" >Host Shutdown</v-btn >
9+ <v-btn block color =" error" :disabled =" printerBusy" @click =" hostReboot " class =" me-2 mb-2" >Host Reboot</v-btn >
10+ <v-btn block color =" error" :disabled =" printerBusy" @click =" hostShutdown " class =" me-2 mb-2" >Host Shutdown</v-btn >
1111 </v-col >
1212 </v-row >
1313 </v-card-text >
1616<script lang="ts">
1717import { Component , Mixins } from ' vue-property-decorator'
1818import UtilsMixin from ' @/mixins/utils'
19+ import { SocketActions } from ' @/socketActions'
1920
2021@Component ({})
21- export default class SystemCommandsWidget extends Mixins (UtilsMixin ) {}
22+ export default class SystemCommandsWidget extends Mixins (UtilsMixin ) {
23+ hostReboot () {
24+ SocketActions .machineReboot ()
25+ }
26+
27+ hostShutdown () {
28+ SocketActions .machineShutdown ()
29+ }
30+ }
2231 </script >
Original file line number Diff line number Diff line change @@ -18,6 +18,18 @@ export const SocketActions = {
1818 )
1919 } ,
2020
21+ async machineReboot ( ) {
22+ Vue . $socket . emit (
23+ 'machine.reboot'
24+ )
25+ } ,
26+
27+ async machineShutdown ( ) {
28+ Vue . $socket . emit (
29+ 'machine.shutdown'
30+ )
31+ } ,
32+
2133 async printerQueryEndstops ( ) {
2234 Vue . $socket . emit (
2335 'printer.query_endstops.status' , {
You can’t perform that action at this time.
0 commit comments