diff --git a/apps/api/src/repositories/knowledge_repository.py b/apps/api/src/repositories/knowledge_repository.py index dbb67179..64b43bdb 100644 --- a/apps/api/src/repositories/knowledge_repository.py +++ b/apps/api/src/repositories/knowledge_repository.py @@ -55,9 +55,12 @@ class KnowledgeDBRepository: return self._to_model(record) async def get_by_id(self, entry_id: str) -> KnowledgeEntry | None: - """根據 ID 取得知識條目""" + """根據 ID 取得知識條目(排除 archived)""" result = await self.db.execute( - select(KnowledgeEntryRecord).where(KnowledgeEntryRecord.id == entry_id) + select(KnowledgeEntryRecord).where( + KnowledgeEntryRecord.id == entry_id, + KnowledgeEntryRecord.status != EntryStatus.ARCHIVED, + ) ) record = result.scalar_one_or_none() return self._to_model(record) if record else None diff --git a/apps/web/messages/en.json b/apps/web/messages/en.json index 778d2595..dc662c3e 100644 --- a/apps/web/messages/en.json +++ b/apps/web/messages/en.json @@ -131,7 +131,14 @@ "approval": "Awaiting Auth", "execution": "Execution", "resolved": "Resolved" - } + }, + "activeIncidents": "Active Incidents", + "serviceHealth": "Service Health", + "todayIncidents": "Today Incidents", + "autoRemediationRate": "Auto Remediation", + "mttrAvg": "MTTR Avg", + "stable": "Stable", + "normal": "Normal" }, "openclaw": { "name": "OpenClaw", diff --git a/apps/web/messages/zh-TW.json b/apps/web/messages/zh-TW.json index 07e946f2..190f2920 100644 --- a/apps/web/messages/zh-TW.json +++ b/apps/web/messages/zh-TW.json @@ -132,7 +132,14 @@ "approval": "等待授權", "execution": "執行", "resolved": "完成" - } + }, + "activeIncidents": "活躍事件", + "serviceHealth": "服務健康", + "todayIncidents": "今日事件", + "autoRemediationRate": "自動處置率", + "mttrAvg": "MTTR 均值", + "stable": "穩定", + "normal": "正常" }, "openclaw": { "name": "OpenClaw", diff --git a/apps/web/public/favicon.svg b/apps/web/public/favicon.svg new file mode 100644 index 00000000..98513768 --- /dev/null +++ b/apps/web/public/favicon.svg @@ -0,0 +1,17 @@ + diff --git a/apps/web/src/app/[locale]/auto-repair/page.tsx b/apps/web/src/app/[locale]/auto-repair/page.tsx index 4c22c246..af5c4058 100644 --- a/apps/web/src/app/[locale]/auto-repair/page.tsx +++ b/apps/web/src/app/[locale]/auto-repair/page.tsx @@ -115,7 +115,11 @@ function IncidentEvalRow({ setLoading(true) try { const res = await fetch(`${base}/api/v1/auto-repair/evaluate/${incidentId}`) - if (res.ok) setEval(await res.json()) + if (res.ok) { + setEval(await res.json()) + } + } catch { + // API 不可用時靜默處理,不噴 console error } finally { setLoading(false) } diff --git a/apps/web/src/app/[locale]/layout.tsx b/apps/web/src/app/[locale]/layout.tsx index 811f44ae..46104eb1 100644 --- a/apps/web/src/app/[locale]/layout.tsx +++ b/apps/web/src/app/[locale]/layout.tsx @@ -49,6 +49,9 @@ export async function generateMetadata({ return { title: metadata?.title || 'AWOOOI', description: metadata?.description || 'AI-Powered Intelligent Operations Platform', + icons: { + icon: '/favicon.svg', + }, } } diff --git a/apps/web/src/app/[locale]/page.tsx b/apps/web/src/app/[locale]/page.tsx index dbfb044e..a3f12afa 100644 --- a/apps/web/src/app/[locale]/page.tsx +++ b/apps/web/src/app/[locale]/page.tsx @@ -66,12 +66,11 @@ export default function Home({ params }: { params: { locale: string } }) { gap: 0, }}> {[ - { label: '活躍事件', value: incidents?.length ?? '--', sub: incidents?.filter((i) => i.severity === 'P0').length ? `+${incidents.filter((i) => i.severity === 'P0').length} P0` : '穩定' }, - { label: '服務健康', value: `${pulseMetrics?.length ?? '--'}/${pulseMetrics?.length ?? '--'}`, sub: '正常' }, - { label: '待簽核', value: pendingApprovals ?? '--', sub: '等待授權' }, - { label: '今日事件', value: incidents?.length ?? '--', sub: '' }, - { label: '自動處置率', value: '--', sub: '' }, - { label: 'MTTR 均值', value: '--', sub: '' }, + { label: tDashboard('activeIncidents'), value: incidents?.length ?? '--', sub: incidents?.filter((i) => i.severity === 'P0').length ? `+${incidents.filter((i) => i.severity === 'P0').length} P0` : tDashboard('stable') }, + { label: tDashboard('serviceHealth'), value: `${pulseMetrics?.length ?? '--'}/${pulseMetrics?.length ?? '--'}`, sub: tDashboard('normal') }, + { label: tDashboard('todayIncidents'), value: incidents?.length ?? '--', sub: '' }, + { label: tDashboard('autoRemediationRate'), value: '--', sub: '' }, + { label: tDashboard('mttrAvg'), value: '--', sub: '' }, ].map((m, i, arr) => (