frequi_origin/src/components/ftbot/ReloadControl.vue

48 lines
1.0 KiB
Vue
Raw Normal View History

<template>
2021-09-26 07:15:06 +00:00
<div class="d-flex flex-align-center ml-2">
<b-form-checkbox
v-model="autoRefreshLoc"
2021-09-26 07:15:06 +00:00
class="ml-auto float-right my-auto"
title="AutoRefresh"
2021-09-26 07:15:06 +00:00
></b-form-checkbox>
<b-button
class="m-1"
variant="secondary"
2021-09-26 07:15:06 +00:00
size="sm"
title="Auto Refresh All bots"
2022-04-18 11:23:42 +00:00
@click="botStore.allRefreshFull"
2021-09-26 07:15:06 +00:00
>
<RefreshIcon :size="16" />
</b-button>
</div>
</template>
<script lang="ts">
2020-11-13 19:19:16 +00:00
import RefreshIcon from 'vue-material-design-icons/Refresh.vue';
2022-07-07 18:44:19 +00:00
import { defineComponent, computed } from 'vue';
2022-04-18 11:23:42 +00:00
import { useBotStore } from '@/stores/ftbotwrapper';
2022-04-15 18:09:28 +00:00
export default defineComponent({
name: 'ReloadControl',
components: { RefreshIcon },
setup() {
2022-04-18 11:23:42 +00:00
const botStore = useBotStore();
2022-04-15 18:09:28 +00:00
const autoRefreshLoc = computed({
get() {
2022-04-18 11:23:42 +00:00
return botStore.globalAutoRefresh;
2022-04-15 18:09:28 +00:00
},
set(newValue: boolean) {
2022-04-18 11:23:42 +00:00
botStore.setGlobalAutoRefresh(newValue);
2022-04-15 18:09:28 +00:00
},
});
return {
2022-04-18 11:23:42 +00:00
botStore,
2022-04-15 18:09:28 +00:00
autoRefreshLoc,
};
},
});
</script>
<style scoped></style>