feat: stationVerifyMode
This commit is contained in:
@@ -1,16 +1,30 @@
|
||||
<script setup lang="ts">
|
||||
import { NDivider, NDrawer, NDrawerContent, NFlex, NFormItem, NInputNumber, NText } from 'naive-ui';
|
||||
import { NDivider, NDrawer, NDrawerContent, NFlex, NFormItem, NInputNumber, NRadio, NRadioGroup, NText } from 'naive-ui';
|
||||
import ThemeSwitch from './theme-switch.vue';
|
||||
import { useLayoutStore } from '@/stores/layout';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { onMounted, ref, watch } from 'vue';
|
||||
import axios from 'axios';
|
||||
import type { VersionInfo } from '@/apis/domains/version-info';
|
||||
import { useQueryControlStore } from '@/stores/query-control';
|
||||
import { useQueryClient } from '@tanstack/vue-query';
|
||||
import { STATION_LIST_QUERY_KEY } from '@/constants';
|
||||
import { useUserStore } from '@/stores/user';
|
||||
|
||||
const show = defineModel<boolean>('show');
|
||||
|
||||
const layoutStore = useLayoutStore();
|
||||
const { stationLayoutGridCols } = storeToRefs(layoutStore);
|
||||
const queryControlStore = useQueryControlStore();
|
||||
const { stationVerifyMode } = storeToRefs(queryControlStore);
|
||||
const userStore = useUserStore();
|
||||
|
||||
const queryClient = useQueryClient();
|
||||
watch(stationVerifyMode, () => {
|
||||
queryClient.cancelQueries({ queryKey: [STATION_LIST_QUERY_KEY] });
|
||||
queryClient.invalidateQueries({ queryKey: [STATION_LIST_QUERY_KEY] });
|
||||
queryClient.refetchQueries({ queryKey: [STATION_LIST_QUERY_KEY] });
|
||||
});
|
||||
|
||||
const versionInfo = ref<VersionInfo>({ version: '', buildTime: '' });
|
||||
|
||||
@@ -32,6 +46,15 @@ onMounted(async () => {
|
||||
<NFormItem label="车站列数" label-placement="left">
|
||||
<NInputNumber v-model:value="stationLayoutGridCols" :min="1" :max="10" />
|
||||
</NFormItem>
|
||||
<template v-if="userStore.isSuperAdmin">
|
||||
<NDivider>调试</NDivider>
|
||||
<NFormItem label="车站Ping模式" label-placement="left">
|
||||
<NRadioGroup v-model:value="stationVerifyMode">
|
||||
<NRadio value="concurrent">并发Ping</NRadio>
|
||||
<NRadio value="batch">接口Ping</NRadio>
|
||||
</NRadioGroup>
|
||||
</NFormItem>
|
||||
</template>
|
||||
</NFlex>
|
||||
<template #footer>
|
||||
<NFlex vertical justify="flex-end" align="center" style="width: 100%; font-size: 12px; gap: 4px">
|
||||
|
||||
Reference in New Issue
Block a user