Skip to content

Commit 07bc5d5

Browse files
committed
fix: host reboot and shutdown now work
1 parent 0adf85e commit 07bc5d5

2 files changed

Lines changed: 24 additions & 3 deletions

File tree

src/components/widgets/SystemCommandsWidget.vue

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
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>
@@ -16,7 +16,16 @@
1616
<script lang="ts">
1717
import { Component, Mixins } from 'vue-property-decorator'
1818
import 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>

src/socketActions.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff 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', {

0 commit comments

Comments
 (0)