frequi_origin/src/components/ftbot/DailyStats.vue

37 lines
856 B
Vue
Raw Normal View History

2020-05-17 18:43:19 +00:00
<template>
2020-05-22 18:04:27 +00:00
<div>
<div class="mb-2">
<label class="mr-auto h3">Daily Stats</label>
<b-button class="float-right" size="sm" @click="getDaily">R</b-button>
</div>
2020-05-22 18:04:27 +00:00
<div>
2020-06-04 18:06:58 +00:00
<b-table class="table-sm" :items="dailyStats.data" :fields="dailyFields"> </b-table>
</div>
2020-05-17 18:43:19 +00:00
</div>
</template>
<script>
import { mapActions, mapState } from 'vuex';
export default {
name: 'DailyStats',
computed: {
...mapState('ftbot', ['dailyStats']),
2020-06-04 18:06:58 +00:00
dailyFields() {
2020-05-17 18:43:19 +00:00
return [
{ key: 'date', label: 'Day' },
{ key: 'abs_profit', label: 'Profit' },
{ key: 'fiat_value', label: `In ${this.dailyStats.fiat_display_currency}` },
{ key: 'trade_count', label: 'Trades' },
];
},
},
methods: {
...mapActions('ftbot', ['getDaily']),
},
mounted() {
this.getDaily();
},
};
</script>