Improve frontend load performance and fix UME/login UX.

Defer topology xyflow and WebCRT xterm until needed, calm idle polling, bake login earth brightness, and let AI alert rules scroll as one natural panel.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
oliver 2026-08-07 22:54:42 +08:00
parent a0170907e4
commit 9bcb8ee0e3
11 changed files with 906 additions and 663 deletions

View file

@ -89,15 +89,18 @@ export function WorkbenchPage() {
const metricsQuery = useQuery({
queryKey: ["runtimeMetrics"],
queryFn: fetchRuntimeMetrics,
refetchInterval: 5000,
staleTime: 2000,
staleTime: 10_000,
refetchInterval: 15_000,
refetchIntervalInBackground: false,
});
const opsQuery = useQuery({
queryKey: ["opsTasks"],
queryFn: fetchOpsTasks,
refetchInterval: 4000,
staleTime: 1500,
staleTime: 10_000,
// Share AppLayout cache; speed up only while something is active.
refetchInterval: (q) => ((q.state.data?.active ?? 0) > 0 ? 4000 : 20_000),
refetchIntervalInBackground: false,
});
const visibleBySection = useMemo(() => {