Add Dashboard view

This commit is contained in:
Matthias 2020-08-17 21:16:27 +02:00
parent f2668c852a
commit 69a7a7f91e
3 changed files with 50 additions and 0 deletions

View File

@ -11,6 +11,7 @@
<b-collapse id="nav-collapse" is-nav> <b-collapse id="nav-collapse" is-nav>
<b-navbar-nav> <b-navbar-nav>
<b-nav-item to="/trade">Trade</b-nav-item> <b-nav-item to="/trade">Trade</b-nav-item>
<b-nav-item to="/dashboard">Dashboard</b-nav-item>
<b-nav-item to="/about">About</b-nav-item> <b-nav-item to="/about">About</b-nav-item>
<BootswatchThemeSelect /> <BootswatchThemeSelect />
</b-navbar-nav> </b-navbar-nav>

View File

@ -24,6 +24,14 @@ const routes: Array<RouteConfig> = [
// which is lazy-loaded when the route is visited. // which is lazy-loaded when the route is visited.
component: () => import(/* webpackChunkName: "about" */ '@/views/Trading.vue'), component: () => import(/* webpackChunkName: "about" */ '@/views/Trading.vue'),
}, },
{
path: '/dashboard',
name: 'Freqtrade Dashboard',
// route level code-splitting
// this generates a separate chunk (about.[hash].js) for this route
// which is lazy-loaded when the route is visited.
component: () => import(/* webpackChunkName: "about" */ '@/views/Dashboard.vue'),
},
{ {
path: '/about', path: '/about',
name: 'About', name: 'About',

41
src/views/Dashboard.vue Normal file
View File

@ -0,0 +1,41 @@
<template>
<div>
<DailyChart v-if="dailyStats.data" :dailyStats="dailyStats" />
<HourlyChart :trades="closedTrades" />
</div>
</template>
<script lang="ts">
import { Component, Vue } from 'vue-property-decorator';
import { namespace } from 'vuex-class';
import DailyChart from '@/components/charts/DailyChart.vue';
import HourlyChart from '@/components/charts/HourlyChart.vue';
import { Trade, DailyReturnValue } from '@/store/types';
const ftbot = namespace('ftbot');
@Component({
components: {
DailyChart,
HourlyChart,
},
})
export default class Trading extends Vue {
@ftbot.Getter closedTrades!: Array<Trade>;
@ftbot.State dailyStats!: DailyReturnValue;
@ftbot.Action getDaily;
@ftbot.Action getTrades;
mounted() {
this.getDaily();
this.getTrades();
}
}
</script>
<style scoped></style>