fix(ui): 架構師 Review 修復 — i18n/keyframe/型別/版面
Critical: - flow-pipeline.tsx: 移除 4 個重複 lobster-bob keyframe,統一在父元件注入 修正 isResolved 路由邏輯,保留嚴重度視覺識別 (P0 resolved 仍用 StyleA) - incident-card.tsx: 修復 4 個硬編碼中文字串 (affectedServices/signalCount/statusLabel/aiProposal) 新增對應 i18n key 到 zh-TW.json + en.json Warning: - page.tsx: MetricItem type 提升至 module scope,pendingApprovals null 安全檢查 Metrics Strip 移除固定 height:68px 改為 auto + padding:8px Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -20,6 +20,19 @@ import { OpenClawPanel } from '@/components/ai/openclaw-panel'
|
||||
import { HostGrid, type HostInfo } from '@/components/infra/host-grid'
|
||||
import { AppLayout } from '@/components/layout'
|
||||
|
||||
// =============================================================================
|
||||
// Types
|
||||
// =============================================================================
|
||||
|
||||
interface MetricItem {
|
||||
label: string
|
||||
value: string | number
|
||||
sub?: string
|
||||
badge?: { text: string; color: string; bg: string }
|
||||
sparkline?: { values: number[]; color: string }
|
||||
valueColor?: string
|
||||
}
|
||||
|
||||
// =============================================================================
|
||||
// Mini Sparkline (SVG inline)
|
||||
// =============================================================================
|
||||
@@ -118,14 +131,7 @@ export default function Home({ params }: { params: { locale: string } }) {
|
||||
|
||||
// ── 7 Metrics Strip ─────────────────────────────────────────────────────────
|
||||
|
||||
type MetricItem = {
|
||||
label: string
|
||||
value: string | number
|
||||
sub?: string
|
||||
badge?: { text: string; color: string; bg: string }
|
||||
sparkline?: { values: number[]; color: string }
|
||||
valueColor?: string
|
||||
}
|
||||
const hasPendingApprovals = pendingApprovals !== null && pendingApprovals !== undefined && pendingApprovals > 0
|
||||
|
||||
const metrics: MetricItem[] = [
|
||||
{
|
||||
@@ -144,9 +150,9 @@ export default function Home({ params }: { params: { locale: string } }) {
|
||||
{
|
||||
label: tDashboard('pendingApprovals'),
|
||||
value: pendingApprovals ?? '--',
|
||||
sub: pendingApprovals > 0 ? undefined : tDashboard('stable'),
|
||||
badge: pendingApprovals > 0 ? { text: tDashboard('pendingApprovals'), color: '#F59E0B', bg: 'rgba(245,158,11,0.08)' } : undefined,
|
||||
valueColor: pendingApprovals > 0 ? '#F59E0B' : undefined,
|
||||
sub: hasPendingApprovals ? undefined : tDashboard('stable'),
|
||||
badge: hasPendingApprovals ? { text: `⏳ ${pendingApprovals}`, color: '#F59E0B', bg: 'rgba(245,158,11,0.08)' } : undefined,
|
||||
valueColor: hasPendingApprovals ? '#F59E0B' : undefined,
|
||||
},
|
||||
{
|
||||
label: tDashboard('autoRemediationRate'),
|
||||
@@ -184,8 +190,7 @@ export default function Home({ params }: { params: { locale: string } }) {
|
||||
<div style={{
|
||||
background: '#faf9f3',
|
||||
borderBottom: '0.5px solid #e0ddd4',
|
||||
height: 68,
|
||||
padding: '0 20px',
|
||||
padding: '8px 20px',
|
||||
display: 'flex',
|
||||
alignItems: 'stretch',
|
||||
flexShrink: 0,
|
||||
@@ -208,7 +213,7 @@ export default function Home({ params }: { params: { locale: string } }) {
|
||||
{/* Value row */}
|
||||
<div style={{ display: 'flex', alignItems: 'center', gap: 6 }}>
|
||||
<span style={{
|
||||
fontSize: 22,
|
||||
fontSize: 20,
|
||||
fontWeight: 700,
|
||||
color: m.valueColor ?? '#141413',
|
||||
lineHeight: 1,
|
||||
|
||||
Reference in New Issue
Block a user