diff --git a/src/App.vue b/src/App.vue index 3d3550d0..0748c95a 100644 --- a/src/App.vue +++ b/src/App.vue @@ -55,8 +55,8 @@ - SAVE CONFIG - mdi-alert-circle-outlineEmergency Stop + SAVE CONFIG + mdi-alert-circle-outlineEmergency Stop @@ -38,16 +38,13 @@ }), }, methods: { - doRestart() { - // TODO loading restart button - //this.$store.commit('setLoadingRestart', true); - this.$socket.sendObj('printer.restart', { }); + this.$store.commit('socket/addLoading', { name: 'restart' }); + this.$socket.sendObj('printer.restart', { }, 'socket/removeLoading', { name: 'restart' }); }, doRestartFirmware() { - // TODO loading fw restart button - //this.$store.commit('setLoadingRestartFirmware', true); - this.$socket.sendObj('printer.firmware_restart', { }); + this.$store.commit('socket/addLoading', { name: 'firmwareRestart' }); + this.$socket.sendObj('printer.firmware_restart', { }, 'socket/removeLoading', { name: 'firmwareRestart' }); }, }, } diff --git a/src/components/panels/Settings/ConfigFilesPanel.vue b/src/components/panels/Settings/ConfigFilesPanel.vue index 8606aab8..5f818664 100644 --- a/src/components/panels/Settings/ConfigFilesPanel.vue +++ b/src/components/panels/Settings/ConfigFilesPanel.vue @@ -32,7 +32,7 @@ mdi-file-plus mdi-folder-plus - mdi-refresh + mdi-refresh Current path: {{ this.currentPath === "" ? "/" : this.currentPath }} - - + mdi-sync @@ -42,12 +41,11 @@ data: function() { return { sortEndstops: {}, - loading: false } }, computed: { ...mapState({ - //loading: state => state.socket.loadingEndstopStatus, + loadings: state => state.socket.loadings, endstops: state => state.printer.endstops, }) }, @@ -56,8 +54,7 @@ }, methods: { syncEndstops() { - // TODO loading - //this.$store.commit('setLoadingEndstopStatus', true); + this.$store.commit('socket/addLoading', { name: 'queryEndstops' }); this.$socket.sendObj('printer.query_endstops.status', { }, "printer/getEndstopStatus"); }, getEndstops() { diff --git a/src/components/panels/StatusPanel.vue b/src/components/panels/StatusPanel.vue index ffea8c79..d234898a 100644 --- a/src/components/panels/StatusPanel.vue +++ b/src/components/panels/StatusPanel.vue @@ -31,11 +31,11 @@ dense multiple > - mdi-pause - mdi-stop - mdi-play - mdi-close - mdi-autorenew + mdi-pause + mdi-stop + mdi-play + mdi-close + mdi-autorenew @@ -128,11 +128,7 @@ export default { data: function() { return { - loadingStatusCancel: false, - loadingStatusResume: false, - loadingStatusPause: false, - loadingStatusClear: false, - loadingStatusReprint: false, + } }, computed: { @@ -151,6 +147,7 @@ printer_state: state => state.printer.print_stats.state, display_message: state => state.printer.display_status.message, + loadings: state => state.socket.loadings, }), printPercent: { get() { @@ -160,29 +157,24 @@ }, methods: { btnPauseJob() { - // TODO loading button - //this.$store.commit('setLoading', { name: 'statusPrintPause' }); - this.$socket.sendObj('printer.print.pause', { }, 'respondPrintPause'); + this.$store.commit('socket/addLoading', { name: 'statusPrintPause' }); + this.$socket.sendObj('printer.print.pause', { }, 'socket/removeLoading', { name: 'statusPrintPause' }); }, btnResumeJob() { - // TODO loading button - //this.$store.commit('setLoading', { name: 'statusPrintResume' }); - this.$socket.sendObj('printer.print.resume', { }, 'respondPrintResume'); + this.$store.commit('socket/addLoading', { name: 'statusPrintResume' }); + this.$socket.sendObj('printer.print.resume', { }, 'socket/removeLoading', { name: 'statusPrintResume' }); }, btnCancelJob() { - // TODO loading button - //this.$store.commit('setLoading', { name: 'statusPrintCancel' }); - this.$socket.sendObj('printer.print.cancel', { }, 'respondPrintCancel'); + this.$store.commit('socket/addLoading', { name: 'statusPrintCancel' }); + this.$socket.sendObj('printer.print.cancel', { }, 'socket/removeLoading', { name: 'statusPrintCancel' }); }, btnClearJob() { - // TODO loading button - //this.$store.commit('setLoading', {name: 'statusPrintClear'}); - this.$socket.sendObj('printer.gcode.script', {script: 'SDCARD_RESET_FILE'}, 'respondPrintClear'); + this.$store.commit('socket/addLoading', {name: 'statusPrintClear'}); + this.$socket.sendObj('printer.gcode.script', {script: 'SDCARD_RESET_FILE'}, 'socket/removeLoading', { name: 'statusPrintClear' }); }, btnReprintJob() { - // TODO loading button - //this.$store.commit('setLoading', {name: 'statusPrintReprint'}); - this.$socket.sendObj('printer.print.start', { filename: this.current_filename }, 'respondPrintReprint'); + this.$store.commit('socket/addLoading', {name: 'statusPrintReprint'}); + this.$socket.sendObj('printer.print.start', { filename: this.current_filename }, 'socket/removeLoading', { name: 'statusPrintReprint' }); }, formatTime(seconds) { let h = Math.floor(seconds / 3600); @@ -192,15 +184,6 @@ return h+':'+m+':'+s; }, - }, - watch: { - /*loadings: function(loadings) { - this.loadingStatusCancel = loadings.includes('statusPrintCancel'); - this.loadingStatusResume = loadings.includes('statusPrintResume'); - this.loadingStatusPause = loadings.includes('statusPrintPause'); - this.loadingStatusClear = loadings.includes('statusPrintClear'); - this.loadingStatusReprint = loadings.includes('statusPrintReprint'); - }*/ } } diff --git a/src/components/panels/ZOffsetPanel.vue b/src/components/panels/ZOffsetPanel.vue index 388c93c4..df5c27c0 100644 --- a/src/components/panels/ZOffsetPanel.vue +++ b/src/components/panels/ZOffsetPanel.vue @@ -18,13 +18,13 @@ - - mdi-arrow-collapse-down -0.01mm - -0.05mm + + mdi-arrow-collapse-down -0.01mm + -0.05mm - - mdi-arrow-expand-up +0.01mm - +0.05mm + + mdi-arrow-expand-up +0.01mm + +0.05mm @@ -42,15 +42,12 @@ }, data: function() { return { - loadingBabySteppingDownFine: false, - loadingBabySteppingDown: false, - loadingBabySteppingUpFine: false, - loadingBabySteppingUp: false, + } }, computed: { ...mapState({ - loadings: state => state.loadings, + loadings: state => state.socket.loadings, homing_origin: state => state.printer.gcode_move.homing_origin, printer_state: state => state.printer.print_stats.state, homed_axis: state => state.printer.toolhead.homed_axes, @@ -59,35 +56,27 @@ methods: { sendBabySteppingDownFine() { let gcode = "SET_GCODE_OFFSET Z_ADJUST=-0.01"+(this.homed_axis === "xyz" ? " MOVE=1" : ""); - this.$store.commit('setLoading', { name: 'babySteppingDownFine' }); + this.$store.commit('socket/addLoading', { name: 'babySteppingDownFine' }); this.$store.commit('addGcodeResponse', gcode); - Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "respondeBabySteppingDownFine"); + Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "socket/removeLoading", { name: 'babySteppingDownFine' }); }, sendBabySteppingDown() { let gcode = "SET_GCODE_OFFSET Z_ADJUST=-0.05"+(this.homed_axis === "xyz" ? " MOVE=1" : ""); - this.$store.commit('setLoading', { name: 'babySteppingDown' }); + this.$store.commit('socket/addLoading', { name: 'babySteppingDown' }); this.$store.commit('addGcodeResponse', gcode); - Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "respondeBabySteppingDown"); + Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "socket/removeLoading", { name: 'babySteppingDown' }); }, sendBabySteppingUpFine() { let gcode = "SET_GCODE_OFFSET Z_ADJUST=0.01"+(this.homed_axis === "xyz" ? " MOVE=1" : ""); - this.$store.commit('setLoading', { name: 'babySteppingUpFine' }); + this.$store.commit('socket/addLoading', { name: 'babySteppingUpFine' }); this.$store.commit('addGcodeResponse', gcode); - Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "respondeBabySteppingUpFine"); + Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "socket/removeLoading", { name: 'babySteppingUpFine' }); }, sendBabySteppingUp() { let gcode = "SET_GCODE_OFFSET Z_ADJUST=0.05"+(this.homed_axis === "xyz" ? " MOVE=1" : ""); - this.$store.commit('setLoading', { name: 'babySteppingUp' }); + this.$store.commit('socket/addLoading', { name: 'babySteppingUp' }); this.$store.commit('addGcodeResponse', gcode); - Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "respondeBabySteppingUp"); - }, - }, - watch: { - loadings: function(loadings) { - this.loadingBabySteppingDownFine = loadings.includes('babySteppingDownFine'); - this.loadingBabySteppingDown = loadings.includes('babySteppingDown'); - this.loadingBabySteppingUpFine = loadings.includes('babySteppingUpFine'); - this.loadingBabySteppingUp = loadings.includes('babySteppingUp'); + Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "socket/removeLoading", { name: 'babySteppingUp' }); }, } } diff --git a/src/pages/Files.vue b/src/pages/Files.vue index 2cd20215..21787233 100644 --- a/src/pages/Files.vue +++ b/src/pages/Files.vue @@ -53,10 +53,10 @@ G-Code Files - mdi-folder-plus new Directory - mdi-refresh Refresh + mdi-folder-plus new Directory + mdi-refresh Refresh - mdi-uploadUpload + mdi-uploadUpload