diff --git a/apps/web/messages/en.json b/apps/web/messages/en.json index 234d2231..233dde61 100644 --- a/apps/web/messages/en.json +++ b/apps/web/messages/en.json @@ -2239,7 +2239,7 @@ "aiopsTimeline": { "title": "AIOps 全景時序", "subtitle": "告警→感官調查→AI決策→自動執行→驗證→學習 完整鏈路", - "mockBadge": "MOCK 模式", + "sampleBadge": "範例資料", "stages": { "alert": "告警觸發", "diagnose": "感官調查", diff --git a/apps/web/messages/zh-TW.json b/apps/web/messages/zh-TW.json index 234d2231..233dde61 100644 --- a/apps/web/messages/zh-TW.json +++ b/apps/web/messages/zh-TW.json @@ -2239,7 +2239,7 @@ "aiopsTimeline": { "title": "AIOps 全景時序", "subtitle": "告警→感官調查→AI決策→自動執行→驗證→學習 完整鏈路", - "mockBadge": "MOCK 模式", + "sampleBadge": "範例資料", "stages": { "alert": "告警觸發", "diagnose": "感官調查", diff --git a/apps/web/src/app/[locale]/aiops/timeline/page.tsx b/apps/web/src/app/[locale]/aiops/timeline/page.tsx index 27c68d4e..3784acb0 100644 --- a/apps/web/src/app/[locale]/aiops/timeline/page.tsx +++ b/apps/web/src/app/[locale]/aiops/timeline/page.tsx @@ -5,7 +5,7 @@ // AIOps 全景時序頁面 // 告警→感官調查→AI決策→自動執行→驗證→學習 完整鏈路視覺化 // -// Mock 模式:NEXT_PUBLIC_AIOPS_TIMELINE_MOCK=true +// 範例資料模式:NEXT_PUBLIC_AIOPS_TIMELINE_MOCK=true // 真實 API: GET /api/v1/aiops/timeline?incident_id=&limit=20 // ============================================================ diff --git a/apps/web/src/components/ai/openclaw-state-machine.tsx b/apps/web/src/components/ai/openclaw-state-machine.tsx index 2c6a9ebf..9aff1a00 100644 --- a/apps/web/src/components/ai/openclaw-state-machine.tsx +++ b/apps/web/src/components/ai/openclaw-state-machine.tsx @@ -12,7 +12,7 @@ * - ApprovalCard 滑入動畫 * - 記憶體安全清理 * - * 真實性條款: 禁止任何 Mock Data + * 真實性條款:禁止以範例資料掩蓋 API 狀態 * i18n: 100% next-intl */ diff --git a/apps/web/src/components/aiops/timeline/AiopsTimelinePanel.tsx b/apps/web/src/components/aiops/timeline/AiopsTimelinePanel.tsx index 1573887f..e3a02f3b 100644 --- a/apps/web/src/components/aiops/timeline/AiopsTimelinePanel.tsx +++ b/apps/web/src/components/aiops/timeline/AiopsTimelinePanel.tsx @@ -20,7 +20,7 @@ import { import { cn } from '@/lib/utils' import { TimelineFilter } from './TimelineFilter' import { TimelineStage } from './TimelineStage' -import { MOCK_INCIDENTS } from './mock-data' +import { SAMPLE_TIMELINE_INCIDENTS } from './sample-incidents' import type { TimelineIncident, TimelineFilterState, @@ -31,7 +31,8 @@ import type { // Constants // ============================================================ -const IS_MOCK = process.env.NEXT_PUBLIC_AIOPS_TIMELINE_MOCK === 'true' +// 保留既有環境變數相容;UI 以「範例資料」呈現,避免誤讀為正式證據。 +const USE_SAMPLE_TIMELINE = process.env.NEXT_PUBLIC_AIOPS_TIMELINE_MOCK === 'true' const API_BASE = process.env.NEXT_PUBLIC_API_URL ?? '' const STAGE_ORDER: StageType[] = ['alert', 'diagnose', 'decide', 'execute', 'verify', 'learn'] @@ -280,14 +281,14 @@ export default function AiopsTimelinePanel() { } = useQuery({ queryKey: ['aiops-timeline', filter.incident_id, filter.time_range], queryFn: () => fetchTimeline(filter.incident_id), - enabled: !IS_MOCK, + enabled: !USE_SAMPLE_TIMELINE, staleTime: 30_000, refetchInterval: 60_000, }) // 客戶端篩選 — rawIncidents 內聯進 useMemo 避免 conditional 依賴警告 const incidents = useMemo(() => { - const rawIncidents: TimelineIncident[] = IS_MOCK ? MOCK_INCIDENTS : (apiData ?? []) + const rawIncidents: TimelineIncident[] = USE_SAMPLE_TIMELINE ? SAMPLE_TIMELINE_INCIDENTS : (apiData ?? []) let list = rawIncidents if (filter.incident_id.trim()) { @@ -325,9 +326,9 @@ export default function AiopsTimelinePanel() {