mirror of
https://github.com/freqtrade/frequi.git
synced 2024-11-23 11:35:14 +00:00
Fix error when 2 trade-id's collide in dashboard
This commit is contained in:
parent
d8d9caf9d9
commit
25e0bace6d
|
@ -11,7 +11,7 @@
|
||||||
:empty-text="emptyText"
|
:empty-text="emptyText"
|
||||||
:per-page="perPage"
|
:per-page="perPage"
|
||||||
:current-page="currentPage"
|
:current-page="currentPage"
|
||||||
primary-key="trade_id"
|
primary-key="botTradeId"
|
||||||
selectable
|
selectable
|
||||||
select-mode="single"
|
select-mode="single"
|
||||||
:filter="filterText"
|
:filter="filterText"
|
||||||
|
|
|
@ -92,7 +92,6 @@ export default function createBotStore(store) {
|
||||||
getters.allAvailableBotsList.forEach((botId) => {
|
getters.allAvailableBotsList.forEach((botId) => {
|
||||||
const trades = getters[`${botId}/${BotStoreGetters.openTrades}`].map((t) => ({
|
const trades = getters[`${botId}/${BotStoreGetters.openTrades}`].map((t) => ({
|
||||||
...t,
|
...t,
|
||||||
botId,
|
|
||||||
}));
|
}));
|
||||||
|
|
||||||
resp = resp.concat(trades);
|
resp = resp.concat(trades);
|
||||||
|
|
|
@ -514,6 +514,11 @@ export function createBotSubStore(botId: string) {
|
||||||
} while (trades.length !== totalTrades);
|
} while (trades.length !== totalTrades);
|
||||||
}
|
}
|
||||||
const tradesCount = trades.length;
|
const tradesCount = trades.length;
|
||||||
|
// Add botId to all trades
|
||||||
|
trades = trades.map((t) => ({
|
||||||
|
...t,
|
||||||
|
botTradeId: `${botId}__${t.trade_id}`,
|
||||||
|
}));
|
||||||
commit('updateTrades', { trades, tradesCount });
|
commit('updateTrades', { trades, tradesCount });
|
||||||
return Promise.resolve();
|
return Promise.resolve();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
@ -564,7 +569,12 @@ export function createBotSubStore(botId: string) {
|
||||||
// dispatch('refreshSlow', null, { root: true });
|
// dispatch('refreshSlow', null, { root: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
commit('updateOpenTrades', result.data);
|
const openTrades = result.data.map((t) => ({
|
||||||
|
...t,
|
||||||
|
botTradeId: `${botId}__${t.trade_id}`,
|
||||||
|
}));
|
||||||
|
|
||||||
|
commit('updateOpenTrades', openTrades);
|
||||||
})
|
})
|
||||||
.catch(console.error);
|
.catch(console.error);
|
||||||
},
|
},
|
||||||
|
|
|
@ -53,8 +53,8 @@ const DEFAULT_TRADING_LAYOUT: GridItemData[] = [
|
||||||
const DEFAULT_DASHBOARD_LAYOUT: GridItemData[] = [
|
const DEFAULT_DASHBOARD_LAYOUT: GridItemData[] = [
|
||||||
{ i: DashboardLayout.KPI, x: 0, y: 0, w: 4, h: 6 },
|
{ i: DashboardLayout.KPI, x: 0, y: 0, w: 4, h: 6 },
|
||||||
{ i: DashboardLayout.dailyChart, x: 4, y: 0, w: 4, h: 6 },
|
{ i: DashboardLayout.dailyChart, x: 4, y: 0, w: 4, h: 6 },
|
||||||
{ i: DashboardLayout.botComparison, x: 0, y: 6, w: 6, h: 4 } /* Bot Comparison */,
|
{ i: DashboardLayout.botComparison, x: 0, y: 6, w: 6, h: 6 } /* Bot Comparison */,
|
||||||
{ i: DashboardLayout.allOpenTrades, x: 6, y: 6, w: 6, h: 4 },
|
{ i: DashboardLayout.allOpenTrades, x: 6, y: 6, w: 6, h: 6 },
|
||||||
{ i: DashboardLayout.cumChartChart, x: 8, y: 0, w: 4, h: 6 },
|
{ i: DashboardLayout.cumChartChart, x: 8, y: 0, w: 4, h: 6 },
|
||||||
{ i: DashboardLayout.tradesLogChart, x: 0, y: 12, w: 12, h: 4 },
|
{ i: DashboardLayout.tradesLogChart, x: 0, y: 12, w: 12, h: 4 },
|
||||||
];
|
];
|
||||||
|
|
|
@ -3,7 +3,7 @@ export interface Trade {
|
||||||
* BotId - only available on "all" methods.
|
* BotId - only available on "all" methods.
|
||||||
* corresponds to the UI (ftbot.1) - does NOT relate to the backend
|
* corresponds to the UI (ftbot.1) - does NOT relate to the backend
|
||||||
*/
|
*/
|
||||||
botId: string;
|
botTradeId: string;
|
||||||
trade_id: number;
|
trade_id: number;
|
||||||
pair: string;
|
pair: string;
|
||||||
is_open: boolean;
|
is_open: boolean;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user