OoO
|
849e189b60
|
feat(p45): UI/UX 升級 ewoooc_base.html + sidebar AI 觀測 7 項 + 新增總覽頁
CD Pipeline / deploy (push) Successful in 2m37s
統帥質疑:「那六頁的視覺方格 UI/UX 搞好了嗎?還有新增頁面嗎?」
回答:沒有,從 Phase 38 開始一直推遲。本 commit 補做。
I-1: 6 頁 base.html → ewoooc_base.html
- host_health / ai_calls_dashboard / budget / promotion_review /
quality_trend / ppt_audit_history 全改
- {% extends "base.html" %} → {% extends "ewoooc_base.html" %}
- {% block content %} → {% block ewooo_content %}
- 自動繼承:sidebar 240px / topbar 64px / fonts (Inter+JetBrains+Noto Sans TC)
/ ewoooc-tokens.css / ewoooc-shell.css / search box / 米色背景
I-2: _ewoooc_shell.html 加「AI 觀測」nav group
- 7 個項目:觀測台總覽 / 主機健康 / AI 呼叫 / 預算控管 /
RAG 晉升審核 / 反饋趨勢 / PPT 視覺審核
- 對應 active_page='obs_*',正確高亮
- 編號 07-13(系統管理改 14)
I-3: 新增頁面 /observability/ + /observability/overview
- routes/admin_observability_routes.py::observability_overview
- 單頁聚合 8 表跨 JOIN 的 KPI:
• 三主機 24h 在線率(host_health_probes,per host card)
• AI 呼叫 24h(ai_calls:total/tokens/cost/error rate/RAG hit/cache hit)
• 當月成本累計
• 預算告警(ratio ≥ alert_pct 自動列表)
• AIOps 7d(incidents + heal_logs:自癒成功率)
• MCP 24h(mcp_calls:tool 呼叫 + cache 率 + cost)
• RAG 學習 30d(learning_episodes:待審 + 晉升率)
• PPT 視覺審核 7d(ppt_audit_results:通過率)
• 6 大子頁入口卡(含一行說明)
- 對應 Phase 44 daily Telegram summary 的 web 版本
- 全部失敗安全(個別 query 失敗只跳過該卡,不擋整頁)
升級對應:
- UI 框架:base.html → ewoooc_base.html ✅(sidebar + topbar + token css 已生效)
- 設計憲法:8 卡片 + 8 表跨 JOIN 全景 + 一頁式總覽
- 入口:sidebar 7 項 + 觀測台首頁
- 資料表覆蓋:4 表(Phase 38)→ 8 表(Phase 45)
注意:完整 design token 重塑(Bootstrap class → --momo-* token / 焦糖橘)
留待後續 phase;本 commit 重點是「框架升級 + 新總覽頁」。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
2026-05-04 19:34:18 +08:00 |
|
OoO
|
79cf08c58c
|
feat(p39): 觀測台升級 — DB + MCP + RAG + AI 自動化深度整合
CD Pipeline / deploy (push) Successful in 2m30s
統帥質疑:6 頁觀測台只是 raw stats dashboard,沒展現 AI 自動化專業。
深度盤點 4 軸結果:
- DB 利用率 22.7%(22 表只用 5 張)
- MCP 整合 1/6(mcp_calls 表完全沒被讀)
- RAG 整合 0/6(沒 import rag_service)
- AI 自動化 L0 × 5 + L1 × 1(純讀 dashboard,無一鍵觸發)
本 commit 5 個增強:
D-1: promotion_review 加 RAG「Top 3 相似已晉升」
- 對每筆 awaiting_review episode 跑 rag_service.query 找 ai_insights 中
cosine ≥ 0.7 的相似已晉升內容
- 輔助人工判斷:是否冗餘?是否新領域?
- header 顯示 ai_insights 知識庫 size
- fail-safe: 單筆 RAG 失敗不影響其餘
D-2: host_health 加 MCP 24h 工作量 widget
- 從 mcp_calls 統計各 server 24h 呼叫次數 / 成功率 / cache 率 /
使用 tool 數 / 平均耗時 / cost
- 展現「AI×MCP 編排規模」而非只「server 健康與否」
D-3: ai_calls × rag_query_log × mcp_calls 三表 JOIN
- 新增「呼叫端 × RAG × MCP 編排矩陣」card
- 每個 caller:總呼叫 / RAG 命中率 / MCP 編排率(透過 request_id 串接)
/ RAG 反饋分數 / 反饋筆數
- 展現「AI 自動化專業」核心指標
D-4: budget 加 RAG 自動策略建議 + 一鍵 force-throttle (L2)
- ratio ≥ 0.8 時自動 RAG 召回 ai_insights 中的 budget_strategy 知識
- POST /budget/force_throttle endpoint:立即重算 cost_throttle 狀態
(不等下次每小時 cron)— 升級到 L2 自動化
- 對應頁面加「立即重算節流狀態」按鈕
D-5: host_health 加 incidents + heal_logs 7d 摘要
- 顯示 ADR-013 AutoHeal 閉環核心 KPI:
總事件 / 未解決 / 已解決 / P0+P1 / 自癒成功率 / 平均自癒耗時
- 展現「AIOps 自癒系統」運作實況
對應升級:
- DB 利用率 22.7% → ~50%(新接 mcp_calls + rag_query_log JOIN
+ ai_insights + incidents + heal_logs)
- MCP 整合 1/6 → 3/6(host_health + ai_calls + budget 都接 mcp_calls)
- RAG 整合 0/6 → 3/6(promotion_review + budget + 待 quality_trend)
- AI 自動化 L1 → L2 一鍵 force-throttle 一個(其餘按鈕待 D-6)
全部 fail-safe:DB 表/RAG/MCP 失敗都不擋頁面渲染。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
2026-05-04 19:08:41 +08:00 |
|
OoO
|
19f1340f5c
|
feat(p38): admin 觀測台 6 頁完整繁中化 + 加入導航選單
CD Pipeline / deploy (push) Successful in 2m42s
問題:
1. 6 個 /observability/* 頁面標題與欄位英文殘留(違反設計憲法繁中要求)
2. 6 頁完全沒掛 navbar,使用者進不去(只能彼此 footer link 互連)
3. emoji 取代 Font Awesome,違反設計規範
修補:
- _navbar.html 新增「AI 觀測台」dropdown(位於 AI 助手 與 雲端匯入 之間)
- AI 監控組:AI 呼叫總覽 / 主機健康監控 / 預算控管
- AI 學習組:RAG 學習晉升審核 / Caller 反饋趨勢 / PPT 視覺審核歷史
- 6 個 admin/observability template 全面繁中化:
- 標題、表格欄位、按鈕、badge 文字、JS alert 文案
- emoji → Font Awesome icon(fa-heartbeat / fa-chart-bar / fa-wallet / fa-brain / fa-comments / fa-search 等)
- 移除 5 處 footer 手寫 link 條(已由 navbar 取代,避免雙寫)
- routes/admin_observability_routes.py 6 個 render_template 加 active_page='obs_*'
讓 navbar dropdown 正確高亮
完整覆蓋:host_health / ai_calls_dashboard / budget / promotion_review / quality_trend / ppt_audit_history
設計規範對齊:仍待 Phase 後續工作(ewoooc_base.html 框架升級 + --momo-* design token)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
2026-05-04 18:49:44 +08:00 |
|
OoO
|
99d2f3c543
|
fix(p32): admin URL prefix /admin → /observability — 避開 188 nginx SPA shadow
CD Pipeline / deploy (push) Successful in 2m25s
Root cause(curl 實證):
prod 188 nginx 對 /admin/* 設 try_files → SPA index.html fallback
→ Phase 27-31 的 6 個 Flask admin 路由全被 nginx 攔截
→ 外部 GET /admin/ai_calls 回 7480 byte 靜態 HTML(同 etag = SPA shell)
→ 我之前說「6 admin 頁 prod 200」是回了 200,但 body 不是 Flask 渲染
修法:
Blueprint url_prefix /admin → /observability
→ 6 個觀測頁實際生效在 /observability/* 不被 SPA 遮蔽
→ SPA frontend 仍擁有 /admin/* 命名空間(不破壞既有前端)
更新範圍:
- routes/admin_observability_routes.py: url_prefix + 註解全改
- 6 templates: 所有 href / fetch() 路徑改 /observability/
- tests/test_admin_observability_routes.py: client.get/post 路徑改
- 10/10 smoke tests 仍 PASS
統帥訪問新路徑:
http://192.168.0.188/observability/ai_calls
http://192.168.0.188/observability/host_health
http://192.168.0.188/observability/budget
http://192.168.0.188/observability/promotion_review
http://192.168.0.188/observability/quality_trend
http://192.168.0.188/observability/ppt_audit_history
|
2026-05-04 14:13:27 +08:00 |
|
OoO
|
69ccf8029b
|
feat(p29): 預算管理頁 + PPT vision 歷史頁 — 完成 6 個 admin 觀測頁
CD Pipeline / deploy (push) Successful in 2m23s
承接 Phase 27/28(48b8fda)剩 2 個前端頁:
1. /admin/budget — 預算編輯器
- GET: ai_call_budgets × 當月 spent 即時對比 + throttle 狀態
- POST /admin/budget/update/<id>: AJAX 編輯 budget_usd / alert_pct
- 不需 restart 立即生效(cost_throttle hourly cron 自動讀新值)
- ratio ≥80% 黃 / ≥110% 紅 / throttled 標 ⚠️ THROTTLED
2. /admin/ppt_audit_history — PPT 視覺審核歷史
- 掃 reports/ 過去 7 日 .pptx 檔(檔名/大小/修改時間)
- 顯示 PPT_VISION_ENABLED 狀態(true=daily 22:00 cron 自動跑)
- 手動觸發 SOP 提示(SSH 188 跑單檔審核)
完工里程碑:6 個 admin 頁 + 1 個導覽
- /admin/ai_calls (Phase 27)
- /admin/promotion_review (Phase 27)
- /admin/quality_trend (Phase 28)
- /admin/host_health (Phase 28)
- /admin/budget (Phase 29) ← 新增
- /admin/ppt_audit_history (Phase 29) ← 新增
Operation Ollama-First v5.0 — 前端互補互動系列收官
|
2026-05-04 13:44:08 +08:00 |
|