Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
20bad7d24c | ||
|
|
8494a35adf | ||
|
|
6766a266e8 | ||
|
|
75d6cce540 | ||
|
|
e0e3150466 | ||
|
|
fcaebc4413 | ||
|
|
37f1ffb04b | ||
|
|
1b501bb810 |
No files matched your search
+2
-1
@@ -3,4 +3,5 @@
|
||||
- [Installation](installation.md)
|
||||
- [Update from 0.0.x to 0.1.x](update-0.0.x.md)
|
||||
- [Macros](macros.md)
|
||||
- [Slicer upload](slicer-upload.md)
|
||||
- [Slicer upload](slicer-upload.md)
|
||||
- [Gcode thumbnails (PrusaSlicer & SuperSlicer only)](gcode-thumbnails.md)
|
||||
@@ -0,0 +1,11 @@
|
||||
# Gcode-thumbnails with PrusaSlicer and SuperSlicer
|
||||
Mainsail can display these thumbnails in the gcode filemanager. To enable the thumbnails,
|
||||
open your slicer (PrusaSlicer or SuperSlicer) click on `Help > Show Configuration Folder`
|
||||
and then inside the `printers` sub-folder you’ll find your printer profiles.
|
||||
|
||||
Open your desired printer profile in your favorite text editor and find the `thumbnails =`
|
||||
section and add the resolutions `32x32,400x300`. Save the file and restart your slicer.
|
||||
|
||||
Now you should see a preview in the filemanager and if you will start a new job.
|
||||
|
||||

