From adabf4278359bcf235dfa69ff9f243fcbf03eb6b Mon Sep 17 00:00:00 2001 From: xusongfu Date: Wed, 30 Mar 2022 10:28:29 +0800 Subject: [PATCH] fix: Fix tags column and validator tips 1. Fix tags error in hypervisors page 2. Fix validator tips about commas Change-Id: Idb92d62e2f309476b647532e01d3e05fa23c7748 --- src/locales/zh.json | 2 +- src/stores/nova/instance.js | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/locales/zh.json b/src/locales/zh.json index e26628d5..b222c5fb 100644 --- a/src/locales/zh.json +++ b/src/locales/zh.json @@ -303,7 +303,7 @@ "Code": "编码", "Cold Migrate": "冷迁移", "Colombia": "哥伦比亚", - "Commas ‘,’ are not allowed to be in a tag name in order to simplify requests that specify lists of tags": "标记名称中不允许使用逗号“,”,以简化指定标记列表的请求", + "Commas ‘,’ are not allowed to be in a tag name in order to simplify requests that specify lists of tags": "标记名称中不允许使用英文逗号“,”,以简化指定标记列表的请求", "Commit Latency(ms)": "提交延迟(毫秒)", "Common Server": "云主机", "Comoros": "科摩罗", diff --git a/src/stores/nova/instance.js b/src/stores/nova/instance.js index ab779cd8..b9859d35 100644 --- a/src/stores/nova/instance.js +++ b/src/stores/nova/instance.js @@ -139,14 +139,25 @@ export class ServerStore extends Base { if (imageId.indexOf(server.image) !== -1) { server.iso_server = true; } + server.tags = (server.origin_data || {}).tags || []; return server; }); } if (isServerGroup) { - return newData.filter((it) => members.indexOf(it.id) >= 0); + return newData + .filter((it) => members.indexOf(it.id) >= 0) + .map((it) => ({ + ...it, + tags: (it.origin_data || {}).tags || [], + })); } if (host) { - return newData.filter((it) => it.host === host); + return newData + .filter((it) => it.host === host) + .map((it) => ({ + ...it, + tags: (it.origin_data || {}).tags || [], + })); } return newData.map((it) => ({ ...it,