mirror of
https://github.com/freqtrade/frequi.git
synced 2024-11-10 02:11:57 +00:00
Show freqtrade bot version
This commit is contained in:
parent
303b036d89
commit
0a20b69dda
|
@ -1,5 +1,8 @@
|
|||
<template>
|
||||
<div>
|
||||
<p>
|
||||
Running Freqtrade <strong>{{ version }}</strong>
|
||||
</p>
|
||||
<p v-if="profit.profit_all_coin">
|
||||
Avg Profit {{ profit.profit_all_coin.toFixed(2) }}% in {{ profit.trade_count }} Trades, with
|
||||
an average duration of {{ profit.avg_duration }}. Best pair: {{ profit.best_pair }}.
|
||||
|
@ -36,7 +39,7 @@ import { mapState } from 'vuex';
|
|||
export default {
|
||||
name: 'BotStatus',
|
||||
computed: {
|
||||
...mapState('ftbot', ['profit', 'botState']),
|
||||
...mapState('ftbot', ['version', 'profit', 'botState']),
|
||||
},
|
||||
methods: {
|
||||
formatTimestamp(timestamp) {
|
||||
|
|
|
@ -22,6 +22,9 @@ export default new Vuex.Store({
|
|||
},
|
||||
},
|
||||
actions: {
|
||||
refreshOnce({ dispatch }) {
|
||||
dispatch('ftbot/getVersion');
|
||||
},
|
||||
refreshAll({ dispatch }) {
|
||||
dispatch('refreshFrequent');
|
||||
dispatch('refreshSlow');
|
||||
|
|
|
@ -3,6 +3,7 @@ import { api } from '@/shared/apiService';
|
|||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
version: '',
|
||||
trades: [],
|
||||
openTrades: [],
|
||||
trade_count: 0,
|
||||
|
@ -54,6 +55,9 @@ export default {
|
|||
updateState(state, botState) {
|
||||
state.botState = botState;
|
||||
},
|
||||
updateVersion(state, version) {
|
||||
state.version = version.version;
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
ping({ commit }) {
|
||||
|
@ -117,6 +121,12 @@ export default {
|
|||
.then((result) => commit('updateState', result.data))
|
||||
.catch(console.error);
|
||||
},
|
||||
getVersion({ commit }) {
|
||||
return api
|
||||
.get('/version')
|
||||
.then((result) => commit('updateVersion', result.data))
|
||||
.catch(console.error);
|
||||
},
|
||||
// Post methods
|
||||
// TODO: Migrate calls to API to a seperate module unrelated to vuex?
|
||||
startBot() {
|
||||
|
|
|
@ -75,6 +75,7 @@ export default {
|
|||
FTBotAPIPairList,
|
||||
},
|
||||
created() {
|
||||
this.refreshOnce();
|
||||
this.refreshAll();
|
||||
},
|
||||
data() {
|
||||
|
@ -89,7 +90,7 @@ export default {
|
|||
...mapGetters('ftbot', ['openTrades', 'closedtrades']),
|
||||
},
|
||||
methods: {
|
||||
...mapActions(['refreshSlow', 'refreshFrequent', 'refreshAll']),
|
||||
...mapActions(['refreshSlow', 'refreshFrequent', 'refreshAll', 'refreshOnce']),
|
||||
// ...mapActions('ftbot', ['getTrades', 'getProfit', 'getState']),
|
||||
startRefresh() {
|
||||
console.log('Starting automatic refresh.');
|
||||
|
|
Loading…
Reference in New Issue
Block a user