mirror of
https://github.com/freqtrade/frequi.git
synced 2024-11-27 05:25:17 +00:00
Update BotList to be a proper list
This commit is contained in:
parent
79c6618b2b
commit
a330a39fe0
|
@ -1,15 +1,23 @@
|
|||
<template>
|
||||
<div>
|
||||
<h3>Available bots</h3>
|
||||
<div v-for="bot in allAvailableBots" :key="bot">
|
||||
{{ bot }}
|
||||
<b-button class="btn-xs ml-1" size="sm" title="Delete trade" @click="clickRemoveBot(bot)">
|
||||
<EditIcon :size="16" title="Delete trade" />
|
||||
</b-button>
|
||||
<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>
|
||||
<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" />
|
||||
</b-button>
|
||||
<b-button class="btn-xs ml-1" size="sm" title="Delete bot" @click="clickRemoveBot(bot)">
|
||||
<DeleteIcon :size="16" title="Delete trade" />
|
||||
</b-button>
|
||||
</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