This commit is contained in:
@@ -3,6 +3,7 @@ import { useNavigate } from 'react-router-dom'
|
||||
import { NavBar, Card, Empty, DotLoading } from 'antd-mobile'
|
||||
import { api } from '../api/client.js'
|
||||
import SwipeTabs from '../components/SwipeTabs.jsx'
|
||||
import useRefreshOnVisible from '../hooks/useRefreshOnVisible.js'
|
||||
|
||||
// 监控页: 两个横向分类
|
||||
// - 主机监控: 实时数据来自 komari (服务端实时代理, 不落库), 点击节点看 24h 时序
|
||||
@@ -74,6 +75,9 @@ function ServerView() {
|
||||
return () => clearInterval(timer)
|
||||
}, [load])
|
||||
|
||||
// 后台回前台时立即静默刷新 (不闪 loading), 优于等下一轮 30s 轮询
|
||||
useRefreshOnVisible(() => load(true))
|
||||
|
||||
return (
|
||||
<div className="server-list">
|
||||
{items === null && <div className="monitor-loading"><DotLoading /> 加载中...</div>}
|
||||
|
||||
Reference in New Issue
Block a user