bugfix: UFP thumbnail (only 300px) bugfix: moonraker > websocket subscription bugfix: miniconsole > different line baseline bugfix: new metadata push > redirect to current file feature: show/hide colums in gcode-files feature: show/hide hidden files/dir feature: display missing config sections feature: display klippy-state in settings > machinies Signed-off-by: meteyou <meteyou@gmail.com>
34 lines
790 B
JavaScript
34 lines
790 B
JavaScript
import axios from "axios";
|
|
|
|
export default {
|
|
reset({ commit }) {
|
|
commit('reset')
|
|
},
|
|
|
|
getData({ commit }, payload) {
|
|
commit('setData', payload)
|
|
},
|
|
|
|
setSettings({ commit, dispatch }, payload) {
|
|
commit('setSettings', payload)
|
|
dispatch('upload')
|
|
},
|
|
|
|
upload({ state, rootState }) {
|
|
let file = new File([JSON.stringify({ state })], 'gui.json');
|
|
|
|
let formData = new FormData();
|
|
formData.append('file', file);
|
|
formData.append('root', 'config');
|
|
|
|
axios.post('//' + rootState.socket.hostname + ':' + rootState.socket.port + '/server/files/upload',
|
|
formData, {
|
|
headers: { 'Content-Type': 'multipart/form-data' }
|
|
}
|
|
).then(() => {
|
|
window.console.info("gui.json successfully uploaded")
|
|
}).catch(() => {
|
|
window.console.error("Error save gui.json!")
|
|
});
|
|
},
|
|
} |