feat: 新增录像机环境状态卡片和网卡信息
This commit is contained in:
@@ -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[];
|
||||||
|
cdPowerSupplyInfo?: NdmNvrPowerSupplyInfo[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface NdmNvrFanInfo {
|
||||||
索引号?: string;
|
索引号?: string;
|
||||||
'风扇转速(rpm)'?: string;
|
'风扇转速(rpm)'?: string;
|
||||||
}[];
|
}
|
||||||
cdPowerSupplyInfo?: {
|
|
||||||
|
export interface NdmNvrPowerSupplyInfo {
|
||||||
索引号?: string;
|
索引号?: string;
|
||||||
电源状态?: string;
|
电源状态?: string;
|
||||||
}[];
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ 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';
|
||||||
@@ -16,6 +17,7 @@ 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>
|
||||||
@@ -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, type DeviceCommonCardProps } 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';
|
||||||
@@ -21,9 +21,14 @@ const lastDiagInfo = computed(() => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const commonInfo = computed<DeviceCommonCardProps['commonInfo']>(() => {
|
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 ?? {};
|
||||||
|
|
||||||
|
let operStatus = '-';
|
||||||
|
if (!!ethInfo?.operStatus) {
|
||||||
|
operStatus = ethInfo?.operStatus === '1' ? '正常' : '异常';
|
||||||
|
}
|
||||||
|
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
@@ -37,6 +42,17 @@ const commonInfo = computed<DeviceCommonCardProps['commonInfo']>(() => {
|
|||||||
{ 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 },
|
||||||
|
],
|
||||||
|
},
|
||||||
];
|
];
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -45,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>
|
||||||
@@ -52,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" />
|
||||||
|
|||||||
Reference in New Issue
Block a user