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
@@ -6,7 +6,6 @@ import { Card, CardContent } from '@/components/ui/card';
|
||||
import { PieChart as PieChartIcon } from 'lucide-react';
|
||||
import { PROBE_TYPE_OPTIONS, normalizeProbeType } from './helpers';
|
||||
import type { SiteTask } from './helpers';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
interface Props {
|
||||
tasks: SiteTask[];
|
||||
@@ -21,7 +20,6 @@ const PROTOCOL_COLORS: Record<string, string> = {
|
||||
};
|
||||
|
||||
export function SiteProtocolPieChart({ tasks }: Props) {
|
||||
const { t } = useTranslation();
|
||||
const protocolData = useMemo(() => {
|
||||
const counts: Record<string, number> = {};
|
||||
for (const t of PROBE_TYPE_OPTIONS) counts[t] = 0;
|
||||
@@ -37,7 +35,7 @@ export function SiteProtocolPieChart({ tasks }: Props) {
|
||||
if (tasks.length === 0) {
|
||||
return (
|
||||
<Card className="bg-[var(--dg-bg-secondary)] border-[var(--dg-border)]">
|
||||
<CardContent className="p-6 text-center text-sm text-[var(--dg-text-muted)]">{t('monitor.siteprotocolpiechart.s0589e5')}</CardContent>
|
||||
<CardContent className="p-6 text-center text-sm text-[var(--dg-text-muted)]">暂无任务</CardContent>
|
||||
</Card>
|
||||
);
|
||||
}
|
||||
@@ -47,7 +45,7 @@ export function SiteProtocolPieChart({ tasks }: Props) {
|
||||
<CardContent className="p-4">
|
||||
<div className="flex items-center gap-2 mb-2">
|
||||
<PieChartIcon className="h-4 w-4 text-[var(--dg-text-muted)]" />
|
||||
<h3 className="text-sm font-medium text-[var(--dg-text-primary)]">{t('monitor.siteprotocolpiechart.s20721c')}</h3>
|
||||
<h3 className="text-sm font-medium text-[var(--dg-text-primary)]">协议数量分布</h3>
|
||||
<span className="text-[10px] text-[var(--dg-text-muted)]">共 {tasks.length} 个任务</span>
|
||||
</div>
|
||||
<ResponsiveContainer width="100%" height={200}>
|
||||
|
||||
Reference in new issue
Block a user