diff --git a/orion-visor-ui/src/api/asset/host-extra.ts b/orion-visor-ui/src/api/asset/host-extra.ts index 62419d8d..ca235c83 100644 --- a/orion-visor-ui/src/api/asset/host-extra.ts +++ b/orion-visor-ui/src/api/asset/host-extra.ts @@ -50,20 +50,23 @@ export interface HostLabelExtraSettingModel { export interface HostSpecExtraModel { sn: string; osName: string; - cpuCore: number; + cpuCount: number; + cpuPhysicalCore: number; + cpuLogicalCore: number; cpuFrequency: number; cpuModel: string; memorySize: number; diskSize: number; inBandwidth: number; outBandwidth: number; - publicIpAddress: Array; - privateIpAddress: Array; + publicIpAddresses: Array; + privateIpAddresses: Array; chargePerson: string; createdTime: number; expiredTime: number; items: Array<{ label: string; + key?: string; value: string; }>; } diff --git a/orion-visor-ui/src/views/asset/host-list/components/host-card-list.vue b/orion-visor-ui/src/views/asset/host-list/components/host-card-list.vue index d0740b5d..90b7eee1 100644 --- a/orion-visor-ui/src/views/asset/host-list/components/host-card-list.vue +++ b/orion-visor-ui/src/views/asset/host-list/components/host-card-list.vue @@ -163,7 +163,7 @@ {{ [ - addSuffix(record.spec.cpuCore, 'C'), + addSuffix(record.spec.cpuPhysicalCore, 'C'), addSuffix(record.spec.memorySize, 'G'), addSuffix(record.spec.diskSize, 'G') ].filter(Boolean).join('/') || '-' diff --git a/orion-visor-ui/src/views/asset/host-list/components/host-form-spec.vue b/orion-visor-ui/src/views/asset/host-list/components/host-form-spec.vue index b1e5e085..e4240511 100644 --- a/orion-visor-ui/src/views/asset/host-list/components/host-form-spec.vue +++ b/orion-visor-ui/src/views/asset/host-list/components/host-form-spec.vue @@ -32,12 +32,22 @@ - {{ formModel.cpuCore }} + {{ formModel.cpuPhysicalCore }} + + + + + {{ formModel.cpuLogicalCore }} @@ -111,43 +121,19 @@ - - - - {{ addr }} - - - + - - - - {{ addr }} - - - + @@ -221,16 +207,24 @@ + @click="toggleEditing"> 编辑 - 保存 + + + 取消 + ({} as HostSpecExtraModel); // 加载配置 const fetchHostSpec = async () => { setLoading(true); + editing.value = false; try { const { data } = await getHostExtraItem({ hostId: props.hostId, item: 'SPEC' }); formModel.value = data; @@ -298,6 +292,13 @@ const saveSpec = async () => { setLoading(true); try { + // 设置额外配置的 key + if (formModel.value.items?.length) { + formModel.value.items.forEach(s => { + s.key = s.label; + }); + } + // 更新 await updateHostSpec({ hostId: props.hostId, extra: JSON.stringify(formModel.value) diff --git a/orion-visor-ui/src/views/asset/host-list/components/host-table.vue b/orion-visor-ui/src/views/asset/host-list/components/host-table.vue index 2952a165..8712ac95 100644 --- a/orion-visor-ui/src/views/asset/host-list/components/host-table.vue +++ b/orion-visor-ui/src/views/asset/host-list/components/host-table.vue @@ -191,7 +191,7 @@ {{ [ - addSuffix(record.spec.cpuCore, 'C'), + addSuffix(record.spec.cpuPhysicalCore, 'C'), addSuffix(record.spec.memorySize, 'G'), addSuffix(record.spec.diskSize, 'G') ].filter(Boolean).join(' / ') || '-'