Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
958358d483 | ||
|
|
ddc2ab477f | ||
|
|
f351268745 | ||
|
|
25a7e8a33b | ||
|
|
8b8f3cf939 | ||
|
|
3440d486df | ||
|
|
693fcae49a |
No files matched your search
@@ -241,7 +241,7 @@ Now we can install Mainsail (static httpdocs).
|
||||
Now you can download the current mainsail static data
|
||||
```
|
||||
cd ~/mainsail
|
||||
wget -q -O mainsail.zip https://github.com/meteyou/mainsail/releases/download/v0.2.1/mainsail-beta-0.2.1.zip && unzip mainsail.zip && rm mainsail.zip
|
||||
wget -q -O mainsail.zip https://github.com/meteyou/mainsail/releases/download/v0.2.2/mainsail-beta-0.2.2.zip && unzip mainsail.zip && rm mainsail.zip
|
||||
```
|
||||
Now it should be possible to open the interface: `http://<printer-ip>/`.
|
||||
|
||||
|
||||
+1
-1
@@ -36,6 +36,6 @@ If you see a content like this
|
||||
```
|
||||
cd ~/mainsail
|
||||
rm -R ./*
|
||||
wget -q -O mainsail.zip https://github.com/meteyou/mainsail/releases/download/v0.2.1/mainsail-beta-0.2.1.zip && unzip mainsail.zip && rm mainsail.zip
|
||||
wget -q -O mainsail.zip https://github.com/meteyou/mainsail/releases/download/v0.2.2/mainsail-beta-0.2.2.zip && unzip mainsail.zip && rm mainsail.zip
|
||||
```
|
||||
Now it should be possible to open the interface: `http://<printer-ip>/`.
|
||||
+2
-2
@@ -131,7 +131,7 @@ export default {
|
||||
methods: {
|
||||
emergencyStop: function() {
|
||||
this.$store.commit('setLoadingEmergencyStop', true);
|
||||
this.$socket.sendObj('post_printer_emergency_stop', {}, 'setLoadingEmergencyStop');
|
||||
this.$socket.sendObj('printer.emergency_stop', {}, 'setLoadingEmergencyStop');
|
||||
},
|
||||
drawFavicon(val) {
|
||||
let favicon = document.getElementById('favicon');
|
||||
@@ -188,7 +188,7 @@ export default {
|
||||
},
|
||||
current_file: {
|
||||
handler: function(newVal) {
|
||||
this.$socket.sendObj("get_file_metadata", { filename: newVal }, "getMetadataCurrentFile");
|
||||
this.$socket.sendObj("server.files.metadata", { filename: newVal }, "getMetadataCurrentFile");
|
||||
}
|
||||
},
|
||||
config() {
|
||||
|
||||
@@ -93,32 +93,32 @@
|
||||
doHome() {
|
||||
this.$store.commit('addGcodeResponse', "G28");
|
||||
this.$store.commit('setLoading', { name: 'controlHomeAll' });
|
||||
this.$socket.sendObj('post_printer_gcode_script', { script: "G28" }, "responseHome");
|
||||
this.$socket.sendObj('printer.gcode.script', { script: "G28" }, "responseHome");
|
||||
},
|
||||
doHomeX() {
|
||||
this.$store.commit('addGcodeResponse', "G28 X");
|
||||
this.$store.commit('setLoading', { name: 'controlHomeX' });
|
||||
this.$socket.sendObj('post_printer_gcode_script', { script: "G28 X" }, "responseHomeX");
|
||||
this.$socket.sendObj('printer.gcode.script', { script: "G28 X" }, "responseHomeX");
|
||||
},
|
||||
doHomeY() {
|
||||
this.$store.commit('addGcodeResponse', "G28 Y");
|
||||
this.$store.commit('setLoading', { name: 'controlHomeY' });
|
||||
this.$socket.sendObj('post_printer_gcode_script', { script: "G28 Y" }, "responseHomeY");
|
||||
this.$socket.sendObj('printer.gcode.script', { script: "G28 Y" }, "responseHomeY");
|
||||
},
|
||||
doHomeZ() {
|
||||
this.$store.commit('addGcodeResponse', "G28 Z");
|
||||
this.$store.commit('setLoading', { name: 'controlHomeZ' });
|
||||
this.$socket.sendObj('post_printer_gcode_script', { script: "G28 Z" }, "responseHomeZ");
|
||||
this.$socket.sendObj('printer.gcode.script', { script: "G28 Z" }, "responseHomeZ");
|
||||
},
|
||||
doQGL() {
|
||||
this.$store.commit('addGcodeResponse', "QUAD_GANTRY_LEVEL");
|
||||
this.$store.commit('setLoading', { name: 'controlQGL' });
|
||||
this.$socket.sendObj('post_printer_gcode_script', { script: "QUAD_GANTRY_LEVEL" }, "responseQGL");
|
||||
this.$socket.sendObj('printer.gcode.script', { script: "QUAD_GANTRY_LEVEL" }, "responseQGL");
|
||||
},
|
||||
doZtilt() {
|
||||
this.$store.commit('addGcodeResponse', "Z_TILT_ADJUST");
|
||||
this.$store.commit('setLoading', { name: 'controlZTilt' });
|
||||
this.$socket.sendObj('post_printer_gcode_script', { script: "Z_TILT_ADJUST" }, "responseZTilt");
|
||||
this.$socket.sendObj('printer.gcode.script', { script: "Z_TILT_ADJUST" }, "responseZTilt");
|
||||
},
|
||||
doSendMove(gcode) {
|
||||
gcode = "G91" + "\n" +
|
||||
@@ -129,7 +129,7 @@
|
||||
},
|
||||
doSend(gcode) {
|
||||
this.$store.commit('addGcodeResponse', gcode);
|
||||
Vue.prototype.$socket.sendObj('post_printer_gcode_script', { script: gcode }, "sendGcode");
|
||||
Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "sendGcode");
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
|
||||
@@ -72,16 +72,16 @@
|
||||
this.feedrate = value;
|
||||
},
|
||||
sendRetract() {
|
||||
let gcode = "M120\nM83\nG1 E-"+this.feedAmount+" F"+(this.feedrate * 60)+"\nM121";
|
||||
let gcode = "M83\nG1 E-"+this.feedAmount+" F"+(this.feedrate * 60);
|
||||
this.$store.commit('setLoading', { name: 'extruderRetract' });
|
||||
this.$store.commit('addGcodeResponse', gcode);
|
||||
Vue.prototype.$socket.sendObj('post_printer_gcode_script', { script: gcode }, "respondeExtruderRetract");
|
||||
Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "respondeExtruderRetract");
|
||||
},
|
||||
sendDetract() {
|
||||
let gcode = "M120\nM83\nG1 E"+this.feedAmount+" F"+(this.feedrate * 60)+"\nM121";
|
||||
let gcode = "M83\nG1 E"+this.feedAmount+" F"+(this.feedrate * 60);
|
||||
this.$store.commit('setLoading', { name: 'extruderDetract' });
|
||||
this.$store.commit('addGcodeResponse', gcode);
|
||||
Vue.prototype.$socket.sendObj('post_printer_gcode_script', { script: gcode }, "respondeExtruderDetract");
|
||||
Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "respondeExtruderDetract");
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
@@ -97,4 +97,4 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
@@ -43,11 +43,11 @@
|
||||
|
||||
doRestart() {
|
||||
this.$store.commit('setLoadingRestart', true);
|
||||
this.$socket.sendObj('post_printer_restart', { }, "responseRestart");
|
||||
this.$socket.sendObj('printer.restart', { }, "responseRestart");
|
||||
},
|
||||
doRestartFirmware() {
|
||||
this.$store.commit('setLoadingRestartFirmware', true);
|
||||
this.$socket.sendObj('post_printer_firmware_restart', { }, "responseRestartFirmware");
|
||||
this.$socket.sendObj('printer.firmware_restart', { }, "responseRestartFirmware");
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -249,9 +249,9 @@
|
||||
this.$store.commit('setLoading', { name: 'loadingConfigRefresh' });
|
||||
|
||||
if (this.currentPath === "") {
|
||||
this.$socket.sendObj('get_directory', { path: 'config' }, 'getDirectory');
|
||||
this.$socket.sendObj('get_directory', { path: 'config_examples' }, 'getDirectory');
|
||||
} else this.$socket.sendObj('get_directory', { path: this.currentPath.substring(1) }, 'getDirectory');
|
||||
this.$socket.sendObj('server.files.get_directory', { path: 'config' }, 'getDirectory');
|
||||
this.$socket.sendObj('server.files.get_directory', { path: 'config_examples' }, 'getDirectory');
|
||||
} else this.$socket.sendObj('server.files.get_directory', { path: this.currentPath.substring(1) }, 'getDirectory');
|
||||
},
|
||||
formatDate(date) {
|
||||
let tmp2 = new Date(date);
|
||||
@@ -380,7 +380,7 @@
|
||||
createFolderAction() {
|
||||
this.dialogCreateFolder.show = false;
|
||||
|
||||
this.$socket.sendObj('post_directory', {
|
||||
this.$socket.sendObj('server.files.post_directory', {
|
||||
path: this.currentPath.substring(1)+"/"+this.dialogCreateFolder.name
|
||||
}, 'getPostDirectory');
|
||||
},
|
||||
@@ -414,7 +414,7 @@
|
||||
},
|
||||
renameFileAction() {
|
||||
this.dialogRenameFile.show = false;
|
||||
this.$socket.sendObj('post_file_move', {
|
||||
this.$socket.sendObj('server.files.move', {
|
||||
source: this.currentPath+"/"+this.dialogRenameFile.item.filename,
|
||||
dest: this.currentPath+"/"+this.dialogRenameFile.newName
|
||||
}, 'getPostFileMove');
|
||||
@@ -430,7 +430,7 @@
|
||||
});
|
||||
},
|
||||
deleteDirectoryAction: function() {
|
||||
this.$socket.sendObj('delete_directory', { path: this.currentPath+"/"+this.contextMenu.item.filename }, 'getDeleteDirectory');
|
||||
this.$socket.sendObj('server.files.delete_directory', { path: this.currentPath+"/"+this.contextMenu.item.filename }, 'getDeleteDirectory');
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
methods: {
|
||||
syncEndstops() {
|
||||
this.$store.commit('setLoadingEndstopStatus', true);
|
||||
this.$socket.sendObj('get_printer_query_endstops_status', { }, "responseEndstopStatus");
|
||||
this.$socket.sendObj('printer.query_endstops.status', { }, "responseEndstopStatus");
|
||||
},
|
||||
getEndstops() {
|
||||
this.sortEndstops = {};
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
state_message: 'RESTART'
|
||||
}
|
||||
});
|
||||
this.$socket.sendObj('post_printer_restart', { }, "responseRestart");
|
||||
this.$socket.sendObj('printer.restart', { }, "responseRestart");
|
||||
},
|
||||
doRestartFirmware() {
|
||||
this.$store.commit('setLoadingRestartFirmware', true);
|
||||
@@ -63,15 +63,15 @@
|
||||
state_message: 'FIRMWARE RESTART'
|
||||
}
|
||||
});
|
||||
this.$socket.sendObj('post_printer_firmware_restart', { }, "responseRestartFirmware");
|
||||
this.$socket.sendObj('printer.firmware_restart', { }, "responseRestartFirmware");
|
||||
},
|
||||
doRebootHost() {
|
||||
this.$store.commit('setLoadingRebootHost', true);
|
||||
this.$socket.sendObj('post_machine_reboot', { });
|
||||
this.$socket.sendObj('machine.reboot', { });
|
||||
},
|
||||
doShutdownHost() {
|
||||
this.$store.commit('setLoadingShutdownHost', true);
|
||||
this.$socket.sendObj('post_machine_shutdown', { });
|
||||
this.$socket.sendObj('machine.shutdown', { });
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -188,23 +188,23 @@
|
||||
methods: {
|
||||
btnPauseJob() {
|
||||
this.$store.commit('setLoading', { name: 'statusPrintPause' });
|
||||
this.$socket.sendObj('post_printer_print_pause', { }, 'respondPrintPause');
|
||||
this.$socket.sendObj('printer.print.pause', { }, 'respondPrintPause');
|
||||
},
|
||||
btnResumeJob() {
|
||||
this.$store.commit('setLoading', { name: 'statusPrintResume' });
|
||||
this.$socket.sendObj('post_printer_print_resume', { }, 'respondPrintResume');
|
||||
this.$socket.sendObj('printer.print.resume', { }, 'respondPrintResume');
|
||||
},
|
||||
btnCancelJob() {
|
||||
this.$store.commit('setLoading', { name: 'statusPrintCancel' });
|
||||
this.$socket.sendObj('post_printer_print_cancel', { }, 'respondPrintCancel');
|
||||
this.$socket.sendObj('printer.print.cancel', { }, 'respondPrintCancel');
|
||||
},
|
||||
btnClearJob() {
|
||||
this.$store.commit('setLoading', {name: 'statusPrintClear'});
|
||||
this.$socket.sendObj('post_printer_gcode_script', {script: 'SDCARD_RESET_FILE'}, 'respondPrintClear');
|
||||
this.$socket.sendObj('printer.gcode.script', {script: 'SDCARD_RESET_FILE'}, 'respondPrintClear');
|
||||
},
|
||||
btnReprintJob() {
|
||||
this.$store.commit('setLoading', {name: 'statusPrintReprint'});
|
||||
this.$socket.sendObj('post_printer_print_start', { filename: this.current_file }, 'respondPrintReprint');
|
||||
this.$socket.sendObj('printer.print.start', { filename: this.current_file }, 'respondPrintReprint');
|
||||
},
|
||||
formatTime(seconds) {
|
||||
let h = Math.floor(seconds / 3600);
|
||||
|
||||
@@ -61,25 +61,25 @@
|
||||
let gcode = "SET_GCODE_OFFSET Z_ADJUST=-0.01"+(this.homed_axis === "xyz" ? " MOVE=1" : "");
|
||||
this.$store.commit('setLoading', { name: 'babySteppingDownFine' });
|
||||
this.$store.commit('addGcodeResponse', gcode);
|
||||
Vue.prototype.$socket.sendObj('post_printer_gcode_script', { script: gcode }, "respondeBabySteppingDownFine");
|
||||
Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "respondeBabySteppingDownFine");
|
||||
},
|
||||
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('addGcodeResponse', gcode);
|
||||
Vue.prototype.$socket.sendObj('post_printer_gcode_script', { script: gcode }, "respondeBabySteppingDown");
|
||||
Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "respondeBabySteppingDown");
|
||||
},
|
||||
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('addGcodeResponse', gcode);
|
||||
Vue.prototype.$socket.sendObj('post_printer_gcode_script', { script: gcode }, "respondeBabySteppingUpFine");
|
||||
Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "respondeBabySteppingUpFine");
|
||||
},
|
||||
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('addGcodeResponse', gcode);
|
||||
Vue.prototype.$socket.sendObj('post_printer_gcode_script', { script: gcode }, "respondeBabySteppingUp");
|
||||
Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "respondeBabySteppingUp");
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
methods: {
|
||||
changeSensor() {
|
||||
let gcode = 'SET_FILAMENT_SENSOR SENSOR='+this.name+' ENABLE='+(this.enabled ? 1 : 0);
|
||||
this.$socket.sendObj('post_printer_gcode_script', { script: gcode });
|
||||
this.$socket.sendObj('printer.gcode.script', { script: gcode });
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
} else if (this.min_temp !== undefined && this.value < this.min_temp && parseFloat(this.value) !== 0) {
|
||||
this.value = this.target;
|
||||
Vue.$toast.error("Temperature too low for "+this.name+"! (min: "+this.min_temp+")");
|
||||
} else this.$socket.sendObj('post_printer_gcode_script', {script: this.command+' '+this.attributeName+'='+this.name+' TARGET='+this.value});
|
||||
} else this.$socket.sendObj('printer.gcode.script', {script: this.command+' '+this.attributeName+'='+this.name+' TARGET='+this.value});
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
},
|
||||
methods: {
|
||||
sendCmd() {
|
||||
this.$socket.sendObj('post_printer_gcode_script', { script: this.command+' '+this.attributeName+(this.value*this.attributeScale).toFixed(0) });
|
||||
this.$socket.sendObj('printer.gcode.script', { script: this.command+' '+this.attributeName+(this.value*this.attributeScale).toFixed(0) });
|
||||
},
|
||||
decrement() {
|
||||
this.value--;
|
||||
|
||||
@@ -128,7 +128,7 @@
|
||||
doSend() {
|
||||
this.$store.commit('setLoading', { name: 'loadingSendGcode' });
|
||||
this.$store.commit('addGcodeResponse', this.gcode);
|
||||
Vue.prototype.$socket.sendObj('post_printer_gcode_script', { script: this.gcode }, "sendGcode");
|
||||
Vue.prototype.$socket.sendObj('printer.gcode.script', { script: this.gcode }, "sendGcode");
|
||||
this.lastCommands.push(this.gcode);
|
||||
this.gcode = "";
|
||||
this.lastCommandNumber = null;
|
||||
|
||||
+10
-10
@@ -149,7 +149,7 @@
|
||||
</v-card>
|
||||
<v-menu v-model="contextMenu.shown" :position-x="contextMenu.x" :position-y="contextMenu.y" absolute offset-y>
|
||||
<v-list>
|
||||
<v-list-item @click="downloadFile" :disabled="is_printing" v-if="!contextMenu.item.isDirectory">
|
||||
<v-list-item @click="clickRow(contextMenu.item)" :disabled="is_printing" v-if="!contextMenu.item.isDirectory">
|
||||
<v-icon class="mr-1">mdi-play</v-icon> Print start
|
||||
</v-list-item>
|
||||
<v-list-item @click="downloadFile" v-if="!contextMenu.item.isDirectory">
|
||||
@@ -347,7 +347,7 @@
|
||||
},
|
||||
refreshFileList: function() {
|
||||
this.$store.commit('setLoading', { name: 'loadingGcodeRefresh' });
|
||||
this.$socket.sendObj('get_directory', { path: this.currentPath }, 'getDirectory');
|
||||
this.$socket.sendObj('server.files.get_directory', { path: this.currentPath }, 'getDirectory');
|
||||
},
|
||||
formatDate(date) {
|
||||
let tmp2 = new Date(date);
|
||||
@@ -415,7 +415,7 @@
|
||||
},
|
||||
renameFileAction() {
|
||||
this.dialogRenameFile.show = false;
|
||||
this.$socket.sendObj('post_file_move', {
|
||||
this.$socket.sendObj('server.files.move', {
|
||||
source: this.currentPath+"/"+this.dialogRenameFile.item.filename,
|
||||
dest: this.currentPath+"/"+this.dialogRenameFile.newName
|
||||
}, 'getPostFileMove');
|
||||
@@ -427,7 +427,7 @@
|
||||
},
|
||||
renameDirectoryAction() {
|
||||
this.dialogRenameDirectory.show = false;
|
||||
this.$socket.sendObj('post_file_move', {
|
||||
this.$socket.sendObj('server.files.move', {
|
||||
source: this.currentPath+"/"+this.dialogRenameDirectory.item.filename,
|
||||
dest: this.currentPath+"/"+this.dialogRenameDirectory.newName
|
||||
}, 'getPostFileMove');
|
||||
@@ -449,11 +449,11 @@
|
||||
createDirectoryAction: function() {
|
||||
if (this.dialogCreateDirectory.name.length && this.dialogCreateDirectory.name.indexOf(" ") === -1) {
|
||||
this.dialogCreateDirectory.show = false;
|
||||
this.$socket.sendObj('post_directory', { path: this.currentPath+"/"+this.dialogCreateDirectory.name }, 'getPostDirectory');
|
||||
this.$socket.sendObj('server.files.post_directory', { path: this.currentPath+"/"+this.dialogCreateDirectory.name }, 'getPostDirectory');
|
||||
}
|
||||
},
|
||||
deleteDirectoryAction: function() {
|
||||
this.$socket.sendObj('delete_directory', { path: this.currentPath+"/"+this.contextMenu.item.filename }, 'getDeleteDirectory');
|
||||
this.$socket.sendObj('server.files.delete_directory', { path: this.currentPath+"/"+this.contextMenu.item.filename }, 'getDeleteDirectory');
|
||||
},
|
||||
clickRow: function(item) {
|
||||
if (!item.isDirectory) {
|
||||
@@ -468,14 +468,14 @@
|
||||
this.currentPath = this.currentPath.substr(0, this.currentPath.lastIndexOf("/"));
|
||||
},
|
||||
loadPath: function() {
|
||||
this.$socket.sendObj('get_directory', { path: this.currentPath }, 'getDirectory');
|
||||
this.$socket.sendObj('server.files.get_directory', { path: this.currentPath }, 'getDirectory');
|
||||
let dirArray = this.currentPath.split("/");
|
||||
this.files = findDirectory(this.filetree, dirArray);
|
||||
},
|
||||
startPrint(filename = "") {
|
||||
filename = (this.currentPath+"/"+filename).substring(7);
|
||||
this.dialogPrintFile.show = false;
|
||||
this.$socket.sendObj('post_printer_print_start', { filename: filename }, 'switchToDashboard');
|
||||
this.$socket.sendObj('printer.print.start', { filename: filename }, 'switchToDashboard');
|
||||
},
|
||||
dragOverUpload(e) {
|
||||
if (!this.draggingFile.status) {
|
||||
@@ -545,7 +545,7 @@
|
||||
dest = this.currentPath.substring(0, this.currentPath.lastIndexOf("/") + 1)+this.draggingFile.item.filename;
|
||||
} else dest = this.currentPath+"/"+row.filename+"/"+this.draggingFile.item.filename;
|
||||
|
||||
this.$socket.sendObj('post_file_move', {
|
||||
this.$socket.sendObj('server.files.move', {
|
||||
source: this.currentPath+"/"+this.draggingFile.item.filename,
|
||||
dest: dest
|
||||
}, 'getPostFileMove');
|
||||
@@ -591,7 +591,7 @@
|
||||
for (let i = data.pageStart; i < data.pageStop; i++) {
|
||||
if (items[i] && !items[i].isDirectory && !items[i].metadataPulled) {
|
||||
let filename = (this.currentPath+"/"+items[i].filename).substring(7);
|
||||
this.$socket.sendObj("get_file_metadata", { filename: filename }, "getMetadata");
|
||||
this.$socket.sendObj("server.files.metadata", { filename: filename }, "getMetadata");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -291,26 +291,26 @@
|
||||
},
|
||||
loadProfile: function() {
|
||||
this.$store.commit('setLoading', { name: 'bedMeshLoad' });
|
||||
this.$socket.sendObj('post_printer_gcode_script', { script: "BED_MESH_PROFILE LOAD="+this.profile }, "responseBedMeshLoad");
|
||||
this.$socket.sendObj('printer.gcode.script', { script: "BED_MESH_PROFILE LOAD="+this.profile }, "responseBedMeshLoad");
|
||||
},
|
||||
saveProfile: function() {
|
||||
this.saveDialog = false;
|
||||
this.$store.commit('setLoading', { name: 'bedMeshSave' });
|
||||
this.$socket.sendObj('post_printer_gcode_script', { script: "BED_MESH_PROFILE SAVE="+this.newName.toUpperCase() }, "responseBedMeshSave");
|
||||
this.$socket.sendObj('printer.gcode.script', { script: "BED_MESH_PROFILE SAVE="+this.newName.toUpperCase() }, "responseBedMeshSave");
|
||||
},
|
||||
removeProfile: function() {
|
||||
this.removeDialog = false;
|
||||
this.$store.commit('setLoading', { name: 'bedMeshRemove' });
|
||||
this.$socket.sendObj('post_printer_gcode_script', { script: "BED_MESH_PROFILE REMOVE="+this.profile }, "responseBedMeshRemove");
|
||||
this.$socket.sendObj('printer.gcode.script', { script: "BED_MESH_PROFILE REMOVE="+this.profile }, "responseBedMeshRemove");
|
||||
},
|
||||
clearBedMesh: function() {
|
||||
this.$store.commit('setLoading', { name: 'bedMeshClear' });
|
||||
this.$socket.sendObj('post_printer_gcode_script', { script: "BED_MESH_CLEAR" }, "responseBedMeshClear");
|
||||
this.$socket.sendObj('printer.gcode.script', { script: "BED_MESH_CLEAR" }, "responseBedMeshClear");
|
||||
},
|
||||
calibrateMesh: function() {
|
||||
this.calibrateDialog = false;
|
||||
this.$store.commit('setLoading', { name: 'bedMeshCalibrate' });
|
||||
this.$socket.sendObj('post_printer_gcode_script', { script: "BED_MESH_CALIBRATE" }, "responseBedMeshCalibrate");
|
||||
this.$socket.sendObj('printer.gcode.script', { script: "BED_MESH_CALIBRATE" }, "responseBedMeshCalibrate");
|
||||
}
|
||||
},
|
||||
created: function() {
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
Current Job
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
|
||||
}
|
||||
</script>
|
||||
@@ -86,12 +86,14 @@ export default class WebSocketClient {
|
||||
}
|
||||
|
||||
sendObj (method, params, action = '') {
|
||||
let id = Math.floor(Math.random() * 10000) + 1
|
||||
this.wsData.push({
|
||||
id: id,
|
||||
action: action,
|
||||
params: params
|
||||
})
|
||||
this.instance.send(this.createMessage(method, params, id))
|
||||
if (this.instance.readyState === WebSocket.OPEN) {
|
||||
let id = Math.floor(Math.random() * 10000) + 1
|
||||
this.wsData.push({
|
||||
id: id,
|
||||
action: action,
|
||||
params: params
|
||||
})
|
||||
this.instance.send(this.createMessage(method, params, id));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
import Dashboard from '../pages/Dashboard.vue'
|
||||
//import Status from '../pages/Status.vue'
|
||||
import Webcam from '../pages/Webcam.vue'
|
||||
import Console from '../pages/Console.vue'
|
||||
import Heightmap from '../pages/Heightmap.vue'
|
||||
|
||||
+14
-9
@@ -7,8 +7,8 @@ import axios from "axios";
|
||||
export default {
|
||||
socket_on_open ({ commit }) {
|
||||
commit('setConnected');
|
||||
Vue.prototype.$socket.sendObj('get_directory', { path: '/gcodes' }, 'getDirectoryRoot');
|
||||
Vue.prototype.$socket.sendObj('get_printer_info', {}, 'getKlipperInfo');
|
||||
Vue.prototype.$socket.sendObj('server.files.get_directory', { path: '/gcodes' }, 'getDirectoryRoot');
|
||||
Vue.prototype.$socket.sendObj('printer.info', {}, 'getKlipperInfo');
|
||||
},
|
||||
|
||||
socket_on_close ({ commit }, event) {
|
||||
@@ -64,9 +64,14 @@ export default {
|
||||
}
|
||||
break;
|
||||
|
||||
case 'notify_metadata_update':
|
||||
commit('setMetadata', data.params[0]);
|
||||
break;
|
||||
|
||||
default:
|
||||
if (data.result !== "ok") {
|
||||
if (data.error && data.error.message !== "Klippy Request Timed Out") window.console.error("JSON-RPC: " + data.error.message);
|
||||
else if (!data.error) window.console.log(data);
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -109,11 +114,11 @@ export default {
|
||||
}
|
||||
});
|
||||
|
||||
Vue.prototype.$socket.sendObj('get_printer_objects_list', {}, 'getObjectsList');
|
||||
Vue.prototype.$socket.sendObj('get_directory', { path: 'gcodes' }, 'getDirectory');
|
||||
Vue.prototype.$socket.sendObj('get_directory', { path: 'config' }, 'getDirectory');
|
||||
Vue.prototype.$socket.sendObj('get_directory', { path: 'config_examples' }, 'getDirectory');
|
||||
Vue.prototype.$socket.sendObj('get_printer_gcode_help', {}, 'getHelpList');
|
||||
Vue.prototype.$socket.sendObj('printer.objects.list', {}, 'getObjectsList');
|
||||
Vue.prototype.$socket.sendObj('server.files.get_directory', { path: 'gcodes' }, 'getDirectory');
|
||||
Vue.prototype.$socket.sendObj('server.files.get_directory', { path: 'config' }, 'getDirectory');
|
||||
Vue.prototype.$socket.sendObj('server.files.get_directory', { path: 'config_examples' }, 'getDirectory');
|
||||
Vue.prototype.$socket.sendObj('printer.gcode.help', {}, 'getHelpList');
|
||||
},
|
||||
|
||||
getObjectsList({ commit }, data) {
|
||||
@@ -130,8 +135,8 @@ export default {
|
||||
) subscripts = {...subscripts, [key]: null }
|
||||
}
|
||||
|
||||
if (subscripts !== {}) Vue.prototype.$socket.sendObj('post_printer_objects_subscribe', { objects: subscripts }, "getPrinterData");
|
||||
Vue.prototype.$socket.sendObj("get_server_temperature_store", {}, "getHeatersHistory");
|
||||
if (subscripts !== {}) Vue.prototype.$socket.sendObj('printer.objects.subscribe', { objects: subscripts }, "getPrinterData");
|
||||
Vue.prototype.$socket.sendObj("server.temperature_store", {}, "getHeatersHistory");
|
||||
},
|
||||
|
||||
getPrinterData({ commit }, data) {
|
||||
|
||||
@@ -126,11 +126,11 @@ export default {
|
||||
},
|
||||
|
||||
fan: state => {
|
||||
return Object.entries(state.object).indexOf('fan') ? state.printer.fan : false;
|
||||
return Object.entries(state.printer).indexOf('fan') ? state.printer.fan : false;
|
||||
},
|
||||
|
||||
is_printing: state => {
|
||||
return (state.printer.print_stats.filename !== "");
|
||||
return (['printing', 'paused'].includes(state.printer.print_stats.state));
|
||||
},
|
||||
|
||||
getMacros: state => {
|
||||
|
||||
@@ -15,7 +15,6 @@ export default new Vuex.Store({
|
||||
port: window.location.port,
|
||||
reconnectInterval: 3000,
|
||||
isConnected: false,
|
||||
metadataRequestDelay: 1000,
|
||||
|
||||
loadingEmergencyStop: false,
|
||||
loadingRestart: false,
|
||||
|
||||
@@ -268,13 +268,6 @@ export default {
|
||||
metadataPulled: false,
|
||||
});
|
||||
}
|
||||
|
||||
let extension = filename.substring(filename.lastIndexOf("."));
|
||||
if (extension.toLowerCase() === ".gcode") {
|
||||
setTimeout(function() {
|
||||
Vue.prototype.$socket.sendObj("get_file_metadata", { filename: data.item.path }, "getMetadata");
|
||||
}, state.socket.metadataRequestDelay);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -362,7 +355,7 @@ export default {
|
||||
childrens: [],
|
||||
});
|
||||
|
||||
Vue.prototype.$socket.sendObj('get_directory', { path: data.requestParams.path+'/'+dir.dirname }, 'getDirectoryRoot');
|
||||
Vue.prototype.$socket.sendObj('server.files.get_directory', { path: data.requestParams.path+'/'+dir.dirname }, 'getDirectoryRoot');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user