上下限优化

This commit is contained in:
2026-04-21 17:01:10 +08:00
parent 39020c3171
commit a17543b95c

View File

@@ -278,7 +278,6 @@ const emit = defineEmits(['close', 'save'])
const { controlCheckTask } = usePythonBridge() const { controlCheckTask } = usePythonBridge()
const HOST_LIST_MIN_COUNT_KEY = 'host_list_dialog_min_count' const HOST_LIST_MIN_COUNT_KEY = 'host_list_dialog_min_count'
const HOST_LIST_GATE_ENABLED_KEY = 'host_list_dialog_gate_enabled'
const HOST_LIST_GATE_STATE_KEY = 'host_list_dialog_gate_state' const HOST_LIST_GATE_STATE_KEY = 'host_list_dialog_gate_state'
const HOST_LIST_MONITOR_INTERVAL_MS = 30000 const HOST_LIST_MONITOR_INTERVAL_MS = 30000
@@ -401,7 +400,6 @@ const parsedIds = computed(() => {
watch(() => props.visible, (newVal) => { watch(() => props.visible, (newVal) => {
if (newVal) { if (newVal) {
document.body.style.overflow = 'hidden' document.body.style.overflow = 'hidden'
loadLocalGateConfig()
loadHosts() loadHosts()
loadConfig() loadConfig()
} else { } else {
@@ -510,8 +508,8 @@ const stopHostListMonitor = () => {
const loadLocalGateConfig = () => { const loadLocalGateConfig = () => {
try { try {
const savedGateEnabled = localStorage.getItem(HOST_LIST_GATE_ENABLED_KEY) gateEnabled.value = false
gateEnabled.value = savedGateEnabled === 'true' localStorage.removeItem(HOST_LIST_GATE_ENABLED_KEY)
const savedMinCount = localStorage.getItem(HOST_LIST_MIN_COUNT_KEY) const savedMinCount = localStorage.getItem(HOST_LIST_MIN_COUNT_KEY)
if (savedMinCount !== null && savedMinCount !== '') { if (savedMinCount !== null && savedMinCount !== '') {
@@ -521,12 +519,8 @@ const loadLocalGateConfig = () => {
} }
} }
const savedGateState = localStorage.getItem(HOST_LIST_GATE_STATE_KEY) checkTaskGateState.value = null
if (savedGateState === 'true') { localStorage.removeItem(HOST_LIST_GATE_STATE_KEY)
checkTaskGateState.value = true
} else if (savedGateState === 'false') {
checkTaskGateState.value = false
}
} catch (e) { } catch (e) {
console.error('[HostListDialog] 读取本地门控配置失败:', e) console.error('[HostListDialog] 读取本地门控配置失败:', e)
} }