Files
ewoooc/templates/admin/ppt_audit_history.html
OoO 99d2f3c543
All checks were successful
CD Pipeline / deploy (push) Successful in 2m25s
fix(p32): admin URL prefix /admin → /observability — 避開 188 nginx SPA shadow
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

59 lines
2.0 KiB
HTML

{% extends "base.html" %}
{% block title %}PPT Audit History{% endblock %}
{% block content %}
<div class="container-fluid mt-3">
<h2 class="mb-3">🔍 PPT 視覺審核歷史
<small class="text-muted">reports/ 過去 7 日 .pptx</small>
</h2>
{% if error %}<div class="alert alert-warning"><strong>⚠️</strong> {{ error }}</div>{% endif %}
<div class="alert {% if vision_enabled %}alert-success{% else %}alert-secondary{% endif %} small">
<strong>PPT_VISION_ENABLED:</strong>
{% if vision_enabled %}
✅ 已啟用 — daily 22:00 cron 自動跑 minicpm-v 視覺檢查,有 issues 推 Telegram
{% else %}
⏸ 未啟用 — 設 PPT_VISION_ENABLED=true + 188 安裝 LibreOffice 即生效
{% endif %}
</div>
<table class="table table-sm">
<thead class="table-light">
<tr>
<th>檔名</th><th class="text-end">大小 (KB)</th>
<th>修改時間</th><th>動作</th>
</tr>
</thead>
<tbody>
{% for f in files %}
<tr>
<td><code>{{ f.name }}</code></td>
<td class="text-end">{{ f.size_kb }}</td>
<td><small>{{ f.mtime }}</small></td>
<td>
<small class="text-muted">audit cron 22:00 自動跑</small>
</td>
</tr>
{% else %}
<tr><td colspan="4" class="text-center text-muted">過去 7 日無 PPT 生成</td></tr>
{% endfor %}
</tbody>
</table>
<p class="text-muted mt-2 small">
審核結果:<strong>有 issues 才推 Telegram</strong>(避免靜默無問題洗版)。
手動觸發單檔審核需 SSH 188 跑:
<code>python3 -c "from services.ppt_vision_service import ppt_vision_service; print(ppt_vision_service.check_ppt_file('reports/xxx.pptx'))"</code>
</p>
<p class="text-muted mt-3"><small>
🤖 Operation Ollama-First v5.0 / Phase 29 — PPT Audit History
| <a href="/observability/ai_calls">AI Calls</a>
| <a href="/observability/host_health">Host Health</a>
| <a href="/observability/budget">Budget</a>
</small></p>
</div>
{% endblock %}