fix: 首席架構師審查修復 — i18n/CD/時區/死碼清理
P0 前端 i18n 合規 (6 檔案):
- settings/page.tsx: 全面改用 useTranslations('settings')
- auto-repair/page.tsx: 30+ 處硬編碼改用 t('autoRepair.*')
- sidebar.tsx: sectionLabel 改用 tSection(),aria-label 國際化
- openclaw-panel.tsx: STATUS_MESSAGES 改用 tPanel(),Production 改用 tBrand
- alerts/page.tsx: StatPill label 改用 t('incident.severity.*')
P1 CD Pipeline:
- cd.yaml: runs-on 改 self-hosted (ADR-039)
- Telegram Secret 注入失敗改為 exit 1 (ADR-035)
- kubectl patch op:replace → op:add (首次部署相容)
P2 後端:
- langfuse_client.py: 移除 v4.x 死碼分支 (SDK 鎖定 <3.0.0)
- ai.py: 標記 TODO(R4) Router 瘦身
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -120,13 +120,7 @@ function NemoClaw({ isActive, isPulsing }: { isActive: boolean; isPulsing: boole
|
||||
// Status Messages (Dot Matrix Style)
|
||||
// =============================================================================
|
||||
|
||||
const STATUS_MESSAGES: Record<OpenClawStatus, string> = {
|
||||
patrolling: '[AGENT] patrolling...',
|
||||
intercepting: '[SYS] Intercepting anomaly...',
|
||||
analyzing: '[SYS] Analyzing blast radius...',
|
||||
generating: '[SYS] Generating proposed action...',
|
||||
complete: '[SYS] Analysis complete',
|
||||
}
|
||||
// 2026-04-02 Claude Code: STATUS_MESSAGES 已移除,改用 i18n 鍵值 openclawPanel.*
|
||||
|
||||
|
||||
// =============================================================================
|
||||
@@ -165,13 +159,14 @@ export function OpenClawPanel({
|
||||
onAnalysisComplete,
|
||||
className,
|
||||
}: OpenClawPanelProps) {
|
||||
const _t = useTranslations('ai')
|
||||
const tPanel = useTranslations('openclawPanel')
|
||||
const tBrand = useTranslations('brand')
|
||||
// Phase 8.0 #16: 移除 cursorVisible state,改用 CSS animate-pulse
|
||||
|
||||
const isActive = status !== 'patrolling'
|
||||
const isPulsing = status === 'intercepting' || status === 'analyzing'
|
||||
|
||||
const statusMessage = STATUS_MESSAGES[status]
|
||||
const statusMessage = tPanel(status)
|
||||
const displayText = useTypewriter(statusMessage, 40)
|
||||
|
||||
// Notify when complete
|
||||
@@ -212,7 +207,7 @@ export function OpenClawPanel({
|
||||
AWOOOI v1.0.0
|
||||
</span>
|
||||
<span className="font-dot-matrix text-xs text-nothing-gray-400">
|
||||
| Production
|
||||
| {tBrand('environment')}
|
||||
</span>
|
||||
{isActive && (
|
||||
<span className="w-2 h-2 rounded-full bg-claw-blue animate-ping" />
|
||||
@@ -237,7 +232,7 @@ export function OpenClawPanel({
|
||||
NemoClaw
|
||||
</div>
|
||||
<div style={{ fontSize: 12, color: '#87867f', marginBottom: 6 }}>
|
||||
{STATUS_MESSAGES[status]}
|
||||
{tPanel(status)}
|
||||
</div>
|
||||
<span style={{
|
||||
fontSize: 11, padding: '2px 8px',
|
||||
|
||||
@@ -69,8 +69,8 @@ type NavSection = {
|
||||
|
||||
const NAV_SECTIONS: NavSection[] = [
|
||||
{
|
||||
sectionKey: 'ai-core',
|
||||
sectionLabel: 'AI 核心',
|
||||
sectionKey: 'aiCore',
|
||||
sectionLabel: '',
|
||||
items: [
|
||||
{ id: 'ai-center', href: '/', labelKey: 'dashboard', Icon: LayoutDashboard },
|
||||
{ id: 'authorizations', href: '/authorizations', labelKey: 'approvals', Icon: ShieldCheck, badge: true },
|
||||
@@ -79,7 +79,7 @@ const NAV_SECTIONS: NavSection[] = [
|
||||
},
|
||||
{
|
||||
sectionKey: 'monitoring',
|
||||
sectionLabel: '監控與安全',
|
||||
sectionLabel: '',
|
||||
items: [
|
||||
{ id: 'monitoring', href: '/monitoring', labelKey: 'monitoring', Icon: Monitor },
|
||||
{ id: 'apm', href: '/apm', labelKey: 'apm', Icon: Activity },
|
||||
@@ -91,7 +91,7 @@ const NAV_SECTIONS: NavSection[] = [
|
||||
},
|
||||
{
|
||||
sectionKey: 'ops',
|
||||
sectionLabel: '運維管理',
|
||||
sectionLabel: '',
|
||||
items: [
|
||||
{ id: 'auto-repair', href: '/auto-repair', labelKey: 'autoRepair', Icon: Wrench },
|
||||
{ id: 'deployments', href: '/deployments', labelKey: 'deployments', Icon: Package },
|
||||
@@ -103,7 +103,7 @@ const NAV_SECTIONS: NavSection[] = [
|
||||
},
|
||||
{
|
||||
sectionKey: 'knowledge',
|
||||
sectionLabel: '知識與工具',
|
||||
sectionLabel: '',
|
||||
items: [
|
||||
{ id: 'knowledge-base', href: '/knowledge-base', labelKey: 'knowledge', Icon: BookOpen },
|
||||
{ id: 'terminal', href: '/terminal', labelKey: 'terminal', Icon: Terminal },
|
||||
@@ -133,6 +133,8 @@ export function Sidebar({
|
||||
}: SidebarProps) {
|
||||
const t = useTranslations('nav')
|
||||
const tBrand = useTranslations('brand')
|
||||
const tSection = useTranslations('navSection')
|
||||
const tSidebar = useTranslations('sidebar')
|
||||
const pathname = usePathname()
|
||||
|
||||
// Phase 8.0 #15: 改用 SSE 驅動的 pending count (移除 30s polling)
|
||||
@@ -236,7 +238,7 @@ export function Sidebar({
|
||||
padding: '8px 12px 3px',
|
||||
fontFamily: 'monospace',
|
||||
}}>
|
||||
{section.sectionLabel}
|
||||
{tSection(section.sectionKey)}
|
||||
</div>
|
||||
)}
|
||||
{section.items.map(item => {
|
||||
@@ -338,7 +340,7 @@ export function Sidebar({
|
||||
'hover:bg-neutral-50',
|
||||
'transition-all duration-150'
|
||||
)}
|
||||
aria-label={collapsed ? 'Expand sidebar' : 'Collapse sidebar'}
|
||||
aria-label={collapsed ? tSidebar('expand') : tSidebar('collapse')}
|
||||
>
|
||||
{collapsed ? (
|
||||
<ChevronRight className="w-3 h-3 text-neutral-400" />
|
||||
|
||||
Reference in New Issue
Block a user