feat(web/kb): 知識庫支援 AUTO_RUNBOOK + ANTI_PATTERN 類型顯示

- KnowledgeEntry type: 加入 auto_runbook + anti_pattern
- TYPE_COLORS: auto_runbook (紫色) + anti_pattern (紅色)
- 類型過濾器: 新增兩種類型選項
- i18n: zh-TW + en 新增 type.auto_runbook + type.anti_pattern + status.published

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
OG T
2026-04-04 18:09:10 +08:00
parent aea16c87ce
commit cd5547f5eb
3 changed files with 16 additions and 6 deletions

View File

@@ -706,13 +706,16 @@
"draft": "Draft",
"review": "In Review",
"approved": "Approved",
"archived": "Archived"
"archived": "Archived",
"published": "Published"
},
"type": {
"incident_case": "Incident Case",
"runbook": "Runbook",
"best_practice": "Best Practice",
"postmortem": "Postmortem"
"postmortem": "Postmortem",
"auto_runbook": "Auto Runbook",
"anti_pattern": "Anti-Pattern"
},
"source": {
"ai_extracted": "AI Extracted",

View File

@@ -707,13 +707,16 @@
"draft": "草稿",
"review": "審核中",
"approved": "已批准",
"archived": "已封存"
"archived": "已封存",
"published": "已發布"
},
"type": {
"incident_case": "案例分析",
"runbook": "操作手冊",
"best_practice": "最佳實踐",
"postmortem": "事後分析"
"postmortem": "事後分析",
"auto_runbook": "AI 自動 Runbook",
"anti_pattern": "失敗案例"
},
"source": {
"ai_extracted": "AI 萃取",

View File

@@ -30,7 +30,8 @@ interface KnowledgeEntry {
id: string
title: string
content: string
entry_type: 'incident_case' | 'runbook' | 'best_practice' | 'postmortem'
// 2026-04-04 Claude Code: Phase 25 P1 新增 auto_runbook + anti_pattern
entry_type: 'incident_case' | 'runbook' | 'best_practice' | 'postmortem' | 'auto_runbook' | 'anti_pattern'
category: string
tags: string[]
source: 'ai_extracted' | 'human'
@@ -76,6 +77,9 @@ const TYPE_COLORS: Record<string, string> = {
runbook: 'bg-claw-blue/10 text-claw-blue border-claw-blue/20',
best_practice: 'bg-status-healthy/10 text-status-healthy border-status-healthy/20',
postmortem: 'bg-status-critical/10 text-status-critical border-status-critical/20',
// 2026-04-04 Claude Code: Phase 25 P1 — Auto-Harvesting 新增類型
auto_runbook: 'bg-purple-100 text-purple-600 border-purple-200',
anti_pattern: 'bg-red-100 text-red-600 border-red-200',
}
const STATUS_COLORS: Record<string, string> = {
@@ -307,7 +311,7 @@ export default function KnowledgeBasePage({
className="text-xs font-body bg-nothing-gray-50 border border-nothing-gray-200 rounded-md px-2 py-1.5 text-secondary focus:outline-none"
>
<option value="">{t('filterByType')}</option>
{['incident_case', 'runbook', 'best_practice', 'postmortem'].map(tp => (
{['incident_case', 'runbook', 'best_practice', 'postmortem', 'auto_runbook', 'anti_pattern'].map(tp => (
<option key={tp} value={tp}>{t(`type.${tp}`)}</option>
))}
</select>