Add possibility for open / closed trades view

This commit is contained in:
Matthias 2021-12-25 10:05:51 +01:00
parent b85241e7c2
commit 5651978902
2 changed files with 17 additions and 4 deletions

View File

@ -48,10 +48,14 @@ const routes: Array<RouteConfig> = [
component: () => import(/* webpackChunkName: "balance" */ '@/components/ftbot/Balance.vue'),
},
{
path: '/trades',
name: 'Freqtrade trade',
path: '/open_trades',
component: () => import(/* webpackChunkName: "balance" */ '@/views/TradesList.vue'),
},
{
path: '/trade_history',
component: () => import(/* webpackChunkName: "balance" */ '@/views/TradesList.vue'),
props: { history: true },
},
{
path: '/settings',
name: 'Freqtrade Settings',

View File

@ -8,7 +8,14 @@
empty-text="Currently no open trades."
/> -->
<CustomTradeList
class="trade-history"
v-if="!history"
:trades="openTrades"
title="Open trades"
:active-trades="true"
empty-text="No open Trades."
/>
<CustomTradeList
v-if="history"
:trades="closedTrades"
title="Trade history"
empty-text="No closed trades so far."
@ -17,7 +24,7 @@
</template>
<script lang="ts">
import { Component, Vue } from 'vue-property-decorator';
import { Component, Prop, Vue } from 'vue-property-decorator';
import { namespace } from 'vuex-class';
import CustomTradeList from '@/components/ftbot/CustomTradeList.vue';
@ -33,6 +40,8 @@ const ftbot = namespace(StoreModules.ftbot);
},
})
export default class Trading extends Vue {
@Prop({ default: false }) history!: boolean;
@ftbot.Getter [BotStoreGetters.openTrades]!: Trade[];
@ftbot.Getter [BotStoreGetters.closedTrades]!: Trade[];