feat: 新增安防箱网卡信息展示并更新卡片标题

- 修改安防箱环境卡片标题为“安防箱环境状态”
- 新增网卡信息展示模块,包含IP、子网掩码、MAC地址等参数
This commit is contained in:
yangsy
2026-05-20 12:48:18 +08:00
parent 6437b6bf35
commit 01a2a5bda6
3 changed files with 50 additions and 2 deletions
@@ -40,7 +40,7 @@ const getStatusTagType = (status: string | null) => {
<template>
<NCard v-if="showCard" hoverable size="small">
<template #header>
<span>安防箱状态</span>
<span>安防箱环境状态</span>
</template>
<template #default>
<NFlex vertical>
@@ -35,9 +35,15 @@ const vendor = computed(() => {
});
const commonInfo = computed<DeviceCommonCardProps['commonInfo']>(() => {
const { stCommonInfo } = lastDiagInfo.value ?? {};
const { ipAddress } = ndmDevice.value;
const { ethInfo, ipInfo, stCommonInfo } = lastDiagInfo.value ?? {};
const { 设备ID, 软件版本, 设备厂商, 设备别名, 设备型号, 硬件版本 } = stCommonInfo ?? {};
let operStatus = '-';
if (!!ethInfo?.operStatus) {
operStatus = ethInfo?.operStatus === '1' ? '正常' : '异常';
}
return [
{
title: '设备型号信息',
@@ -50,6 +56,17 @@ const commonInfo = computed<DeviceCommonCardProps['commonInfo']>(() => {
{ 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 },
],
},
];
});