mirror of
https://github.com/freqtrade/frequi.git
synced 2024-11-13 03:33:50 +00:00
Use getter for current locks
This commit is contained in:
parent
8ec31cbb35
commit
833526fee2
|
@ -5,14 +5,15 @@
|
||||||
<b-button class="float-right" size="sm" @click="getLocks">↻</b-button>
|
<b-button class="float-right" size="sm" @click="getLocks">↻</b-button>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<b-table class="table-sm" :items="locks.locks" :fields="tableFields"> </b-table>
|
<b-table class="table-sm" :items="currentLocks" :fields="tableFields"> </b-table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { timestampms } from '@/shared/formatters';
|
import { timestampms } from '@/shared/formatters';
|
||||||
import { LockResponse } from '@/types';
|
import { BotStoreGetters } from '@/store/modules/ftbot';
|
||||||
|
import { Lock } from '@/types';
|
||||||
import { Component, Vue } from 'vue-property-decorator';
|
import { Component, Vue } from 'vue-property-decorator';
|
||||||
import { namespace } from 'vuex-class';
|
import { namespace } from 'vuex-class';
|
||||||
|
|
||||||
|
@ -22,7 +23,7 @@ const ftbot = namespace('ftbot');
|
||||||
export default class PairLockList extends Vue {
|
export default class PairLockList extends Vue {
|
||||||
@ftbot.Action getLocks;
|
@ftbot.Action getLocks;
|
||||||
|
|
||||||
@ftbot.State locks!: LockResponse;
|
@ftbot.Getter [BotStoreGetters.currentLocks]!: Lock;
|
||||||
|
|
||||||
timestampms = timestampms;
|
timestampms = timestampms;
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,7 @@ import {
|
||||||
BalanceInterface,
|
BalanceInterface,
|
||||||
DailyReturnValue,
|
DailyReturnValue,
|
||||||
LockResponse,
|
LockResponse,
|
||||||
|
Lock,
|
||||||
} from '@/types';
|
} from '@/types';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
|
@ -33,6 +34,7 @@ export enum BotStoreGetters {
|
||||||
tradeDetail = 'tradeDetail',
|
tradeDetail = 'tradeDetail',
|
||||||
closedTrades = 'closedTrades',
|
closedTrades = 'closedTrades',
|
||||||
allTrades = 'allTrades',
|
allTrades = 'allTrades',
|
||||||
|
currentLocks = 'currentLocks',
|
||||||
plotConfig = 'plotConfig',
|
plotConfig = 'plotConfig',
|
||||||
plotConfigNames = 'plotConfigNames',
|
plotConfigNames = 'plotConfigNames',
|
||||||
timeframe = 'timeframe',
|
timeframe = 'timeframe',
|
||||||
|
@ -64,7 +66,7 @@ export default {
|
||||||
strategyList: [],
|
strategyList: [],
|
||||||
strategy: {},
|
strategy: {},
|
||||||
pairlist: [],
|
pairlist: [],
|
||||||
locks: [],
|
currentLocks: [],
|
||||||
},
|
},
|
||||||
getters: {
|
getters: {
|
||||||
[BotStoreGetters.plotConfig](state) {
|
[BotStoreGetters.plotConfig](state) {
|
||||||
|
@ -79,6 +81,9 @@ export default {
|
||||||
[BotStoreGetters.allTrades](state): Trade[] {
|
[BotStoreGetters.allTrades](state): Trade[] {
|
||||||
return [...state.openTrades, ...state.trades];
|
return [...state.openTrades, ...state.trades];
|
||||||
},
|
},
|
||||||
|
[BotStoreGetters.currentLocks](state): Lock[] {
|
||||||
|
return state.currentLocks.locks;
|
||||||
|
},
|
||||||
[BotStoreGetters.tradeDetail](state): Trade {
|
[BotStoreGetters.tradeDetail](state): Trade {
|
||||||
let dTrade = state.openTrades.find((item) => item.trade_id === state.detailTradeId);
|
let dTrade = state.openTrades.find((item) => item.trade_id === state.detailTradeId);
|
||||||
if (!dTrade) {
|
if (!dTrade) {
|
||||||
|
@ -102,7 +107,7 @@ export default {
|
||||||
state.openTrades = trades;
|
state.openTrades = trades;
|
||||||
},
|
},
|
||||||
updateLocks(state, locks: LockResponse) {
|
updateLocks(state, locks: LockResponse) {
|
||||||
state.locks = locks;
|
state.currentLocks = locks;
|
||||||
},
|
},
|
||||||
updatePerformance(state, performance) {
|
updatePerformance(state, performance) {
|
||||||
state.performanceStats = performance;
|
state.performanceStats = performance;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user