refactor(ops): 简化自动刷新定时器逻辑

- 合并双定时器为单一倒计时定时器
- 倒计时归零时触发数据刷新
- 添加自定义时间范围的安全回退
This commit is contained in:
IanShaw027
2026-01-15 22:07:23 +08:00
parent a478822b8e
commit 8b95d16220
4 changed files with 44 additions and 24 deletions

View File

@@ -414,7 +414,17 @@ const handleScroll = () => {
menu.show = false
}
onMounted(async () => { load(); try { const [p, g] = await Promise.all([adminAPI.proxies.getAll(), adminAPI.groups.getAll()]); proxies.value = p; groups.value = g } catch (error) { console.error('Failed to load proxies/groups:', error) } window.addEventListener('scroll', handleScroll, true) })
onMounted(async () => {
load()
try {
const [p, g] = await Promise.all([adminAPI.proxies.getAll(), adminAPI.groups.getAll()])
proxies.value = p
groups.value = g
} catch (error) {
console.error('Failed to load proxies/groups:', error)
}
window.addEventListener('scroll', handleScroll, true)
})
onUnmounted(() => {
window.removeEventListener('scroll', handleScroll, true)