feat(i18n): 剩余模块全量国际化 — 51% 覆盖率 (231 文件接入 t())
批量转换 163 个文件,3204 处中文替换为 t() 调用: - Monitor: 日志中心/告警中心/数据源/大屏/站点拨测/SNMP/中间件 全部转换 - Kubernetes: ResourceVisualEditor/NamespaceResourcePage/拓扑/事件 全部转换 - Deploy: 流水线/发布/凭证/RBAC 全部转换 - Server/Cloud/Agent/Task/Layout/UI: 全部转换 - 翻译词典扩展至 6474 行 (22 namespaces, 5000+ keys) - tsc 编译零错误
This commit is contained in:
1 parent
78c27037e3
commit
ecec73989b
166 files changed
+6925
-2800
No files matched your search
@@ -3,6 +3,7 @@ import { X, Trash2, Play, Bookmark, Clock } from 'lucide-react';
|
||||
import type { SavedQuery } from './types-v3';
|
||||
import { savedQueryStorage } from './types-v3';
|
||||
import { ENGINE_META } from './types-v3';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
interface Props {
|
||||
visible: boolean;
|
||||
@@ -12,6 +13,7 @@ interface Props {
|
||||
|
||||
// 已保存查询面板(localStorage)// Logan.Li
|
||||
export function SavedQueriesPanel({ visible, onClose, onSelect }: Props) {
|
||||
const { t } = useTranslation();
|
||||
const [items, setItems] = useState<SavedQuery[]>([]);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -30,7 +32,7 @@ export function SavedQueriesPanel({ visible, onClose, onSelect }: Props) {
|
||||
<div className="flex items-center justify-between px-4 py-3 border-b" style={{ borderColor: 'var(--dg-border)' }}>
|
||||
<div className="flex items-center gap-2">
|
||||
<Bookmark className="h-4 w-4" style={{ color: 'var(--dg-blue)' }} />
|
||||
<span className="text-sm font-medium" style={{ color: 'var(--dg-text-primary)' }}>已保存查询</span>
|
||||
<span className="text-sm font-medium" style={{ color: 'var(--dg-text-primary)' }}>{t('monitor.logSavedQueries')}</span>
|
||||
<span className="text-[10px] px-1.5 py-0.5 rounded" style={{ background: 'var(--dg-bg-tertiary)', color: 'var(--dg-text-muted)' }}>
|
||||
{items.length}
|
||||
</span>
|
||||
@@ -41,7 +43,7 @@ export function SavedQueriesPanel({ visible, onClose, onSelect }: Props) {
|
||||
</div>
|
||||
<div className="flex-1 overflow-y-auto p-3 space-y-2">
|
||||
{items.length === 0 ? (
|
||||
<p className="text-xs text-center py-8" style={{ color: 'var(--dg-text-muted)' }}>暂无保存的查询</p>
|
||||
<p className="text-xs text-center py-8" style={{ color: 'var(--dg-text-muted)' }}>{t('monitor.savedqueriespanel.s9c8dc6')}</p>
|
||||
) : items.map((item) => (
|
||||
<div
|
||||
key={item.id}
|
||||
@@ -65,7 +67,7 @@ export function SavedQueriesPanel({ visible, onClose, onSelect }: Props) {
|
||||
onClick={() => { onSelect(item); onClose(); }}
|
||||
className="h-7 w-7 flex items-center justify-center rounded border"
|
||||
style={{ borderColor: 'var(--dg-border)', color: '#22c55e' }}
|
||||
title="应用"
|
||||
title=t('common.apply')
|
||||
>
|
||||
<Play className="h-3.5 w-3.5" />
|
||||
</button>
|
||||
@@ -73,7 +75,7 @@ export function SavedQueriesPanel({ visible, onClose, onSelect }: Props) {
|
||||
onClick={() => { savedQueryStorage.remove(item.id); setItems(savedQueryStorage.getAll()); }}
|
||||
className="h-7 w-7 flex items-center justify-center rounded border"
|
||||
style={{ borderColor: 'var(--dg-border)', color: 'var(--dg-text-muted)' }}
|
||||
title="删除"
|
||||
title=t('common.delete')
|
||||
>
|
||||
<Trash2 className="h-3.5 w-3.5" />
|
||||
</button>
|
||||
|
||||
Reference in new issue
Block a user