Add landing page, fix type errors, mark dynamic API route, and refactor user portrait page. Co-authored-by: null <4804959+fnvtk@users.noreply.github.com>
59 lines
1012 B
TypeScript
59 lines
1012 B
TypeScript
export type DeviceStatus = "online" | "offline" | "unknown"
|
|
|
|
export interface Device {
|
|
id: string
|
|
name: string
|
|
wechatId?: string
|
|
group?: string
|
|
tags?: string[]
|
|
status: DeviceStatus
|
|
lastSeen?: string
|
|
}
|
|
|
|
export interface CreateDeviceParams {
|
|
name: string
|
|
wechatId?: string
|
|
group?: string
|
|
tags?: string[]
|
|
}
|
|
|
|
export interface UpdateDeviceParams extends Partial<CreateDeviceParams> {
|
|
id: string
|
|
}
|
|
|
|
export interface QueryDeviceParams {
|
|
keyword?: string
|
|
tags?: string[]
|
|
dateRange?: { start: string; end: string }
|
|
page?: number
|
|
pageSize?: number
|
|
}
|
|
|
|
export interface DeviceStats {
|
|
id: string
|
|
tasksToday: number
|
|
uptimePercent: number
|
|
}
|
|
|
|
export interface DeviceTaskRecord {
|
|
id: string
|
|
deviceId: string
|
|
type: string
|
|
status: "success" | "failed"
|
|
time: string
|
|
}
|
|
|
|
export interface PaginatedResponse<T> {
|
|
items: T[]
|
|
total: number
|
|
page: number
|
|
pageSize: number
|
|
totalPages: number
|
|
}
|
|
|
|
export interface ApiResponse<T> {
|
|
code: number
|
|
message: string
|
|
data: T | null
|
|
}
|