refactor(diag-info): make all fields optional
This commit is contained in:
@@ -21,16 +21,16 @@ const debugModeStore = useDebugModeStore();
|
||||
const { stationCode, ndmSwitch } = toRefs(props);
|
||||
|
||||
const lastDiagInfo = computed(() => {
|
||||
const result = destr<NdmSwitchDiagInfo>(ndmSwitch.value.lastDiagInfo);
|
||||
const result = destr<any>(ndmSwitch.value.lastDiagInfo);
|
||||
if (!result) return null;
|
||||
if (typeof result !== 'object') return null;
|
||||
return result;
|
||||
return result as NdmSwitchDiagInfo;
|
||||
});
|
||||
|
||||
const cpuUsage = computed(() => lastDiagInfo.value?.cpuRatio);
|
||||
const memUsage = computed(() => lastDiagInfo.value?.memoryRatio);
|
||||
|
||||
const portInfoList = computed(() => lastDiagInfo.value?.info.portInfoList ?? []);
|
||||
const portInfoList = computed(() => lastDiagInfo.value?.info?.portInfoList ?? []);
|
||||
|
||||
const selectedTab = ref('设备状态');
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user