29 lines
625 B
JavaScript
29 lines
625 B
JavaScript
/*
|
|
* Copyright (C) Sapphirecode - All Rights Reserved
|
|
* This file is part of appreports which is released under GPL-3.0-or-later.
|
|
* See file 'LICENSE' for full license details.
|
|
* Created by Timo Hocker <timo@scode.ovh>, July 2020
|
|
*/
|
|
|
|
import Vue from 'vue';
|
|
import Vuex from 'vuex';
|
|
|
|
Vue.use (Vuex);
|
|
|
|
export default new Vuex.Store ({
|
|
state: { log: [] },
|
|
mutations: {
|
|
set_log (state, log) {
|
|
state.log = log;
|
|
}
|
|
},
|
|
actions: {
|
|
async get_log ({ commit }) {
|
|
const log = await fetch ('/log')
|
|
.then ((res) => res.json ());
|
|
commit ('set_log', log);
|
|
}
|
|
},
|
|
modules: {}
|
|
});
|