added ui save message on settings save

This commit is contained in:
ori agranat
2019-11-09 21:26:02 +02:00
parent 1198e2cf99
commit ee618f6d86
4 changed files with 28 additions and 7 deletions

View File

@@ -61,7 +61,6 @@
}
},
data: () => ({
saveSnackbar: false,
timer: undefined
}),
created() {
@@ -78,6 +77,16 @@
console.error('error: ' + data.data + " , " + error);
}
}
},
computed: {
saveSnackbar: {
get() {
return this.$store.state.saveBar;
},
set(value) {
this.$store.commit("saveBar", value);
}
}
}
};
</script>

View File

@@ -48,7 +48,8 @@ export default new Vuex.Store({
currentPipelineIndex: 0,
cameraList: [],
pipelineList: [],
point: {}
point: {},
saveBar: false
},
mutations: {
settings: set('settings'),
@@ -66,7 +67,8 @@ export default new Vuex.Store({
Vue.set(state.pipeline, i, obj[i]);
}
},
driverMode: set('driverMode')
driverMode: set('driverMode'),
saveBar: set("saveBar")
},
actions: {
settings: state => state.settings,
@@ -79,6 +81,7 @@ export default new Vuex.Store({
cameraList: state => state.cameraList,
pipelineList: state => state.pipelineList,
point: state => state.point,
driverMode: state => state.driverMode
driverMode: state => state.driverMode,
saveBar: state => state.saveBar
}
})

View File

@@ -24,7 +24,14 @@
},
methods: {
sendCameraSettings() {
this.handleInput('cameraSettings', this.cameraSettings);
const self = this;
this.axios.post("http://" + this.$address + "/api/settings/camera", this.cameraSettings).then(
function (response) {
if (response.status === 200){
self.$store.state.saveBar = true;
}
}
)
},
},

View File

@@ -29,10 +29,12 @@
},
methods: {
sendGeneralSettings() {
// this.handleInput('generalSettings', this.settings);
const self = this;
this.axios.post("http://" + this.$address + "/api/settings/general", this.settings).then(
function (response) {
console.log(response);
if (response.status === 200){
self.$store.state.saveBar = true;
}
}
)
}