Compare commits
25 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1f73019714 | |||
| 0b39c9c602 | |||
| ec77b28cf2 | |||
| 983b865ff7 | |||
| 161f7db147 | |||
| 01a2a5bda6 | |||
| 6437b6bf35 | |||
| 848f2a0018 | |||
| eaa855a09e | |||
| a014bbfd13 | |||
| 87962d188c | |||
| d334e55551 | |||
| b8927e064b | |||
| 11b673550b | |||
| c3f3844cd5 | |||
| a43a8b24e3 | |||
| f29ab9f768 | |||
| 2a6f049938 | |||
| 18378b79a6 | |||
| 3fae0b841b | |||
| b8ef57e417 | |||
| c03667b312 | |||
| 2b7b4e7bd9 | |||
| dc8184d5dd | |||
| f36e5c3d3c |
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ndm-web-platform",
|
"name": "ndm-web-platform",
|
||||||
"version": "0.0.0",
|
"version": "0.42.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"engines": {
|
"engines": {
|
||||||
|
|||||||
@@ -1,4 +1,40 @@
|
|||||||
[
|
[
|
||||||
|
{
|
||||||
|
"version": "0.42.0",
|
||||||
|
"date": "2026-05-20",
|
||||||
|
"changes": {
|
||||||
|
"fixes": [
|
||||||
|
{ "content": "优化安防箱环境数据卡片,避免空标签渲染并改进风扇信息展示" },
|
||||||
|
{ "content": "修复设备硬件卡片进度条异常值显示问题,并完善状态判断逻辑" }
|
||||||
|
],
|
||||||
|
"feats": [
|
||||||
|
{ "content": "新增服务器网卡信息展示" },
|
||||||
|
{ "content": "新增安防箱网卡信息展示,并优化相关卡片标题" },
|
||||||
|
{ "content": "为交换机诊断信息新增温度字段" },
|
||||||
|
{ "content": "新增录像机环境状态卡片和网卡信息展示" }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"version": "0.41.0",
|
||||||
|
"date": "2026-05-19",
|
||||||
|
"changes": {
|
||||||
|
"fixes": [
|
||||||
|
{ "content": "修复交换机端口卡片在端口数据为空时仍展示的问题" },
|
||||||
|
{ "content": "修复安防箱门禁状态和防雷状态显示错误的问题" },
|
||||||
|
{ "content": "修复解码器和录像机历史诊断中硬件占用卡片的加载状态同步问题" }
|
||||||
|
],
|
||||||
|
"feats": [
|
||||||
|
{ "content": "新增摄像机阈值配置功能" },
|
||||||
|
{ "content": "新增摄像机硬件占用率历史诊断记录卡片" },
|
||||||
|
{ "content": "优化设备诊断页的信息展示结构,支持按设备型号、网卡信息、接入信息等分组展示" },
|
||||||
|
{ "content": "为摄像机诊断信息新增网卡信息、IP信息和设备通用信息展示" },
|
||||||
|
{ "content": "新增多厂商安防箱支持,支持BeiDian和NingTech安防箱的空开控制与设备重启" },
|
||||||
|
{ "content": "安防箱配置新增开关数量和团体字符串(写)" },
|
||||||
|
{ "content": "为各类设备实体新增团体字符串(写)字段" }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"version": "0.40.0",
|
"version": "0.40.0",
|
||||||
"date": "2026-04-10",
|
"date": "2026-04-10",
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
{
|
{
|
||||||
"version": "0.40.0",
|
"version": "0.42.0",
|
||||||
"buildTime": "2026-04-10 15:42:03"
|
"buildTime": "2026-05-20 13:52:07"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,45 @@
|
|||||||
export interface NdmCameraDiagInfo {
|
export interface NdmCameraDiagInfo {
|
||||||
[key: string]: any;
|
[key: string]: any;
|
||||||
|
ethInfo?: {
|
||||||
|
adminStatus?: string; // '1'
|
||||||
|
desc?: string; // 'IPcamera'
|
||||||
|
ifType?: string; // '5'
|
||||||
|
inDiscards?: string; // '0'
|
||||||
|
inErrors?: string; // '0'
|
||||||
|
inNUcastPkts?: string; // '0'
|
||||||
|
inOctets?: string; // '0'
|
||||||
|
inUcastPkts?: string; // '0'
|
||||||
|
inUnknownProtos?: string; // '0'
|
||||||
|
index?: string; // '1'
|
||||||
|
lastChange?: string; // '0:00:00.00'
|
||||||
|
mTU?: string; // '1500'
|
||||||
|
macAddress?: string; // '04:ee:cd:52:3a:a5'
|
||||||
|
operStatus?: string; // '1'
|
||||||
|
outDiscards?: string; // '0'
|
||||||
|
outErrors?: string; // '0'
|
||||||
|
outNUcastPkts?: string; // '0'
|
||||||
|
outOctets?: string; // '0'
|
||||||
|
outQLen?: string; // '0'
|
||||||
|
outUcastPkts?: string; // '0'
|
||||||
|
specific?: string; // '0.0'
|
||||||
|
speed?: string; // '10000000'
|
||||||
|
};
|
||||||
|
ipInfo?: {
|
||||||
|
broadcastAddress?: string; // '0'
|
||||||
|
iPAddress?: string; // '0'
|
||||||
|
index?: string; // '1'
|
||||||
|
mASK?: string; // '255.255.255.0'
|
||||||
|
reasmMaxSize?: string; // '0'
|
||||||
|
};
|
||||||
logTime?: string;
|
logTime?: string;
|
||||||
info?: string;
|
stCommonInfo?: {
|
||||||
|
设备ID?: string;
|
||||||
|
软件版本?: string;
|
||||||
|
设备厂商?: string;
|
||||||
|
设备别名?: string;
|
||||||
|
设备型号?: string;
|
||||||
|
硬件版本?: string;
|
||||||
|
内存使用率?: string;
|
||||||
|
CPU使用率?: string;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,37 @@ export interface NdmNvrDiagInfo {
|
|||||||
totalSize?: number;
|
totalSize?: number;
|
||||||
}[];
|
}[];
|
||||||
};
|
};
|
||||||
|
ethInfo: {
|
||||||
|
adminStatus?: string; // '1'
|
||||||
|
desc?: string; // 'bond1'
|
||||||
|
ifType?: string; // '6'
|
||||||
|
inDiscards?: string; // '17931688'
|
||||||
|
inErrors?: string; // '0'
|
||||||
|
inNUcastPkts?: string; // '40945433'
|
||||||
|
inOctets?: string; // '3453544614'
|
||||||
|
inUcastPkts?: string; // '3375411816'
|
||||||
|
inUnknownProtos?: string; // '0'
|
||||||
|
index?: string; // '8'
|
||||||
|
lastChange?: string; // '0:05:42.15'
|
||||||
|
mTU?: string; // '1500'
|
||||||
|
macAddress?: string; // '04:7b:cb:69:92:58'
|
||||||
|
operStatus?: string; // '1'
|
||||||
|
outDiscards?: string; // '0'
|
||||||
|
outErrors?: string; // '0'
|
||||||
|
outNUcastPkts?: string; // '0'
|
||||||
|
outOctets?: string; // '3443476717'
|
||||||
|
outQLen?: string; // '0'
|
||||||
|
outUcastPkts?: string; // '415381735'
|
||||||
|
specific?: string; // '0.0'
|
||||||
|
speed?: string; // '2000000000'
|
||||||
|
};
|
||||||
|
ipInfo: {
|
||||||
|
broadcastAddress?: string; // '1'
|
||||||
|
iPAddress?: string; // '10.14.1.22'
|
||||||
|
index?: string; // '8'
|
||||||
|
mASK?: string; // '255.255.255.0'
|
||||||
|
reasmMaxSize?: string; // '0'
|
||||||
|
};
|
||||||
stCommonInfo?: {
|
stCommonInfo?: {
|
||||||
设备ID?: string;
|
设备ID?: string;
|
||||||
软件版本?: string;
|
软件版本?: string;
|
||||||
@@ -20,12 +51,16 @@ export interface NdmNvrDiagInfo {
|
|||||||
内存使用率?: string;
|
内存使用率?: string;
|
||||||
CPU使用率?: string;
|
CPU使用率?: string;
|
||||||
};
|
};
|
||||||
cdFanInfo?: {
|
cdFanInfo?: NdmNvrFanInfo[];
|
||||||
索引号?: string;
|
cdPowerSupplyInfo?: NdmNvrPowerSupplyInfo[];
|
||||||
'风扇转速(rpm)'?: string;
|
}
|
||||||
}[];
|
|
||||||
cdPowerSupplyInfo?: {
|
export interface NdmNvrFanInfo {
|
||||||
索引号?: string;
|
索引号?: string;
|
||||||
电源状态?: string;
|
'风扇转速(rpm)'?: string;
|
||||||
}[];
|
}
|
||||||
|
|
||||||
|
export interface NdmNvrPowerSupplyInfo {
|
||||||
|
索引号?: string;
|
||||||
|
电源状态?: string;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,36 @@
|
|||||||
export interface NdmSecurityBoxDiagInfo {
|
export interface NdmSecurityBoxDiagInfo {
|
||||||
[key: string]: any;
|
[key: string]: any;
|
||||||
|
ethInfo?: {
|
||||||
|
adminStatus?: string; // '1'
|
||||||
|
desc?: string; // 'br-lan'
|
||||||
|
ifType?: string; // '6'
|
||||||
|
inDiscards?: string; // '84977'
|
||||||
|
inErrors?: string; // '0'
|
||||||
|
inNUcastPkts?: string; // '233473'
|
||||||
|
inOctets?: string; // '92355850'
|
||||||
|
inUcastPkts?: string; // '899970'
|
||||||
|
inUnknownProtos?: string; // '0'
|
||||||
|
index?: string; // '8'
|
||||||
|
lastChange?: string; // '0:00:00.00'
|
||||||
|
mTU?: string; // '1500'
|
||||||
|
macAddress?: string; // '56:62:bc:d3:9e:37'
|
||||||
|
operStatus?: string; // '1'
|
||||||
|
outDiscards?: string; // '0'
|
||||||
|
outErrors?: string; // '0'
|
||||||
|
outNUcastPkts?: string; // '0'
|
||||||
|
outOctets?: string; // '68175904'
|
||||||
|
outQLen?: string; // '0'
|
||||||
|
outUcastPkts?: string; // '748100'
|
||||||
|
specific?: string; // '0.0'
|
||||||
|
speed?: string; // '0'
|
||||||
|
};
|
||||||
|
ipInfo?: {
|
||||||
|
broadcastAddress?: string; // '1'
|
||||||
|
iPAddress?: string; // '10.24.18.101'
|
||||||
|
index?: string; // '8'
|
||||||
|
mASK?: string; // '255.255.255.0'
|
||||||
|
reasmMaxSize?: string; // '0'
|
||||||
|
};
|
||||||
info?: [
|
info?: [
|
||||||
{
|
{
|
||||||
addrCode?: number;
|
addrCode?: number;
|
||||||
@@ -12,8 +43,14 @@ export interface NdmSecurityBoxDiagInfo {
|
|||||||
];
|
];
|
||||||
stCommonInfo?: {
|
stCommonInfo?: {
|
||||||
[key: string]: any;
|
[key: string]: any;
|
||||||
内存使用率?: string;
|
设备ID?: string; // 'NTBoxMetro'
|
||||||
CPU使用率?: string;
|
软件版本?: string; // 'V0101'
|
||||||
|
设备厂商?: string; // 'NingTech'
|
||||||
|
设备别名?: string; // 'SUN-IBOX'
|
||||||
|
设备型号?: string; // 'SUN-IBOX'
|
||||||
|
硬件版本?: string; // 'V0101'
|
||||||
|
内存使用率?: string; // '18'
|
||||||
|
CPU使用率?: string; // '1'
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,4 +6,35 @@ export interface NdmServerDiagInfo {
|
|||||||
磁盘使用率?: string;
|
磁盘使用率?: string;
|
||||||
系统运行时间?: string;
|
系统运行时间?: string;
|
||||||
};
|
};
|
||||||
|
ethInfo?: {
|
||||||
|
adminStatus?: string; // '1'
|
||||||
|
desc?: string; // 'Intel Corporation I350 Gigabit Network Connection'
|
||||||
|
ifType?: string; // '6'
|
||||||
|
inDiscards?: string; // '6707634'
|
||||||
|
inErrors?: string; // '0'
|
||||||
|
inNUcastPkts?: string; // '8991944'
|
||||||
|
inOctets?: string; // '4220524983'
|
||||||
|
inUcastPkts?: string; // '2342740610'
|
||||||
|
inUnknownProtos?: string; // '0'
|
||||||
|
index?: string; // '2'
|
||||||
|
lastChange?: string; // '0:03:15.26'
|
||||||
|
mTU?: string; // '1500'
|
||||||
|
macAddress?: string; // 'e8:78:ee:f6:8d:98'
|
||||||
|
operStatus?: string; // '1'
|
||||||
|
outDiscards?: string; // '0'
|
||||||
|
outErrors?: string; // '0'
|
||||||
|
outNUcastPkts?: string; // '0'
|
||||||
|
outOctets?: string; // '1415770066'
|
||||||
|
outQLen?: string; // '0'
|
||||||
|
outUcastPkts?: string; // '3335494729'
|
||||||
|
specific?: string; // '0.0'
|
||||||
|
speed?: string; // '1000000000'
|
||||||
|
};
|
||||||
|
ipInfo?: {
|
||||||
|
broadcastAddress?: string; // '1'
|
||||||
|
iPAddress?: string; // '10.14.1.8'
|
||||||
|
index?: string; // '2'
|
||||||
|
mASK?: string; // '255.255.255.0'
|
||||||
|
reasmMaxSize?: string; // '0'
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ export interface NdmSwitchDiagInfo {
|
|||||||
[key: string]: any;
|
[key: string]: any;
|
||||||
cpuRatio?: string; // 因环境不同可能不存在
|
cpuRatio?: string; // 因环境不同可能不存在
|
||||||
memoryRatio?: string; // 因环境不同可能不存在
|
memoryRatio?: string; // 因环境不同可能不存在
|
||||||
|
temperature?: number;
|
||||||
logTime?: string;
|
logTime?: string;
|
||||||
info?: {
|
info?: {
|
||||||
overFlowPorts?: string[];
|
overFlowPorts?: string[];
|
||||||
|
|||||||
@@ -20,7 +20,9 @@ export interface NdmSecurityBox extends BaseModel {
|
|||||||
description: string;
|
description: string;
|
||||||
deviceStatus: string;
|
deviceStatus: string;
|
||||||
deviceType: string;
|
deviceType: string;
|
||||||
|
circuitCount: number;
|
||||||
community: string;
|
community: string;
|
||||||
|
writeCommunity: string;
|
||||||
frontendConfig: string;
|
frontendConfig: string;
|
||||||
linkDescription: string;
|
linkDescription: string;
|
||||||
snmpEnabled: boolean;
|
snmpEnabled: boolean;
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ export interface NdmSwitch extends BaseModel {
|
|||||||
deviceStatus: string;
|
deviceStatus: string;
|
||||||
deviceType: string;
|
deviceType: string;
|
||||||
community: string;
|
community: string;
|
||||||
|
writeCommunity: string;
|
||||||
frontendConfig: string;
|
frontendConfig: string;
|
||||||
linkDescription: string;
|
linkDescription: string;
|
||||||
snmpEnabled: boolean;
|
snmpEnabled: boolean;
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ export interface NdmNvr extends BaseModel {
|
|||||||
deviceStatus: string;
|
deviceStatus: string;
|
||||||
deviceType: string;
|
deviceType: string;
|
||||||
community: string;
|
community: string;
|
||||||
|
writeCommunity: string;
|
||||||
frontendConfig: string;
|
frontendConfig: string;
|
||||||
linkDescription: string;
|
linkDescription: string;
|
||||||
snmpEnabled: boolean;
|
snmpEnabled: boolean;
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ export interface NdmCamera extends BaseModel {
|
|||||||
deviceType: string;
|
deviceType: string;
|
||||||
cameraType: string;
|
cameraType: string;
|
||||||
community: string;
|
community: string;
|
||||||
|
writeCommunity: string;
|
||||||
frontendConfig: string;
|
frontendConfig: string;
|
||||||
linkDescription: string;
|
linkDescription: string;
|
||||||
snmpEnabled: boolean;
|
snmpEnabled: boolean;
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ export interface NdmDecoder extends BaseModel {
|
|||||||
deviceStatus: string;
|
deviceStatus: string;
|
||||||
deviceType: string;
|
deviceType: string;
|
||||||
community: string;
|
community: string;
|
||||||
|
writeCommunity: string;
|
||||||
frontendConfig: string;
|
frontendConfig: string;
|
||||||
linkDescription: string;
|
linkDescription: string;
|
||||||
snmpEnabled: boolean;
|
snmpEnabled: boolean;
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ export interface NdmKeyboard extends BaseModel {
|
|||||||
deviceStatus: string;
|
deviceStatus: string;
|
||||||
deviceType: string;
|
deviceType: string;
|
||||||
community: string;
|
community: string;
|
||||||
|
writeCommunity: string;
|
||||||
frontendConfig: string;
|
frontendConfig: string;
|
||||||
linkDescription: string;
|
linkDescription: string;
|
||||||
snmpEnabled: boolean;
|
snmpEnabled: boolean;
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ export interface NdmMediaServer extends BaseModel {
|
|||||||
deviceStatus: string;
|
deviceStatus: string;
|
||||||
deviceType: string;
|
deviceType: string;
|
||||||
community: string;
|
community: string;
|
||||||
|
writeCommunity: string;
|
||||||
frontendConfig: string;
|
frontendConfig: string;
|
||||||
linkDescription: string;
|
linkDescription: string;
|
||||||
snmpEnabled: boolean;
|
snmpEnabled: boolean;
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ export interface NdmVideoServer extends BaseModel {
|
|||||||
deviceStatus: string;
|
deviceStatus: string;
|
||||||
deviceType: string;
|
deviceType: string;
|
||||||
community: string;
|
community: string;
|
||||||
|
writeCommunity: string;
|
||||||
frontendConfig: string;
|
frontendConfig: string;
|
||||||
linkDescription: string;
|
linkDescription: string;
|
||||||
snmpEnabled: boolean;
|
snmpEnabled: boolean;
|
||||||
|
|||||||
@@ -93,22 +93,46 @@ export const probeSecurityBoxApi = async (ids: string[], options?: { stationCode
|
|||||||
unwrapVoidResponse(resp);
|
unwrapVoidResponse(resp);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const turnCitcuitStatusApi = async (ipAddress: string, circuitIndex: number, status: number, options?: { stationCode?: Station['code']; signal?: AbortSignal }) => {
|
// beidian安防箱切换空开状态
|
||||||
|
export const turnCircuitStatusBeidianApi = async (community: string, ipAddress: string, circuitIndex: number, status: number, options?: { stationCode?: Station['code']; signal?: AbortSignal }) => {
|
||||||
const { stationCode, signal } = options ?? {};
|
const { stationCode, signal } = options ?? {};
|
||||||
const client = stationCode ? ndmClient : userClient;
|
const client = stationCode ? ndmClient : userClient;
|
||||||
const prefix = stationCode ? `/${stationCode}` : '';
|
const prefix = stationCode ? `/${stationCode}` : '';
|
||||||
const endpoint = `${prefix}/api/ndm/ndmSecurityBox/turnStatus`;
|
const endpoint = `${prefix}/api/ndm/ndmSecurityBox/turnStatus`;
|
||||||
const resp = await client.post<boolean>(endpoint, { community: 'public', ipAddress, circuit: `${circuitIndex}`, status }, { signal });
|
const resp = await client.post<boolean>(endpoint, { community, ipAddress, circuit: `${circuitIndex}`, status }, { signal });
|
||||||
const data = unwrapResponse(resp);
|
const data = unwrapResponse(resp);
|
||||||
return data;
|
return data;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const rebootSecurityBoxApi = async (ipAddress: string, options?: { stationCode?: Station['code']; signal?: AbortSignal }) => {
|
// beidian安防箱重启
|
||||||
|
export const rebootSecurityBoxBeidianApi = async (community: string, ipAddress: string, options?: { stationCode?: Station['code']; signal?: AbortSignal }) => {
|
||||||
const { stationCode, signal } = options ?? {};
|
const { stationCode, signal } = options ?? {};
|
||||||
const client = stationCode ? ndmClient : userClient;
|
const client = stationCode ? ndmClient : userClient;
|
||||||
const prefix = stationCode ? `/${stationCode}` : '';
|
const prefix = stationCode ? `/${stationCode}` : '';
|
||||||
const endpoint = `${prefix}/api/ndm/ndmSecurityBox/reboot`;
|
const endpoint = `${prefix}/api/ndm/ndmSecurityBox/reboot`;
|
||||||
const resp = await client.post<boolean>(endpoint, { community: 'public', ipAddress }, { signal });
|
const resp = await client.post<boolean>(endpoint, { community, ipAddress }, { signal });
|
||||||
|
const data = unwrapResponse(resp);
|
||||||
|
return data;
|
||||||
|
};
|
||||||
|
|
||||||
|
// ningtech安防箱切换空开状态
|
||||||
|
export const turnCircuitStatusNingTechApi = async (community: string, ipAddress: string, circuitIndex: number, status: number, options?: { stationCode?: Station['code']; signal?: AbortSignal }) => {
|
||||||
|
const { stationCode, signal } = options ?? {};
|
||||||
|
const client = stationCode ? ndmClient : userClient;
|
||||||
|
const prefix = stationCode ? `/${stationCode}` : '';
|
||||||
|
const endpoint = `${prefix}/api/ndm/ndmSecurityBox/turnStatusNingTech`;
|
||||||
|
const resp = await client.post<boolean>(endpoint, { community, ipAddress, circuit: `${circuitIndex}`, status }, { signal });
|
||||||
|
const data = unwrapResponse(resp);
|
||||||
|
return data;
|
||||||
|
};
|
||||||
|
|
||||||
|
// ningtech安防箱重启
|
||||||
|
export const rebootSecurityBoxNingTechApi = async (community: string, ipAddress: string, options?: { stationCode?: Station['code']; signal?: AbortSignal }) => {
|
||||||
|
const { stationCode, signal } = options ?? {};
|
||||||
|
const client = stationCode ? ndmClient : userClient;
|
||||||
|
const prefix = stationCode ? `/${stationCode}` : '';
|
||||||
|
const endpoint = `${prefix}/api/ndm/ndmSecurityBox/rebootNingTech`;
|
||||||
|
const resp = await client.post<boolean>(endpoint, { community, ipAddress }, { signal });
|
||||||
const data = unwrapResponse(resp);
|
const data = unwrapResponse(resp);
|
||||||
return data;
|
return data;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,16 +1,20 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { NCard, NDescriptions, NDescriptionsItem } from 'naive-ui';
|
import { NCard, NDescriptions, NDescriptionsItem, NFlex, NText } from 'naive-ui';
|
||||||
import { computed, toRefs } from 'vue';
|
import { computed, toRefs } from 'vue';
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
commonInfo?: Record<string, string>;
|
commonInfo?: Array<{
|
||||||
|
title: string;
|
||||||
|
items: Array<{
|
||||||
|
label: string;
|
||||||
|
value: string;
|
||||||
|
}>;
|
||||||
|
}>;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const { commonInfo } = toRefs(props);
|
const { commonInfo } = toRefs(props);
|
||||||
|
|
||||||
const showCard = computed(() => !!commonInfo.value);
|
const showCard = computed(() => (commonInfo.value?.length ?? 0) > 0);
|
||||||
|
|
||||||
const commonInfoEntries = computed(() => Object.entries(commonInfo.value ?? {}));
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -18,11 +22,20 @@ const commonInfoEntries = computed(() => Object.entries(commonInfo.value ?? {}))
|
|||||||
<template #header>
|
<template #header>
|
||||||
<div>设备信息</div>
|
<div>设备信息</div>
|
||||||
</template>
|
</template>
|
||||||
<NDescriptions bordered label-placement="left" :columns="2">
|
<template v-if="!!commonInfo && commonInfo.length > 0">
|
||||||
<template v-for="item in commonInfoEntries" :key="item[0]">
|
<NFlex vertical :size="16">
|
||||||
<NDescriptionsItem :label="item[0]">{{ item[1] }}</NDescriptionsItem>
|
<template v-for="({ title, items }, index) in commonInfo" :key="`${title}-${index}`">
|
||||||
</template>
|
<NFlex vertical>
|
||||||
</NDescriptions>
|
<NText strong :depth="3">{{ title }}</NText>
|
||||||
|
<NDescriptions bordered :label-placement="'left'" :columns="2">
|
||||||
|
<template v-for="({ label, value }, index) in items" :key="`${label}-${index}`">
|
||||||
|
<NDescriptionsItem :label="label">{{ value }}</NDescriptionsItem>
|
||||||
|
</template>
|
||||||
|
</NDescriptions>
|
||||||
|
</NFlex>
|
||||||
|
</template>
|
||||||
|
</NFlex>
|
||||||
|
</template>
|
||||||
</NCard>
|
</NCard>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
+30
-12
@@ -1,3 +1,18 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
const parsePercentMetric = (raw?: string) => {
|
||||||
|
const trimmed = raw?.trim();
|
||||||
|
|
||||||
|
if (!!trimmed) {
|
||||||
|
const value = Number(trimmed);
|
||||||
|
if (Number.isFinite(value)) {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return undefined;
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ClockCheckIcon, CpuIcon, HardDriveIcon, MemoryStickIcon } from 'lucide-vue-next';
|
import { ClockCheckIcon, CpuIcon, HardDriveIcon, MemoryStickIcon } from 'lucide-vue-next';
|
||||||
import { NCard, NFlex, NIcon, NProgress, type ProgressStatus } from 'naive-ui';
|
import { NCard, NFlex, NIcon, NProgress, type ProgressStatus } from 'naive-ui';
|
||||||
@@ -21,24 +36,27 @@ const showCard = computed(() => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const cpuPercent = computed(() => {
|
const cpuPercent = computed(() => {
|
||||||
if (!cpuUsage?.value) return 0;
|
return parsePercentMetric(cpuUsage.value);
|
||||||
return parseFloat(cpuUsage.value.replace('%', ''));
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const memPercent = computed(() => {
|
const memPercent = computed(() => {
|
||||||
if (!memUsage?.value) return 0;
|
return parsePercentMetric(memUsage.value);
|
||||||
return parseFloat(memUsage.value.replace('%', ''));
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const diskPercent = computed(() => {
|
const diskPercent = computed(() => {
|
||||||
if (!diskUsage?.value) return 0;
|
return parsePercentMetric(diskUsage.value);
|
||||||
return parseFloat(diskUsage.value.replace('%', ''));
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const formattedRunningTime = computed(() => {
|
const formattedRunningTime = computed(() => {
|
||||||
return (runningTime?.value ?? '-').replace('days', '天');
|
return (runningTime?.value ?? '-').replace('days', '天');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const getProgressPercentage = (percent: number) => {
|
||||||
|
if (percent < 0) return 0;
|
||||||
|
if (percent > 100) return 100;
|
||||||
|
return percent;
|
||||||
|
};
|
||||||
|
|
||||||
const getProgressStatus = (percent: number): ProgressStatus => {
|
const getProgressStatus = (percent: number): ProgressStatus => {
|
||||||
if (percent >= 90) return 'error';
|
if (percent >= 90) return 'error';
|
||||||
if (percent >= 70) return 'warning';
|
if (percent >= 70) return 'warning';
|
||||||
@@ -53,20 +71,20 @@ const getProgressStatus = (percent: number): ProgressStatus => {
|
|||||||
</template>
|
</template>
|
||||||
<template #default>
|
<template #default>
|
||||||
<NFlex vertical>
|
<NFlex vertical>
|
||||||
<NFlex v-if="cpuUsage" style="width: 100%" align="center" :wrap="false">
|
<NFlex v-if="cpuPercent" style="width: 100%" align="center" :wrap="false">
|
||||||
<NIcon :component="CpuIcon" />
|
<NIcon :component="CpuIcon" />
|
||||||
<span style="word-break: keep-all">{{ cpuUsageLabel || 'CPU' }}</span>
|
<span style="word-break: keep-all">{{ cpuUsageLabel || 'CPU' }}</span>
|
||||||
<NProgress :percentage="cpuPercent" :status="getProgressStatus(cpuPercent)">{{ cpuPercent }}%</NProgress>
|
<NProgress :percentage="getProgressPercentage(cpuPercent)" :status="getProgressStatus(cpuPercent)">{{ cpuPercent }}%</NProgress>
|
||||||
</NFlex>
|
</NFlex>
|
||||||
<NFlex v-if="memUsage" style="width: 100%" align="center" :wrap="false">
|
<NFlex v-if="memPercent" style="width: 100%" align="center" :wrap="false">
|
||||||
<NIcon :component="MemoryStickIcon" />
|
<NIcon :component="MemoryStickIcon" />
|
||||||
<span style="word-break: keep-all">{{ memUsageLabel || '内存' }}</span>
|
<span style="word-break: keep-all">{{ memUsageLabel || '内存' }}</span>
|
||||||
<NProgress :percentage="memPercent" :status="getProgressStatus(memPercent)">{{ memPercent }}%</NProgress>
|
<NProgress :percentage="getProgressPercentage(memPercent)" :status="getProgressStatus(memPercent)">{{ memPercent }}%</NProgress>
|
||||||
</NFlex>
|
</NFlex>
|
||||||
<NFlex v-if="diskUsage" style="width: 100%" align="center" :wrap="false">
|
<NFlex v-if="diskPercent" style="width: 100%" align="center" :wrap="false">
|
||||||
<NIcon :component="HardDriveIcon" />
|
<NIcon :component="HardDriveIcon" />
|
||||||
<span style="word-break: keep-all">{{ diskUsageLabel || '磁盘' }}</span>
|
<span style="word-break: keep-all">{{ diskUsageLabel || '磁盘' }}</span>
|
||||||
<NProgress :percentage="diskPercent" :status="getProgressStatus(diskPercent)">{{ diskPercent }}%</NProgress>
|
<NProgress :percentage="getProgressPercentage(diskPercent)" :status="getProgressStatus(diskPercent)">{{ diskPercent }}%</NProgress>
|
||||||
</NFlex>
|
</NFlex>
|
||||||
<NFlex v-if="runningTime" style="width: 100%" align="center" :wrap="false">
|
<NFlex v-if="runningTime" style="width: 100%" align="center" :wrap="false">
|
||||||
<NIcon :component="ClockCheckIcon" />
|
<NIcon :component="ClockCheckIcon" />
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
|
import type { ComponentInstance } from 'vue';
|
||||||
import DeviceCommonCard from './device-common-card.vue';
|
import DeviceCommonCard from './device-common-card.vue';
|
||||||
import DeviceHardwareCard from './device-hardware-card.vue';
|
import DeviceHardwareCard from './device-hardware-card.vue';
|
||||||
import DeviceHeaderCard from './device-header-card.vue';
|
import DeviceHeaderCard from './device-header-card.vue';
|
||||||
|
import NvrEnvCard from './nvr-env-card.vue';
|
||||||
import NvrDiskCard from './nvr-disk-card.vue';
|
import NvrDiskCard from './nvr-disk-card.vue';
|
||||||
import NvrRecordCheckCard from './nvr-record-check-card.vue';
|
import NvrRecordCheckCard from './nvr-record-check-card.vue';
|
||||||
import SecurityBoxCircuitCard from './security-box-circuit-card.vue';
|
import SecurityBoxCircuitCard from './security-box-circuit-card.vue';
|
||||||
@@ -9,10 +11,13 @@ import SecurityBoxEnvCard from './security-box-env-card.vue';
|
|||||||
import SwitchPortCard from './switch-port-card.vue';
|
import SwitchPortCard from './switch-port-card.vue';
|
||||||
import SwitchPortLinkModal from './switch-port-link-modal.vue';
|
import SwitchPortLinkModal from './switch-port-link-modal.vue';
|
||||||
|
|
||||||
|
export type DeviceCommonCardProps = ComponentInstance<typeof DeviceCommonCard>['$props'];
|
||||||
|
|
||||||
export {
|
export {
|
||||||
DeviceCommonCard,
|
DeviceCommonCard,
|
||||||
DeviceHardwareCard,
|
DeviceHardwareCard,
|
||||||
DeviceHeaderCard,
|
DeviceHeaderCard,
|
||||||
|
NvrEnvCard,
|
||||||
NvrDiskCard,
|
NvrDiskCard,
|
||||||
NvrRecordCheckCard,
|
NvrRecordCheckCard,
|
||||||
SecurityBoxCircuitCard,
|
SecurityBoxCircuitCard,
|
||||||
|
|||||||
@@ -0,0 +1,47 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import type { NdmNvrFanInfo, NdmNvrPowerSupplyInfo } from '@/apis';
|
||||||
|
import { FanIcon, PlugIcon } from 'lucide-vue-next';
|
||||||
|
import { NCard, NFlex, NIcon, NTag } from 'naive-ui';
|
||||||
|
import { computed, toRefs } from 'vue';
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
fanInfo?: NdmNvrFanInfo[];
|
||||||
|
powerSupplyInfo?: NdmNvrPowerSupplyInfo[];
|
||||||
|
}>();
|
||||||
|
|
||||||
|
const { fanInfo, powerSupplyInfo } = toRefs(props);
|
||||||
|
|
||||||
|
const showCard = computed(() => {
|
||||||
|
return Object.values(props).some((value) => !!value);
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<NCard v-if="showCard" hoverable size="small">
|
||||||
|
<template #header>
|
||||||
|
<span>录像机环境状态</span>
|
||||||
|
</template>
|
||||||
|
<template #default>
|
||||||
|
<NFlex vertical>
|
||||||
|
<NTag v-for="info in fanInfo ?? []" :key="info['索引号']">
|
||||||
|
<template #icon>
|
||||||
|
<NIcon :component="FanIcon" />
|
||||||
|
</template>
|
||||||
|
<template #default>
|
||||||
|
<span>风扇{{ info['索引号'] }}: {{ info['风扇转速(rpm)'] }} RPM</span>
|
||||||
|
</template>
|
||||||
|
</NTag>
|
||||||
|
<NTag v-for="info in powerSupplyInfo ?? []" :key="info['索引号']">
|
||||||
|
<template #icon>
|
||||||
|
<NIcon :component="PlugIcon" />
|
||||||
|
</template>
|
||||||
|
<template #default>
|
||||||
|
<span>电源{{ info['索引号'] }}: {{ info['电源状态'] }}</span>
|
||||||
|
</template>
|
||||||
|
</NTag>
|
||||||
|
</NFlex>
|
||||||
|
</template>
|
||||||
|
</NCard>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped></style>
|
||||||
+21
-7
@@ -2,8 +2,6 @@
|
|||||||
import {
|
import {
|
||||||
detailDeviceApi,
|
detailDeviceApi,
|
||||||
probeDeviceApi,
|
probeDeviceApi,
|
||||||
rebootSecurityBoxApi,
|
|
||||||
turnCitcuitStatusApi,
|
|
||||||
updateDeviceApi,
|
updateDeviceApi,
|
||||||
type LinkDescription,
|
type LinkDescription,
|
||||||
type NdmDeviceResultVO,
|
type NdmDeviceResultVO,
|
||||||
@@ -16,6 +14,7 @@ import { SecurityBoxCircuitLinkModal } from '@/components';
|
|||||||
import { usePermission } from '@/composables';
|
import { usePermission } from '@/composables';
|
||||||
import { SELECT_DEVICE_FN_INJECTION_KEY } from '@/constants';
|
import { SELECT_DEVICE_FN_INJECTION_KEY } from '@/constants';
|
||||||
import { PERMISSION_TYPE_LITERALS } from '@/enums';
|
import { PERMISSION_TYPE_LITERALS } from '@/enums';
|
||||||
|
import { normalizeSecurityBoxWriteCommunity, dispatchRebootSecurityBoxApi, dispatchTurnCircuitStatusApi, normalizeSecurityBoxCircuitIndex } from '@/helpers';
|
||||||
import { useDeviceStore, useSettingStore } from '@/stores';
|
import { useDeviceStore, useSettingStore } from '@/stores';
|
||||||
import { parseErrorFeedback } from '@/utils';
|
import { parseErrorFeedback } from '@/utils';
|
||||||
import { useMutation } from '@tanstack/vue-query';
|
import { useMutation } from '@tanstack/vue-query';
|
||||||
@@ -31,6 +30,7 @@ import { computed, inject, ref, toRefs } from 'vue';
|
|||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
ndmDevice: NdmSecurityBoxResultVO;
|
ndmDevice: NdmSecurityBoxResultVO;
|
||||||
station: Station;
|
station: Station;
|
||||||
|
vendor?: string;
|
||||||
circuits?: NdmSecurityBoxCircuit[];
|
circuits?: NdmSecurityBoxCircuit[];
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
@@ -44,7 +44,7 @@ const { useLocalDB } = storeToRefs(settingStore);
|
|||||||
|
|
||||||
const { hasPermission } = usePermission();
|
const { hasPermission } = usePermission();
|
||||||
|
|
||||||
const { ndmDevice, station, circuits } = toRefs(props);
|
const { ndmDevice, station, vendor, circuits } = toRefs(props);
|
||||||
|
|
||||||
const showCard = computed(() => !!circuits.value && circuits.value.length > 0);
|
const showCard = computed(() => !!circuits.value && circuits.value.length > 0);
|
||||||
|
|
||||||
@@ -52,6 +52,10 @@ const localCircuits = ref<NdmSecurityBoxCircuit[]>([]);
|
|||||||
|
|
||||||
watchImmediate(circuits, (newCircuits) => {
|
watchImmediate(circuits, (newCircuits) => {
|
||||||
localCircuits.value = newCircuits?.map((circuit) => ({ ...circuit })) ?? [];
|
localCircuits.value = newCircuits?.map((circuit) => ({ ...circuit })) ?? [];
|
||||||
|
const circuitCount = ndmDevice.value.circuitCount;
|
||||||
|
if (!!circuitCount) {
|
||||||
|
localCircuits.value = localCircuits.value.slice(0, circuitCount);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const getCircuitStatusTagType = (circuit: NdmSecurityBoxCircuit): TagProps['type'] => {
|
const getCircuitStatusTagType = (circuit: NdmSecurityBoxCircuit): TagProps['type'] => {
|
||||||
@@ -79,13 +83,19 @@ const { mutate: turnStatus, isPending: turning } = useMutation({
|
|||||||
window.$loadingBar.start();
|
window.$loadingBar.start();
|
||||||
|
|
||||||
const { circuitIndex, newStatus } = params;
|
const { circuitIndex, newStatus } = params;
|
||||||
if (!ndmDevice.value.ipAddress) {
|
const community = normalizeSecurityBoxWriteCommunity(ndmDevice.value, vendor.value);
|
||||||
|
const ipAddress = ndmDevice.value.ipAddress;
|
||||||
|
if (!ipAddress) {
|
||||||
throw new Error('设备IP地址不存在');
|
throw new Error('设备IP地址不存在');
|
||||||
}
|
}
|
||||||
const status = newStatus ? 1 : 0;
|
const status = newStatus ? 1 : 0;
|
||||||
|
|
||||||
const stationCode = station.value.code;
|
const stationCode = station.value.code;
|
||||||
const signal = abortController.value.signal;
|
const signal = abortController.value.signal;
|
||||||
await turnCitcuitStatusApi(ndmDevice.value.ipAddress, circuitIndex, status, { stationCode, signal });
|
|
||||||
|
const turnCircuitStatusApi = dispatchTurnCircuitStatusApi(vendor.value);
|
||||||
|
const normalizedCircuitIndex = normalizeSecurityBoxCircuitIndex(circuitIndex, vendor.value);
|
||||||
|
await turnCircuitStatusApi(community, ipAddress, normalizedCircuitIndex, status, { stationCode, signal });
|
||||||
await probeDeviceApi(ndmDevice.value, { stationCode, signal });
|
await probeDeviceApi(ndmDevice.value, { stationCode, signal });
|
||||||
return status;
|
return status;
|
||||||
},
|
},
|
||||||
@@ -110,13 +120,17 @@ const { mutate: reboot, isPending: rebooting } = useMutation({
|
|||||||
|
|
||||||
window.$loadingBar.start();
|
window.$loadingBar.start();
|
||||||
|
|
||||||
if (!ndmDevice.value.ipAddress) {
|
const community = normalizeSecurityBoxWriteCommunity(ndmDevice.value, vendor.value);
|
||||||
|
const ipAddress = ndmDevice.value.ipAddress;
|
||||||
|
if (!ipAddress) {
|
||||||
throw new Error('设备IP地址不存在');
|
throw new Error('设备IP地址不存在');
|
||||||
}
|
}
|
||||||
|
|
||||||
const stationCode = station.value.code;
|
const stationCode = station.value.code;
|
||||||
const signal = abortController.value.signal;
|
const signal = abortController.value.signal;
|
||||||
await rebootSecurityBoxApi(ndmDevice.value.ipAddress, { stationCode, signal });
|
|
||||||
|
const rebootSecurityBoxApi = dispatchRebootSecurityBoxApi(vendor.value);
|
||||||
|
await rebootSecurityBoxApi(community, ipAddress, { stationCode, signal });
|
||||||
},
|
},
|
||||||
onSuccess: () => {
|
onSuccess: () => {
|
||||||
window.$loadingBar.finish();
|
window.$loadingBar.finish();
|
||||||
|
|||||||
+17
-22
@@ -16,40 +16,35 @@ const showCard = computed(() => {
|
|||||||
return Object.values(props).some((value) => !!value);
|
return Object.values(props).some((value) => !!value);
|
||||||
});
|
});
|
||||||
|
|
||||||
// 门禁状态
|
|
||||||
const accessControlStatus = computed(() => {
|
|
||||||
if (!switches?.value || switches.value.length < 1) return null;
|
|
||||||
const status = switches.value.at(0)!;
|
|
||||||
return status === 0 ? '开门' : status === 1 ? '关门' : '-';
|
|
||||||
});
|
|
||||||
|
|
||||||
// 防雷状态
|
// 防雷状态
|
||||||
const lightningProtectionStatus = computed(() => {
|
const lightningProtectionStatus = computed(() => {
|
||||||
if (!switches?.value || switches.value.length < 2) return null;
|
if (!switches?.value || switches.value.length < 2) return null;
|
||||||
|
const status = switches.value.at(0)!;
|
||||||
|
return status === 0 ? '失效' : status === 1 ? '生效' : '-';
|
||||||
|
});
|
||||||
|
|
||||||
|
// 门禁状态
|
||||||
|
const accessControlStatus = computed(() => {
|
||||||
|
if (!switches?.value || switches.value.length < 1) return null;
|
||||||
const status = switches.value.at(1)!;
|
const status = switches.value.at(1)!;
|
||||||
return status === 0 ? '正常' : status === 1 ? '失效' : '-';
|
return status === 0 ? '开门' : status === 1 ? '关门' : '-';
|
||||||
});
|
});
|
||||||
|
|
||||||
const getStatusTagType = (status: string | null) => {
|
const getStatusTagType = (status: string | null) => {
|
||||||
if (['正常'].includes(status ?? '')) return 'success';
|
if (['生效', '关门'].includes(status ?? '')) return 'success';
|
||||||
if (['失效'].includes(status ?? '')) return 'error';
|
if (['失效', '开门'].includes(status ?? '')) return 'error';
|
||||||
return 'default';
|
return 'default';
|
||||||
};
|
};
|
||||||
|
|
||||||
const formattedFanSpeeds = computed(() => {
|
|
||||||
if (!fanSpeeds?.value || fanSpeeds.value.length === 0) return null;
|
|
||||||
return fanSpeeds.value.map((speed, index) => `风扇${index + 1}: ${speed} RPM`).join(', ');
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<NCard v-if="showCard" hoverable size="small">
|
<NCard v-if="showCard" hoverable size="small">
|
||||||
<template #header>
|
<template #header>
|
||||||
<span>安防箱状态</span>
|
<span>安防箱环境状态</span>
|
||||||
</template>
|
</template>
|
||||||
<template #default>
|
<template #default>
|
||||||
<NFlex vertical>
|
<NFlex vertical>
|
||||||
<NTag>
|
<NTag v-if="!!temperature">
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<NIcon :component="ThermometerIcon" />
|
<NIcon :component="ThermometerIcon" />
|
||||||
</template>
|
</template>
|
||||||
@@ -57,7 +52,7 @@ const formattedFanSpeeds = computed(() => {
|
|||||||
<span>温度: {{ temperature }}℃</span>
|
<span>温度: {{ temperature }}℃</span>
|
||||||
</template>
|
</template>
|
||||||
</NTag>
|
</NTag>
|
||||||
<NTag>
|
<NTag v-if="!!humidity">
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<NIcon :component="DropletIcon" />
|
<NIcon :component="DropletIcon" />
|
||||||
</template>
|
</template>
|
||||||
@@ -65,15 +60,15 @@ const formattedFanSpeeds = computed(() => {
|
|||||||
<span>湿度: {{ humidity }}%</span>
|
<span>湿度: {{ humidity }}%</span>
|
||||||
</template>
|
</template>
|
||||||
</NTag>
|
</NTag>
|
||||||
<NTag>
|
<NTag v-for="(speed, index) in fanSpeeds ?? []" :key="index">
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<NIcon :component="FanIcon" />
|
<NIcon :component="FanIcon" />
|
||||||
</template>
|
</template>
|
||||||
<template #default>
|
<template #default>
|
||||||
<span>风扇: {{ formattedFanSpeeds }}</span>
|
<span>风扇{{ index + 1 }}: {{ speed }} RPM</span>
|
||||||
</template>
|
</template>
|
||||||
</NTag>
|
</NTag>
|
||||||
<NTag :type="getStatusTagType(accessControlStatus)">
|
<NTag v-if="!!accessControlStatus" :type="getStatusTagType(accessControlStatus)">
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<NIcon :component="ShieldIcon" />
|
<NIcon :component="ShieldIcon" />
|
||||||
</template>
|
</template>
|
||||||
@@ -81,7 +76,7 @@ const formattedFanSpeeds = computed(() => {
|
|||||||
<span>门禁: {{ accessControlStatus }}</span>
|
<span>门禁: {{ accessControlStatus }}</span>
|
||||||
</template>
|
</template>
|
||||||
</NTag>
|
</NTag>
|
||||||
<NTag :type="getStatusTagType(lightningProtectionStatus)">
|
<NTag v-if="!!lightningProtectionStatus" :type="getStatusTagType(lightningProtectionStatus)">
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<NIcon :component="ZapIcon" />
|
<NIcon :component="ZapIcon" />
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ const { hasPermission } = usePermission();
|
|||||||
|
|
||||||
const { ndmDevice, station, ports } = toRefs(props);
|
const { ndmDevice, station, ports } = toRefs(props);
|
||||||
|
|
||||||
const showCard = computed(() => !!ports.value);
|
const showCard = computed(() => !!ports.value && ports.value.length > 0);
|
||||||
|
|
||||||
const switchSlots = computed(() => {
|
const switchSlots = computed(() => {
|
||||||
// 解析端口名称,将端口按槽位进行分组
|
// 解析端口名称,将端口按槽位进行分组
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { NFlex } from 'naive-ui';
|
import { NFlex } from 'naive-ui';
|
||||||
import { DeviceCommonCard, DeviceHeaderCard } from '@/components';
|
import { DeviceCommonCard, DeviceHeaderCard, type DeviceCommonCardProps } from '@/components';
|
||||||
import type { NdmAlarmHostResultVO, Station } from '@/apis';
|
import type { NdmAlarmHostResultVO, Station } from '@/apis';
|
||||||
import { computed, toRefs } from 'vue';
|
import { computed, toRefs } from 'vue';
|
||||||
|
|
||||||
@@ -11,13 +11,18 @@ const props = defineProps<{
|
|||||||
|
|
||||||
const { ndmDevice, station } = toRefs(props);
|
const { ndmDevice, station } = toRefs(props);
|
||||||
|
|
||||||
const commonInfo = computed(() => {
|
const commonInfo = computed<DeviceCommonCardProps['commonInfo']>(() => {
|
||||||
const { createdTime, updatedTime, manufacturer } = ndmDevice.value;
|
const { createdTime, updatedTime, manufacturer } = ndmDevice.value;
|
||||||
return {
|
return [
|
||||||
创建时间: createdTime ?? '-',
|
{
|
||||||
更新时间: updatedTime ?? '-',
|
title: '设备接入信息',
|
||||||
制造商: manufacturer ?? '-',
|
items: [
|
||||||
};
|
{ label: '创建时间', value: createdTime || '-' },
|
||||||
|
{ label: '更新时间', value: updatedTime || '-' },
|
||||||
|
{ label: '制造商', value: manufacturer || '-' },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
];
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -16,11 +16,12 @@ const isCameraTypeCode = (code: string): code is CameraType => {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { NdmCameraResultVO, Station } from '@/apis';
|
import type { NdmCameraDiagInfo, NdmCameraResultVO, Station } from '@/apis';
|
||||||
import { DeviceCommonCard, DeviceHeaderCard } from '@/components';
|
import { DeviceCommonCard, DeviceHardwareCard, DeviceHeaderCard, type DeviceCommonCardProps } from '@/components';
|
||||||
import { useSettingStore } from '@/stores';
|
import { useSettingStore } from '@/stores';
|
||||||
import { useQuery, useQueryClient } from '@tanstack/vue-query';
|
import { useQuery, useQueryClient } from '@tanstack/vue-query';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
import destr from 'destr';
|
||||||
import { NDescriptions, NDescriptionsItem, NFlex } from 'naive-ui';
|
import { NDescriptions, NDescriptionsItem, NFlex } from 'naive-ui';
|
||||||
import { storeToRefs } from 'pinia';
|
import { storeToRefs } from 'pinia';
|
||||||
import { computed, toRefs, watch } from 'vue';
|
import { computed, toRefs, watch } from 'vue';
|
||||||
@@ -113,7 +114,17 @@ watch(activeRequests, (active) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const commonInfo = computed(() => {
|
const lastDiagInfo = computed(() => {
|
||||||
|
const result = destr<any>(ndmDevice.value.lastDiagInfo);
|
||||||
|
if (!result) return null;
|
||||||
|
if (typeof result !== 'object') return null;
|
||||||
|
return result as NdmCameraDiagInfo;
|
||||||
|
});
|
||||||
|
|
||||||
|
const commonInfo = computed<DeviceCommonCardProps['commonInfo']>(() => {
|
||||||
|
const { stCommonInfo } = lastDiagInfo.value ?? {};
|
||||||
|
const { 设备ID, 软件版本, 设备厂商, 设备别名, 设备型号, 硬件版本 } = stCommonInfo ?? {};
|
||||||
|
const { ethInfo, ipInfo } = lastDiagInfo.value ?? {};
|
||||||
const {
|
const {
|
||||||
createdTime,
|
createdTime,
|
||||||
updatedTime,
|
updatedTime,
|
||||||
@@ -126,22 +137,58 @@ const commonInfo = computed(() => {
|
|||||||
onvifMinorIndex,
|
onvifMinorIndex,
|
||||||
icmpEnabled,
|
icmpEnabled,
|
||||||
community,
|
community,
|
||||||
|
ipAddress,
|
||||||
//
|
//
|
||||||
} = ndmDevice.value;
|
} = ndmDevice.value;
|
||||||
return {
|
|
||||||
创建时间: createdTime ?? '-',
|
let operStatus = '-';
|
||||||
更新时间: updatedTime ?? '-',
|
if (!!ethInfo?.operStatus) {
|
||||||
制造商: manufacturer ?? '-',
|
operStatus = ethInfo?.operStatus === '1' ? '正常' : '异常';
|
||||||
GB28181启用: `${!!gb28181Enabled ? '是' : '否'}`,
|
}
|
||||||
ONVIF端口: `${onvifPort ?? '-'}`,
|
|
||||||
ONVIF用户名: onvifUsername ?? '-',
|
return [
|
||||||
ONVIF密码: onvifPassword ?? '-',
|
{
|
||||||
ONVIF主流索引: `${onvifMajorIndex ?? '-'}`,
|
title: '设备型号信息',
|
||||||
ONVIF辅流索引: `${onvifMinorIndex ?? '-'}`,
|
items: [
|
||||||
ICMP启用: `${!!icmpEnabled ? '是' : '否'}`,
|
{ label: '设备ID', value: 设备ID || '-' },
|
||||||
团体字符串: community ?? '-',
|
{ label: '软件版本', value: 软件版本 || '-' },
|
||||||
};
|
{ label: '设备厂商', value: 设备厂商 || manufacturer || '-' },
|
||||||
|
{ label: '设备别名', value: 设备别名 || '-' },
|
||||||
|
{ label: '设备型号', value: 设备型号 || '-' },
|
||||||
|
{ label: '硬件版本', value: 硬件版本 || '-' },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '设备网卡信息',
|
||||||
|
items: [
|
||||||
|
{ label: 'IP地址', value: ipAddress || '-' },
|
||||||
|
{ label: '子网掩码', value: ipInfo?.mASK || '-' },
|
||||||
|
{ label: 'MAC地址', value: ethInfo?.macAddress || '-' },
|
||||||
|
{ label: '连接速率', value: ethInfo?.speed || '-' },
|
||||||
|
{ label: 'MTU', value: ethInfo?.mTU || '-' },
|
||||||
|
{ label: '运行状态', value: operStatus },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '设备接入信息',
|
||||||
|
items: [
|
||||||
|
{ label: '创建时间', value: createdTime || '-' },
|
||||||
|
{ label: '更新时间', value: updatedTime || '-' },
|
||||||
|
{ label: 'GB28181启用', value: `${!!gb28181Enabled ? '是' : '否'}` },
|
||||||
|
{ label: 'ICMP启用', value: `${!!icmpEnabled ? '是' : '否'}` },
|
||||||
|
{ label: 'ONVIF用户名', value: onvifUsername || '-' },
|
||||||
|
{ label: 'ONVIF密码', value: onvifPassword || '-' },
|
||||||
|
{ label: 'ONVIF主流索引', value: `${onvifMajorIndex ?? '-'}` },
|
||||||
|
{ label: 'ONVIF辅流索引', value: `${onvifMinorIndex ?? '-'}` },
|
||||||
|
{ label: 'ONVIF端口', value: `${onvifPort ?? '-'}` },
|
||||||
|
{ label: '团体字符串', value: community || '-' },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
];
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const cpuUsage = computed(() => lastDiagInfo.value?.stCommonInfo?.CPU使用率);
|
||||||
|
const memUsage = computed(() => lastDiagInfo.value?.stCommonInfo?.内存使用率);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -155,6 +202,7 @@ const commonInfo = computed(() => {
|
|||||||
</template>
|
</template>
|
||||||
</DeviceHeaderCard>
|
</DeviceHeaderCard>
|
||||||
<DeviceCommonCard :common-info="commonInfo" />
|
<DeviceCommonCard :common-info="commonInfo" />
|
||||||
|
<DeviceHardwareCard :cpu-usage="cpuUsage" :mem-usage="memUsage" />
|
||||||
</NFlex>
|
</NFlex>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,14 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { NdmCameraResultVO, Station } from '@/apis';
|
import type { NdmCameraResultVO, Station } from '@/apis';
|
||||||
import { DeviceAlarmHistoryCard, DeviceIcmpHistoryCard, HistoryDiagFilterCard, type DeviceAlarmHistoryCardProps, type DeviceIcmpHistoryCardProps } from '@/components';
|
import {
|
||||||
|
DeviceAlarmHistoryCard,
|
||||||
|
DeviceIcmpHistoryCard,
|
||||||
|
DeviceUsageHistoryCard,
|
||||||
|
HistoryDiagFilterCard,
|
||||||
|
type DeviceAlarmHistoryCardProps,
|
||||||
|
type DeviceIcmpHistoryCardProps,
|
||||||
|
type DeviceUsageHistoryCardProps,
|
||||||
|
} from '@/components';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
import { NFlex, type SelectOption } from 'naive-ui';
|
import { NFlex, type SelectOption } from 'naive-ui';
|
||||||
import { onMounted, ref, toRefs, watch } from 'vue';
|
import { onMounted, ref, toRefs, watch } from 'vue';
|
||||||
@@ -15,6 +23,7 @@ const { ndmDevice, station } = toRefs(props);
|
|||||||
const historyDiagOptions: SelectOption[] = [
|
const historyDiagOptions: SelectOption[] = [
|
||||||
{ label: '设备状态', value: 'icmp' },
|
{ label: '设备状态', value: 'icmp' },
|
||||||
{ label: '设备告警', value: 'alarm' },
|
{ label: '设备告警', value: 'alarm' },
|
||||||
|
{ label: '硬件占用', value: 'usage' },
|
||||||
];
|
];
|
||||||
const getWeekRange = (): [number, number] => {
|
const getWeekRange = (): [number, number] => {
|
||||||
const now = dayjs();
|
const now = dayjs();
|
||||||
@@ -27,7 +36,8 @@ const selected = ref<string[]>([...historyDiagOptions.map((option) => `${option.
|
|||||||
const loading = ref<boolean>(false);
|
const loading = ref<boolean>(false);
|
||||||
const icmpLoading = ref<boolean>(false);
|
const icmpLoading = ref<boolean>(false);
|
||||||
const alarmLoading = ref<boolean>(false);
|
const alarmLoading = ref<boolean>(false);
|
||||||
watch([icmpLoading, alarmLoading], (loadings) => {
|
const usageLoading = ref<boolean>(false);
|
||||||
|
watch([icmpLoading, alarmLoading, usageLoading], (loadings) => {
|
||||||
loading.value = loadings.some((loading) => loading);
|
loading.value = loadings.some((loading) => loading);
|
||||||
});
|
});
|
||||||
const icmpHistoryQueryFn = ref<() => void>();
|
const icmpHistoryQueryFn = ref<() => void>();
|
||||||
@@ -38,9 +48,14 @@ const alarmHistoryQueryFn = ref<() => void>();
|
|||||||
const onExposeAlarmHistoryQueryFn: DeviceAlarmHistoryCardProps['onExposeQueryFn'] = (queryFn) => {
|
const onExposeAlarmHistoryQueryFn: DeviceAlarmHistoryCardProps['onExposeQueryFn'] = (queryFn) => {
|
||||||
alarmHistoryQueryFn.value = queryFn;
|
alarmHistoryQueryFn.value = queryFn;
|
||||||
};
|
};
|
||||||
|
const usageHistoryQueryFn = ref<() => void>();
|
||||||
|
const onExposeUsageHistoryQueryFn: DeviceUsageHistoryCardProps['onExposeQueryFn'] = (queryFn) => {
|
||||||
|
usageHistoryQueryFn.value = queryFn;
|
||||||
|
};
|
||||||
const queryData = () => {
|
const queryData = () => {
|
||||||
if (selected.value.includes('icmp')) icmpHistoryQueryFn.value?.();
|
if (selected.value.includes('icmp')) icmpHistoryQueryFn.value?.();
|
||||||
if (selected.value.includes('alarm')) alarmHistoryQueryFn.value?.();
|
if (selected.value.includes('alarm')) alarmHistoryQueryFn.value?.();
|
||||||
|
if (selected.value.includes('usage')) usageHistoryQueryFn.value?.();
|
||||||
};
|
};
|
||||||
const onQuery = () => {
|
const onQuery = () => {
|
||||||
queryData();
|
queryData();
|
||||||
@@ -70,6 +85,16 @@ onMounted(() => {
|
|||||||
v-model:loading="alarmLoading"
|
v-model:loading="alarmLoading"
|
||||||
@expose-query-fn="onExposeAlarmHistoryQueryFn"
|
@expose-query-fn="onExposeAlarmHistoryQueryFn"
|
||||||
/>
|
/>
|
||||||
|
<DeviceUsageHistoryCard
|
||||||
|
v-if="selected.includes('usage')"
|
||||||
|
:ndm-device="ndmDevice"
|
||||||
|
:station="station"
|
||||||
|
:cpu-usage-field="'stCommonInfo.CPU使用率'"
|
||||||
|
:mem-usage-field="'stCommonInfo.内存使用率'"
|
||||||
|
v-model:range="range"
|
||||||
|
v-model:loading="usageLoading"
|
||||||
|
@expose-query-fn="onExposeUsageHistoryQueryFn"
|
||||||
|
/>
|
||||||
</NFlex>
|
</NFlex>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { NdmDecoderDiagInfo, NdmDecoderResultVO, Station } from '@/apis';
|
import type { NdmDecoderDiagInfo, NdmDecoderResultVO, Station } from '@/apis';
|
||||||
import { DeviceCommonCard, DeviceHardwareCard, DeviceHeaderCard } from '@/components';
|
import { DeviceCommonCard, DeviceHardwareCard, DeviceHeaderCard, type DeviceCommonCardProps } from '@/components';
|
||||||
import destr from 'destr';
|
import destr from 'destr';
|
||||||
import { NFlex } from 'naive-ui';
|
import { NFlex } from 'naive-ui';
|
||||||
import { computed, toRefs } from 'vue';
|
import { computed, toRefs } from 'vue';
|
||||||
@@ -19,17 +19,23 @@ const lastDiagInfo = computed(() => {
|
|||||||
return result as NdmDecoderDiagInfo;
|
return result as NdmDecoderDiagInfo;
|
||||||
});
|
});
|
||||||
|
|
||||||
const commonInfo = computed(() => {
|
const commonInfo = computed<DeviceCommonCardProps['commonInfo']>(() => {
|
||||||
const { stCommonInfo } = lastDiagInfo.value ?? {};
|
const { stCommonInfo } = lastDiagInfo.value ?? {};
|
||||||
const { 设备ID, 软件版本, 设备厂商, 设备别名, 设备型号, 硬件版本 } = stCommonInfo ?? {};
|
const { 设备ID, 软件版本, 设备厂商, 设备别名, 设备型号, 硬件版本 } = stCommonInfo ?? {};
|
||||||
return {
|
|
||||||
设备ID: 设备ID ?? '-',
|
return [
|
||||||
软件版本: 软件版本 ?? '-',
|
{
|
||||||
设备厂商: 设备厂商 ?? '-',
|
title: '设备型号信息',
|
||||||
设备别名: 设备别名 ?? '-',
|
items: [
|
||||||
设备型号: 设备型号 ?? '-',
|
{ label: '设备ID', value: 设备ID || '-' },
|
||||||
硬件版本: 硬件版本 ?? '-',
|
{ label: '软件版本', value: 软件版本 || '-' },
|
||||||
};
|
{ label: '设备厂商', value: 设备厂商 || '-' },
|
||||||
|
{ label: '设备别名', value: 设备别名 || '-' },
|
||||||
|
{ label: '设备型号', value: 设备型号 || '-' },
|
||||||
|
{ label: '硬件版本', value: 硬件版本 || '-' },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
];
|
||||||
});
|
});
|
||||||
|
|
||||||
const cpuUsage = computed(() => lastDiagInfo.value?.stCommonInfo?.CPU使用率);
|
const cpuUsage = computed(() => lastDiagInfo.value?.stCommonInfo?.CPU使用率);
|
||||||
|
|||||||
@@ -36,7 +36,8 @@ const selected = ref([...historyDiagOptions.map((option) => `${option.value}`)])
|
|||||||
const loading = ref<boolean>(false);
|
const loading = ref<boolean>(false);
|
||||||
const icmpLoading = ref<boolean>(false);
|
const icmpLoading = ref<boolean>(false);
|
||||||
const alarmLoading = ref<boolean>(false);
|
const alarmLoading = ref<boolean>(false);
|
||||||
watch([icmpLoading, alarmLoading], (loadings) => {
|
const usageLoading = ref<boolean>(false);
|
||||||
|
watch([icmpLoading, alarmLoading, usageLoading], (loadings) => {
|
||||||
loading.value = loadings.some((loading) => loading);
|
loading.value = loadings.some((loading) => loading);
|
||||||
});
|
});
|
||||||
const icmpHistoryQueryFn = ref<() => void>();
|
const icmpHistoryQueryFn = ref<() => void>();
|
||||||
@@ -91,7 +92,7 @@ onMounted(() => {
|
|||||||
:cpu-usage-field="'stCommonInfo.CPU使用率'"
|
:cpu-usage-field="'stCommonInfo.CPU使用率'"
|
||||||
:mem-usage-field="'stCommonInfo.内存使用率'"
|
:mem-usage-field="'stCommonInfo.内存使用率'"
|
||||||
v-model:range="range"
|
v-model:range="range"
|
||||||
v-model:loading="alarmLoading"
|
v-model:loading="usageLoading"
|
||||||
@expose-query-fn="onExposeUsageHistoryQueryFn"
|
@expose-query-fn="onExposeUsageHistoryQueryFn"
|
||||||
/>
|
/>
|
||||||
</NFlex>
|
</NFlex>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { NdmNvrDiagInfo, NdmNvrResultVO, Station } from '@/apis';
|
import type { NdmNvrDiagInfo, NdmNvrResultVO, Station } from '@/apis';
|
||||||
import { DeviceCommonCard, DeviceHardwareCard, DeviceHeaderCard, NvrDiskCard, NvrRecordCheckCard } from '@/components';
|
import { DeviceCommonCard, DeviceHardwareCard, DeviceHeaderCard, NvrDiskCard, NvrEnvCard, NvrRecordCheckCard, type DeviceCommonCardProps } from '@/components';
|
||||||
import { isNvrCluster } from '@/helpers';
|
import { isNvrCluster } from '@/helpers';
|
||||||
import destr from 'destr';
|
import destr from 'destr';
|
||||||
import { NFlex } from 'naive-ui';
|
import { NFlex } from 'naive-ui';
|
||||||
@@ -20,18 +20,40 @@ const lastDiagInfo = computed(() => {
|
|||||||
return result as NdmNvrDiagInfo;
|
return result as NdmNvrDiagInfo;
|
||||||
});
|
});
|
||||||
|
|
||||||
const commonInfo = computed(() => {
|
const commonInfo = computed<DeviceCommonCardProps['commonInfo']>(() => {
|
||||||
const { stCommonInfo } = lastDiagInfo.value ?? {};
|
const { ipAddress } = ndmDevice.value;
|
||||||
if (!stCommonInfo) return undefined;
|
const { ethInfo, ipInfo, stCommonInfo } = lastDiagInfo.value ?? {};
|
||||||
const { 设备ID, 软件版本, 生产厂商, 设备别名, 设备型号, 硬件版本 } = stCommonInfo;
|
const { 设备ID, 软件版本, 生产厂商, 设备别名, 设备型号, 硬件版本 } = stCommonInfo ?? {};
|
||||||
return {
|
|
||||||
设备ID: 设备ID ?? '-',
|
let operStatus = '-';
|
||||||
软件版本: 软件版本 ?? '-',
|
if (!!ethInfo?.operStatus) {
|
||||||
生产厂商: 生产厂商 ?? '-',
|
operStatus = ethInfo?.operStatus === '1' ? '正常' : '异常';
|
||||||
设备别名: 设备别名 ?? '-',
|
}
|
||||||
设备型号: 设备型号 ?? '-',
|
|
||||||
硬件版本: 硬件版本 ?? '-',
|
return [
|
||||||
};
|
{
|
||||||
|
title: '设备型号信息',
|
||||||
|
items: [
|
||||||
|
{ label: '设备ID', value: 设备ID || '-' },
|
||||||
|
{ label: '软件版本', value: 软件版本 || '-' },
|
||||||
|
{ label: '生产厂商', value: 生产厂商 || '-' },
|
||||||
|
{ label: '设备别名', value: 设备别名 || '-' },
|
||||||
|
{ label: '设备型号', value: 设备型号 || '-' },
|
||||||
|
{ label: '硬件版本', value: 硬件版本 || '-' },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '设备网卡信息',
|
||||||
|
items: [
|
||||||
|
{ label: 'IP地址', value: ipAddress || '-' },
|
||||||
|
{ label: '子网掩码', value: ipInfo?.mASK || '-' },
|
||||||
|
{ label: 'MAC地址', value: ethInfo?.macAddress || '-' },
|
||||||
|
{ label: '连接速率', value: ethInfo?.speed || '-' },
|
||||||
|
{ label: 'MTU', value: ethInfo?.mTU || '-' },
|
||||||
|
{ label: '运行状态', value: operStatus },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
];
|
||||||
});
|
});
|
||||||
|
|
||||||
const cpuUsage = computed(() => lastDiagInfo.value?.stCommonInfo?.CPU使用率);
|
const cpuUsage = computed(() => lastDiagInfo.value?.stCommonInfo?.CPU使用率);
|
||||||
@@ -39,6 +61,9 @@ const memUsage = computed(() => lastDiagInfo.value?.stCommonInfo?.内存使用
|
|||||||
|
|
||||||
const diskHealth = computed(() => lastDiagInfo.value?.info?.diskHealth);
|
const diskHealth = computed(() => lastDiagInfo.value?.info?.diskHealth);
|
||||||
const diskArray = computed(() => lastDiagInfo.value?.info?.groupInfoList);
|
const diskArray = computed(() => lastDiagInfo.value?.info?.groupInfoList);
|
||||||
|
|
||||||
|
const fanInfo = computed(() => lastDiagInfo.value?.cdFanInfo);
|
||||||
|
const powerSupplyInfo = computed(() => lastDiagInfo.value?.cdPowerSupplyInfo);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -46,6 +71,7 @@ const diskArray = computed(() => lastDiagInfo.value?.info?.groupInfoList);
|
|||||||
<DeviceHeaderCard :ndm-device="ndmDevice" :station="station" />
|
<DeviceHeaderCard :ndm-device="ndmDevice" :station="station" />
|
||||||
<DeviceCommonCard :common-info="commonInfo" />
|
<DeviceCommonCard :common-info="commonInfo" />
|
||||||
<DeviceHardwareCard :cpu-usage="cpuUsage" :mem-usage="memUsage" />
|
<DeviceHardwareCard :cpu-usage="cpuUsage" :mem-usage="memUsage" />
|
||||||
|
<NvrEnvCard :fan-info="fanInfo" :power-supply-info="powerSupplyInfo" />
|
||||||
<NvrDiskCard :disk-health="diskHealth" :disk-array="diskArray" />
|
<NvrDiskCard :disk-health="diskHealth" :disk-array="diskArray" />
|
||||||
<template v-if="isNvrCluster(ndmDevice)">
|
<template v-if="isNvrCluster(ndmDevice)">
|
||||||
<NvrRecordCheckCard :ndm-device="ndmDevice" :station="station" />
|
<NvrRecordCheckCard :ndm-device="ndmDevice" :station="station" />
|
||||||
|
|||||||
@@ -42,8 +42,9 @@ const selected = ref([...historyDiagOptions.value.map((option) => `${option.valu
|
|||||||
const loading = ref<boolean>(false);
|
const loading = ref<boolean>(false);
|
||||||
const icmpLoading = ref<boolean>(false);
|
const icmpLoading = ref<boolean>(false);
|
||||||
const alarmLoading = ref<boolean>(false);
|
const alarmLoading = ref<boolean>(false);
|
||||||
|
const usageLoading = ref<boolean>(false);
|
||||||
const diskLoading = ref<boolean>(false);
|
const diskLoading = ref<boolean>(false);
|
||||||
watch([icmpLoading, alarmLoading, diskLoading], (loadings) => {
|
watch([icmpLoading, alarmLoading, usageLoading, diskLoading], (loadings) => {
|
||||||
loading.value = loadings.some((loading) => loading);
|
loading.value = loadings.some((loading) => loading);
|
||||||
});
|
});
|
||||||
const icmpHistoryQueryFn = ref<() => void>();
|
const icmpHistoryQueryFn = ref<() => void>();
|
||||||
@@ -103,7 +104,7 @@ onMounted(() => {
|
|||||||
:cpu-usage-field="'stCommonInfo.CPU使用率'"
|
:cpu-usage-field="'stCommonInfo.CPU使用率'"
|
||||||
:mem-usage-field="'stCommonInfo.内存使用率'"
|
:mem-usage-field="'stCommonInfo.内存使用率'"
|
||||||
v-model:range="range"
|
v-model:range="range"
|
||||||
v-model:loading="alarmLoading"
|
v-model:loading="usageLoading"
|
||||||
@expose-query-fn="onExposeUsageHistoryQueryFn"
|
@expose-query-fn="onExposeUsageHistoryQueryFn"
|
||||||
/>
|
/>
|
||||||
<NvrDiskHistoryCard v-if="selected.includes('disk')" :ndm-device="ndmDevice" :station="station" v-model:range="range" v-model:loading="diskLoading" @expose-query-fn="onExposeDiskHistoryQueryFn" />
|
<NvrDiskHistoryCard v-if="selected.includes('disk')" :ndm-device="ndmDevice" :station="station" v-model:range="range" v-model:loading="diskLoading" @expose-query-fn="onExposeDiskHistoryQueryFn" />
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { NdmSecurityBoxDiagInfo, NdmSecurityBoxResultVO, Station } from '@/apis';
|
import type { NdmSecurityBoxDiagInfo, NdmSecurityBoxResultVO, Station } from '@/apis';
|
||||||
import { DeviceCommonCard, DeviceHardwareCard, DeviceHeaderCard, SecurityBoxCircuitCard, SecurityBoxEnvCard } from '@/components';
|
import { DeviceCommonCard, DeviceHardwareCard, DeviceHeaderCard, SecurityBoxCircuitCard, SecurityBoxEnvCard, type DeviceCommonCardProps } from '@/components';
|
||||||
|
import { SECURITY_BOX_VENDOR_LITERALS } from '@/helpers';
|
||||||
import destr from 'destr';
|
import destr from 'destr';
|
||||||
import { NFlex } from 'naive-ui';
|
import { NFlex } from 'naive-ui';
|
||||||
import { computed, toRefs } from 'vue';
|
import { computed, toRefs } from 'vue';
|
||||||
@@ -19,17 +20,54 @@ const lastDiagInfo = computed(() => {
|
|||||||
return result as NdmSecurityBoxDiagInfo;
|
return result as NdmSecurityBoxDiagInfo;
|
||||||
});
|
});
|
||||||
|
|
||||||
const commonInfo = computed(() => {
|
// 解析安防箱厂商
|
||||||
const { stCommonInfo } = lastDiagInfo.value ?? {};
|
const vendor = computed(() => {
|
||||||
|
// 先读取诊断信息中的 stCommonInfo 中的设备厂商
|
||||||
|
if (!!lastDiagInfo.value?.stCommonInfo?.设备厂商) {
|
||||||
|
return lastDiagInfo.value.stCommonInfo.设备厂商.trim().toLocaleLowerCase();
|
||||||
|
}
|
||||||
|
// 如果 stCommonInfo 中没有设备厂商,再读取 ndmDevice 中的 manufacturer
|
||||||
|
if (!!ndmDevice.value.manufacturer) {
|
||||||
|
return ndmDevice.value.manufacturer.trim().toLocaleLowerCase();
|
||||||
|
}
|
||||||
|
// 如果 ndmDevice 中也没有 manufacturer,返回 beidian 作为兜底
|
||||||
|
return SECURITY_BOX_VENDOR_LITERALS.beidian;
|
||||||
|
});
|
||||||
|
|
||||||
|
const commonInfo = computed<DeviceCommonCardProps['commonInfo']>(() => {
|
||||||
|
const { ipAddress } = ndmDevice.value;
|
||||||
|
const { ethInfo, ipInfo, stCommonInfo } = lastDiagInfo.value ?? {};
|
||||||
const { 设备ID, 软件版本, 设备厂商, 设备别名, 设备型号, 硬件版本 } = stCommonInfo ?? {};
|
const { 设备ID, 软件版本, 设备厂商, 设备别名, 设备型号, 硬件版本 } = stCommonInfo ?? {};
|
||||||
return {
|
|
||||||
设备ID: 设备ID ?? '',
|
let operStatus = '-';
|
||||||
软件版本: 软件版本 ?? '',
|
if (!!ethInfo?.operStatus) {
|
||||||
设备厂商: 设备厂商 ?? '',
|
operStatus = ethInfo?.operStatus === '1' ? '正常' : '异常';
|
||||||
设备别名: 设备别名 ?? '',
|
}
|
||||||
设备型号: 设备型号 ?? '',
|
|
||||||
硬件版本: 硬件版本 ?? '',
|
return [
|
||||||
};
|
{
|
||||||
|
title: '设备型号信息',
|
||||||
|
items: [
|
||||||
|
{ label: '设备ID', value: 设备ID || '-' },
|
||||||
|
{ label: '软件版本', value: 软件版本 || '-' },
|
||||||
|
{ label: '设备厂商', value: 设备厂商 || '-' },
|
||||||
|
{ label: '设备别名', value: 设备别名 || '-' },
|
||||||
|
{ label: '设备型号', value: 设备型号 || '-' },
|
||||||
|
{ label: '硬件版本', value: 硬件版本 || '-' },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '设备网卡信息',
|
||||||
|
items: [
|
||||||
|
{ label: 'IP地址', value: ipAddress || '-' },
|
||||||
|
{ label: '子网掩码', value: ipInfo?.mASK || '-' },
|
||||||
|
{ label: 'MAC地址', value: ethInfo?.macAddress || '-' },
|
||||||
|
{ label: '连接速率', value: ethInfo?.speed || '-' },
|
||||||
|
{ label: 'MTU', value: ethInfo?.mTU || '-' },
|
||||||
|
{ label: '运行状态', value: operStatus },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
];
|
||||||
});
|
});
|
||||||
|
|
||||||
const cpuUsage = computed(() => lastDiagInfo.value?.stCommonInfo?.CPU使用率);
|
const cpuUsage = computed(() => lastDiagInfo.value?.stCommonInfo?.CPU使用率);
|
||||||
@@ -49,7 +87,7 @@ const circuits = computed(() => lastDiagInfo.value?.info?.at(0)?.circuits);
|
|||||||
<DeviceCommonCard :common-info="commonInfo" />
|
<DeviceCommonCard :common-info="commonInfo" />
|
||||||
<DeviceHardwareCard :cpu-usage="cpuUsage" :mem-usage="memUsage" />
|
<DeviceHardwareCard :cpu-usage="cpuUsage" :mem-usage="memUsage" />
|
||||||
<SecurityBoxEnvCard :fan-speeds="fanSpeeds" :temperature="temperature" :humidity="humidity" :switches="switches" />
|
<SecurityBoxEnvCard :fan-speeds="fanSpeeds" :temperature="temperature" :humidity="humidity" :switches="switches" />
|
||||||
<SecurityBoxCircuitCard :ndm-device="ndmDevice" :station="station" :circuits="circuits" />
|
<SecurityBoxCircuitCard :ndm-device="ndmDevice" :station="station" :vendor="vendor" :circuits="circuits" />
|
||||||
</NFlex>
|
</NFlex>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { useMutation } from '@tanstack/vue-query';
|
|||||||
import { isCancel } from 'axios';
|
import { isCancel } from 'axios';
|
||||||
import destr from 'destr';
|
import destr from 'destr';
|
||||||
import { isString } from 'es-toolkit';
|
import { isString } from 'es-toolkit';
|
||||||
import { NButton, NCard, NFlex, NForm, NFormItem, NFormItemGi, NGrid, NInput, NSwitch, type FormInst, type FormRules } from 'naive-ui';
|
import { NButton, NCard, NFlex, NForm, NFormItem, NFormItemGi, NGrid, NInput, NInputNumber, NSwitch, type FormInst, type FormRules } from 'naive-ui';
|
||||||
import { computed, onBeforeUnmount, ref, toRefs, useTemplateRef, watch } from 'vue';
|
import { computed, onBeforeUnmount, ref, toRefs, useTemplateRef, watch } from 'vue';
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
@@ -126,9 +126,15 @@ onBeforeUnmount(() => {
|
|||||||
<NFormItem label-placement="left" label="型号">
|
<NFormItem label-placement="left" label="型号">
|
||||||
<NInput v-model:value="localDevice.model" />
|
<NInput v-model:value="localDevice.model" />
|
||||||
</NFormItem>
|
</NFormItem>
|
||||||
|
<NFormItem label-placement="left" label="开关数量">
|
||||||
|
<NInputNumber clearable v-model:value="localDevice.circuitCount" />
|
||||||
|
</NFormItem>
|
||||||
<NFormItem label-placement="left" label="团体字符串">
|
<NFormItem label-placement="left" label="团体字符串">
|
||||||
<NInput v-model:value="localDevice.community" />
|
<NInput v-model:value="localDevice.community" />
|
||||||
</NFormItem>
|
</NFormItem>
|
||||||
|
<NFormItem label-placement="left" label="团体字符串(写)">
|
||||||
|
<NInput v-model:value="localDevice.writeCommunity" />
|
||||||
|
</NFormItem>
|
||||||
<NFormItem label-placement="left" label="设备描述">
|
<NFormItem label-placement="left" label="设备描述">
|
||||||
<NInput v-model:value="localDevice.description" />
|
<NInput v-model:value="localDevice.description" />
|
||||||
</NFormItem>
|
</NFormItem>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { type NdmServerDiagInfo, type NdmServerResultVO, type Station } from '@/apis';
|
import { type NdmServerDiagInfo, type NdmServerResultVO, type Station } from '@/apis';
|
||||||
import { DeviceHardwareCard, DeviceHeaderCard, ServerAlive, ServerHighAvailable, ServerStreamPush } from '@/components';
|
import { DeviceCommonCard, DeviceHardwareCard, DeviceHeaderCard, ServerAlive, ServerHighAvailable, ServerStreamPush, type DeviceCommonCardProps } from '@/components';
|
||||||
import destr from 'destr';
|
import destr from 'destr';
|
||||||
import { NFlex } from 'naive-ui';
|
import { NFlex } from 'naive-ui';
|
||||||
import { computed, toRefs } from 'vue';
|
import { computed, toRefs } from 'vue';
|
||||||
@@ -19,6 +19,30 @@ const lastDiagInfo = computed(() => {
|
|||||||
return result as NdmServerDiagInfo;
|
return result as NdmServerDiagInfo;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const commonInfo = computed<DeviceCommonCardProps['commonInfo']>(() => {
|
||||||
|
const { ipAddress } = ndmDevice.value;
|
||||||
|
const { ethInfo, ipInfo } = lastDiagInfo.value ?? {};
|
||||||
|
|
||||||
|
let operStatus = '-';
|
||||||
|
if (!!ethInfo?.operStatus) {
|
||||||
|
operStatus = ethInfo?.operStatus === '1' ? '正常' : '异常';
|
||||||
|
}
|
||||||
|
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
title: '设备网卡信息',
|
||||||
|
items: [
|
||||||
|
{ label: 'IP地址', value: ipAddress || '-' },
|
||||||
|
{ label: '子网掩码', value: ipInfo?.mASK || '-' },
|
||||||
|
{ label: 'MAC地址', value: ethInfo?.macAddress || '-' },
|
||||||
|
{ label: '连接速率', value: ethInfo?.speed || '-' },
|
||||||
|
{ label: 'MTU', value: ethInfo?.mTU || '-' },
|
||||||
|
{ label: '运行状态', value: operStatus },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
];
|
||||||
|
});
|
||||||
|
|
||||||
const cpuUsage = computed(() => lastDiagInfo.value?.commInfo?.CPU使用率);
|
const cpuUsage = computed(() => lastDiagInfo.value?.commInfo?.CPU使用率);
|
||||||
const memUsage = computed(() => lastDiagInfo.value?.commInfo?.内存使用率);
|
const memUsage = computed(() => lastDiagInfo.value?.commInfo?.内存使用率);
|
||||||
const diskUsage = computed(() => lastDiagInfo.value?.commInfo?.磁盘使用率);
|
const diskUsage = computed(() => lastDiagInfo.value?.commInfo?.磁盘使用率);
|
||||||
@@ -29,6 +53,7 @@ const runningTime = computed(() => lastDiagInfo.value?.commInfo?.系统运行时
|
|||||||
<NFlex vertical>
|
<NFlex vertical>
|
||||||
<ServerHighAvailable :ndm-device="ndmDevice" :station="station" />
|
<ServerHighAvailable :ndm-device="ndmDevice" :station="station" />
|
||||||
<DeviceHeaderCard :ndm-device="ndmDevice" :station="station" />
|
<DeviceHeaderCard :ndm-device="ndmDevice" :station="station" />
|
||||||
|
<DeviceCommonCard :common-info="commonInfo" />
|
||||||
<DeviceHardwareCard running-time-label="服务器运行时间" :cpu-usage="cpuUsage" :mem-usage="memUsage" :disk-usage="diskUsage" :running-time="runningTime" />
|
<DeviceHardwareCard running-time-label="服务器运行时间" :cpu-usage="cpuUsage" :mem-usage="memUsage" :disk-usage="diskUsage" :running-time="runningTime" />
|
||||||
<ServerAlive :ndm-device="ndmDevice" :station="station" />
|
<ServerAlive :ndm-device="ndmDevice" :station="station" />
|
||||||
<ServerStreamPush :ndm-device="ndmDevice" :station="station" />
|
<ServerStreamPush :ndm-device="ndmDevice" :station="station" />
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { getHighAvailableApi, type NdmServerResultVO, type Station } from '@/api
|
|||||||
import { DEVICE_TYPE_LITERALS, tryGetDeviceType } from '@/enums';
|
import { DEVICE_TYPE_LITERALS, tryGetDeviceType } from '@/enums';
|
||||||
import { useSettingStore } from '@/stores';
|
import { useSettingStore } from '@/stores';
|
||||||
import { useQuery, useQueryClient } from '@tanstack/vue-query';
|
import { useQuery, useQueryClient } from '@tanstack/vue-query';
|
||||||
import { NAlert, NCard, NFlex } from 'naive-ui';
|
import { NAlert, NFlex } from 'naive-ui';
|
||||||
import { storeToRefs } from 'pinia';
|
import { storeToRefs } from 'pinia';
|
||||||
import { computed, toRefs, watch } from 'vue';
|
import { computed, toRefs, watch } from 'vue';
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
// 设备参数配置在系统中的key前缀
|
// 设备参数配置在系统中的key前缀
|
||||||
const DEVICE_PARAM_PREFIXES = {
|
const DEVICE_PARAM_PREFIXES = {
|
||||||
|
Camera: 'CAMERA_',
|
||||||
Switch: 'SWITCH_',
|
Switch: 'SWITCH_',
|
||||||
Server: 'SERVER_',
|
Server: 'SERVER_',
|
||||||
Decoder: 'DECODER_',
|
Decoder: 'DECODER_',
|
||||||
@@ -67,6 +68,10 @@ const getItemSuffix = (name: string) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const tabPanes = [
|
const tabPanes = [
|
||||||
|
{
|
||||||
|
tab: '摄像机阈值',
|
||||||
|
name: DEVICE_PARAM_PREFIXES.Camera,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
tab: '交换机阈值',
|
tab: '交换机阈值',
|
||||||
name: DEVICE_PARAM_PREFIXES.Switch,
|
name: DEVICE_PARAM_PREFIXES.Switch,
|
||||||
@@ -109,7 +114,7 @@ const show = defineModel<boolean>('show', { required: true });
|
|||||||
|
|
||||||
const { station } = toRefs(props);
|
const { station } = toRefs(props);
|
||||||
|
|
||||||
const activeTabName = ref<DeviceParamPrefix>(DEVICE_PARAM_PREFIXES.Switch);
|
const activeTabName = ref<DeviceParamPrefix>(DEVICE_PARAM_PREFIXES.Camera);
|
||||||
|
|
||||||
const deviceParams = ref<DeviceParamItem[]>([]);
|
const deviceParams = ref<DeviceParamItem[]>([]);
|
||||||
|
|
||||||
@@ -211,7 +216,7 @@ const onAfterModalEnter = () => {
|
|||||||
|
|
||||||
const onBeforeModalLeave = () => {
|
const onBeforeModalLeave = () => {
|
||||||
saveDeviceParams({ tabName: activeTabName.value, items: deviceParams.value });
|
saveDeviceParams({ tabName: activeTabName.value, items: deviceParams.value });
|
||||||
activeTabName.value = DEVICE_PARAM_PREFIXES.Switch;
|
activeTabName.value = DEVICE_PARAM_PREFIXES.Camera;
|
||||||
deviceParams.value = [];
|
deviceParams.value = [];
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
export * from './nvr';
|
||||||
|
export * from './security-box';
|
||||||
|
export * from './switch';
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
export * from './util';
|
||||||
@@ -0,0 +1,64 @@
|
|||||||
|
import { rebootSecurityBoxBeidianApi, rebootSecurityBoxNingTechApi, turnCircuitStatusBeidianApi, turnCircuitStatusNingTechApi, type NdmSecurityBoxResultVO } from '@/apis';
|
||||||
|
import { objectEntries } from '@vueuse/core';
|
||||||
|
|
||||||
|
const UNSUPPORTED_SECURITY_BOX_VENDOR = '不支持的安防箱厂商';
|
||||||
|
|
||||||
|
export const SECURITY_BOX_VENDOR_LITERALS = {
|
||||||
|
beidian: 'beidian',
|
||||||
|
ningtech: 'ningtech',
|
||||||
|
} as const;
|
||||||
|
|
||||||
|
export type SecurityBoxVendor = keyof typeof SECURITY_BOX_VENDOR_LITERALS;
|
||||||
|
|
||||||
|
export const resolveSecurityBoxVendor = (vendor?: string) => {
|
||||||
|
const entry = objectEntries(SECURITY_BOX_VENDOR_LITERALS).find(([, value]) => value === vendor);
|
||||||
|
return entry?.at(0);
|
||||||
|
};
|
||||||
|
|
||||||
|
export const normalizeSecurityBoxWriteCommunity = (ndmDevice: NdmSecurityBoxResultVO, vendor?: string) => {
|
||||||
|
const resolved = resolveSecurityBoxVendor(vendor);
|
||||||
|
if (resolved === SECURITY_BOX_VENDOR_LITERALS.beidian) {
|
||||||
|
const community = ndmDevice.community;
|
||||||
|
if (!community) throw new Error('团体字符串不存在');
|
||||||
|
return community;
|
||||||
|
}
|
||||||
|
if (resolved === SECURITY_BOX_VENDOR_LITERALS.ningtech) {
|
||||||
|
const community = ndmDevice.writeCommunity;
|
||||||
|
if (!community) throw new Error('团体字符串(写)不存在');
|
||||||
|
return community;
|
||||||
|
}
|
||||||
|
throw new Error(UNSUPPORTED_SECURITY_BOX_VENDOR);
|
||||||
|
};
|
||||||
|
|
||||||
|
export const normalizeSecurityBoxCircuitIndex = (index: number, vendor?: string) => {
|
||||||
|
const resolved = resolveSecurityBoxVendor(vendor);
|
||||||
|
if (resolved === SECURITY_BOX_VENDOR_LITERALS.beidian) {
|
||||||
|
return index;
|
||||||
|
}
|
||||||
|
if (resolved === SECURITY_BOX_VENDOR_LITERALS.ningtech) {
|
||||||
|
return index + 1;
|
||||||
|
}
|
||||||
|
throw new Error(UNSUPPORTED_SECURITY_BOX_VENDOR);
|
||||||
|
};
|
||||||
|
|
||||||
|
export const dispatchTurnCircuitStatusApi = (vendor?: string) => {
|
||||||
|
const resolved = resolveSecurityBoxVendor(vendor);
|
||||||
|
if (resolved === SECURITY_BOX_VENDOR_LITERALS.beidian) {
|
||||||
|
return turnCircuitStatusBeidianApi;
|
||||||
|
}
|
||||||
|
if (resolved === SECURITY_BOX_VENDOR_LITERALS.ningtech) {
|
||||||
|
return turnCircuitStatusNingTechApi;
|
||||||
|
}
|
||||||
|
throw new Error(UNSUPPORTED_SECURITY_BOX_VENDOR);
|
||||||
|
};
|
||||||
|
|
||||||
|
export const dispatchRebootSecurityBoxApi = (vendor?: string) => {
|
||||||
|
const resolved = resolveSecurityBoxVendor(vendor);
|
||||||
|
if (resolved === SECURITY_BOX_VENDOR_LITERALS.beidian) {
|
||||||
|
return rebootSecurityBoxBeidianApi;
|
||||||
|
}
|
||||||
|
if (resolved === SECURITY_BOX_VENDOR_LITERALS.ningtech) {
|
||||||
|
return rebootSecurityBoxNingTechApi;
|
||||||
|
}
|
||||||
|
throw new Error(UNSUPPORTED_SECURITY_BOX_VENDOR);
|
||||||
|
};
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
export * from './adapter';
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
export * from './util';
|
||||||
@@ -1,3 +1,2 @@
|
|||||||
export * from './device-alarm';
|
export * from './device';
|
||||||
export * from './nvr-cluster';
|
export * from './log';
|
||||||
export * from './switch-port';
|
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
export * from './render';
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
export * from './alarm-log';
|
||||||
Reference in New Issue
Block a user