Add Pairlock view

This commit is contained in:
Matthias 2020-10-24 20:04:01 +02:00
parent 11f967aa05
commit 8ec31cbb35
5 changed files with 47 additions and 2 deletions

View File

@ -0,0 +1,39 @@
<template>
<div>
<div class="mb-2">
<label class="mr-auto h3">Pair Locks</label>
<b-button class="float-right" size="sm" @click="getLocks">&#x21bb;</b-button>
</div>
<div>
<b-table class="table-sm" :items="locks.locks" :fields="tableFields"> </b-table>
</div>
</div>
</template>
<script lang="ts">
import { timestampms } from '@/shared/formatters';
import { LockResponse } from '@/types';
import { Component, Vue } from 'vue-property-decorator';
import { namespace } from 'vuex-class';
const ftbot = namespace('ftbot');
@Component({})
export default class PairLockList extends Vue {
@ftbot.Action getLocks;
@ftbot.State locks!: LockResponse;
timestampms = timestampms;
get tableFields() {
return [
{ key: 'pair', label: 'Pair' },
{ key: 'lock_end_timestamp', label: 'Until', formatter: 'timestampms' },
{ key: 'reason', label: 'Reason' },
];
}
}
</script>
<style scoped></style>

View File

@ -75,6 +75,7 @@ export default new Vuex.Store({
// Refresh data that's needed in near realtime
dispatch('ftbot/getOpenTrades');
dispatch('ftbot/getState');
dispatch('ftbot/getLocks');
},
},
});

View File

@ -64,7 +64,7 @@ export default {
strategyList: [],
strategy: {},
pairlist: [],
currentLocks: [],
locks: [],
},
getters: {
[BotStoreGetters.plotConfig](state) {

View File

@ -29,7 +29,7 @@ export enum LayoutActions {
resetTradingLayout = 'resetTradingLayout',
}
enum LayoutMutations {
export enum LayoutMutations {
setDashboardLayout = 'setDashboardLayout',
setTradingLayout = 'setTradingLayout',
}

View File

@ -45,6 +45,9 @@
<b-tab title="Pairlist" lazy>
<FTBotAPIPairList />
</b-tab>
<b-tab title="Pair Locks" lazy>
<PairLockList />
</b-tab>
</b-tabs>
</DraggableContainer>
</GridItem>
@ -143,6 +146,7 @@ import BotStatus from '@/components/ftbot/BotStatus.vue';
import Balance from '@/components/ftbot/Balance.vue';
import DailyStats from '@/components/ftbot/DailyStats.vue';
import FTBotAPIPairList from '@/components/ftbot/FTBotAPIPairList.vue';
import PairLockList from '@/components/ftbot/PairLockList.vue';
import TradeDetail from '@/components/ftbot/TradeDetail.vue';
import ReloadControl from '@/components/ftbot/ReloadControl.vue';
import LogViewer from '@/components/ftbot/LogViewer.vue';
@ -168,6 +172,7 @@ const layoutNs = namespace('layout');
Balance,
DailyStats,
FTBotAPIPairList,
PairLockList,
TradeDetail,
ReloadControl,
LogViewer,