frequi_origin/src/components/ftbot/ReloadControl.vue

58 lines
1.5 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"
2021-09-26 07:21:53 +00:00
@click="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';
2021-09-26 07:15:06 +00:00
import { MultiBotStoreGetters } from '@/store/modules/botStoreWrapper';
import StoreModules from '@/store/storeSubModules';
2022-04-15 18:09:28 +00:00
import { defineComponent, computed } from '@vue/composition-api';
import { useNamespacedActions, useNamespacedGetters } from 'vuex-composition-helpers';
export default defineComponent({
name: 'ReloadControl',
components: { RefreshIcon },
setup() {
const { globalAutoRefresh } = useNamespacedGetters(StoreModules.ftbot, [
MultiBotStoreGetters.globalAutoRefresh,
]);
const { setGlobalAutoRefresh, allRefreshFull } = useNamespacedActions(StoreModules.ftbot, [
'setGlobalAutoRefresh',
'allRefreshFull',
]);
const autoRefreshLoc = computed({
get() {
return globalAutoRefresh.value;
},
set(newValue: boolean) {
setGlobalAutoRefresh(newValue);
},
});
return {
globalAutoRefresh,
setGlobalAutoRefresh,
allRefreshFull,
autoRefreshLoc,
};
},
});
</script>
<style scoped></style>