Added versions and minor cleanup
This commit is contained in:
24
tubio-frontend-nuxt-app/store/serverVersion.js
Normal file
24
tubio-frontend-nuxt-app/store/serverVersion.js
Normal file
@@ -0,0 +1,24 @@
|
||||
import axios from 'axios';
|
||||
|
||||
export const state = () => ({
|
||||
serverVersion: -1
|
||||
});
|
||||
|
||||
export const mutations = {
|
||||
update(state, data) {
|
||||
state.serverVersion = data;
|
||||
},
|
||||
};
|
||||
|
||||
export const actions = {
|
||||
update(context) {
|
||||
axios.post("/api", {
|
||||
request: "get_server_version"
|
||||
})
|
||||
.then(function(response) {
|
||||
if (response.data.status === "OK") {
|
||||
context.commit("update", response.data.server_version);
|
||||
}
|
||||
});
|
||||
},
|
||||
};
|
Reference in New Issue
Block a user