diff --git a/frontend/src/i18n/locales/en/collectors.ts b/frontend/src/i18n/locales/en/collectors.ts index d7b88f7..d4b6a32 100644 --- a/frontend/src/i18n/locales/en/collectors.ts +++ b/frontend/src/i18n/locales/en/collectors.ts @@ -78,6 +78,9 @@ const collectors = { cluster: 'Target Cluster', clusterPlaceholder: 'Select a cluster', namespace: 'Namespace', + namespaceHintSidecar: 'The namespace where the TARGET Deployment lives. The platform finds that Deployment there and injects a Fluent Bit sidecar; collected logs also carry this namespace label. It is NOT a log filter.', + namespaceHintDaemonset: 'The namespace where the Promtail DaemonSet is deployed. The DaemonSet collects container logs from ALL namespaces in the cluster — it does not filter by namespace (usually just the Loki namespace, e.g. log).', + namespaceHintHost: 'Not used in host mode.', nsPickCluster: 'Select a cluster first', nsLoading: 'Loading namespaces…', nsPick: 'Select a namespace', diff --git a/frontend/src/i18n/locales/zh/collectors.ts b/frontend/src/i18n/locales/zh/collectors.ts index 28592aa..83b740b 100644 --- a/frontend/src/i18n/locales/zh/collectors.ts +++ b/frontend/src/i18n/locales/zh/collectors.ts @@ -82,6 +82,9 @@ const collectors = { cluster: '目标集群', clusterPlaceholder: '选择集群', namespace: '命名空间', + namespaceHintSidecar: '填「目标应用(Deployment)所在的命名空间」。平台会在该命名空间里找到目标 Deployment 并注入 Fluent Bit sidecar,采集到的日志也会打上这个 namespace 标签。它不是日志过滤条件。', + namespaceHintDaemonset: '填「Promtail DaemonSet 部署到哪个命名空间」。DaemonSet 会采集整个集群所有命名空间的容器日志,不按命名空间过滤(一般就用 Loki 所在的 log)。', + namespaceHintHost: '主机模式不使用该字段。', nsPickCluster: '先选择集群', nsLoading: '加载命名空间…', nsPick: '选择命名空间', diff --git a/frontend/src/pages/collectors/components/CollectorFormDialog.tsx b/frontend/src/pages/collectors/components/CollectorFormDialog.tsx index 3342b93..aa39460 100644 --- a/frontend/src/pages/collectors/components/CollectorFormDialog.tsx +++ b/frontend/src/pages/collectors/components/CollectorFormDialog.tsx @@ -389,6 +389,15 @@ export const CollectorFormDialog = memo(function CollectorFormDialog({ )} + {/* 这个字段在不同采集类型下含义完全不同,必须写清楚, + 否则用户会以为它是"日志过滤条件"。 */} +

+ {isSidecarType + ? t('form.namespaceHintSidecar') + : collectorType === 'k8s-daemonset' + ? t('form.namespaceHintDaemonset') + : t('form.namespaceHintHost')} +

{isSidecarType &&