2
0

fix:历史记录界面后端对接

This commit is contained in:
zhongzm
2024-12-18 17:24:26 +08:00
parent 7cf6249fd8
commit a6342d7036
8 changed files with 327 additions and 216 deletions

150
src/typings/api.d.ts vendored
View File

@@ -435,4 +435,154 @@ declare namespace Api {
type DictList = Common.PaginatingQueryRecord<Dict>;
}
/**
* Namespace Dashboard
*
* Backend api module: "dashboard"
*/
namespace Dashboard {
/** Dashboard gauge data */
interface GaugeData {
/** Remaining credit amount */
remainingCredit: number;
/** Used credit amount */
usedCredit: number;
/** Remaining flow amount (MB) */
remainingFlow: number;
/** Used flow amount (MB) */
usedFlow: number;
/** Current traffic rate (MB/s) */
trafficRate: number;
/** Peak traffic rate (MB/s) */
peakTrafficRate: number;
}
}
/**
* Namespace Device
*
* Backend api module: "device"
*/
namespace Device {
/** Device information */
interface DeviceInfo {
/** Device unique key */
key: string;
/** Device name */
deviceName: string;
/** MAC address */
macAddress: string;
/** Current speed */
speed: string;
}
/** Device list response */
interface DeviceListResponse {
/** List of devices */
rows: DeviceInfo[];
/** Total count */
total: number;
}
/** Historical device information */
interface HistoricalDeviceInfo {
/** Device unique key */
key: string;
/** Device name */
deviceName: string;
/** MAC address */
macAddress: string;
/** Connection time */
connectionTime: string;
/** Disconnection time */
disconnectionTime: string;
/** Data usage */
dataUsage: string;
}
/** Historical device list response */
interface HistoricalDeviceListResponse {
/** List of historical devices */
rows: HistoricalDeviceInfo[];
/** Total count */
total: number;
}
interface DeviceInfo {
id: number;
clientName: string;
clientMac: string;
clientDeviceType: string;
activity: number;
}
interface DeviceResponse {
total: number;
rows: DeviceInfo[];
}
interface HistoricalDeviceInfo {
id: number;
clientName: string;
clientMac: string;
startTime: number; // 时间戳
endTime: number; // 时间戳
duration: number; // 流量使用量(bytes)
}
interface HistoricalDeviceResponse {
total: number;
rows: HistoricalDeviceInfo[];
}
}
namespace CDR {
/** CDR record information */
interface CDRRecord {
/** Record ID */
id: number;
/** AP name */
ap_name: string;
/** Upload traffic */
traffic_up: number;
/** Download traffic */
traffic_down: number;
/** Up time */
up_time: string;
/** Last seen time */
last_seen_time: string;
}
interface CDRRecord {
/** Record ID */
id: number;
/** Client name */
clientName: string;
/** Client MAC address */
clientMac: string;
/** Upload traffic in bytes */
trafficUp: number;
/** Download traffic in bytes */
trafficDown: number;
/** Start time timestamp */
startTime: number;
/** End time timestamp */
endTime: number;
}
/** CDR record list response */
interface CDRListResponse {
/** List of CDR records */
rows: CDRRecord[];
/** Total count */
total: number;
}
/** CDR query params */
interface CDRQueryParams {
/** Page number */
pageNum: number;
/** Page size */
pageSize: number;
}
}
}