mirror of
https://github.com/freqtrade/frequi.git
synced 2024-11-11 02:33:51 +00:00
Properly sort bots for dashboard
This commit is contained in:
parent
a75a6e2882
commit
1653386da9
|
@ -99,14 +99,17 @@ export class UserService {
|
||||||
public static getAvailableBots(): BotDescriptors {
|
public static getAvailableBots(): BotDescriptors {
|
||||||
const allInfo = UserService.getAllLoginInfos();
|
const allInfo = UserService.getAllLoginInfos();
|
||||||
const response: BotDescriptors = {};
|
const response: BotDescriptors = {};
|
||||||
Object.entries(allInfo).forEach(([k, v], idx) => {
|
Object.keys(allInfo)
|
||||||
response[k] = {
|
.sort((a, b) => (allInfo[a].sortId ?? 0) - (allInfo[b].sortId ?? 0))
|
||||||
botId: k,
|
.forEach((k, idx) => {
|
||||||
botName: v.botName,
|
response[k] = {
|
||||||
botUrl: v.apiUrl,
|
botId: k,
|
||||||
sortId: v.sortId ?? idx,
|
botName: allInfo[k].botName,
|
||||||
};
|
botUrl: allInfo[k].apiUrl,
|
||||||
});
|
sortId: allInfo[k].sortId ?? idx,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user