bugfix: change gui.json to .mainsail.json

Signed-off-by: Stefan Dej <meteyou@gmail.com>
This commit is contained in:
Stefan Dej committed 2020-12-05 15:45:55 +01:00
1 parent 3747682538
commit 0bb53fdde7
2 files changed
+15 -4

No files matched your search

+12 -1
View File
@@ -2,6 +2,7 @@ import Vue from 'vue'
import { getDefaultState } from './index'
import { findDirectory } from "@/plugins/helpers"
import store from "@/store";
import axios from "axios";
export default {
reset(state) {
@@ -56,10 +57,20 @@ export default {
})
}
if (file.filename === ".mainsail.json" && payload.requestParams.path === "config") {
fetch('//'+store.state.socket.hostname+':'+store.state.socket.port+'/server/files/config/.mainsail.json?time='+Date.now())
.then(res => res.json()).then(file => {
this.commit('gui/setData', file, { root: true })
})
}
if (file.filename === "gui.json" && payload.requestParams.path === "config") {
fetch('//'+store.state.socket.hostname+':'+store.state.socket.port+'/server/files/config/gui.json?time='+Date.now())
.then(res => res.json()).then(file => {
this.commit('gui/setData', file, { root: true });
this.commit('gui/setData', file, { root: true })
this.dispatch('gui/upload', {}, { root: true })
axios.delete('//'+ store.state.socket.hostname+':'+store.state.socket.port +'/server/files/config/gui.json');
})
}
}
+3 -3
View File
@@ -15,7 +15,7 @@ export default {
},
upload({ state, rootState }) {
let file = new File([JSON.stringify({ state })], 'gui.json');
let file = new File([JSON.stringify({ state })], '.mainsail.json');
let formData = new FormData();
formData.append('file', file);
@@ -26,9 +26,9 @@ export default {
headers: { 'Content-Type': 'multipart/form-data' }
}
).then(() => {
window.console.info("gui.json successfully uploaded")
window.console.info(".mainsail.json successfully uploaded")
}).catch(() => {
window.console.error("Error save gui.json!")
window.console.error("Error save .mainsail.json!")
});
},