Move trade view to draggableContainers

This commit is contained in:
Matthias 2020-08-31 20:01:51 +02:00
parent 28b8aee404
commit 21e6ac9c8f
4 changed files with 57 additions and 57 deletions

View File

@ -1,13 +1,15 @@
<template>
<div class="container-fluid">
<div class="row">
<button class="btn-primary col-md-5 m-1" @click="startBot()">Start</button>
<button class="btn-primary col-md-5 m-1" @click="stopBot()">Stop</button>
<button class="btn-primary col-md-5 m-1" @click="stopBuy()">StopBuy</button>
<button class="btn-primary col-md-5 m-1" @click="reloadConfig()">Reload Config</button>
<button class="btn btn-primary btn-sm col-md-5 m-1" @click="startBot()">Start</button>
<button class="btn btn-primary btn-sm col-md-5 m-1" @click="stopBot()">Stop</button>
<button class="btn btn-primary btn-sm col-md-5 m-1" @click="stopBuy()">StopBuy</button>
<button class="btn btn-primary btn-sm col-md-5 m-1" @click="reloadConfig()">
Reload Config
</button>
<button
v-if="botState.forcebuy_enabled"
class="btn-primary col-md-5 m-1"
class="btn btn-primary btn-sm col-md-5 m-1"
@click="initiateForcebuy"
>
Forcebuy

View File

@ -1,8 +1,8 @@
<template>
<div>
<button class="btn btn-secondary" @click="refreshAll()">Refresh all</button>
<button class="btn btn-secondary btn-sm" @click="refreshAll()">Refresh all</button>
<b-form-checkbox v-model="autoRefreshLoc" class="float-right" size="lg" switch
<b-form-checkbox v-model="autoRefreshLoc" class="float-right" size="sm" switch
>AutoRefresh</b-form-checkbox
>
</div>

View File

@ -1,7 +1,6 @@
import { GridItemData } from 'vue-grid-layout';
export enum TradeLayout {
reloadControl = 'g-reloadControl',
botControls = 'g-botControls',
multiPane = 'g-multiPane',
openTrades = 'g-openTrades',
@ -17,8 +16,7 @@ export enum DashboardLayout {
// Define default layouts
const DEFAULT_TRADING_LAYOUT: GridItemData[] = [
{ i: TradeLayout.reloadControl, x: 0, y: 0, w: 4, h: 1 },
{ i: TradeLayout.botControls, x: 0, y: 0, w: 4, h: 3 },
{ i: TradeLayout.botControls, x: 0, y: 0, w: 4, h: 4 },
{ i: TradeLayout.multiPane, x: 0, y: 0, w: 4, h: 7 },
{ i: TradeLayout.openTrades, x: 4, y: 0, w: 8, h: 5 },
{ i: TradeLayout.tradeHistory, x: 4, y: 4, w: 8, h: 6 },

View File

@ -6,15 +6,6 @@
:vertical-compact="false"
@layout-updated="layoutUpdatedEvent"
>
<GridItem
:i="gridLayoutReload.i"
:x="gridLayoutReload.x"
:y="gridLayoutReload.y"
:w="gridLayoutReload.w"
:h="gridLayoutReload.h"
>
<ReloadControl />
</GridItem>
<GridItem
:i="gridLayoutBotControls.i"
:x="gridLayoutBotControls.x"
@ -22,7 +13,10 @@
:w="gridLayoutBotControls.w"
:h="gridLayoutBotControls.h"
>
<BotControls class="mt-3" />
<DraggableContainer header="Bot Controls">
<ReloadControl class="mt-3" />
<BotControls />
</DraggableContainer>
</GridItem>
<GridItem
:i="gridLayoutMultiPane.i"
@ -31,24 +25,26 @@
:w="gridLayoutMultiPane.w"
:h="gridLayoutMultiPane.h"
>
<b-tabs content-class="mt-3" class="mt-3">
<b-tab title="Status" active>
<BotStatus />
</b-tab>
<b-tab title="Performance">
<Performance class="performance-view" />
</b-tab>
<b-tab title="Balance" lazy>
<Balance />
</b-tab>
<b-tab title="Daily Stats" lazy>
<DailyStats />
</b-tab>
<DraggableContainer header="Multi Pane">
<b-tabs content-class="mt-3" class="mt-3">
<b-tab title="Status" active>
<BotStatus />
</b-tab>
<b-tab title="Performance">
<Performance class="performance-view" />
</b-tab>
<b-tab title="Balance" lazy>
<Balance />
</b-tab>
<b-tab title="Daily Stats" lazy>
<DailyStats />
</b-tab>
<b-tab title="Pairlist" lazy>
<FTBotAPIPairList />
</b-tab>
</b-tabs>
<b-tab title="Pairlist" lazy>
<FTBotAPIPairList />
</b-tab>
</b-tabs>
</DraggableContainer>
</GridItem>
<GridItem
:i="gridLayoutOpenTrades.i"
@ -58,13 +54,15 @@
:h="gridLayoutOpenTrades.h"
drag-allow-from=".card-header"
>
<TradeList
class="open-trades"
:trades="openTrades"
title="Open trades"
:active-trades="true"
empty-text="Currently no open trades."
/>
<DraggableContainer header="Open Trades">
<TradeList
class="open-trades"
:trades="openTrades"
title="Open trades"
:active-trades="true"
empty-text="Currently no open trades."
/>
</DraggableContainer>
</GridItem>
<GridItem
:i="gridLayoutTradeHistory.i"
@ -74,14 +72,16 @@
:h="gridLayoutTradeHistory.h"
drag-allow-from=".card-header"
>
<TradeList
v-if="!detailTradeId"
class="trade-history"
:trades="closedTrades"
title="Trade history"
empty-text="No closed trades so far."
/>
<TradeDetail v-if="detailTradeId" :trade="tradeDetail"> </TradeDetail>
<DraggableContainer header="Closed Trades">
<TradeList
v-if="!detailTradeId"
class="trade-history"
:trades="closedTrades"
title="Trade history"
empty-text="No closed trades so far."
/>
<TradeDetail v-if="detailTradeId" :trade="tradeDetail"> </TradeDetail>
</DraggableContainer>
</GridItem>
<GridItem
:i="gridLayoutLogView.i"
@ -90,7 +90,9 @@
:w="gridLayoutLogView.w"
:h="gridLayoutLogView.h"
>
<LogViewer />
<DraggableContainer header="Logs">
<LogViewer />
</DraggableContainer>
</GridItem>
</GridLayout>
</template>
@ -110,6 +112,7 @@ import FTBotAPIPairList from '@/components/ftbot/FTBotAPIPairList.vue';
import TradeDetail from '@/components/ftbot/TradeDetail.vue';
import ReloadControl from '@/components/ftbot/ReloadControl.vue';
import LogViewer from '@/components/ftbot/LogViewer.vue';
import DraggableContainer from '@/components/layout/DraggableContainer.vue';
import { Trade } from '@/types';
import { UserStoreGetters } from '@/store/modules/ftbot';
@ -122,6 +125,7 @@ const layoutNs = namespace('layout');
components: {
GridLayout,
GridItem,
DraggableContainer,
TradeList,
Performance,
BotControls,
@ -151,10 +155,6 @@ export default class Trading extends Vue {
return this.getTradingLayout;
}
get gridLayoutReload(): GridItemData {
return findGridLayout(this.gridLayout, TradeLayout.reloadControl);
}
get gridLayoutBotControls(): GridItemData {
return findGridLayout(this.gridLayout, TradeLayout.botControls);
}