Fix table column formatting

This commit is contained in:
Matthias 2020-08-17 19:55:43 +02:00
parent 9e77a4cdba
commit bf1495b26c
2 changed files with 6 additions and 6 deletions

View File

@ -3,11 +3,11 @@
<ValuePair description="TradeId">{{ trade.trade_id }}</ValuePair> <ValuePair description="TradeId">{{ trade.trade_id }}</ValuePair>
<ValuePair description="Pair">{{ trade.pair }}</ValuePair> <ValuePair description="Pair">{{ trade.pair }}</ValuePair>
<ValuePair description="Stoploss"> <ValuePair description="Stoploss">
{{ formatPercent(trade.stop_loss_pct / 100) }} | {{ formatPercent(trade.stop_loss_ratio) }} |
{{ formatPrice(trade.stop_loss) }} {{ formatPrice(trade.stop_loss) }}
</ValuePair> </ValuePair>
<ValuePair description="Initial Stoploss"> <ValuePair description="Initial Stoploss">
{{ formatPercent(trade.initial_stop_loss_pct / 100) }} | {{ formatPercent(trade.initial_stop_loss_ratio) }} |
{{ formatPrice(trade.initial_stop_loss) }} {{ formatPrice(trade.initial_stop_loss) }}
</ValuePair> </ValuePair>
<ValuePair description="Current stoploss dist"> <ValuePair description="Current stoploss dist">
@ -26,7 +26,7 @@
{{ timestampms(trade.stoploss_last_update_timestamp) }} {{ timestampms(trade.stoploss_last_update_timestamp) }}
</ValuePair> </ValuePair>
<ValuePair description="Current profit" v-if="trade.current_profit_abs"> <ValuePair description="Current profit" v-if="trade.current_profit_abs">
{{ trade.current_profit_abs }} {{ trade.current_profit_abs }} ({{ formatPercent(trade.current_profit) }})
</ValuePair> </ValuePair>
</b-card> </b-card>
</template> </template>

View File

@ -72,6 +72,8 @@ export default class TradeList extends Vue {
currentPage = 1; currentPage = 1;
formatPercent = formatPercent;
get rows(): number { get rows(): number {
return this.trades.length; return this.trades.length;
} }
@ -90,7 +92,7 @@ export default class TradeList extends Vue {
}, },
{ {
key: this.activeTrades ? 'current_profit' : 'close_profit', key: this.activeTrades ? 'current_profit' : 'close_profit',
label: this.activeTrades ? 'Current profit' : 'Profit', label: this.activeTrades ? 'Current profit %' : 'Profit %',
formatter: 'formatPercent', formatter: 'formatPercent',
}, },
{ key: 'open_date', label: 'Open date' }, { key: 'open_date', label: 'Open date' },
@ -98,8 +100,6 @@ export default class TradeList extends Vue {
...(this.activeTrades ? [{ key: 'actions' }] : []), ...(this.activeTrades ? [{ key: 'actions' }] : []),
]; ];
formatPercent;
profitSymbol(item) { profitSymbol(item) {
// Red arrow / green circle // Red arrow / green circle
return item.close_profit < 0 || item.current_profit < 0 ? `&#x1F534;` : `&#x1F7E2;`; return item.close_profit < 0 || item.current_profit < 0 ? `&#x1F534;` : `&#x1F7E2;`;