mirror of
https://github.com/freqtrade/frequi.git
synced 2024-11-11 10:43:52 +00:00
38 lines
727 B
JavaScript
38 lines
727 B
JavaScript
import Vue from 'vue'
|
|
import Vuex from 'vuex'
|
|
import axios from 'axios';
|
|
|
|
import ftbotModule from './modules/ftbot';
|
|
|
|
|
|
import { apiBase } from './modules/config';
|
|
|
|
Vue.use(Vuex)
|
|
|
|
export default new Vuex.Store({
|
|
state: {
|
|
ping: 'ddd',
|
|
},
|
|
modules: {
|
|
ftbot: ftbotModule
|
|
},
|
|
mutations: {
|
|
setPing(state, ping) {
|
|
console.log(ping);
|
|
const now = Date(Date.now());
|
|
state.ping = `${ping.status} ${now.toString()}` ;
|
|
}
|
|
},
|
|
actions: {
|
|
ping({ commit }) {
|
|
axios.get(`${apiBase}/ping`)
|
|
.then((result) => commit('setPing', result.data))
|
|
.catch(console.error);
|
|
},
|
|
refresh_all({dispatch}) {
|
|
// Refresh all data
|
|
dispatch('ftbot/getTrades');
|
|
}
|
|
}
|
|
})
|