bugfix: change gui.json to .mainsail.json
Signed-off-by: Stefan Dej <meteyou@gmail.com>
This commit is contained in:
1 parent
3747682538
commit
0bb53fdde7
2 files changed
+15
-4
No files matched your search
@@ -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');
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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!")
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
Reference in new issue
Block a user