mirror of
https://github.com/freqtrade/frequi.git
synced 2024-11-23 11:35:14 +00:00
Update BotList to be a proper list
This commit is contained in:
parent
79c6618b2b
commit
a330a39fe0
|
@ -1,7 +1,14 @@
|
|||
<template>
|
||||
<div>
|
||||
<h3>Available bots</h3>
|
||||
<div v-for="bot in allAvailableBots" :key="bot">
|
||||
<b-list-group>
|
||||
<b-list-group-item
|
||||
v-for="bot in allAvailableBots"
|
||||
:key="bot"
|
||||
button
|
||||
:active="bot === selectedBot"
|
||||
@click="selectBot(bot)"
|
||||
>
|
||||
{{ bot }}
|
||||
<b-button class="btn-xs ml-1" size="sm" title="Delete trade" @click="clickRemoveBot(bot)">
|
||||
<EditIcon :size="16" title="Delete trade" />
|
||||
|
@ -9,7 +16,8 @@
|
|||
<b-button class="btn-xs ml-1" size="sm" title="Delete bot" @click="clickRemoveBot(bot)">
|
||||
<DeleteIcon :size="16" title="Delete trade" />
|
||||
</b-button>
|
||||
</div>
|
||||
</b-list-group-item>
|
||||
</b-list-group>
|
||||
<LoginModal class="mt-2" login-text="Add new bot" />
|
||||
</div>
|
||||
</template>
|
||||
|
@ -26,10 +34,14 @@ const ftbot = namespace('ftbot');
|
|||
|
||||
@Component({ components: { LoginModal, DeleteIcon, EditIcon } })
|
||||
export default class BotList extends Vue {
|
||||
@ftbot.Getter [MultiBotStoreGetters.selectedBot]: string;
|
||||
|
||||
@ftbot.Getter [MultiBotStoreGetters.allAvailableBots]: string[];
|
||||
|
||||
@ftbot.Action removeBot;
|
||||
|
||||
@ftbot.Action selectBot;
|
||||
|
||||
clickRemoveBot(botId) {
|
||||
//
|
||||
this.$bvModal.msgBoxConfirm(`Really remove (logout) from ${botId}?`).then((value: boolean) => {
|
||||
|
|
|
@ -89,6 +89,9 @@ export default function createBotStore(store) {
|
|||
commit('selectBot', getters.allAvailableBots[0]);
|
||||
}
|
||||
},
|
||||
selectBot({ commit }, botId: string) {
|
||||
commit('selectBot', botId);
|
||||
},
|
||||
};
|
||||
// Autocreate Actions
|
||||
Object.keys(BotStoreActions).forEach((e) => {
|
||||
|
|
Loading…
Reference in New Issue
Block a user