批量转换脚本引入的语法错误已回退,保留稳定的 i18n 转换: - 翻译词典: 22 namespaces, 3600+ keys - 已接入: 145+ 文件 (Dashboard/Login/K8s 主页面/Monitor/System/Deploy) - 语言切换器在 Header 中可用 (🇨🇳/🇺🇸) - tsc 零错误, Vite 构建成功
25 lines
880 B
TypeScript
25 lines
880 B
TypeScript
// 服务器统计条 — 紧凑型替代 4 张大卡片
|
|
import { StatStrip } from '@/components/ui/stat-strip';
|
|
import type { JsonData } from '@/types/common';
|
|
|
|
interface ServerStatsStripProps {
|
|
servers: JsonData[];
|
|
}
|
|
|
|
export function ServerStatsStrip({ servers }: ServerStatsStripProps) {
|
|
const runningCount = servers.filter((s) => s.status === 'running').length;
|
|
const maintenanceCount = servers.filter((s) => s.status === 'maintenance').length;
|
|
const stoppedCount = servers.filter((s) => s.status === 'stopped').length;
|
|
|
|
return (
|
|
<StatStrip
|
|
items={[
|
|
{ label: '服务器', value: servers.length, color: 'blue' },
|
|
{ label: '运行中', value: runningCount, color: 'emerald' },
|
|
{ label: '维护中', value: maintenanceCount, color: 'amber' },
|
|
{ label: '已停止', value: stoppedCount, color: 'muted' },
|
|
]}
|
|
/>
|
|
);
|
|
}
|