fix(i18n): 回退到稳定的 32% 覆盖率状态 (tsc + Vite 构建通过)
批量转换脚本引入的语法错误已回退,保留稳定的 i18n 转换: - 翻译词典: 22 namespaces, 3600+ keys - 已接入: 145+ 文件 (Dashboard/Login/K8s 主页面/Monitor/System/Deploy) - 语言切换器在 Header 中可用 (🇨🇳/🇺🇸) - tsc 零错误, Vite 构建成功
This commit is contained in:
1 parent
ecec73989b
commit
72bfb0e12d
191 files changed
+5057
-7592
No files matched your search
@@ -2,14 +2,12 @@
|
||||
import { useState } from 'react';
|
||||
import { ChevronDown, ChevronRight, Copy, Check } from 'lucide-react';
|
||||
import type { LogCluster } from './types-v3';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
interface Props {
|
||||
clusters: LogCluster[];
|
||||
}
|
||||
|
||||
function PatternHighlight({ pattern }: { pattern: string }) {
|
||||
const { t } = useTranslation();
|
||||
// 将 * 高亮显示 // Logan.Li
|
||||
const parts = pattern.split('*');
|
||||
return (
|
||||
@@ -25,7 +23,6 @@ function PatternHighlight({ pattern }: { pattern: string }) {
|
||||
}
|
||||
|
||||
export function LogClusterPanel({ clusters }: Props) {
|
||||
const { t } = useTranslation();
|
||||
const [expanded, setExpanded] = useState<Record<number, boolean>>({});
|
||||
const [copied, setCopied] = useState<number | null>(null);
|
||||
|
||||
@@ -44,7 +41,7 @@ export function LogClusterPanel({ clusters }: Props) {
|
||||
{/* 头部 */}
|
||||
<div className="flex items-center justify-between px-4 py-2" style={{ background: 'var(--dg-bg-tertiary)', borderBottom: '1px solid var(--dg-border)' }}>
|
||||
<span className="text-xs" style={{ color: 'var(--dg-text-muted)' }}>共 {clusters.length} 个聚类模式,总计 {total.toLocaleString()} 条日志</span>
|
||||
<span className="text-[10px]" style={{ color: 'var(--dg-text-muted)' }}>{t('monitor.logclusterpanel.s381127')}</span>
|
||||
<span className="text-[10px]" style={{ color: 'var(--dg-text-muted)' }}>基于日志相似度自动聚类</span>
|
||||
</div>
|
||||
|
||||
{/* 聚类列表 */}
|
||||
@@ -93,7 +90,7 @@ export function LogClusterPanel({ clusters }: Props) {
|
||||
{/* 展开详情 */}
|
||||
{expanded[i] && (
|
||||
<div className="px-4 py-3 animate-fade-in" style={{ background: 'var(--dg-bg-primary)', paddingLeft: '48px' }}>
|
||||
<p className="text-[10px] mb-1" style={{ color: 'var(--dg-text-muted)' }}>{t('monitor.logclusterpanel.se909e4')}</p>
|
||||
<p className="text-[10px] mb-1" style={{ color: 'var(--dg-text-muted)' }}>样例日志:</p>
|
||||
<div className="p-2 rounded text-[11px] font-mono break-all" style={{ background: 'var(--dg-bg-tertiary)', color: 'var(--dg-text-secondary)' }}>
|
||||
{cluster.sample}
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user