feat: Dashboard with summary cards, health distribution, gateway trend, global search
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,63 @@
|
||||
import client from './client'
|
||||
|
||||
export interface SummaryData {
|
||||
online_count: number
|
||||
offline_count: number
|
||||
total_profiles: number
|
||||
running_tasks: number
|
||||
cron_failures_today: number
|
||||
updated_at: string
|
||||
}
|
||||
|
||||
export interface HealthDistribution {
|
||||
A: number
|
||||
B: number
|
||||
C: number
|
||||
D: number
|
||||
total: number
|
||||
d_profiles: string[]
|
||||
}
|
||||
|
||||
export interface GatewayTrendItem {
|
||||
hour: string
|
||||
restarts: number
|
||||
feishu_disconnects: number
|
||||
heartbeat_timeouts: number
|
||||
}
|
||||
|
||||
export interface KanbanSummaryItem {
|
||||
board: string
|
||||
running: string | null
|
||||
ready: string | null
|
||||
}
|
||||
|
||||
export interface CronRecentItem {
|
||||
job: string
|
||||
status: string
|
||||
time?: string
|
||||
}
|
||||
|
||||
export interface SearchResult {
|
||||
profiles: { name: string; status: string }[]
|
||||
kanban_tasks: { title: string; column: string }[]
|
||||
cron_jobs: { job: string; status: string }[]
|
||||
events: { title: string; status: string }[]
|
||||
}
|
||||
|
||||
export const getDashboardSummary = () =>
|
||||
client.get<SummaryData>('/dashboard/summary')
|
||||
|
||||
export const getHealthDistribution = () =>
|
||||
client.get<HealthDistribution>('/dashboard/health-distribution')
|
||||
|
||||
export const getGatewayTrend = () =>
|
||||
client.get<GatewayTrendItem[]>('/dashboard/gateway-trend')
|
||||
|
||||
export const getKanbanSummary = () =>
|
||||
client.get<KanbanSummaryItem[]>('/dashboard/kanban-summary')
|
||||
|
||||
export const getCronRecent = () =>
|
||||
client.get<CronRecentItem[]>('/dashboard/cron-recent')
|
||||
|
||||
export const globalSearch = (q: string) =>
|
||||
client.get<SearchResult>('/search', { params: { q } })
|
||||
Reference in New Issue
Block a user