diff --git a/frontend/src/components/dashboard/Dashboard.tsx b/frontend/src/components/dashboard/Dashboard.tsx index fe06506..afd2a8e 100644 --- a/frontend/src/components/dashboard/Dashboard.tsx +++ b/frontend/src/components/dashboard/Dashboard.tsx @@ -1,5 +1,6 @@ import { useCallback, useEffect, useState } from 'react'; import { useNavigate } from 'react-router-dom'; +import { useTranslation } from 'react-i18next'; import { Button } from '@/components/ui/button'; import { cn } from '@/lib/utils'; import { Clock, Server, ArrowRight } from 'lucide-react'; @@ -34,6 +35,7 @@ import type { AlertEventRecord, CertExpiryRecord } from '@/types'; * 6. 添加页面标题区域的操作入口 */ export function Dashboard() { + const { t } = useTranslation(); const navigate = useNavigate(); const [initialLoading, setInitialLoading] = useState(true); const [refreshing, setRefreshing] = useState(false); @@ -111,8 +113,8 @@ export function Dashboard() { {/* Page Header */}
实时监控和运维概览 · 最后更新: {new Date().toLocaleTimeString('zh-CN')}
+{t('dashboard.subtitle')} · {t('dashboard.lastUpdated')}: {new Date().toLocaleTimeString()}
@@ -146,7 +149,7 @@ export function CostOverviewCard({ costStats }: { costStats: JsonData }) {
费用分布 {t('dashboard.cost.distribution')} 月度趋势 {t('dashboard.cost.monthlyTrend')} 暂无告警事件 所有系统运行正常 {t('dashboard.alerts.empty')} {t('dashboard.alerts.emptyHint')} 暂无证书数据 {t('dashboard.certificates.empty')} {domain.name} 到期: {domain.expire_date?.substring(0, 10)} {t('dashboard.certificates.expireDate')}: {domain.expire_date?.substring(0, 10)} 暂无发布记录 {t('dashboard.releases.empty')}
- CPU {Number(server.cpu_usage ?? 0).toFixed(1)}%
+ {t('dashboard.serversStatus.cpu')} {Number(server.cpu_usage ?? 0).toFixed(1)}%
- 内存 {Number(server.memory_usage ?? 0).toFixed(1)}%
+ {t('dashboard.serversStatus.memory')} {Number(server.memory_usage ?? 0).toFixed(1)}%
暂无服务器 {t('dashboard.serversStatus.empty')}
暂无集群数据
+{t('dashboard.clusters.empty')}