{% extends "ewoooc_base.html" %} {% block title %}AI 觀測戰情室{% endblock %} {% block ewooo_content %} {% set ai = summary.ai_calls if summary.ai_calls else none %} {% set host_count = summary.hosts|length if summary.hosts else 0 %} {% set host_bad = namespace(value=0) %} {% if summary.hosts %} {% for h in summary.hosts %} {% if h.uptime_pct < 90 %}{% set host_bad.value = host_bad.value + 1 %}{% endif %} {% endfor %} {% endif %} {% set risk_count = (summary.budget_alerts|length if summary.budget_alerts else 0) + host_bad.value + (1 if ai and ai.error_rate >= 15 else 0) + (1 if summary.episodes and summary.episodes.pending > 0 else 0) %}
AI Observability Command Room · {{ today }}

AI 觀測戰情室

這裡是 momo-pro 私有 AI 中樞的第一入口:三主機、AI 呼叫、RAG 學習、MCP、AIOps、預算與 PPT 視覺審核全部收斂到同一張作戰圖。數字只讀正式資料來源;沒有資料時顯示診斷空狀態,不用假 KPI 撐場面。

Risk Signals
{{ risk_count }}
主機、預算、錯誤率、待審核的即時風險數
AI Calls / 24h
{{ "{:,}".format(ai.total) if ai else '—' }}
Token {{ "{:,}".format(ai.tokens) if ai else '—' }}
Cost
${{ "%.2f"|format(ai.cost_24h) if ai else '0.00' }}
當月累計 ${{ "%.2f"|format(summary.month_cost|default(0)) }}
RAG Hit Rate
{{ "%.1f"|format(ai.rag_rate) if ai else '—' }}{% if ai %}%{% endif %}
Cache {{ "%.0f"|format(ai.cache_rate) if ai else '—' }}{% if ai %}%{% endif %}
Host Cascade

三主機生命線

主機健康
{% if summary.hosts %}
{% for h in summary.hosts %}
{{ h.label }} {{ "%.1f"|format(h.uptime_pct) }}%
{{ h.up }}/{{ h.total }} probes · 平均 {{ h.avg_ms }} ms · 24h 視窗
{% if host_sparkline.get(h.label) %} {% else %}
尚無趨勢資料
{% endif %}
{% endfor %}
{% else %}
host_health_probes 無資料。請確認 migration 029 與 scheduler probe job 是否已啟動。
{% endif %}
{% if summary.budget_alerts %}
Budget Guard

預算告警

處理預算
{% for b in summary.budget_alerts %} {% endfor %}
週期供應商已花費預算使用率
{{ b.period }} {{ b.provider }} ${{ "%.2f"|format(b.spent) }} ${{ "%.2f"|format(b.budget) }} {{ "%.0f"|format(b.ratio * 100) }}%
{% endif %}

資料來源:host_health_probes / ai_calls / ai_call_budgets / learning_episodes / rag_query_log / mcp_calls / incidents / heal_logs / ppt_audit_results。

{% endblock %}