1
0
Files
DiAL/src/shared/api.ts
lanyuanxiaoyao 3fa1b3957e refactor: 项目更名为 DiAL(统一拨测平台)
将 gateway-checker/Gateway Checker 统一替换为 dial-server/DiAL
- 包名、可执行文件名、API service 标识改为 dial-server
- UI 标题改为 DiAL,副标题改为统一拨测平台
- 同步更新测试断言、构建脚本、示例配置和文档
2026-05-11 22:23:17 +08:00

74 lines
1.3 KiB
TypeScript

export type RuntimeMode = "development" | "production" | "test";
export interface HealthResponse {
ok: true;
service: "dial-server";
timestamp: string;
}
export interface ApiErrorResponse {
error: string;
status: number;
}
export interface SummaryResponse {
total: number;
up: number;
down: number;
lastCheckTime: string | null;
}
export interface RecentSample {
timestamp: string;
durationMs: number | null;
up: boolean;
}
export interface TargetStatus {
id: number;
name: string;
type: string;
target: string;
group: string;
interval: string;
latestCheck: CheckResult | null;
stats: TargetStats;
recentSamples: RecentSample[];
}
export interface TargetStats {
totalChecks: number;
availability: number;
}
export interface HistoryResponse {
items: CheckResult[];
total: number;
page: number;
pageSize: number;
}
export interface CheckResult {
timestamp: string;
matched: boolean;
durationMs: number | null;
statusDetail: string | null;
failure: CheckFailure | null;
}
export interface CheckFailure {
kind: "error" | "mismatch";
phase: string;
path: string;
expected?: unknown;
actual?: unknown;
message: string;
}
export interface TrendPoint {
hour: string;
avgDurationMs: number | null;
availability: number;
totalChecks: number;
}