refactor: 重构项目结构
- 优化 `车站-设备-告警` 轮询机制 - 改进设备卡片的布局 - 支持修改设备 - 告警轮询中获取完整告警数据 - 车站告警详情支持导出完整的 `今日告警列表` - 支持将状态持久化到 `IndexedDB` - 新增轮询控制 (调试模式) - 新增离线开发模式 (调试模式) - 新增 `IndexedDB` 数据控制 (调试模式)
This commit is contained in:
6
src/apis/domain/biz/diag/index.ts
Normal file
6
src/apis/domain/biz/diag/index.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
export * from './ndm-camera-diag-info';
|
||||
export * from './ndm-decoder-diag-info';
|
||||
export * from './ndm-nvr-diag-info';
|
||||
export * from './ndm-security-box-diag-info';
|
||||
export * from './ndm-server-diag-info';
|
||||
export * from './ndm-switch-diag-info';
|
||||
5
src/apis/domain/biz/diag/ndm-camera-diag-info.ts
Normal file
5
src/apis/domain/biz/diag/ndm-camera-diag-info.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
export interface NdmCameraDiagInfo {
|
||||
[key: string]: any;
|
||||
logTime?: string;
|
||||
info?: string;
|
||||
}
|
||||
14
src/apis/domain/biz/diag/ndm-decoder-diag-info.ts
Normal file
14
src/apis/domain/biz/diag/ndm-decoder-diag-info.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
export interface NdmDecoderDiagInfo {
|
||||
[key: string]: any;
|
||||
logTime?: string;
|
||||
stCommonInfo?: {
|
||||
设备ID?: string;
|
||||
软件版本?: string;
|
||||
设备厂商?: string;
|
||||
设备别名?: string;
|
||||
设备型号?: string;
|
||||
硬件版本?: string;
|
||||
内存使用率?: string;
|
||||
CPU使用率?: string;
|
||||
};
|
||||
}
|
||||
31
src/apis/domain/biz/diag/ndm-nvr-diag-info.ts
Normal file
31
src/apis/domain/biz/diag/ndm-nvr-diag-info.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
export interface NdmNvrDiagInfo {
|
||||
[key: string]: any;
|
||||
logTime?: string;
|
||||
info?: {
|
||||
diskHealth?: number[];
|
||||
groupInfoList?: {
|
||||
freeSize?: number;
|
||||
state?: number;
|
||||
stateValue?: string;
|
||||
totalSize?: number;
|
||||
}[];
|
||||
};
|
||||
stCommonInfo?: {
|
||||
设备ID?: string;
|
||||
软件版本?: string;
|
||||
生产厂商?: string;
|
||||
设备别名?: string;
|
||||
设备型号?: string;
|
||||
硬件版本?: string;
|
||||
内存使用率?: string;
|
||||
CPU使用率?: string;
|
||||
};
|
||||
cdFanInfo?: {
|
||||
索引号?: string;
|
||||
'风扇转速(rpm)'?: string;
|
||||
}[];
|
||||
cdPowerSupplyInfo?: {
|
||||
索引号?: string;
|
||||
电源状态?: string;
|
||||
}[];
|
||||
}
|
||||
24
src/apis/domain/biz/diag/ndm-security-box-diag-info.ts
Normal file
24
src/apis/domain/biz/diag/ndm-security-box-diag-info.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
export interface NdmSecurityBoxDiagInfo {
|
||||
[key: string]: any;
|
||||
info?: [
|
||||
{
|
||||
addrCode?: number;
|
||||
circuits?: NdmSecurityBoxCircuit[];
|
||||
fanSpeeds?: number[];
|
||||
humidity?: number;
|
||||
switches?: [number, number, number, number];
|
||||
temperature?: number;
|
||||
},
|
||||
];
|
||||
stCommonInfo?: {
|
||||
[key: string]: any;
|
||||
内存使用率?: string;
|
||||
CPU使用率?: string;
|
||||
};
|
||||
}
|
||||
|
||||
export interface NdmSecurityBoxCircuit {
|
||||
current: number;
|
||||
status: number;
|
||||
voltage: number;
|
||||
}
|
||||
9
src/apis/domain/biz/diag/ndm-server-diag-info.ts
Normal file
9
src/apis/domain/biz/diag/ndm-server-diag-info.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
export interface NdmServerDiagInfo {
|
||||
[key: string]: any;
|
||||
commInfo?: {
|
||||
CPU使用率?: string;
|
||||
内存使用率?: string;
|
||||
磁盘使用率?: string;
|
||||
系统运行时间?: string;
|
||||
};
|
||||
}
|
||||
22
src/apis/domain/biz/diag/ndm-switch-diag-info.ts
Normal file
22
src/apis/domain/biz/diag/ndm-switch-diag-info.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
export interface NdmSwitchDiagInfo {
|
||||
[key: string]: any;
|
||||
cpuRatio?: string; // 因环境不同可能不存在
|
||||
memoryRatio?: string; // 因环境不同可能不存在
|
||||
logTime?: string;
|
||||
info?: {
|
||||
overFlowPorts?: string[];
|
||||
portInfoList?: NdmSwitchPortInfo[];
|
||||
};
|
||||
}
|
||||
|
||||
export interface NdmSwitchPortInfo {
|
||||
flow: number;
|
||||
inBytes: number;
|
||||
inFlow: number;
|
||||
lastInBytes: number;
|
||||
lastOutBytes: number;
|
||||
outBytes: number;
|
||||
outFlow: number;
|
||||
portName: string;
|
||||
upDown: number;
|
||||
}
|
||||
2
src/apis/domain/biz/index.ts
Normal file
2
src/apis/domain/biz/index.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
export * from './diag';
|
||||
export * from './station';
|
||||
35
src/apis/domain/biz/station/alarm.ts
Normal file
35
src/apis/domain/biz/station/alarm.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import type { NdmDeviceAlarmLogResultVO } from '@/apis/model';
|
||||
import { DEVICE_TYPE_LITERALS } from '@/enums';
|
||||
import type { Station } from './station';
|
||||
|
||||
export interface StationAlarms {
|
||||
[DEVICE_TYPE_LITERALS.ndmAlarmHost]: NdmDeviceAlarmLogResultVO[];
|
||||
[DEVICE_TYPE_LITERALS.ndmCamera]: NdmDeviceAlarmLogResultVO[];
|
||||
[DEVICE_TYPE_LITERALS.ndmDecoder]: NdmDeviceAlarmLogResultVO[];
|
||||
[DEVICE_TYPE_LITERALS.ndmKeyboard]: NdmDeviceAlarmLogResultVO[];
|
||||
[DEVICE_TYPE_LITERALS.ndmMediaServer]: NdmDeviceAlarmLogResultVO[];
|
||||
[DEVICE_TYPE_LITERALS.ndmNvr]: NdmDeviceAlarmLogResultVO[];
|
||||
[DEVICE_TYPE_LITERALS.ndmSecurityBox]: NdmDeviceAlarmLogResultVO[];
|
||||
[DEVICE_TYPE_LITERALS.ndmSwitch]: NdmDeviceAlarmLogResultVO[];
|
||||
[DEVICE_TYPE_LITERALS.ndmVideoServer]: NdmDeviceAlarmLogResultVO[];
|
||||
unclassified: NdmDeviceAlarmLogResultVO[];
|
||||
}
|
||||
|
||||
export interface LineAlarms {
|
||||
[stationCode: Station['code']]: StationAlarms;
|
||||
}
|
||||
|
||||
export const initStationAlarms = (): StationAlarms => {
|
||||
return {
|
||||
[DEVICE_TYPE_LITERALS.ndmAlarmHost]: [],
|
||||
[DEVICE_TYPE_LITERALS.ndmCamera]: [],
|
||||
[DEVICE_TYPE_LITERALS.ndmDecoder]: [],
|
||||
[DEVICE_TYPE_LITERALS.ndmKeyboard]: [],
|
||||
[DEVICE_TYPE_LITERALS.ndmMediaServer]: [],
|
||||
[DEVICE_TYPE_LITERALS.ndmNvr]: [],
|
||||
[DEVICE_TYPE_LITERALS.ndmSecurityBox]: [],
|
||||
[DEVICE_TYPE_LITERALS.ndmSwitch]: [],
|
||||
[DEVICE_TYPE_LITERALS.ndmVideoServer]: [],
|
||||
unclassified: [],
|
||||
};
|
||||
};
|
||||
43
src/apis/domain/biz/station/device.ts
Normal file
43
src/apis/domain/biz/station/device.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
import type {
|
||||
NdmAlarmHostResultVO,
|
||||
NdmCameraResultVO,
|
||||
NdmDecoderResultVO,
|
||||
NdmKeyboardResultVO,
|
||||
NdmMediaServerResultVO,
|
||||
NdmNvrResultVO,
|
||||
NdmSecurityBoxResultVO,
|
||||
NdmSwitchResultVO,
|
||||
NdmVideoServerResultVO,
|
||||
Station,
|
||||
} from '@/apis';
|
||||
import { DEVICE_TYPE_LITERALS } from '@/enums';
|
||||
|
||||
export interface StationDevices {
|
||||
[DEVICE_TYPE_LITERALS.ndmAlarmHost]: NdmAlarmHostResultVO[];
|
||||
[DEVICE_TYPE_LITERALS.ndmCamera]: NdmCameraResultVO[];
|
||||
[DEVICE_TYPE_LITERALS.ndmDecoder]: NdmDecoderResultVO[];
|
||||
[DEVICE_TYPE_LITERALS.ndmKeyboard]: NdmKeyboardResultVO[];
|
||||
[DEVICE_TYPE_LITERALS.ndmMediaServer]: NdmMediaServerResultVO[];
|
||||
[DEVICE_TYPE_LITERALS.ndmNvr]: NdmNvrResultVO[];
|
||||
[DEVICE_TYPE_LITERALS.ndmSecurityBox]: NdmSecurityBoxResultVO[];
|
||||
[DEVICE_TYPE_LITERALS.ndmSwitch]: NdmSwitchResultVO[];
|
||||
[DEVICE_TYPE_LITERALS.ndmVideoServer]: NdmVideoServerResultVO[];
|
||||
}
|
||||
|
||||
export interface LineDevices {
|
||||
[stationCode: Station['code']]: StationDevices;
|
||||
}
|
||||
|
||||
export const initStationDevices = (): StationDevices => {
|
||||
return {
|
||||
[DEVICE_TYPE_LITERALS.ndmAlarmHost]: [],
|
||||
[DEVICE_TYPE_LITERALS.ndmCamera]: [],
|
||||
[DEVICE_TYPE_LITERALS.ndmDecoder]: [],
|
||||
[DEVICE_TYPE_LITERALS.ndmKeyboard]: [],
|
||||
[DEVICE_TYPE_LITERALS.ndmMediaServer]: [],
|
||||
[DEVICE_TYPE_LITERALS.ndmNvr]: [],
|
||||
[DEVICE_TYPE_LITERALS.ndmSecurityBox]: [],
|
||||
[DEVICE_TYPE_LITERALS.ndmSwitch]: [],
|
||||
[DEVICE_TYPE_LITERALS.ndmVideoServer]: [],
|
||||
};
|
||||
};
|
||||
3
src/apis/domain/biz/station/index.ts
Normal file
3
src/apis/domain/biz/station/index.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
export * from './alarm';
|
||||
export * from './device';
|
||||
export * from './station';
|
||||
6
src/apis/domain/biz/station/station.ts
Normal file
6
src/apis/domain/biz/station/station.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
export interface Station {
|
||||
code: string;
|
||||
name: string;
|
||||
online: boolean;
|
||||
ip: string;
|
||||
}
|
||||
Reference in New Issue
Block a user