|
||||
Binary file not shown.
|
After Width: | Height: | Size: 74 KiB |
@@ -209,7 +209,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.1.0/mainsail-beta-0.1.0.zip && unzip mainsail.zip && rm mainsail.zip
|
||||
wget -q -O mainsail.zip https://github.com/meteyou/mainsail/releases/download/v0.1.1/mainsail-beta-0.1.1.zip && unzip mainsail.zip && rm mainsail.zip
|
||||
```
|
||||
Now it should be possible to open the interface: `http://<printer-ip>/`.
|
||||
|
||||
|
||||
@@ -43,5 +43,5 @@ Restart nginx with `sudo service nginx restart`
|
||||
```
|
||||
rm -R ~/mainsail/*
|
||||
cd ~/mainsail
|
||||
wget -q -O mainsail.zip https://github.com/meteyou/mainsail/releases/download/v0.1.0/mainsail-beta-0.1.0.zip && unzip mainsail.zip && rm mainsail.zip
|
||||
wget -q -O mainsail.zip https://github.com/meteyou/mainsail/releases/download/v0.1.1/mainsail-beta-0.1.1.zip && unzip mainsail.zip && rm mainsail.zip
|
||||
```
|
||||
@@ -8,6 +8,7 @@
|
||||
<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-col>
|
||||
</v-row>
|
||||
<v-row class="mt-3" v-if="!is_printing">
|
||||
@@ -52,7 +53,7 @@
|
||||
<v-row class="" v-if="getMacros.length > 0">
|
||||
<v-col class="col-12 px-4 py-2 text-center">
|
||||
<div v-for="(macro, index) in getMacros" v-bind:key="index+99" class="d-inline-block mx-1 my-1">
|
||||
<v-btn color="primary" class="mx-1 my-1" @click="doSend(macro.name)">{{ macro.name }}</v-btn>
|
||||
<v-btn color="primary" class="mx-1 my-1" @click="doSend(macro.name)">{{ macro.name.replace("_", " ") }}</v-btn>
|
||||
</div>
|
||||
</v-col>
|
||||
</v-row>
|
||||
@@ -73,6 +74,7 @@
|
||||
loadingHomeX: false,
|
||||
loadingHomeY: false,
|
||||
loadingHomeZ: false,
|
||||
loadingZTilt: false,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -116,6 +118,11 @@
|
||||
this.$store.commit('setLoadingQGL', true);
|
||||
this.$socket.sendObj('post_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");
|
||||
},
|
||||
doSendMove(gcode) {
|
||||
gcode = "G91" + "\n" +
|
||||
"G1 " + gcode + " F6000" + "\n" +
|
||||
@@ -134,6 +141,7 @@
|
||||
this.loadingHomeX = loadings.includes('controlHomeX');
|
||||
this.loadingHomeY = loadings.includes('controlHomeY');
|
||||
this.loadingHomeZ = loadings.includes('controlHomeZ');
|
||||
this.loadingZTilt = loadings.includes('controlZTilt');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<div><v-btn :href="'http://'+hostname+':'+port+'/server/files/moonraker.log'" color="mt-3 primary"><v-icon class="mr-sm-2">mdi-download</v-icon>Moonraker Log</v-btn></div>
|
||||
<div><v-btn @click="doRestart" :loading="loadingRestart" color="error" class="mt-3"><v-icon class="mr-sm-2">mdi-cached</v-icon>Restart</v-btn></div>
|
||||
<div><v-btn @click="doRestartFirmware" :loading="loadingRestartFirmware" class="mt-3" color="error"><v-icon class="mr-sm-2">mdi-cached</v-icon>FW <span class="d-none d-sm-block">Restart</span></v-btn></div>
|
||||
<div><v-btn @click="doRebootHost" :loading="loadingRebootHost" class="mt-3" color="error"><v-icon class="mr-sm-2">mdi-cached</v-icon>Host <span class="d-none d-sm-block">Restart</span></v-btn></div>
|
||||
<div><v-btn @click="doRebootHost" :loading="loadingRebootHost" class="mt-3" color="error"><v-icon class="mr-sm-2">mdi-cached</v-icon>Host <span class="d-none d-sm-block">Reboot</span></v-btn></div>
|
||||
<div><v-btn @click="doShutdownHost" :loading="loadingShutdownHost" class="mt-3" color="error"><v-icon class="mr-sm-2">mdi-power</v-icon>Host <span class="d-none d-sm-block">Shutdown</span></v-btn></div>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
|
||||
@@ -17,9 +17,15 @@
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col class="col-12 pt-0 text-center">
|
||||
<v-btn @click="sendBabySteppingDown()" class="mx-2" :loading="loadingBabySteppingDown" ><v-icon class="mr-2">mdi-arrow-collapse-down</v-icon> -0.05mm</v-btn>
|
||||
<v-btn @click="sendBabySteppingUp()" class="mx-2" :loading="loadingBabySteppingUp" ><v-icon class="mr-2">mdi-arrow-expand-up</v-icon> +0.05mm</v-btn>
|
||||
<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>
|
||||
<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>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-card-text>
|
||||
@@ -36,7 +42,9 @@
|
||||
},
|
||||
data: function() {
|
||||
return {
|
||||
loadingBabySteppingDownFine: false,
|
||||
loadingBabySteppingDown: false,
|
||||
loadingBabySteppingUpFine: false,
|
||||
loadingBabySteppingUp: false,
|
||||
}
|
||||
},
|
||||
@@ -50,12 +58,24 @@
|
||||
}),
|
||||
},
|
||||
methods: {
|
||||
sendBabySteppingDownFine() {
|
||||
let gcode = "SET_GCODE_OFFSET Z_ADJUST=-0.01 MOVE=1";
|
||||
this.$store.commit('setLoading', { name: 'babySteppingDownFine' });
|
||||
this.$store.commit('addGcodeResponse', gcode);
|
||||
Vue.prototype.$socket.sendObj('post_printer_gcode_script', { script: gcode }, "respondeBabySteppingDownFine");
|
||||
},
|
||||
sendBabySteppingDown() {
|
||||
let gcode = "SET_GCODE_OFFSET Z_ADJUST=-0.05 MOVE=1";
|
||||
this.$store.commit('setLoading', { name: 'babySteppingDown' });
|
||||
this.$store.commit('addGcodeResponse', gcode);
|
||||
Vue.prototype.$socket.sendObj('post_printer_gcode_script', { script: gcode }, "respondeBabySteppingDown");
|
||||
},
|
||||
sendBabySteppingUpFine() {
|
||||
let gcode = "SET_GCODE_OFFSET Z_ADJUST=0.01 MOVE=1";
|
||||
this.$store.commit('setLoading', { name: 'babySteppingUpFine' });
|
||||
this.$store.commit('addGcodeResponse', gcode);
|
||||
Vue.prototype.$socket.sendObj('post_printer_gcode_script', { script: gcode }, "respondeBabySteppingUpFine");
|
||||
},
|
||||
sendBabySteppingUp() {
|
||||
let gcode = "SET_GCODE_OFFSET Z_ADJUST=0.05 MOVE=1";
|
||||
this.$store.commit('setLoading', { name: 'babySteppingUp' });
|
||||
@@ -65,7 +85,9 @@
|
||||
},
|
||||
watch: {
|
||||
loadings: function(loadings) {
|
||||
this.loadingBabySteppingDownFine = loadings.includes('babySteppingDownFine');
|
||||
this.loadingBabySteppingDown = loadings.includes('babySteppingDown');
|
||||
this.loadingBabySteppingUpFine = loadings.includes('babySteppingUpFine');
|
||||
this.loadingBabySteppingUp = loadings.includes('babySteppingUp');
|
||||
},
|
||||
}
|
||||
|
||||
+8
-10
@@ -55,7 +55,7 @@
|
||||
<v-btn color="primary ml-4 " :loading="loadingGcodeUpload" @click="clickUploadButton"><v-icon>mdi-upload</v-icon>Upload</v-btn>
|
||||
</v-card-title>
|
||||
<v-card-subtitle>
|
||||
Current path: {{ this.currentPath }}
|
||||
Current path: {{ this.currentPath !== 'gcodes' ? "/"+this.currentPath.substring(7) : "/" }}
|
||||
</v-card-subtitle>
|
||||
<v-card-text>
|
||||
<v-text-field
|
||||
@@ -231,7 +231,7 @@
|
||||
import { mapState, mapGetters } from 'vuex';
|
||||
import axios from 'axios';
|
||||
import { findDirectory } from "../plugins/helpers";
|
||||
import Vue from "vue";
|
||||
/*import Vue from "vue";*/
|
||||
|
||||
export default {
|
||||
data () {
|
||||
@@ -335,12 +335,6 @@
|
||||
).then((result) => {
|
||||
this.$store.commit('removeLoading', { name: 'loadingGcodeUpload' });
|
||||
toast.success("Upload of "+result.data.result+" successful!");
|
||||
this.$socket.sendObj('get_directory', { path: this.currentPath }, 'getDirectory');
|
||||
|
||||
let filename = (this.currentPath+"/"+file.name).substring(7);
|
||||
setTimeout(function() {
|
||||
Vue.prototype.$socket.sendObj("get_file_metadata", { filename: filename }, "getMetadata");
|
||||
}, 1000);
|
||||
})
|
||||
.catch(() => {
|
||||
this.$store.commit('removeLoading', { name: 'loadingGcodeUpload' });
|
||||
@@ -435,7 +429,6 @@
|
||||
'http://'+ this.hostname + ':' + this.port +'/server/files/'+filename
|
||||
).then((result) => {
|
||||
this.$toast.success(result.data.result+" successfully deleted.");
|
||||
this.$socket.sendObj('get_directory', { path: this.currentPath }, 'getDirectory');
|
||||
}).catch(() => {
|
||||
this.$toast.error("Error! Cannot delete file.");
|
||||
});
|
||||
@@ -538,9 +531,14 @@
|
||||
e.preventDefault();
|
||||
e.target.parentElement.style.backgroundColor = 'transparent';
|
||||
|
||||
let dest = "";
|
||||
if (row.filename === '..') {
|
||||
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', {
|
||||
source: this.currentPath+"/"+this.draggingFile.item.filename,
|
||||
dest: this.currentPath+"/"+row.filename+"/"+this.draggingFile.item.filename,
|
||||
dest: dest
|
||||
}, 'getPostFileMove');
|
||||
}
|
||||
},
|
||||
|
||||
+39
-20
@@ -36,7 +36,31 @@ export default {
|
||||
break;
|
||||
|
||||
case 'notify_filelist_changed':
|
||||
commit('setFileList', data.params[0].filelist);
|
||||
switch(data.params[0].action) {
|
||||
case 'added':
|
||||
commit('setFileChangeAdded', data.params[0]);
|
||||
break;
|
||||
|
||||
case 'removed':
|
||||
commit('setFileChangeRemoved', data.params[0]);
|
||||
break;
|
||||
|
||||
case 'file_move':
|
||||
commit('setFileChangeFileMove', data.params[0]);
|
||||
break;
|
||||
|
||||
case 'add_directory':
|
||||
commit('setFileChangeAddDirectory', data.params[0]);
|
||||
break;
|
||||
|
||||
case 'delete_directory':
|
||||
commit('setFileChangeDeleteDirectory', data.params[0]);
|
||||
break;
|
||||
|
||||
default:
|
||||
window.console.error("Unknown filelist_changed action: "+data.params[0].action);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -96,7 +120,6 @@ export default {
|
||||
idle_timeout: [],
|
||||
display_status: [],
|
||||
});
|
||||
Vue.prototype.$socket.sendObj('get_file_list', {}, 'getFileList');
|
||||
Vue.prototype.$socket.sendObj('get_directory', { path: 'gcodes' }, 'getDirectory');
|
||||
Vue.prototype.$socket.sendObj('get_printer_gcode_help', {}, 'getHelpList');
|
||||
} else if (data !== undefined && !data.is_ready) commit('setKlippyStatus', 'disconnect');
|
||||
@@ -157,11 +180,6 @@ export default {
|
||||
commit('setPrinterConfig', data);
|
||||
},
|
||||
|
||||
getFileList({ commit }, data) {
|
||||
commit('setFileList', data);
|
||||
commit('removeLoading', 'loadingGcodeRefresh');
|
||||
},
|
||||
|
||||
getDirectory({ commit }, data) {
|
||||
commit('setDirectory', data);
|
||||
commit('removeLoading', { name: 'loadingGcodeRefresh' });
|
||||
@@ -179,11 +197,9 @@ export default {
|
||||
if (data.error) {
|
||||
Vue.$toast.error(data.error.message);
|
||||
} else if (data.result === "ok") {
|
||||
let currentPath = data.requestParams.path.substr(0, data.requestParams.path.lastIndexOf("/"));
|
||||
let newPath = data.requestParams.path.substr(data.requestParams.path.lastIndexOf("/")+1);
|
||||
|
||||
Vue.$toast.success("Successfully created "+newPath);
|
||||
Vue.prototype.$socket.sendObj('get_directory', { path: currentPath }, 'getDirectory');
|
||||
commit('voidMutation');
|
||||
}
|
||||
},
|
||||
@@ -192,15 +208,10 @@ export default {
|
||||
if (data.error) {
|
||||
Vue.$toast.error(data.error.message);
|
||||
} else if (data.result === "ok") {
|
||||
let currentPath = data.requestParams.path.substr(0, data.requestParams.path.lastIndexOf("/"));
|
||||
let delPath = data.requestParams.path.substr(data.requestParams.path.lastIndexOf("/")+1);
|
||||
|
||||
Vue.$toast.success("Successfully deleted "+delPath);
|
||||
//Vue.prototype.$socket.sendObj('get_directory', { path: currentPath }, 'getDirectory');
|
||||
commit('removeDirFromFiletree', {
|
||||
currentPath: currentPath,
|
||||
delPathName: delPath
|
||||
});
|
||||
commit('voidMutation');
|
||||
}
|
||||
},
|
||||
|
||||
@@ -214,11 +225,7 @@ export default {
|
||||
|
||||
if (sourceDir === destDir) Vue.$toast.success("Successfully renamed "+filename);
|
||||
else Vue.$toast.success("Successfully moved "+filename);
|
||||
|
||||
commit('renameMetadataFilename', {
|
||||
source: data.requestParams.source,
|
||||
dest: data.requestParams.dest
|
||||
});
|
||||
commit('voidMutation');
|
||||
}
|
||||
},
|
||||
|
||||
@@ -272,6 +279,10 @@ export default {
|
||||
commit('setLoadingQGL', false);
|
||||
},
|
||||
|
||||
responseZTilt({commit}) {
|
||||
commit('removeLoading', { name: 'controlZTilt' });
|
||||
},
|
||||
|
||||
responseRestart({commit}) {
|
||||
commit('setLoadingRestart', false);
|
||||
},
|
||||
@@ -293,10 +304,18 @@ export default {
|
||||
commit('removeLoading', { name: 'extruderDetract' });
|
||||
},
|
||||
|
||||
respondeBabySteppingDownFine({commit}) {
|
||||
commit('removeLoading', { name: 'babySteppingDownFine' });
|
||||
},
|
||||
|
||||
respondeBabySteppingDown({commit}) {
|
||||
commit('removeLoading', { name: 'babySteppingDown' });
|
||||
},
|
||||
|
||||
respondeBabySteppingUpFine({commit}) {
|
||||
commit('removeLoading', { name: 'babySteppingUpFine' });
|
||||
},
|
||||
|
||||
respondeBabySteppingUp({commit}) {
|
||||
commit('removeLoading', { name: 'babySteppingUp' });
|
||||
},
|
||||
|
||||
+69
-30
@@ -158,7 +158,7 @@ export default {
|
||||
switch (payload.name) {
|
||||
case 'heater_bed': color = colorHeaterBed; break;
|
||||
case 'chamber': color = colorChamber; break;
|
||||
default: color = colorArray[state.temperaturChart.datasets.length]; break;
|
||||
default: color = colorArray[state.temperaturChart.datasets.filter(element => !element.label.endsWith("_target") && element.label !== "heater_bed" && element.label !== "chamber").length]; break;
|
||||
}
|
||||
|
||||
let hidden = state.gui.dashboard.hiddenTempChart.indexOf(payload.name.toUpperCase()) >= 0 ? true : null;
|
||||
@@ -215,29 +215,74 @@ export default {
|
||||
if (data.configfile) Vue.set(state, 'config', data.configfile.config);
|
||||
},
|
||||
|
||||
setFileList(state, data) {
|
||||
state.files = [];
|
||||
//window.console.log(data);
|
||||
let array = Object.entries(data);
|
||||
setFileChangeAdded(state, data) {
|
||||
let filename = data.filename.substr(data.filename.lastIndexOf("/")).replace("/", "");
|
||||
let path = data.filename.substr(0, data.filename.lastIndexOf("/"));
|
||||
let parent = findDirectory(state.filetree, (data.root+"/"+path).split("/"));
|
||||
|
||||
for (let [key, file] of array) {
|
||||
if (file.filename !== "gui.json") {
|
||||
state.files.push({
|
||||
number: key,
|
||||
filename: file.filename,
|
||||
modified: Date.parse(file.modified),
|
||||
size: file.size,
|
||||
slicer: file.slicer,
|
||||
filament_total: file.filament_total,
|
||||
estimated_time: file.estimated_time,
|
||||
layer_height: file.layer_height,
|
||||
first_layer_height: file.first_layer_height,
|
||||
object_height: file.object_height,
|
||||
thumbnails : file.thumbnails ? file.thumbnails : [],
|
||||
});
|
||||
}
|
||||
if (parent) {
|
||||
parent.push({
|
||||
isDirectory: false,
|
||||
filename: filename,
|
||||
modified: new Date(),
|
||||
size: 0,
|
||||
metadataPulled: false,
|
||||
});
|
||||
|
||||
setTimeout(function() {
|
||||
Vue.prototype.$socket.sendObj("get_file_metadata", { filename: data.filename }, "getMetadata");
|
||||
}, 500);
|
||||
}
|
||||
//state.files = data;
|
||||
},
|
||||
|
||||
setFileChangeRemoved(state, data) {
|
||||
let currentPath = data.filename.substr(0, data.filename.lastIndexOf("/"));
|
||||
let delPath = data.filename.substr(data.filename.lastIndexOf("/")+1);
|
||||
currentPath = findDirectory(state.filetree, (data.root+"/"+currentPath).split("/"));
|
||||
let index = currentPath.findIndex(element => element.filename === delPath);
|
||||
|
||||
if (index >= 0 && currentPath[index]) currentPath.splice(index, 1);
|
||||
},
|
||||
|
||||
setFileChangeFileMove(state, data) {
|
||||
let oldPath = data.prev_file.substr(0, data.prev_file.lastIndexOf("/") + 1);
|
||||
let newPath = data.filename.substr(0, data.filename.lastIndexOf("/") + 1);
|
||||
let filenameOld = data.prev_file.substr(data.prev_file.lastIndexOf("/")+1);
|
||||
let filenameNew = data.filename.substr(data.filename.lastIndexOf("/")+1);
|
||||
|
||||
oldPath = findDirectory(state.filetree, (data.root+"/"+oldPath).split("/"));
|
||||
let indexFile = oldPath.findIndex(element => element.filename === filenameOld);
|
||||
|
||||
if (indexFile >= 0 && oldPath[indexFile]) {
|
||||
let file = oldPath.splice(indexFile, 1)[0];
|
||||
file.filename = filenameNew;
|
||||
newPath = findDirectory(state.filetree, (data.root+"/"+newPath).split("/"));
|
||||
newPath.push(file);
|
||||
}
|
||||
},
|
||||
|
||||
setFileChangeAddDirectory(state, data) {
|
||||
let filename = data.filename.substr(data.filename.lastIndexOf("/") + 1);
|
||||
let path = data.filename.substr(0, data.filename.lastIndexOf("/"));
|
||||
let parent = findDirectory(state.filetree, (data.root+"/"+path).split("/"));
|
||||
|
||||
if (parent) {
|
||||
parent.push({
|
||||
isDirectory: true,
|
||||
filename: filename,
|
||||
modified: new Date(),
|
||||
childrens: [],
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
setFileChangeDeleteDirectory(state, data) {
|
||||
let currentPath = data.filename.substr(0, data.filename.lastIndexOf("/"));
|
||||
let delPath = data.filename.substr(data.filename.lastIndexOf("/")+1);
|
||||
currentPath = findDirectory(state.filetree, (data.root+"/"+currentPath).split("/"));
|
||||
let index = currentPath.findIndex(element => element.filename === delPath);
|
||||
|
||||
if (index >= 0 && currentPath[index]) currentPath.splice(index, 1);
|
||||
},
|
||||
|
||||
setDirectory(state, data) {
|
||||
@@ -311,6 +356,8 @@ export default {
|
||||
slicer: data.slicer ? data.slicer : undefined,
|
||||
thumbnails: data.thumbnails ? data.thumbnails : undefined,
|
||||
metadataPulled: true,
|
||||
modified: Date.parse(data.modified),
|
||||
size: parseInt(data.size),
|
||||
};
|
||||
|
||||
let newObject = Object.assign(path[index], newData);
|
||||
@@ -351,14 +398,6 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
removeDirFromFiletree(state, data) {
|
||||
let currentPathArray = data.currentPath.split("/");
|
||||
let currentPath = findDirectory(state.filetree, currentPathArray);
|
||||
let index = currentPath.findIndex(element => element.filename === data.delPathName);
|
||||
|
||||
if (index >= 0 && currentPath[index]) currentPath.splice(index, 1);
|
||||
},
|
||||
|
||||
setHelpList(state, data) {
|
||||
state.helplist = [];
|
||||
|
||||
|
||||
@@ -4,12 +4,12 @@ export const hostname = "voron250.local:8080";
|
||||
|
||||
export const colorArray = [
|
||||
'#F44336',
|
||||
'#E91E63',
|
||||
'#9C27B0',
|
||||
'#673AB7',
|
||||
'#3F51B5',
|
||||
'#00BCD4',
|
||||
'#009688',
|
||||
'#E91E63',
|
||||
];
|
||||
|
||||
export const colorHeaterBed = '#2196F3';
|
||||
|
||||
Reference in new issue
Block a user