bugfix: reprogramming button loadings
Signed-off-by: meteyou <meteyou@gmail.com>
This commit is contained in:
1 parent
7b2d257db3
commit
601d49fc4e
18 files changed
+155
-291
No files matched your search
+7
-12
@@ -55,8 +55,8 @@
|
||||
<v-app-bar app elevate-on-scroll>
|
||||
<v-app-bar-nav-icon @click.stop="drawer = !drawer"></v-app-bar-nav-icon>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="primary" class="mr-5 d-none d-sm-flex" v-if="isConnected && save_config_pending" :loading="loadingConfigChanged" @click="clickSaveConfig">SAVE CONFIG</v-btn>
|
||||
<v-btn color="error" class="button-min-width-auto px-3" v-if="isConnected" :loading="loadingEmergencyStop" @click="clickEmergencyStop"><v-icon class="mr-sm-2">mdi-alert-circle-outline</v-icon><span class="d-none d-sm-flex">Emergency Stop</span></v-btn>
|
||||
<v-btn color="primary" class="mr-5 d-none d-sm-flex" v-if="isConnected && save_config_pending" :loading="loadings.includes['topbarSaveConfig']" @click="clickSaveConfig">SAVE CONFIG</v-btn>
|
||||
<v-btn color="error" class="button-min-width-auto px-3" v-if="isConnected" :loading="loadings.includes['topbarEmergencyStop']" @click="clickEmergencyStop"><v-icon class="mr-sm-2">mdi-alert-circle-outline</v-icon><span class="d-none d-sm-flex">Emergency Stop</span></v-btn>
|
||||
<v-menu bottom left :offset-y="true">
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<v-btn dark icon v-bind="attrs" v-on="on">
|
||||
@@ -125,10 +125,7 @@ export default {
|
||||
drawer: null,
|
||||
activeClass: 'active',
|
||||
routes: routes,
|
||||
//is_ready: false,
|
||||
boolNaviHeightmap: false,
|
||||
loadingEmergencyStop: false,
|
||||
loadingConfigChanged: false,
|
||||
}),
|
||||
created () {
|
||||
this.$vuetify.theme.dark = true;
|
||||
@@ -143,12 +140,12 @@ export default {
|
||||
hostname: state => state.printer.hostname,
|
||||
version: state => state.printer.software_version,
|
||||
klippy_state: state => state.server.klippy_state,
|
||||
loadings: state => state.socket.loadings,
|
||||
|
||||
toolhead: state => state.printer.toolhead,
|
||||
printername: state => state.gui.general.printername,
|
||||
virtual_sdcard: state => state.printer.virtual_sdcard,
|
||||
current_file: state => state.printer.print_stats.filename,
|
||||
current_file_position: state => state.printer.virtual_sdcard.file_position,
|
||||
boolNaviWebcam: state => state.gui.webcam.bool,
|
||||
config: state => state.printer.configfile.config,
|
||||
save_config_pending: state => state.printer.configfile.save_config_pending,
|
||||
@@ -165,15 +162,13 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
clickEmergencyStop: function() {
|
||||
// TODO loading emergency stop
|
||||
//this.$store.commit('setLoading', { name: 'btnEmergencyStop' });
|
||||
this.$socket.sendObj('printer.emergency_stop', {});
|
||||
this.$store.commit('socket/addLoading', { name: 'topbarEmergencyStop' });
|
||||
this.$socket.sendObj('printer.emergency_stop', {}, 'socket/removeLoading',{ name: 'topbarEmergencyStop' });
|
||||
},
|
||||
clickSaveConfig: function() {
|
||||
this.$store.commit('server/addEvent', "SAVE_CONFIG");
|
||||
// TODO loading save_config button
|
||||
//this.$store.commit('setLoading', { name: 'btnSaveConfig' });
|
||||
this.$socket.sendObj('printer.gcode.script', { script: "SAVE_CONFIG" });
|
||||
this.$store.commit('socket/addLoading', { name: 'topbarSaveConfig' });
|
||||
this.$socket.sendObj('printer.gcode.script', { script: "SAVE_CONFIG" }, 'socket/removeLoading', { name: 'topbarSaveConfig' });
|
||||
},
|
||||
doRestart: function() {
|
||||
this.$store.commit('server/addEvent', "RESTART");
|
||||
|
||||
@@ -13,9 +13,9 @@
|
||||
<v-card>
|
||||
<v-row class="" v-if="['standby', 'complete', 'error'].includes(printer_state)">
|
||||
<v-col class="col-12 pb-0 text-center">
|
||||
<div class="d-inline-block mx-2 my-1"><v-btn @click="doHome" :loading="loadingHomeAll" :color="homedAxes.includes('xyz') ? 'primary' : 'warning'" class=""><v-icon class="mr-1">mdi-home</v-icon><span class="d-none d-sm-inline">Home </span>all</v-btn></div>
|
||||
<div class="d-inline-block mx-2 my-1" v-if="config.hasOwnProperty('quad_gantry_level')"><v-btn @click="doQGL" :loading="loadingQGL" color="primary">QGL</v-btn></div>
|
||||
<div class="d-inline-block mx-2 my-1" v-if="config.hasOwnProperty('z_tilt')"><v-btn @click="doZtilt" :loading="loadingZTilt" color="primary">Z Tilt</v-btn></div>
|
||||
<v-btn small @click="doHome" :loading="loadings.includes('homeAll')" :color="homedAxes.includes('xyz') ? 'primary' : 'warning'"><v-icon class="mr-1">mdi-home</v-icon><span class="d-none d-sm-inline">Home </span>all</v-btn>
|
||||
<v-btn small @click="doQGL" :loading="loadings.includes('qgl')" color="primary" class="ml-2" v-if="'quad_gantry_level' in config">QGL</v-btn>
|
||||
<v-btn small @click="doZtilt" :loading="loadings.includes('zTilt')" color="primary" class="ml-2" v-if="'z_tilt' in config">Z Tilt</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row class="mt-3" v-if="['standby', 'complete', 'error'].includes(printer_state)">
|
||||
@@ -24,7 +24,7 @@
|
||||
<v-btn @click="doSendMove('X-100')" class="btnMinWidthAuto flex-grow-1 flex-shrink-0 d-none d-sm-flex"><span class="body-2">-100</span></v-btn>
|
||||
<v-btn @click="doSendMove('X-10')" class="btnMinWidthAuto flex-grow-1 flex-shrink-0"><span class="body-2">-10</span></v-btn>
|
||||
<v-btn @click="doSendMove('X-1')" class="btnMinWidthAuto flex-grow-1 flex-shrink-0"><span class="body-2">-1</span></v-btn>
|
||||
<v-btn @click="doHomeX" :color="homedAxes.includes('x') ? 'primary' : 'warning'" :loading="loadingHomeX" class="font-weight-bold flex-grow-0 btnHomeAxis">X</v-btn>
|
||||
<v-btn @click="doHomeX" :color="homedAxes.includes('x') ? 'primary' : 'warning'" :loading="loadings.includes('homeX')" class="font-weight-bold flex-grow-0 btnHomeAxis">X</v-btn>
|
||||
<v-btn @click="doSendMove('X+1')" class="btnMinWidthAuto flex-grow-1 flex-shrink-0"><span class="body-2">+1</span></v-btn>
|
||||
<v-btn @click="doSendMove('X+10')" class="btnMinWidthAuto flex-grow-1 flex-shrink-0"><span class="body-2">+10</span></v-btn>
|
||||
<v-btn @click="doSendMove('X+100')" class="btnMinWidthAuto flex-grow-1 flex-shrink-0 d-none d-sm-flex"><span class="body-2">+100</span></v-btn>
|
||||
@@ -37,7 +37,7 @@
|
||||
<v-btn @click="doSendMove('Y-100')" class="btnMinWidthAuto flex-grow-1 flex-shrink-0 d-none d-sm-flex"><span class="body-2">-100</span></v-btn>
|
||||
<v-btn @click="doSendMove('Y-10')" class="btnMinWidthAuto flex-grow-1 flex-shrink-0"><span class="body-2">-10</span></v-btn>
|
||||
<v-btn @click="doSendMove('Y-1')" class="btnMinWidthAuto flex-grow-1 flex-shrink-0"><span class="body-2">-1</span></v-btn>
|
||||
<v-btn @click="doHomeY" :color="homedAxes.includes('y') ? 'primary' : 'warning'" :loading="loadingHomeY" class="font-weight-bold btnHomeAxis">Y</v-btn>
|
||||
<v-btn @click="doHomeY" :color="homedAxes.includes('y') ? 'primary' : 'warning'" :loading="loadings.includes('homeY')" class="font-weight-bold btnHomeAxis">Y</v-btn>
|
||||
<v-btn @click="doSendMove('Y+1')" class="btnMinWidthAuto flex-grow-1 flex-shrink-0"><span class="body-2">+1</span></v-btn>
|
||||
<v-btn @click="doSendMove('Y+10')" class="btnMinWidthAuto flex-grow-1 flex-shrink-0"><span class="body-2">+10</span></v-btn>
|
||||
<v-btn @click="doSendMove('Y+100')" class="btnMinWidthAuto flex-grow-1 flex-shrink-0 d-none d-sm-flex"><span class="body-2">+100</span></v-btn>
|
||||
@@ -50,7 +50,7 @@
|
||||
<v-btn @click="doSendMove('Z-25')" dense class="btnMinWidthAuto flex-grow-1 flex-shrink-0"><span class="body-2">-25</span></v-btn>
|
||||
<v-btn @click="doSendMove('Z-1')" dense class="btnMinWidthAuto flex-grow-1 flex-shrink-0"><span class="body-2">-1</span></v-btn>
|
||||
<v-btn @click="doSendMove('Z-0.1')" dense class="btnMinWidthAuto flex-grow-1 flex-shrink-0 d-none d-sm-flex"><span class="body-2">-0.1</span></v-btn>
|
||||
<v-btn @click="doHomeZ" :color="homedAxes.includes('z') ? 'primary' : 'warning'" :loading="loadingHomeZ" class="font-weight-bold btnHomeAxis">Z</v-btn>
|
||||
<v-btn @click="doHomeZ" :color="homedAxes.includes('z') ? 'primary' : 'warning'" :loading="loadings.includes('homeZ')" class="font-weight-bold btnHomeAxis">Z</v-btn>
|
||||
<v-btn @click="doSendMove('Z+0.1')" dense class="btnMinWidthAuto flex-grow-1 flex-shrink-0 d-none d-sm-flex"><span class="body-2">+0.1</span></v-btn>
|
||||
<v-btn @click="doSendMove('Z+1')" dense class="btnMinWidthAuto flex-grow-1 flex-shrink-0"><span class="body-2">+1</span></v-btn>
|
||||
<v-btn @click="doSendMove('Z+25')" dense class="btnMinWidthAuto flex-grow-1 flex-shrink-0"><span class="body-2">+25</span></v-btn>
|
||||
@@ -60,7 +60,7 @@
|
||||
<v-row class="" v-if="this['printer/getMacros'].length > 0">
|
||||
<v-col class="col-12 px-4 py-2 text-center">
|
||||
<div v-for="(macro, index) in this['printer/getMacros']" v-bind:key="index+99" class="d-inline-block mx-1 my-1">
|
||||
<v-btn small color="primary" class="mx-1 my-1" @click="doSend(macro.name)">{{ macro.name.replace(/_/g, " ") }}</v-btn>
|
||||
<v-btn small color="primary" class="mx-1 my-1" :loading="loadings.includes('macro_'+macro.name)" @click="doSendMacro(macro.name)">{{ macro.name.replace(/_/g, " ") }}</v-btn>
|
||||
</div>
|
||||
</v-col>
|
||||
</v-row>
|
||||
@@ -77,19 +77,14 @@
|
||||
},
|
||||
data: function() {
|
||||
return {
|
||||
loadingHomeAll: false,
|
||||
loadingHomeX: false,
|
||||
loadingHomeY: false,
|
||||
loadingHomeZ: false,
|
||||
loadingQGL: false,
|
||||
loadingZTilt: false,
|
||||
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
homedAxes: state => state.printer.toolhead.homed_axes,
|
||||
config: state => state.printer.configfile.config,
|
||||
loadings: state => state.loadings,
|
||||
loadings: state => state.socket.loadings,
|
||||
printer_state: state => state.printer.print_stats.state
|
||||
}),
|
||||
...mapGetters([
|
||||
@@ -99,33 +94,33 @@
|
||||
methods: {
|
||||
doHome() {
|
||||
this.$store.commit('server/addEvent', "G28");
|
||||
//this.$store.commit('setLoading', { name: 'controlHomeAll' });
|
||||
this.$socket.sendObj('printer.gcode.script', { script: "G28" }, "responseHome");
|
||||
this.$store.commit('socket/addLoading', { name: 'homeAll' });
|
||||
this.$socket.sendObj('printer.gcode.script', { script: "G28" }, "socket/removeLoading", { name: 'homeAll' });
|
||||
},
|
||||
doHomeX() {
|
||||
this.$store.commit('server/addEvent', "G28 X");
|
||||
//this.$store.commit('setLoading', { name: 'controlHomeX' });
|
||||
this.$socket.sendObj('printer.gcode.script', { script: "G28 X" }, "responseHomeX");
|
||||
this.$store.commit('socket/addLoading', { name: 'homeX' });
|
||||
this.$socket.sendObj('printer.gcode.script', { script: "G28 X" }, "socket/removeLoading", { name: 'homeX' });
|
||||
},
|
||||
doHomeY() {
|
||||
this.$store.commit('server/addEvent', "G28 Y");
|
||||
//this.$store.commit('setLoading', { name: 'controlHomeY' });
|
||||
this.$socket.sendObj('printer.gcode.script', { script: "G28 Y" }, "responseHomeY");
|
||||
this.$store.commit('socket/addLoading', { name: 'homeY' });
|
||||
this.$socket.sendObj('printer.gcode.script', { script: "G28 Y" }, "socket/removeLoading", { name: 'homeY' });
|
||||
},
|
||||
doHomeZ() {
|
||||
this.$store.commit('server/addEvent', "G28 Z");
|
||||
//this.$store.commit('setLoading', { name: 'controlHomeZ' });
|
||||
this.$socket.sendObj('printer.gcode.script', { script: "G28 Z" }, "responseHomeZ");
|
||||
this.$store.commit('socket/addLoading', { name: 'homeZ' });
|
||||
this.$socket.sendObj('printer.gcode.script', { script: "G28 Z" }, "socket/removeLoading", { name: 'homeZ' });
|
||||
},
|
||||
doQGL() {
|
||||
this.$store.commit('server/addEvent', "QUAD_GANTRY_LEVEL");
|
||||
//this.$store.commit('setLoading', { name: 'controlQGL' });
|
||||
this.$socket.sendObj('printer.gcode.script', { script: "QUAD_GANTRY_LEVEL" }, "responseQGL");
|
||||
this.$store.commit('socket/addLoading', { name: 'qgl' });
|
||||
this.$socket.sendObj('printer.gcode.script', { script: "QUAD_GANTRY_LEVEL" }, "socket/removeLoading", { name: 'qgl' });
|
||||
},
|
||||
doZtilt() {
|
||||
this.$store.commit('server/addEvent', "Z_TILT_ADJUST");
|
||||
//this.$store.commit('setLoading', { name: 'controlZTilt' });
|
||||
this.$socket.sendObj('printer.gcode.script', { script: "Z_TILT_ADJUST" }, "responseZTilt");
|
||||
this.$store.commit('socket/addLoading', { name: 'zTilt' });
|
||||
this.$socket.sendObj('printer.gcode.script', { script: "Z_TILT_ADJUST" }, "socket/removeLoading", { name: 'zTilt' });
|
||||
},
|
||||
doSendMove(gcode) {
|
||||
gcode = "G91" + "\n" +
|
||||
@@ -138,16 +133,11 @@
|
||||
this.$store.commit('server/addEvent', gcode);
|
||||
Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "server/getGcodeRespond");
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
loadings: function(loadings) {
|
||||
this.loadingHomeAll = loadings.includes('controlHomeAll');
|
||||
this.loadingHomeX = loadings.includes('controlHomeX');
|
||||
this.loadingHomeY = loadings.includes('controlHomeY');
|
||||
this.loadingHomeZ = loadings.includes('controlHomeZ');
|
||||
this.loadingQGL = loadings.includes('controlQGL');
|
||||
this.loadingZTilt = loadings.includes('controlZTilt');
|
||||
}
|
||||
doSendMacro(gcode) {
|
||||
this.$store.commit('server/addEvent', gcode);
|
||||
this.$store.commit('socket/addLoading', { name: 'macro_'+gcode });
|
||||
Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "socket/removeLoading", { name: 'macro_'+gcode });
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -8,20 +8,20 @@
|
||||
<v-col class="col-12 col-md-6">
|
||||
<v-label>Feed amount in mm:</v-label>
|
||||
<v-btn-toggle class="mt-2" dense no-gutters style="flex-wrap: nowrap; width: 100%;" >
|
||||
<v-btn v-for="amount in feedAmounts" v-bind:key="amount" @click="setFeedAmount(amount)" dense cols="1" :class="(amount === feedAmount ? 'v-btn--active' : '') + 'btnMinWidthAuto flex-grow-1 px-0 _btnFeedrate'">{{ amount }}</v-btn>
|
||||
<v-btn v-for="amount in feedAmounts" v-bind:key="amount" @click="setFeedAmount(amount)" dense :class="(amount === feedAmount ? 'v-btn--active' : '') + ' btnMinWidthAuto flex-grow-1 px-0 _btnFeedrate'">{{ amount }}</v-btn>
|
||||
</v-btn-toggle>
|
||||
</v-col>
|
||||
<v-col class="col-12 col-md-6">
|
||||
<v-label>Feedrate in mm/s:</v-label>
|
||||
<v-btn-toggle class="mt-2" dense no-gutters style="flex-wrap: nowrap; width: 100%;" >
|
||||
<v-btn v-for="rate in feedrates" v-bind:key="rate" @click="setFeedrate(rate)" dense cols="1" :class="(feedrate === rate ? 'v-btn--active' : '') + ' btnMinWidthAuto flex-grow-1 px-0 _btnFeedrate'">{{ rate }}</v-btn>
|
||||
<v-btn v-for="rate in feedrates" v-bind:key="rate" @click="setFeedrate(rate)" dense :class="(feedrate === rate ? 'v-btn--active' : '') + ' btnMinWidthAuto flex-grow-1 px-0 _btnFeedrate'">{{ rate }}</v-btn>
|
||||
</v-btn-toggle>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row class="px-3">
|
||||
<v-col class="col-12 text-center">
|
||||
<v-btn @click="sendRetract()" class="mx-2" :loading="loadingRetract" :disabled="!this['printer/getExtrudePossible']"><v-icon>mdi-arrow-up-bold</v-icon> Retract</v-btn>
|
||||
<v-btn @click="sendDetract()" class="mx-2" :loading="loadingDetract" :disabled="!this['printer/getExtrudePossible']"><v-icon>mdi-arrow-down-bold</v-icon> Extrude</v-btn>
|
||||
<v-btn small @click="sendRetract()" class="mx-2" :loading="loadings.includes('btnRetract')" :disabled="!this['printer/getExtrudePossible']"><v-icon small class="mr-1">mdi-arrow-up-bold</v-icon> Retract</v-btn>
|
||||
<v-btn small @click="sendDetract()" class="mx-2" :loading="loadings.includes('btnDetract')" :disabled="!this['printer/getExtrudePossible']"><v-icon small class="mr-1">mdi-arrow-down-bold</v-icon> Extrude</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-card>
|
||||
@@ -37,17 +37,15 @@
|
||||
},
|
||||
data: function() {
|
||||
return {
|
||||
feedAmount: 20,
|
||||
feedAmount: 25,
|
||||
feedrate: 5,
|
||||
feedAmounts: [ 100, 25, 10, 5, 1 ],
|
||||
feedrates: [ 60, 30, 15, 5, 1 ],
|
||||
loadingRetract: false,
|
||||
loadingDetract: false,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
loadings: state => state.loadings,
|
||||
loadings: state => state.socket.loadings,
|
||||
printer_state: state => state.printer.print_stats.state,
|
||||
extruder: state => state.printer.extruder,
|
||||
config: state => state.printer.configfile.config
|
||||
@@ -66,18 +64,14 @@
|
||||
sendRetract() {
|
||||
let gcode = "M83\nG1 E-"+this.feedAmount+" F"+(this.feedrate * 60);
|
||||
this.$store.commit('server/addEvent', gcode);
|
||||
Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode });
|
||||
this.$store.commit('socket/addLoading', { name: 'btnRetract' });
|
||||
Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "socket/removeLoading", { name: 'btnRetract' });
|
||||
},
|
||||
sendDetract() {
|
||||
let gcode = "M83\nG1 E"+this.feedAmount+" F"+(this.feedrate * 60);
|
||||
this.$store.commit('server/addEvent', gcode);
|
||||
Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode });
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
loadings: function(loadings) {
|
||||
this.loadingRetract = loadings.includes('extruderRetract');
|
||||
this.loadingDetract = loadings.includes('extruderDetract');
|
||||
this.$store.commit('socket/addLoading', { name: 'btnDetract' });
|
||||
Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "socket/removeLoading", { name: 'btnDetract' });
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
</v-card-text>
|
||||
<v-divider class="my-2" v-if="klippy_connected" ></v-divider>
|
||||
<v-card-text class="px-4 pt-2 pb-4 content text-center text-lg-left" v-if="klippy_connected">
|
||||
<v-btn @click="doRestart" color="error" class=""><v-icon class="mr-sm-2">mdi-cached</v-icon>Restart</v-btn>
|
||||
<v-btn @click="doRestartFirmware" class="ml-4" color="error"><v-icon class="mr-sm-2">mdi-cached</v-icon>FIRMWARE_Restart</v-btn>
|
||||
<v-btn small @click="doRestart" color="error" class=""><v-icon class="mr-sm-2">mdi-cached</v-icon>Restart</v-btn>
|
||||
<v-btn small @click="doRestartFirmware" class="ml-4" color="error"><v-icon class="mr-sm-2">mdi-cached</v-icon>FIRMWARE_Restart</v-btn>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</template>
|
||||
@@ -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' });
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color=" ml-4" v-if="currentPath !== '' && currentPath !== '/config_examples'" @click="createFile"><v-icon>mdi-file-plus</v-icon></v-btn>
|
||||
<v-btn color=" ml-4" v-if="currentPath !== '' && currentPath !== '/config_examples'" @click="createFolder"><v-icon>mdi-folder-plus</v-icon></v-btn>
|
||||
<v-btn color="primary ml-4" :loading="loadingConfigRefresh" @click="refreshFileList"><v-icon>mdi-refresh</v-icon></v-btn>
|
||||
<v-btn color="primary ml-4" @click="refreshFileList"><v-icon>mdi-refresh</v-icon></v-btn>
|
||||
</v-card-title>
|
||||
<v-card-subtitle>Current path: {{ this.currentPath === "" ? "/" : this.currentPath }}</v-card-subtitle>
|
||||
<v-data-table
|
||||
@@ -195,7 +195,6 @@
|
||||
currentPage: 1,
|
||||
files: [],
|
||||
currentPath: '',
|
||||
loadingConfigRefresh: false,
|
||||
editor: {
|
||||
show: false,
|
||||
showLoader: false,
|
||||
@@ -244,10 +243,6 @@
|
||||
return highlight(code, languages.ini); //returns html
|
||||
},
|
||||
refreshFileList: function() {
|
||||
window.console.log(this.currentPath.substring(1));
|
||||
// TODO loading refresh
|
||||
//this.$store.commit('setLoading', { name: 'loadingConfigRefresh' });
|
||||
|
||||
if (this.currentPath === "") {
|
||||
this.$socket.sendObj('server.files.get_directory', { path: 'config' }, 'files/getDirectory');
|
||||
this.$socket.sendObj('server.files.get_directory', { path: 'config_examples' }, 'files/getDirectory');
|
||||
|
||||
@@ -24,8 +24,7 @@
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
|
||||
<v-btn icon @click="syncEndstops" :loading="loading">
|
||||
<v-btn icon @click="syncEndstops" :loading="loadings.includes('queryEndstops')">
|
||||
<v-icon>mdi-sync</v-icon>
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
@@ -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() {
|
||||
|
||||
@@ -31,11 +31,11 @@
|
||||
dense
|
||||
multiple
|
||||
>
|
||||
<v-btn class="button-min-width-auto orange px-2" v-if="printer_state === 'printing'" @click="btnPauseJob" :loading="loadingStatusPause" title="Pause print"><v-icon>mdi-pause</v-icon></v-btn>
|
||||
<v-btn class="button-min-width-auto red" v-if="(printer_state === 'paused')" :loading="loadingStatusCancel" @click="btnCancelJob" title="Cancel print"><v-icon>mdi-stop</v-icon></v-btn>
|
||||
<v-btn class="button-min-width-auto orange" v-if="(printer_state === 'paused')" :loading="loadingStatusResume" @click="btnResumeJob" title="Resume job"><v-icon>mdi-play</v-icon></v-btn>
|
||||
<v-btn class="button-min-width-auto orange" v-if="(printer_state === 'error')" :loading="loadingStatusClear" @click="btnClearJob" title="Clear job"><v-icon>mdi-close</v-icon></v-btn>
|
||||
<v-btn class="button-min-width-auto primary" v-if="(printer_state === 'complete')" :loading="loadingStatusReprint" @click="btnReprintJob" title="Reprint job"><v-icon>mdi-autorenew</v-icon></v-btn>
|
||||
<v-btn class="button-min-width-auto orange px-2" v-if="printer_state === 'printing'" @click="btnPauseJob" :loading="loadings.includes('statusPrintPause')" title="Pause print"><v-icon>mdi-pause</v-icon></v-btn>
|
||||
<v-btn class="button-min-width-auto red" v-if="(printer_state === 'paused')" :loading="loadings.includes('statusPrintCancel')" @click="btnCancelJob" title="Cancel print"><v-icon>mdi-stop</v-icon></v-btn>
|
||||
<v-btn class="button-min-width-auto orange" v-if="(printer_state === 'paused')" :loading="loadings.includes('statusPrintResume')" @click="btnResumeJob" title="Resume job"><v-icon>mdi-play</v-icon></v-btn>
|
||||
<v-btn class="button-min-width-auto orange" v-if="(printer_state === 'error')" :loading="loadings.includes('statusPrintClear')" @click="btnClearJob" title="Clear job"><v-icon>mdi-close</v-icon></v-btn>
|
||||
<v-btn class="button-min-width-auto primary" v-if="(printer_state === 'complete')" :loading="loadings.includes('statusPrintReprint')" @click="btnReprintJob" title="Reprint job"><v-icon>mdi-autorenew</v-icon></v-btn>
|
||||
</v-btn-toggle>
|
||||
</v-list-item>
|
||||
<v-divider class="mt-0 mb-0" ></v-divider>
|
||||
@@ -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');
|
||||
}*/
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -18,13 +18,13 @@
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col class="col-12 pt-0 text-center d-flex flex-column align-center flex-sm-row justify-center">
|
||||
<v-btn-toggle borderless no-gutters class="mx-2 mb-2 order-last flex-nowrap order-sm-first" >
|
||||
<v-btn @click="sendBabySteppingDownFine()" class="" :loading="loadingBabySteppingDownFine" ><v-icon class="mr-2">mdi-arrow-collapse-down</v-icon> -0.01mm</v-btn>
|
||||
<v-btn @click="sendBabySteppingDown()" class="" :loading="loadingBabySteppingDown" >-0.05mm</v-btn>
|
||||
<v-btn-toggle dense no-gutters class="mx-2 mb-2 order-last flex-nowrap order-sm-first" >
|
||||
<v-btn small @click="sendBabySteppingDownFine()" class="" :loading="loadings.includes('babySteppingDownFine')" ><v-icon small class="mr-2">mdi-arrow-collapse-down</v-icon> -0.01mm</v-btn>
|
||||
<v-btn small @click="sendBabySteppingDown()" class="" :loading="loadings.includes('babySteppingDown')" >-0.05mm</v-btn>
|
||||
</v-btn-toggle>
|
||||
<v-btn-toggle borderless no-gutters class="mx-2 mb-2 order-first flex-nowrap order-sm-last" >
|
||||
<v-btn @click="sendBabySteppingUpFine()" class="" :loading="loadingBabySteppingUpFine" ><v-icon class="mr-2">mdi-arrow-expand-up</v-icon> +0.01mm</v-btn>
|
||||
<v-btn @click="sendBabySteppingUp()" class="" :loading="loadingBabySteppingUp" >+0.05mm</v-btn>
|
||||
<v-btn-toggle dense no-gutters class="mx-2 mb-2 order-first flex-nowrap order-sm-last" >
|
||||
<v-btn small @click="sendBabySteppingUpFine()" class="" :loading="loadings.includes('babySteppingUpFine')" ><v-icon small class="mr-2">mdi-arrow-expand-up</v-icon> +0.01mm</v-btn>
|
||||
<v-btn small @click="sendBabySteppingUp()" class="" :loading="loadings.includes('babySteppingUp')" >+0.05mm</v-btn>
|
||||
</v-btn-toggle>
|
||||
</v-col>
|
||||
</v-row>
|
||||
@@ -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' });
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
+41
-59
@@ -53,10 +53,10 @@
|
||||
<v-card-title>
|
||||
G-Code Files
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn :loading="loadingMakeDirectory" @click="createDirectory"><v-icon class="mr-1">mdi-folder-plus</v-icon> new Directory</v-btn>
|
||||
<v-btn color="primary ml-4" :loading="loadingGcodeRefresh" @click="refreshFileList"><v-icon class="mr-1">mdi-refresh</v-icon> Refresh</v-btn>
|
||||
<v-btn @click="createDirectory"><v-icon class="mr-1">mdi-folder-plus</v-icon> new Directory</v-btn>
|
||||
<v-btn color="primary ml-4" @click="refreshFileList"><v-icon class="mr-1">mdi-refresh</v-icon> Refresh</v-btn>
|
||||
<input type="file" ref="fileUpload" style="display: none" @change="uploadFile" />
|
||||
<v-btn class="primary ml-4 " :loading="loadingGcodeUpload" @click="clickUploadButton"><v-icon>mdi-upload</v-icon>Upload</v-btn>
|
||||
<v-btn class="primary ml-4 " :loading="loadings.includes('gcodeUpload')" @click="clickUploadButton"><v-icon>mdi-upload</v-icon>Upload</v-btn>
|
||||
<v-menu :offset-y="true">
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<v-btn class="ml-4" v-bind="attrs" v-on="on"><v-icon>mdi-cog</v-icon></v-btn>
|
||||
@@ -286,9 +286,6 @@
|
||||
},
|
||||
files: [],
|
||||
currentPath: 'gcodes',
|
||||
loadingGcodeUpload: false,
|
||||
loadingGcodeRefresh: false,
|
||||
loadingMakeDirectory: false,
|
||||
draggingFile: {
|
||||
status: false,
|
||||
item: {}
|
||||
@@ -304,7 +301,7 @@
|
||||
countPerPage: state => state.gui.gcodefiles.countPerPage,
|
||||
hostname: state => state.socket.hostname,
|
||||
port: state => state.socket.port,
|
||||
loadings: state => state.loadings,
|
||||
loadings: state => state.socket.loadings,
|
||||
|
||||
displayMetadata: state => state.gui.gcodefiles.showMetadata,
|
||||
}),
|
||||
@@ -327,15 +324,14 @@
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.loadPath();
|
||||
this.loadPath()
|
||||
},
|
||||
methods: {
|
||||
uploadFile: function() {
|
||||
if (this.$refs.fileUpload.files.length) {
|
||||
this.doUploadFile(this.$refs.fileUpload.files[0]).finally(() => {
|
||||
this.$refs.fileUpload.value = '';
|
||||
});
|
||||
|
||||
this.$refs.fileUpload.value = ''
|
||||
})
|
||||
}
|
||||
},
|
||||
doUploadFile: function(file) {
|
||||
@@ -344,81 +340,71 @@
|
||||
let filename = file.name.replace(" ", "_");
|
||||
|
||||
formData.append('file', file, (this.currentPath+"/"+filename).substring(7));
|
||||
// TODO loading upload
|
||||
//this.$store.commit('setLoading', { name: 'loadingGcodeUpload' });
|
||||
this.$store.commit('socket/addLoading', { name: 'gcodeUpload' });
|
||||
|
||||
return axios.post('//' + this.hostname + ':' + this.port + '/server/files/upload',
|
||||
formData, {
|
||||
headers: { 'Content-Type': 'multipart/form-data' }
|
||||
}
|
||||
formData, { headers: { 'Content-Type': 'multipart/form-data' } }
|
||||
).then((result) => {
|
||||
// TODO loading upload
|
||||
//this.$store.commit('removeLoading', { name: 'loadingGcodeUpload' });
|
||||
this.$store.commit('socket/removeLoading', { name: 'gcodeUpload' });
|
||||
toast.success("Upload of "+result.data.result+" successful!");
|
||||
})
|
||||
.catch(() => {
|
||||
// TODO loading upload
|
||||
//this.$store.commit('removeLoading', { name: 'loadingGcodeUpload' });
|
||||
}).catch(() => {
|
||||
this.$store.commit('socket/removeLoading', { name: 'gcodeUpload' });
|
||||
toast.error("Cannot upload the file!");
|
||||
});
|
||||
},
|
||||
clickUploadButton: function() {
|
||||
this.$refs.fileUpload.click();
|
||||
this.$refs.fileUpload.click()
|
||||
},
|
||||
refreshFileList: function() {
|
||||
// TODO loading button
|
||||
//this.$store.commit('setLoading', { name: 'loadingGcodeRefresh' });
|
||||
this.$socket.sendObj('server.files.get_directory', { path: this.currentPath }, 'files/getDirectory');
|
||||
this.$socket.sendObj('server.files.get_directory', { path: this.currentPath }, 'files/getDirectory')
|
||||
},
|
||||
formatDate(date) {
|
||||
let tmp2 = new Date(date);
|
||||
let tmp2 = new Date(date)
|
||||
|
||||
return tmp2.toLocaleString().replace(',', '');
|
||||
return tmp2.toLocaleString().replace(',', '')
|
||||
},
|
||||
formatFilesize(fileSizeInBytes) {
|
||||
let i = -1;
|
||||
let byteUnits = [' kB', ' MB', ' GB', ' TB', 'PB', 'EB', 'ZB', 'YB'];
|
||||
let i = -1
|
||||
let byteUnits = [' kB', ' MB', ' GB', ' TB', 'PB', 'EB', 'ZB', 'YB']
|
||||
do {
|
||||
fileSizeInBytes = fileSizeInBytes / 1024;
|
||||
i++;
|
||||
} while (fileSizeInBytes > 1024);
|
||||
fileSizeInBytes = fileSizeInBytes / 1024
|
||||
i++
|
||||
} while (fileSizeInBytes > 1024)
|
||||
|
||||
return Math.max(fileSizeInBytes, 0.1).toFixed(1) + byteUnits[i];
|
||||
return Math.max(fileSizeInBytes, 0.1).toFixed(1) + byteUnits[i]
|
||||
},
|
||||
formatPrintTime(totalSeconds) {
|
||||
if (totalSeconds) {
|
||||
let output = "";
|
||||
let output = ""
|
||||
|
||||
let days = Math.floor(totalSeconds / (3600 * 24));
|
||||
let days = Math.floor(totalSeconds / (3600 * 24))
|
||||
if (days) {
|
||||
totalSeconds %= (3600 * 24);
|
||||
output += days+"d";
|
||||
totalSeconds %= (3600 * 24)
|
||||
output += days+"d"
|
||||
}
|
||||
|
||||
let hours = Math.floor(totalSeconds / 3600);
|
||||
totalSeconds %= 3600;
|
||||
if (hours) output += " "+hours+"h";
|
||||
let hours = Math.floor(totalSeconds / 3600)
|
||||
totalSeconds %= 3600
|
||||
if (hours) output += " "+hours+"h"
|
||||
|
||||
let minutes = Math.floor(totalSeconds / 60);
|
||||
if (minutes) output += " "+minutes+"m";
|
||||
let minutes = Math.floor(totalSeconds / 60)
|
||||
if (minutes) output += " "+minutes+"m"
|
||||
|
||||
let seconds = totalSeconds % 60;
|
||||
if (seconds) output += " "+seconds.toFixed(0)+"s";
|
||||
let seconds = totalSeconds % 60
|
||||
if (seconds) output += " "+seconds.toFixed(0)+"s"
|
||||
|
||||
return output;
|
||||
return output
|
||||
}
|
||||
|
||||
return '--';
|
||||
return '--'
|
||||
},
|
||||
showContextMenu (e, item) {
|
||||
e.preventDefault();
|
||||
this.contextMenu.shown = true;
|
||||
this.contextMenu.x = e.clientX;
|
||||
this.contextMenu.y = e.clientY;
|
||||
this.contextMenu.item = item;
|
||||
this.$nextTick(() => {
|
||||
this.contextMenu.shown = true
|
||||
});
|
||||
e.preventDefault()
|
||||
this.contextMenu.shown = true
|
||||
this.contextMenu.x = e.clientX
|
||||
this.contextMenu.y = e.clientY
|
||||
this.contextMenu.item = item
|
||||
this.$nextTick(() => { this.contextMenu.shown = true })
|
||||
},
|
||||
downloadFile() {
|
||||
let filename = (this.currentPath+"/"+this.contextMenu.item.filename);
|
||||
@@ -656,10 +642,6 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
loadings: function(loadings) {
|
||||
this.loadingGcodeRefresh = loadings.includes('loadingGcodeRefresh');
|
||||
this.loadingGcodeUpload = loadings.includes('loadingGcodeUpload');
|
||||
},
|
||||
displayMetadata: {
|
||||
deep: true,
|
||||
handler(newVal) {
|
||||
|
||||
+11
-8
@@ -77,26 +77,29 @@ export default class WebSocketClient {
|
||||
);
|
||||
}
|
||||
} else {
|
||||
let result = data.result;
|
||||
if (result === "ok") result = { result: result };
|
||||
let result = data.result
|
||||
if (result === "ok") result = { result: result }
|
||||
|
||||
this.store.dispatch(
|
||||
this.wsData.filter(item => item.id === data.id)[0].action,
|
||||
Object.assign({requestParams: this.wsData.filter(item => item.id === data.id)[0].params }, result)
|
||||
)
|
||||
let preload = {}
|
||||
let wsData = this.wsData.filter(item => item.id === data.id)[0]
|
||||
if (wsData.actionPreload) Object.assign(preload, wsData.actionPreload)
|
||||
Object.assign(preload, { requestParams: wsData.params })
|
||||
Object.assign(preload, result)
|
||||
this.store.dispatch(wsData.action, preload)
|
||||
}
|
||||
} else this.passToStore('socket/onMessage', data)
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
sendObj (method, params, action = '') {
|
||||
sendObj (method, params, action = '', actionPreload = null) {
|
||||
if (this.instance.readyState === WebSocket.OPEN) {
|
||||
let id = Math.floor(Math.random() * 10000) + 1
|
||||
this.wsData.push({
|
||||
id: id,
|
||||
action: action,
|
||||
params: params
|
||||
params: params,
|
||||
actionPreload: actionPreload,
|
||||
})
|
||||
this.instance.send(this.createMessage(method, params, id));
|
||||
}
|
||||
|
||||
@@ -2,66 +2,11 @@ import router from "../plugins/router";
|
||||
|
||||
|
||||
export default {
|
||||
|
||||
|
||||
|
||||
setHeaterChartVisibility({ commit, dispatch }, data) {
|
||||
commit('setHeaterChartVisibility', data);
|
||||
dispatch('saveGuiSettings');
|
||||
},
|
||||
|
||||
respondPrintPause({commit}) {
|
||||
commit('removeLoading', { name: 'statusPrintPause' });
|
||||
},
|
||||
|
||||
respondPrintResume({commit}) {
|
||||
commit('removeLoading', { name: 'statusPrintResume' });
|
||||
},
|
||||
|
||||
respondPrintCancel({commit}) {
|
||||
commit('removeLoading', { name: 'statusPrintCancel' });
|
||||
},
|
||||
|
||||
respondPrintClear({commit}) {
|
||||
commit('removeLoading', { name: 'statusPrintClear' });
|
||||
},
|
||||
|
||||
respondPrintReprint({commit}) {
|
||||
commit('removeLoading', { name: 'statusPrintReprint' });
|
||||
},
|
||||
|
||||
responseHome({commit}) {
|
||||
commit('removeLoading', { name: 'controlHomeAll' });
|
||||
},
|
||||
|
||||
responseHomeX({commit}) {
|
||||
commit('removeLoading', { name: 'controlHomeX' });
|
||||
},
|
||||
|
||||
responseHomeY({commit}) {
|
||||
commit('removeLoading', { name: 'controlHomeY' });
|
||||
},
|
||||
|
||||
responseHomeZ({commit}) {
|
||||
commit('removeLoading', { name: 'controlHomeZ' });
|
||||
},
|
||||
|
||||
responseQGL({commit}) {
|
||||
commit('removeLoading', { name: 'controlQGL' });
|
||||
},
|
||||
|
||||
responseZTilt({commit}) {
|
||||
commit('removeLoading', { name: 'controlZTilt' });
|
||||
},
|
||||
|
||||
responseRestart({commit}) {
|
||||
commit('setLoadingRestart', false);
|
||||
},
|
||||
|
||||
responseRestartFirmware({commit}) {
|
||||
commit('setLoadingRestartFirmware', false);
|
||||
},
|
||||
|
||||
respondeExtruderRetract({commit}) {
|
||||
commit('removeLoading', { name: 'extruderRetract' });
|
||||
},
|
||||
|
||||
@@ -7,9 +7,6 @@ export default {
|
||||
|
||||
getDirectory({ commit }, payload) {
|
||||
commit('setDirectory', payload)
|
||||
|
||||
//TODO refresh reload
|
||||
//commit('removeLoading', { name: 'loadingGcodeRefresh' })
|
||||
},
|
||||
|
||||
getMetadata({ commit, rootState }, payload) {
|
||||
|
||||
@@ -1,17 +1,4 @@
|
||||
export default {
|
||||
|
||||
|
||||
/*setLoading(state, data) {
|
||||
if (!state.loadings.includes(data.name)) {
|
||||
state.loadings.push(data.name);
|
||||
}
|
||||
},
|
||||
|
||||
removeLoading(state, data) {
|
||||
state.loadings = state.loadings.filter(function(ele){ return ele !== data.name; });
|
||||
},*/
|
||||
|
||||
|
||||
reportError(state, payload) {
|
||||
window.console.log(payload)
|
||||
},
|
||||
|
||||
@@ -56,7 +56,7 @@ export default {
|
||||
},
|
||||
|
||||
getEndstopStatus({ commit }, payload) {
|
||||
//commit('setLoadingEndstopStatus', false);
|
||||
commit('socket/removeLoading', { name: 'queryEndstops' }, { root: true });
|
||||
commit('setEndstopStatus', payload);
|
||||
},
|
||||
}
|
||||
@@ -39,7 +39,6 @@ export default {
|
||||
},
|
||||
|
||||
getGcodeRespond({commit}, data) {
|
||||
//commit('removeLoading', { name: 'loadingSendGcode' });
|
||||
commit('addEvent', data);
|
||||
},
|
||||
}
|
||||
@@ -76,5 +76,9 @@ export default {
|
||||
else if (!payload.error) window.console.log(payload)
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
removeLoading({ commit }, payload) {
|
||||
commit('removeLoading', payload)
|
||||
}
|
||||
}
|
||||
@@ -20,5 +20,16 @@ export default {
|
||||
Object.entries(payload).forEach(([key, value]) => {
|
||||
Vue.set(state, key, value)
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
addLoading(state, payload) {
|
||||
state.loadings.push(payload.name)
|
||||
},
|
||||
|
||||
removeLoading(state, payload) {
|
||||
const index = state.loadings.indexOf(payload.name);
|
||||
if (index > -1) {
|
||||
state.loadings.splice(index, 1);
|
||||
}
|
||||
},
|
||||
}
|
||||
@@ -1,7 +1,3 @@
|
||||
//export const hostname = window.location.host;
|
||||
export const hostname = "voron250.local:8080";
|
||||
//export const hostname = "kossel.local:8080";
|
||||
|
||||
export const colorArray = [
|
||||
'#F44336',
|
||||
'#9C27B0',
|
||||
|
||||
Reference in new issue
Block a user