From 81972b3a52a082131906d8da0d582bde63aa5147 Mon Sep 17 00:00:00 2001 From: Matthias Date: Fri, 31 Jul 2020 07:17:50 +0200 Subject: [PATCH] Add strategy list --- src/components/ftbot/StrategyList.vue | 45 +++++++++++++++++++++++++++ src/store/modules/ftbot.ts | 10 ++++++ src/views/Graphs.vue | 5 ++- 3 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 src/components/ftbot/StrategyList.vue diff --git a/src/components/ftbot/StrategyList.vue b/src/components/ftbot/StrategyList.vue new file mode 100644 index 00000000..af8471d8 --- /dev/null +++ b/src/components/ftbot/StrategyList.vue @@ -0,0 +1,45 @@ + + + + + diff --git a/src/store/modules/ftbot.ts b/src/store/modules/ftbot.ts index c943d6c2..80a2e65c 100644 --- a/src/store/modules/ftbot.ts +++ b/src/store/modules/ftbot.ts @@ -42,6 +42,7 @@ export default { history: {}, strategyPlotConfig: {}, customPlotConfig: { ...EMPTY_PLOTCONFIG }, + strategyList: [], }, getters: { [BotStoreGetters.openTrades](state) { @@ -97,6 +98,9 @@ export default { setDetailTrade(state, trade: Trade) { state.detailTradeId = trade ? trade.trade_id : null; }, + updateStrategyList(state, list) { + state.strategyList = list; + }, updatePairCandles(state, { pair, timeframe, data }) { state.candleData = { ...state.candleData, [`${pair}__${timeframe}`]: data }; }, @@ -191,6 +195,12 @@ export default { .then((result) => commit('updatePlotConfig', result.data)) .catch(console.error); }, + getStrategyList({ commit }) { + return api + .get('/strategies') + .then((result) => commit('updateStrategyList', result.data)) + .catch(console.error); + }, getPerformance({ commit }) { return api .get('/performance') diff --git a/src/views/Graphs.vue b/src/views/Graphs.vue index 448cc986..37360c60 100644 --- a/src/views/Graphs.vue +++ b/src/views/Graphs.vue @@ -13,6 +13,7 @@
+
@@ -33,11 +34,13 @@ import { Component, Vue } from 'vue-property-decorator'; import { namespace } from 'vuex-class'; import CandleChart from '@/components/ftbot/CandleChart.vue'; import TimeRangeSelect from '@/components/ftbot/TimeRangeSelect.vue'; +import StrategyList from '@/components/ftbot/StrategyList.vue'; import { PairCandlePayload, PairHistoryPayload } from '@/store/types'; const ftbot = namespace('ftbot'); + @Component({ - components: { CandleChart, TimeRangeSelect }, + components: { CandleChart, StrategyList, TimeRangeSelect }, }) export default class Graphs extends Vue { pair = 'XRP/USDT';