mirror of
https://github.com/freqtrade/frequi.git
synced 2024-11-11 02:33:51 +00:00
Botentry -> script setup
This commit is contained in:
parent
60620a8103
commit
f9ea16973c
|
@ -54,59 +54,39 @@
|
|||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
<script setup lang="ts">
|
||||
import EditIcon from 'vue-material-design-icons/Pencil.vue';
|
||||
import LoginIcon from 'vue-material-design-icons/Login.vue';
|
||||
import DeleteIcon from 'vue-material-design-icons/Delete.vue';
|
||||
import OnlineIcon from 'vue-material-design-icons/Circle.vue';
|
||||
import LoggedOutIcon from 'vue-material-design-icons/Cancel.vue';
|
||||
import { BotDescriptor } from '@/types';
|
||||
import { defineComponent, computed, ref } from 'vue';
|
||||
import { computed, ref } from 'vue';
|
||||
import { useBotStore } from '@/stores/ftbotwrapper';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'BotEntry',
|
||||
components: {
|
||||
DeleteIcon,
|
||||
EditIcon,
|
||||
LoginIcon,
|
||||
OnlineIcon,
|
||||
LoggedOutIcon,
|
||||
const props = defineProps({
|
||||
bot: { required: true, type: Object as () => BotDescriptor },
|
||||
noButtons: { default: false, type: Boolean },
|
||||
});
|
||||
defineEmits(['edit', 'editLogin']);
|
||||
const botStore = useBotStore();
|
||||
|
||||
const changeEvent = (v) => {
|
||||
botStore.botStores[props.bot.botId].setAutoRefresh(v);
|
||||
};
|
||||
const botRemoveModalVisible = ref(false);
|
||||
|
||||
const confirmRemoveBot = () => {
|
||||
botRemoveModalVisible.value = false;
|
||||
botStore.removeBot(props.bot.botId);
|
||||
console.log('removing bot.');
|
||||
};
|
||||
const autoRefreshLoc = computed({
|
||||
get() {
|
||||
return botStore.botStores[props.bot.botId].autoRefresh;
|
||||
},
|
||||
props: {
|
||||
bot: { required: true, type: Object as () => BotDescriptor },
|
||||
noButtons: { default: false, type: Boolean },
|
||||
},
|
||||
emits: ['edit', 'editLogin'],
|
||||
setup(props) {
|
||||
const botStore = useBotStore();
|
||||
|
||||
const changeEvent = (v) => {
|
||||
botStore.botStores[props.bot.botId].setAutoRefresh(v);
|
||||
};
|
||||
const botRemoveModalVisible = ref(false);
|
||||
|
||||
const confirmRemoveBot = () => {
|
||||
botRemoveModalVisible.value = false;
|
||||
botStore.removeBot(props.bot.botId);
|
||||
console.log('removing bot.');
|
||||
};
|
||||
const autoRefreshLoc = computed({
|
||||
get() {
|
||||
return botStore.botStores[props.bot.botId].autoRefresh;
|
||||
},
|
||||
set() {
|
||||
// pass
|
||||
},
|
||||
});
|
||||
|
||||
return {
|
||||
botStore,
|
||||
changeEvent,
|
||||
autoRefreshLoc,
|
||||
confirmRemoveBot,
|
||||
botRemoveModalVisible,
|
||||
};
|
||||
set() {
|
||||
// pass
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
|
Loading…
Reference in New Issue
Block a user