From 8185bc71cba8c07a8e99a16099246ba84af9aaea Mon Sep 17 00:00:00 2001 From: songyu-bytedance Date: Tue, 16 Dec 2025 17:29:01 +0800 Subject: [PATCH 1/8] chore(docs): remove tracked docs/dist build artifacts --- docs/dist | 1 - 1 file changed, 1 deletion(-) delete mode 120000 docs/dist diff --git a/docs/dist b/docs/dist deleted file mode 120000 index 417ec0f8..00000000 --- a/docs/dist +++ /dev/null @@ -1 +0,0 @@ -/Users/bytedance/Desktop/ve-arch/agent/veaiops/docs/.output/public \ No newline at end of file From a25da465a46086d1c25cda2200a99383721ff1a1 Mon Sep 17 00:00:00 2001 From: songyu-bytedance Date: Wed, 17 Dec 2025 11:23:02 +0800 Subject: [PATCH 2/8] feat(wizard): support regex search for host selection --- .../shared/instance-selection-configs.tsx | 36 ++--- .../src/components/wizard/utils/filter.ts | 134 ++++++++++++++++++ 2 files changed, 152 insertions(+), 18 deletions(-) create mode 100644 frontend/apps/veaiops/src/components/wizard/utils/filter.ts diff --git a/frontend/apps/veaiops/src/components/wizard/steps/host-selection/components/shared/instance-selection-configs.tsx b/frontend/apps/veaiops/src/components/wizard/steps/host-selection/components/shared/instance-selection-configs.tsx index a2826267..eee22194 100644 --- a/frontend/apps/veaiops/src/components/wizard/steps/host-selection/components/shared/instance-selection-configs.tsx +++ b/frontend/apps/veaiops/src/components/wizard/steps/host-selection/components/shared/instance-selection-configs.tsx @@ -18,8 +18,9 @@ */ import { IconCloud, IconDesktop } from '@arco-design/web-react/icon'; +import type { AliyunInstance, VolcengineInstance } from '@wizard/types'; +import { checkMatch } from '@wizard/utils/filter'; import type { ZabbixHost } from 'api-generate'; -import type { AliyunInstance, VolcengineInstance } from '../../../../types'; import type { InstanceSelectionConfig } from './instance-selection-config'; /** @@ -42,7 +43,7 @@ export const createAliyunConfig = ( instance.instanceId || instance.dimensions?.instanceId || instance.dimensions?.userId || - instance.userId || + (instance as AliyunInstance & { userId?: string }).userId || ''; const name = instance.instanceName || @@ -62,23 +63,23 @@ export const createAliyunConfig = ( }, selectionAction, searchFilter: (instance, searchValue) => { - const searchLower = searchValue.toLowerCase(); return ( - (instance.instanceId?.toLowerCase() || '').includes(searchLower) || - (instance.instanceName?.toLowerCase() || '').includes(searchLower) || - (instance.region?.toLowerCase() || '').includes(searchLower) || + checkMatch(instance.instanceId, searchValue) || + checkMatch(instance.instanceName, searchValue) || + checkMatch(instance.region, searchValue) || // 当只有 userId 时,也支持搜索 userId - (instance.dimensions?.userId?.toLowerCase() || '').includes( - searchLower, - ) || - (instance.userId?.toLowerCase() || '').includes(searchLower) + checkMatch(instance.dimensions?.userId, searchValue) || + checkMatch( + (instance as AliyunInstance & { userId?: string }).userId, + searchValue, + ) ); }, getId: (instance) => instance.instanceId || instance.dimensions?.instanceId || instance.dimensions?.userId || - instance.userId || + (instance as AliyunInstance & { userId?: string }).userId || '', }); @@ -104,10 +105,10 @@ export const createVolcengineConfig = ( }), selectionAction, searchFilter: (instance, searchValue) => - instance.instanceId.toLowerCase().includes(searchValue) || - (instance.instanceName?.toLowerCase() || '').includes(searchValue) || - (instance.region?.toLowerCase() || '').includes(searchValue) || - (instance.namespace?.toLowerCase() || '').includes(searchValue), + checkMatch(instance.instanceId, searchValue) || + checkMatch(instance.instanceName, searchValue) || + checkMatch(instance.region, searchValue) || + checkMatch(instance.namespace, searchValue), getId: (instance) => instance.instanceId, }); @@ -120,7 +121,7 @@ export const createZabbixConfig = ( title: '选择主机', description: '选择要监控的主机,可以选择多个主机', emptyDescription: '暂无可用的主机', - searchPlaceholder: '搜索主机名称...', + searchPlaceholder: '搜索主机名称 (支持正则)...', itemType: '主机', icon: , dataTransformer: (host) => ({ @@ -131,8 +132,7 @@ export const createZabbixConfig = ( }), selectionAction, searchFilter: (host, searchValue) => - host.host.toLowerCase().includes(searchValue) || - host.name.toLowerCase().includes(searchValue), + checkMatch(host.host, searchValue) || checkMatch(host.name, searchValue), getId: (host) => host.host, // 使用 host 作为唯一标识 useHostList: true, // 使用特殊的主机列表组件 }); diff --git a/frontend/apps/veaiops/src/components/wizard/utils/filter.ts b/frontend/apps/veaiops/src/components/wizard/utils/filter.ts new file mode 100644 index 00000000..a8e43cf4 --- /dev/null +++ b/frontend/apps/veaiops/src/components/wizard/utils/filter.ts @@ -0,0 +1,134 @@ +// Copyright 2025 Beijing Volcano Engine Technology Co., Ltd. and/or its affiliates +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * 检查字符串是否匹配搜索值(支持模糊匹配和正则表达式) + * @param text 要检查的文本 + * @param searchValue 搜索值(普通字符串或正则表达式字符串) + * @returns 是否匹配 + */ +export const isMatch = ( + text: string | undefined | null, + searchValue: string, +): boolean => { + if (!text) { + return false; + } + + const safeText = text.toLowerCase(); + const safeSearch = searchValue.toLowerCase().trim(); + + if (!safeSearch) { + return true; + } + + try { + // 优先尝试作为正则表达式匹配 + // 用户可能会输入 AA-\d+-BB 这样的正则 + // 也可能输入 AA-* 这样的通配符 + // 或者只是简单的子串 AA + + // 策略: + // 1. 如果包含正则元字符(除了 *),尝试作为正则解析 + // 2. 如果只包含 *,作为通配符处理 + // 3. 否则作为普通字符串包含匹配 + + // 检查是否包含除了 * 以外的正则元字符 + // const hasRegexMeta = /[.+?^${}()|[\]\\]/.test(safeSearch); + + // 直接尝试构建正则 + // 为了支持通配符 *,我们可以先尝试将通配符转换为正则 + // 但这会与用户输入的 \d+ 冲突 + // 考虑到需求明确提到 "AA-数字-BB 格式正则匹配",即用户会输入正则语法 + // 所以优先支持标准正则语法 + + const regex = new RegExp(safeSearch, 'i'); + if (regex.test(text)) { + return true; + } + } catch (e) { + // 如果标准正则解析失败(例如语法错误),则尝试作为通配符处理 + // 这种情况可能发生在用户输入了不完整的正则,或者意图是使用通配符但包含了一些会被正则引擎误判的字符 + } + + // 通配符处理逻辑 (简单的 * 转换) + // 仅当包含 * 且不是有效的正则时尝试(或者作为备选策略) + if (safeSearch.includes('*')) { + try { + // 转义除了 * 以外的所有正则元字符 + const pattern = safeSearch + .replace(/[.+?^${}()|[\]\\]/g, '\\$&') + .replace(/\*/g, '.*'); + const wildcardRegex = new RegExp(`^${pattern}$`, 'i'); // 通配符通常意味着全匹配模式,或者用户习惯 + if (wildcardRegex.test(text)) { + return true; + } + } catch (e) { + // 忽略 + } + } + + // 最后回退到普通包含匹配 + return safeText.includes(safeSearch); +}; + +/** + * 专门针对 AA-数字-BB 格式优化的匹配逻辑 + * 以及支持普通的正则匹配 + */ +/** + * 专门针对 AA-数字-BB 格式优化的匹配逻辑 + * 以及支持普通的正则匹配 + */ +export const checkMatch = ( + text: string | undefined | null, + searchValue: string, +): boolean => { + if (!text) { + return false; + } + + const safeText = text.trim(); + const query = searchValue.trim(); + + if (!query) { + return true; + } + + // 1. 尝试作为正则表达式匹配 + // 优化:只有当查询字符串包含正则元字符时才尝试正则匹配 + // 这可以避免将普通字符串 "server" 作为正则处理的开销(虽然微乎其微), + // 但更重要的是明确了匹配意图。 + // 不过,需求要求 "AA-数字-BB" 这种格式,其中包含 \d 这样的元字符序列, + // 或者用户可能直接输入 ^server.* 这样的正则。 + // 所以直接尝试 RegExp 是最稳妥的。 + + try { + // 使用 'i' 标志忽略大小写 + const regex = new RegExp(query, 'i'); + if (regex.test(safeText)) { + return true; + } + } catch (e) { + // 正则解析失败(例如输入了未闭合的括号),忽略错误,降级到普通字符串匹配 + // 在开发环境下可以打印日志 + if (process.env.NODE_ENV === 'development') { + // console.warn('Regex parsing failed:', e); + } + } + + // 2. 普通字符串包含匹配 (忽略大小写) + // 这是为了兜底,比如用户输入了 "server(" 这种在正则中非法但在普通文本中可能存在的字符串 + return safeText.toLowerCase().includes(query.toLowerCase()); +}; From 75d9da9d55e42c5d7ee4707585e5aab8ae30d068 Mon Sep 17 00:00:00 2001 From: songyu-bytedance Date: Wed, 17 Dec 2025 11:34:31 +0800 Subject: [PATCH 3/8] fix(filter): support wildcard matching in checkMatch --- .../src/components/wizard/utils/filter.ts | 23 +++++++++++++++---- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/frontend/apps/veaiops/src/components/wizard/utils/filter.ts b/frontend/apps/veaiops/src/components/wizard/utils/filter.ts index a8e43cf4..5174b2df 100644 --- a/frontend/apps/veaiops/src/components/wizard/utils/filter.ts +++ b/frontend/apps/veaiops/src/components/wizard/utils/filter.ts @@ -121,14 +121,27 @@ export const checkMatch = ( return true; } } catch (e) { - // 正则解析失败(例如输入了未闭合的括号),忽略错误,降级到普通字符串匹配 - // 在开发环境下可以打印日志 - if (process.env.NODE_ENV === 'development') { - // console.warn('Regex parsing failed:', e); + // 正则解析失败(例如输入了未闭合的括号),忽略错误,降级到通配符或普通字符串匹配 + } + + // 2. 尝试通配符 * 匹配 + // 仅当包含 * 且之前不是有效的正则时尝试(或者作为备选策略) + if (query.includes('*')) { + try { + // 转义除了 * 以外的所有正则元字符 + const pattern = query + .replace(/[.+?^${}()|[\]\\]/g, '\\$&') + .replace(/\*/g, '.*'); + const wildcardRegex = new RegExp(`^${pattern}$`, 'i'); // 通配符通常意味着全匹配模式 + if (wildcardRegex.test(safeText)) { + return true; + } + } catch (e) { + // 忽略 } } - // 2. 普通字符串包含匹配 (忽略大小写) + // 3. 普通字符串包含匹配 (忽略大小写) // 这是为了兜底,比如用户输入了 "server(" 这种在正则中非法但在普通文本中可能存在的字符串 return safeText.toLowerCase().includes(query.toLowerCase()); }; From b193506f1f31b3936711dec4c3c92f02fdc85ce5 Mon Sep 17 00:00:00 2001 From: songyu-bytedance Date: Wed, 17 Dec 2025 11:48:42 +0800 Subject: [PATCH 4/8] chore(filter): translate comments to English --- .../src/components/wizard/utils/filter.ts | 86 ++++++++----------- 1 file changed, 37 insertions(+), 49 deletions(-) diff --git a/frontend/apps/veaiops/src/components/wizard/utils/filter.ts b/frontend/apps/veaiops/src/components/wizard/utils/filter.ts index 5174b2df..2f2a5fbc 100644 --- a/frontend/apps/veaiops/src/components/wizard/utils/filter.ts +++ b/frontend/apps/veaiops/src/components/wizard/utils/filter.ts @@ -13,10 +13,11 @@ // limitations under the License. /** - * 检查字符串是否匹配搜索值(支持模糊匹配和正则表达式) - * @param text 要检查的文本 - * @param searchValue 搜索值(普通字符串或正则表达式字符串) - * @returns 是否匹配 + * Check whether the given text matches the search value. + * Supports both fuzzy substring matching and regular expressions. + * @param text Text to check + * @param searchValue Search value (plain string or regex pattern string) + * @returns Whether the text matches the search condition */ export const isMatch = ( text: string | undefined | null, @@ -34,62 +35,51 @@ export const isMatch = ( } try { - // 优先尝试作为正则表达式匹配 - // 用户可能会输入 AA-\d+-BB 这样的正则 - // 也可能输入 AA-* 这样的通配符 - // 或者只是简单的子串 AA + // Try regex matching first + // Typical user inputs: + // - AA-\d+-BB style regex + // - AA-* style wildcard + // - Simple substring like AA - // 策略: - // 1. 如果包含正则元字符(除了 *),尝试作为正则解析 - // 2. 如果只包含 *,作为通配符处理 - // 3. 否则作为普通字符串包含匹配 + // Strategy: + // 1. Try to interpret the query as regex + // 2. If it fails and contains *, treat it as a wildcard + // 3. Otherwise fallback to plain substring match - // 检查是否包含除了 * 以外的正则元字符 - // const hasRegexMeta = /[.+?^${}()|[\]\\]/.test(safeSearch); - - // 直接尝试构建正则 - // 为了支持通配符 *,我们可以先尝试将通配符转换为正则 - // 但这会与用户输入的 \d+ 冲突 - // 考虑到需求明确提到 "AA-数字-BB 格式正则匹配",即用户会输入正则语法 - // 所以优先支持标准正则语法 + // We directly build RegExp here to fully support regex syntax const regex = new RegExp(safeSearch, 'i'); if (regex.test(text)) { return true; } } catch (e) { - // 如果标准正则解析失败(例如语法错误),则尝试作为通配符处理 - // 这种情况可能发生在用户输入了不完整的正则,或者意图是使用通配符但包含了一些会被正则引擎误判的字符 + // If regex parsing fails (e.g. syntax error), try wildcard handling instead } - // 通配符处理逻辑 (简单的 * 转换) - // 仅当包含 * 且不是有效的正则时尝试(或者作为备选策略) + // Wildcard handling (simple * to .*) + // Only used when query contains * and regex parsing failed if (safeSearch.includes('*')) { try { - // 转义除了 * 以外的所有正则元字符 + // Escape all regex metacharacters except * const pattern = safeSearch .replace(/[.+?^${}()|[\]\\]/g, '\\$&') .replace(/\*/g, '.*'); - const wildcardRegex = new RegExp(`^${pattern}$`, 'i'); // 通配符通常意味着全匹配模式,或者用户习惯 + const wildcardRegex = new RegExp(`^${pattern}$`, 'i'); // Wildcard usually implies full match if (wildcardRegex.test(text)) { return true; } } catch (e) { - // 忽略 + // Ignore and continue to substring fallback } } - // 最后回退到普通包含匹配 + // Final fallback: plain substring match return safeText.includes(safeSearch); }; /** - * 专门针对 AA-数字-BB 格式优化的匹配逻辑 - * 以及支持普通的正则匹配 - */ -/** - * 专门针对 AA-数字-BB 格式优化的匹配逻辑 - * 以及支持普通的正则匹配 + * Matching helper optimized for AA-number-BB style patterns + * while still supporting generic regex and wildcard queries. */ export const checkMatch = ( text: string | undefined | null, @@ -106,13 +96,11 @@ export const checkMatch = ( return true; } - // 1. 尝试作为正则表达式匹配 - // 优化:只有当查询字符串包含正则元字符时才尝试正则匹配 - // 这可以避免将普通字符串 "server" 作为正则处理的开销(虽然微乎其微), - // 但更重要的是明确了匹配意图。 - // 不过,需求要求 "AA-数字-BB" 这种格式,其中包含 \d 这样的元字符序列, - // 或者用户可能直接输入 ^server.* 这样的正则。 - // 所以直接尝试 RegExp 是最稳妥的。 + // 1. Try regex match first + // Typical usage: + // - AA-\d+-BB style patterns with \d for digits + // - ^server.* for prefix matching + // Using RegExp directly gives maximum flexibility for power users. try { // 使用 'i' 标志忽略大小写 @@ -121,27 +109,27 @@ export const checkMatch = ( return true; } } catch (e) { - // 正则解析失败(例如输入了未闭合的括号),忽略错误,降级到通配符或普通字符串匹配 + // If regex parsing fails (e.g. unclosed parenthesis), fall through to wildcard or substring } - // 2. 尝试通配符 * 匹配 - // 仅当包含 * 且之前不是有效的正则时尝试(或者作为备选策略) + // 2. Try wildcard * match + // Only used when query contains * and regex parsing did not succeed if (query.includes('*')) { try { - // 转义除了 * 以外的所有正则元字符 + // Escape all regex metacharacters except * const pattern = query .replace(/[.+?^${}()|[\]\\]/g, '\\$&') .replace(/\*/g, '.*'); - const wildcardRegex = new RegExp(`^${pattern}$`, 'i'); // 通配符通常意味着全匹配模式 + const wildcardRegex = new RegExp(`^${pattern}$`, 'i'); // Wildcard usually implies full match if (wildcardRegex.test(safeText)) { return true; } } catch (e) { - // 忽略 + // Ignore and fallback to plain substring match } } - // 3. 普通字符串包含匹配 (忽略大小写) - // 这是为了兜底,比如用户输入了 "server(" 这种在正则中非法但在普通文本中可能存在的字符串 + // 3. Plain substring match (case-insensitive) + // Fallback for queries like "server(" which are invalid regex but valid text return safeText.toLowerCase().includes(query.toLowerCase()); }; From fa0d837fb19fcd3a1193e0494e845aeba06389a9 Mon Sep 17 00:00:00 2001 From: songyu-bytedance Date: Wed, 17 Dec 2025 11:51:10 +0800 Subject: [PATCH 5/8] chore(filter): translate remaining comments to English --- frontend/apps/veaiops/src/components/wizard/utils/filter.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/apps/veaiops/src/components/wizard/utils/filter.ts b/frontend/apps/veaiops/src/components/wizard/utils/filter.ts index 2f2a5fbc..626524ab 100644 --- a/frontend/apps/veaiops/src/components/wizard/utils/filter.ts +++ b/frontend/apps/veaiops/src/components/wizard/utils/filter.ts @@ -103,7 +103,7 @@ export const checkMatch = ( // Using RegExp directly gives maximum flexibility for power users. try { - // 使用 'i' 标志忽略大小写 + // Use 'i' flag to make the match case-insensitive const regex = new RegExp(query, 'i'); if (regex.test(safeText)) { return true; From 36d9de73fe5d5c68b3074431938db4312cb47aee Mon Sep 17 00:00:00 2001 From: songyu-bytedance Date: Wed, 17 Dec 2025 11:53:28 +0800 Subject: [PATCH 6/8] chore(wizard): translate instance selection comments to English --- .../shared/instance-selection-configs.tsx | 51 ++++++++++--------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/frontend/apps/veaiops/src/components/wizard/steps/host-selection/components/shared/instance-selection-configs.tsx b/frontend/apps/veaiops/src/components/wizard/steps/host-selection/components/shared/instance-selection-configs.tsx index eee22194..28088637 100644 --- a/frontend/apps/veaiops/src/components/wizard/steps/host-selection/components/shared/instance-selection-configs.tsx +++ b/frontend/apps/veaiops/src/components/wizard/steps/host-selection/components/shared/instance-selection-configs.tsx @@ -13,8 +13,8 @@ // limitations under the License. /** - * 实例选择配置工厂 - * @description 为不同数据源提供预定义的配置 + * Instance selection config factory. + * @description Provides predefined instance selection configs for different data sources. */ import { IconCloud, IconDesktop } from '@arco-design/web-react/icon'; @@ -24,21 +24,21 @@ import type { ZabbixHost } from 'api-generate'; import type { InstanceSelectionConfig } from './instance-selection-config'; /** - * 阿里云实例选择配置 + * Aliyun instance selection config. */ export const createAliyunConfig = ( selectionAction: (instances: AliyunInstance[]) => void, ): InstanceSelectionConfig => ({ title: '选择实例', description: - '选择要监控的阿里云实例,可以选择多个实例。如果不选择实例,将监控所有符合条件的实例。', - emptyDescription: '暂无可用的实例', - searchPlaceholder: '搜索实例ID或名称...', - itemType: '实例', + 'Select the Aliyun instances to monitor. Multiple instances can be selected. If no instance is selected, all matching instances will be monitored.', + emptyDescription: 'No available instances', + searchPlaceholder: 'Search by instance ID or name...', + itemType: 'Instance', icon: , dataTransformer: (instance) => { - // 当只有 userId 而没有 instanceId 时,使用 userId 作为 id - // 这样可以确保标题和显示正确 + // When only userId exists (no instanceId), use userId as the id + // This ensures the title and display are still meaningful const id = instance.instanceId || instance.dimensions?.instanceId || @@ -67,7 +67,7 @@ export const createAliyunConfig = ( checkMatch(instance.instanceId, searchValue) || checkMatch(instance.instanceName, searchValue) || checkMatch(instance.region, searchValue) || - // 当只有 userId 时,也支持搜索 userId + // When only userId exists, also allow searching by userId checkMatch(instance.dimensions?.userId, searchValue) || checkMatch( (instance as AliyunInstance & { userId?: string }).userId, @@ -84,16 +84,17 @@ export const createAliyunConfig = ( }); /** - * 火山引擎实例选择配置 + * Volcengine instance selection config. */ export const createVolcengineConfig = ( selectionAction: (instances: VolcengineInstance[]) => void, ): InstanceSelectionConfig => ({ title: '选择实例', - description: '选择要监控的火山引擎实例,可以选择多个实例', - emptyDescription: '暂无可用的实例', - searchPlaceholder: '搜索实例ID或名称...', - itemType: '实例', + description: + 'Select Volcengine instances to monitor. Multiple instances can be selected.', + emptyDescription: 'No available instances', + searchPlaceholder: 'Search by instance ID or name...', + itemType: 'Instance', icon: , dataTransformer: (instance) => ({ id: instance.instanceId, @@ -113,26 +114,26 @@ export const createVolcengineConfig = ( }); /** - * Zabbix主机选择配置 + * Zabbix host selection config. */ export const createZabbixConfig = ( selectionAction: (hosts: ZabbixHost[]) => void, ): InstanceSelectionConfig => ({ title: '选择主机', - description: '选择要监控的主机,可以选择多个主机', - emptyDescription: '暂无可用的主机', - searchPlaceholder: '搜索主机名称 (支持正则)...', - itemType: '主机', + description: 'Select the hosts to monitor. Multiple hosts can be selected.', + emptyDescription: 'No available hosts', + searchPlaceholder: 'Search host name (supports regex)...', + itemType: 'Host', icon: , dataTransformer: (host) => ({ - id: host.host, // 使用 host 作为唯一标识 + id: host.host, // Use host as the unique identifier name: host.name, - region: undefined, // Zabbix没有region概念 - dimensions: undefined, // Zabbix没有dimensions概念 + region: undefined, // Zabbix has no region concept + dimensions: undefined, // Zabbix has no dimensions concept }), selectionAction, searchFilter: (host, searchValue) => checkMatch(host.host, searchValue) || checkMatch(host.name, searchValue), - getId: (host) => host.host, // 使用 host 作为唯一标识 - useHostList: true, // 使用特殊的主机列表组件 + getId: (host) => host.host, // Use host as the unique identifier + useHostList: true, // Use the specialized host list component }); From 3037d4cd26f72d2bcaaba7f7f0ff92124fcf8841 Mon Sep 17 00:00:00 2001 From: songyu-bytedance Date: Wed, 17 Dec 2025 11:56:22 +0800 Subject: [PATCH 7/8] chore(wizard): restore volcengine instance i18n texts --- .../components/shared/instance-selection-configs.tsx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/frontend/apps/veaiops/src/components/wizard/steps/host-selection/components/shared/instance-selection-configs.tsx b/frontend/apps/veaiops/src/components/wizard/steps/host-selection/components/shared/instance-selection-configs.tsx index 28088637..3a2066e4 100644 --- a/frontend/apps/veaiops/src/components/wizard/steps/host-selection/components/shared/instance-selection-configs.tsx +++ b/frontend/apps/veaiops/src/components/wizard/steps/host-selection/components/shared/instance-selection-configs.tsx @@ -90,11 +90,10 @@ export const createVolcengineConfig = ( selectionAction: (instances: VolcengineInstance[]) => void, ): InstanceSelectionConfig => ({ title: '选择实例', - description: - 'Select Volcengine instances to monitor. Multiple instances can be selected.', - emptyDescription: 'No available instances', - searchPlaceholder: 'Search by instance ID or name...', - itemType: 'Instance', + description: '选择要监控的火山引擎实例,可以选择多个实例', + emptyDescription: '暂无可用的实例', + searchPlaceholder: '搜索实例ID或名称...', + itemType: '实例', icon: , dataTransformer: (instance) => ({ id: instance.instanceId, From 56483404f54091e408493c2e976e41d23d5fef19 Mon Sep 17 00:00:00 2001 From: songyu-bytedance Date: Wed, 17 Dec 2025 11:57:32 +0800 Subject: [PATCH 8/8] chore(wizard): restore Aliyun and Zabbix i18n texts --- .../shared/instance-selection-configs.tsx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/frontend/apps/veaiops/src/components/wizard/steps/host-selection/components/shared/instance-selection-configs.tsx b/frontend/apps/veaiops/src/components/wizard/steps/host-selection/components/shared/instance-selection-configs.tsx index 3a2066e4..46bb1934 100644 --- a/frontend/apps/veaiops/src/components/wizard/steps/host-selection/components/shared/instance-selection-configs.tsx +++ b/frontend/apps/veaiops/src/components/wizard/steps/host-selection/components/shared/instance-selection-configs.tsx @@ -31,10 +31,10 @@ export const createAliyunConfig = ( ): InstanceSelectionConfig => ({ title: '选择实例', description: - 'Select the Aliyun instances to monitor. Multiple instances can be selected. If no instance is selected, all matching instances will be monitored.', - emptyDescription: 'No available instances', - searchPlaceholder: 'Search by instance ID or name...', - itemType: 'Instance', + '选择要监控的阿里云实例,可以选择多个实例。如果不选择实例,将监控所有符合条件的实例。', + emptyDescription: '暂无可用的实例', + searchPlaceholder: '搜索实例ID或名称...', + itemType: '实例', icon: , dataTransformer: (instance) => { // When only userId exists (no instanceId), use userId as the id @@ -119,10 +119,10 @@ export const createZabbixConfig = ( selectionAction: (hosts: ZabbixHost[]) => void, ): InstanceSelectionConfig => ({ title: '选择主机', - description: 'Select the hosts to monitor. Multiple hosts can be selected.', - emptyDescription: 'No available hosts', - searchPlaceholder: 'Search host name (supports regex)...', - itemType: 'Host', + description: '选择要监控的主机,可以选择多个主机', + emptyDescription: '暂无可用的主机', + searchPlaceholder: '搜索主机名称 (支持正则)...', + itemType: '主机', icon: , dataTransformer: (host) => ({ id: host.host, // Use host as the unique identifier