refactor: extract isNvrCluster
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import type { NdmNvrResultVO } from '@/apis/models';
|
||||
import { isNvrCluster } from '@/components/helper';
|
||||
import dayjs from 'dayjs';
|
||||
import { NButton, NCard, NDatePicker, NFlex, NGi, NGrid, NSelect, type DatePickerProps, type SelectOption } from 'naive-ui';
|
||||
import { computed, onMounted, reactive, ref, toRefs, useTemplateRef } from 'vue';
|
||||
@@ -66,12 +67,11 @@ onMounted(() => {
|
||||
});
|
||||
|
||||
const diagCards = computed<SelectOption[]>(() => {
|
||||
const isCluster = (maybeNvrCluster: NdmNvrResultVO) => !!maybeNvrCluster.clusterList?.trim() && maybeNvrCluster.clusterList !== maybeNvrCluster.ipAddress;
|
||||
const baseOptions: SelectOption[] = [
|
||||
{ label: '设备状态', value: 'status' },
|
||||
{ label: '设备告警', value: 'alarm' },
|
||||
];
|
||||
if (!isCluster(ndmNvr.value)) {
|
||||
if (!isNvrCluster(ndmNvr.value)) {
|
||||
baseOptions.push({ label: '硬件使用率', value: 'usage' }, { label: '硬盘健康', value: 'health' });
|
||||
}
|
||||
return baseOptions;
|
||||
|
||||
Reference in New Issue
Block a user