// Dashboard 统计数据 // 从 services/api.ts 拆分 — Q3 api.ts 模块化 import { http } from '../http'; import { isOnline, timeAgo, asList } from '../../components/agent/agentUtils'; export const dashboardStatsApi = { getStats: async () => { return http.get('/dashboard/stats'); }, getAlerts: async (limit?: number) => { return http.get('/dashboard/recent-alerts', limit ? { limit } : undefined); }, getReleases: async (limit?: number) => { return http.get('/dashboard/recent-releases', limit ? { limit } : undefined); }, getMetrics: async (hours?: number) => { return http.get('/dashboard/metrics', hours ? { hours } : undefined); }, }; // ==================== 服务器管理 API ====================