frequi_origin/src/components/BotList.vue

45 lines
1.3 KiB
Vue
Raw Normal View History

2021-08-29 08:29:53 +00:00
<template>
<div>
<h3>Available bots</h3>
<div v-for="bot in allAvailableBots" :key="bot">
{{ bot }}
2021-08-29 08:54:37 +00:00
<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>
2021-08-29 08:29:53 +00:00
</div>
2021-08-29 08:54:37 +00:00
<LoginModal class="mt-2" login-text="Add new bot" />
2021-08-29 08:29:53 +00:00
</div>
</template>
<script lang="ts">
import { Component, Vue } from 'vue-property-decorator';
import { namespace } from 'vuex-class';
import { MultiBotStoreGetters } from '@/store/modules/botStoreWrapper';
import LoginModal from '@/views/LoginModal.vue';
2021-08-29 08:54:37 +00:00
import EditIcon from 'vue-material-design-icons/Cog.vue';
import DeleteIcon from 'vue-material-design-icons/Delete.vue';
2021-08-29 08:29:53 +00:00
const ftbot = namespace('ftbot');
2021-08-29 08:54:37 +00:00
@Component({ components: { LoginModal, DeleteIcon, EditIcon } })
2021-08-29 08:29:53 +00:00
export default class BotList extends Vue {
@ftbot.Getter [MultiBotStoreGetters.allAvailableBots]: string[];
2021-08-29 08:54:37 +00:00
@ftbot.Action removeBot;
clickRemoveBot(botId) {
2021-08-29 08:29:53 +00:00
//
2021-08-29 08:54:37 +00:00
this.$bvModal.msgBoxConfirm(`Really remove (logout) from ${botId}?`).then((value: boolean) => {
if (value) {
this.removeBot(botId);
}
});
2021-08-29 08:29:53 +00:00
}
}
</script>
<style scoped></style>