From 20cc08159c481c4572175173f771148b29d2550d Mon Sep 17 00:00:00 2001 From: "Jingwei.Zhang" Date: Thu, 16 Dec 2021 10:03:58 +0800 Subject: [PATCH] feat: Update flavor detail page 1. Add numa node info in flavor detail page 2. Add memory page size info in flavor detail page Change-Id: I6fc4a93c4e78e9a75f32fe1f35e4b73cb504bcca --- src/locales/en.json | 2 +- src/locales/zh.json | 4 ++-- .../containers/Flavor/Detail/BaseDetail.jsx | 15 ++++++++++++++- .../Flavor/actions/StepCreate/ParamSetting.jsx | 4 ++-- 4 files changed, 19 insertions(+), 6 deletions(-) diff --git a/src/locales/en.json b/src/locales/en.json index 6616cddb..e159f13d 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -1177,7 +1177,7 @@ "Memory": "Memory", "Memory Optimized": "Memory Optimized", "Memory Page": "Memory Page", - "Memory Page Value": "Memory Page Value", + "Memory Page Size": "Memory Page Size", "Memory Usage": "Memory Usage", "Memory usage Num (GB": "Memory usage Num (GB", "Message": "Message", diff --git a/src/locales/zh.json b/src/locales/zh.json index 8e6eeac4..4eb75af3 100644 --- a/src/locales/zh.json +++ b/src/locales/zh.json @@ -104,7 +104,7 @@ "Anti-affinity (mandatory):": "反亲和(强制):", "Anti-affinity (not mandatory):": "反亲和 (非强制):", "Antigua and Barbuda": "安提瓜和巴布达", - "Any": "", + "Any": "任意", "Any(Random)": "任意(随机)", "Application Credentials": "应用凭证", "Application Template": "应用模板", @@ -1177,7 +1177,7 @@ "Memory": "内存", "Memory Optimized": "内存型", "Memory Page": "内存页", - "Memory Page Value": "内存页值", + "Memory Page Size": "内存页大小", "Memory Usage": "内存使用量", "Memory usage Num (GB": "内存用量 (GB)", "Message": "消息", diff --git a/src/pages/compute/containers/Flavor/Detail/BaseDetail.jsx b/src/pages/compute/containers/Flavor/Detail/BaseDetail.jsx index ddf7cee4..313f2c5b 100644 --- a/src/pages/compute/containers/Flavor/Detail/BaseDetail.jsx +++ b/src/pages/compute/containers/Flavor/Detail/BaseDetail.jsx @@ -100,6 +100,7 @@ export default class BaseDetail extends Base { const { category, architecture } = this.detailData; const hasIOPS = categoryHasIOPS(category); const hasEphemeral = categoryHasEphemeral(category); + const typeIsComputeOptimized = isComputeOptimized(category); if (isBareMetal(architecture)) { return this.getBareMetalCard(); } @@ -133,6 +134,18 @@ export default class BaseDetail extends Base { }, }); } + if (!typeIsComputeOptimized) { + const numaItem = { + label: t('NUMA Node Count'), + dataIndex: 'hw:numa_nodes', + }; + const memPageItem = { + label: t('Memory Page Size'), + dataIndex: 'hw:mem_page_size', + render: (value) => (value && pageTypeMap[value]) || value || '-', + }; + options.push(...[numaItem, memPageItem]); + } return { title: t('Base Info'), @@ -224,7 +237,7 @@ export default class BaseDetail extends Base { render: (value) => cpuThreadPolicyMap[value] || '-', }, { - label: t('Memory Page'), + label: t('Memory Page Size'), dataIndex: 'hw:mem_page_size', render: (value) => pageTypeMap[value] || '-', }, diff --git a/src/pages/compute/containers/Flavor/actions/StepCreate/ParamSetting.jsx b/src/pages/compute/containers/Flavor/actions/StepCreate/ParamSetting.jsx index 855394f2..0c31444a 100644 --- a/src/pages/compute/containers/Flavor/actions/StepCreate/ParamSetting.jsx +++ b/src/pages/compute/containers/Flavor/actions/StepCreate/ParamSetting.jsx @@ -414,7 +414,7 @@ export class ParamSetting extends Base { }, { name: 'memPageSizeValueMore', - label: t('Memory Page Value'), + label: t('Memory Page Size'), type: 'input', hidden: !showPageSizeInputMore, required: showPageSizeInputMore, @@ -499,7 +499,7 @@ export class ParamSetting extends Base { }, { name: 'memPageSizeValue', - label: t('Memory Page Value'), + label: t('Memory Page Size'), type: 'input', hidden: !showPageSizeInput, required: showPageSizeInput,