Files
ewoooc/web/templates/components/_navbar.html
ogt 0099543c05
Some checks failed
CD Pipeline / deploy (push) Failing after 5m18s
fix(security): 全域健檢 — 40 項安全/Bug/品質修復
🔴 Critical
- auto_heal_service: 補 import re + sqlalchemy.text + 修正 orchestrator 變數名
  + autoheal_playbook→playbooks 表名 + _alert_and_store cooldown 修復
- aider_heal_executor: shell injection 改 shell=False + list 參數
- docker-compose: DISABLE_LOGIN 改 env var + 移除密碼 fallback + POSTGRES_HOST 修正
- app.py: /api/backup /api/run_task 等 6 個管理 API 加 @login_required
- config.py + pg_sync + e2e_test: 移除 wooo_pg_2026 hardcoded 密碼 fallback
- pg_backup.sh: 移除 TELEGRAM_TOKEN= 中間變數,直接用 $TELEGRAM_BOT_TOKEN
- migration 014: trigger_pattern→match_pattern + 補 error_type NOT NULL 欄位

🟡 High
- telegram_bot_service: str(e) 改通用訊息 + session try/finally + 移除 pa:/pr: 舊 callback
- run_scheduler: ElephantAlpha thread 死亡監控 + 自動重啟 + Telegram 告警
  + agent_context 03:30 TTL 定時清理任務
- openclaw_learning_service: build_rag_context 兩路徑加 .limit(200)
- hooks: commit-quality + momo-prod-guard 空 catch 改 stderr+exit(1)
- scripts/code_review: auto_yes 預設改 false
- db_backup_service: PGPASSWORD 透過 env dict 傳遞

📦 Migrations
- 013_autoheal: 修正建表順序 playbooks→incidents(外鍵前向引用)
- 018_add_missing_indexes: heal_logs/incidents 外鍵索引 + cleanup_expired_agent_context()

🟢 Infrastructure
- requirements.txt: 加版本下界 Flask>=2.3 SQLAlchemy>=1.4 等
- cd.yaml: 新增 run_scheduler.py + run_telegram_bot.py 監聽路徑
- .gitignore: insert_playbook_local.py 加入忽略

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-22 01:12:23 +08:00

190 lines
8.4 KiB
HTML
Executable File

{#
導航列組件
注意:目前已停用登入驗證,所有選單項目對所有人可見。
使用方式:
{% include 'components/_navbar.html' %}
#}
<nav class="navbar navbar-expand-xl navbar-dark bg-custom-dark fixed-top shadow-sm">
<div class="container">
<!-- 品牌 Logo -->
<a class="navbar-brand d-flex align-items-center" href="/">
<span class="d-none d-sm-inline fw-bold" style="letter-spacing: 2px;">WOOO</span>
</a>
<!-- 手機版選單按鈕 -->
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav me-auto">
<!-- 商品看板 - 所有人可見 -->
<li class="nav-item">
<a class="nav-link {% if active_page == 'dashboard' %}active{% endif %}" href="/">
<i class="fas fa-chart-line me-1"></i>商品看板
</a>
</li>
<!-- 活動看板 - 所有人可見 -->
<li class="nav-item">
<a class="nav-link {% if active_page == 'edm' %}active{% endif %}" href="/edm">
<i class="fas fa-bullhorn me-1"></i>活動看板
</a>
</li>
<!-- 分析報表 -->
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle {% if active_page in ['sales', 'daily_sales', 'monthly', 'growth'] %}active{% endif %}"
href="#" role="button" data-bs-toggle="dropdown">
<i class="fas fa-chart-bar me-1"></i>分析報表
</a>
<ul class="dropdown-menu">
<li>
<a class="dropdown-item" href="/sales_analysis">
<i class="fas fa-chart-bar me-2"></i>業績分析
</a>
</li>
<li>
<a class="dropdown-item" href="/daily_sales">
<i class="fas fa-calendar-day me-2"></i>當日業績
</a>
</li>
<li>
<a class="dropdown-item" href="/growth_analysis">
<i class="fas fa-chart-line me-2"></i>成長分析
</a>
</li>
<li><hr class="dropdown-divider"></li>
<li>
<a class="dropdown-item" href="/monthly_summary_analysis">
<i class="fas fa-table me-2"></i>月份總表數據分析
</a>
</li>
{% if metabase_url %}
<li><hr class="dropdown-divider"></li>
<li>
<a class="dropdown-item" href="{{ metabase_url }}" target="_blank">
<i class="fas fa-chart-pie me-2"></i>自訂圖表 (Metabase)
<i class="fas fa-external-link-alt ms-1 small text-muted"></i>
</a>
</li>
{% endif %}
{% if grist_url %}
<li>
<a class="dropdown-item" href="{{ grist_url }}" target="_blank">
<i class="fas fa-table me-2"></i>資料協作 (Grist)
<i class="fas fa-external-link-alt ms-1 small text-muted"></i>
</a>
</li>
{% endif %}
</ul>
</li>
<!-- 廠商缺貨 -->
<li class="nav-item">
<a class="nav-link {% if active_page == 'vendor_stockout' %}active{% endif %}" href="/vendor-stockout">
<i class="fas fa-box-open me-1"></i>廠商缺貨
</a>
</li>
<!-- AI 助手 -->
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle {% if active_page in ['ai_recommend', 'ai_history'] %}active{% endif %}"
href="#" role="button" data-bs-toggle="dropdown">
<i class="fas fa-robot me-1"></i>AI 助手
</a>
<ul class="dropdown-menu">
<li>
<a class="dropdown-item" href="/ai_recommend">
<i class="fas fa-magic me-2"></i>智慧文案生成
</a>
</li>
<li>
<a class="dropdown-item" href="/ai_history">
<i class="fas fa-history me-2"></i>生成歷史記錄
</a>
</li>
</ul>
</li>
<!-- 雲端匯入 -->
<li class="nav-item">
<a class="nav-link {% if active_page == 'auto_import' %}active{% endif %}" href="/auto_import">
<i class="fas fa-cloud-download-alt me-1"></i>雲端匯入
</a>
</li>
<!-- 系統管理 -->
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle {% if active_page in ['settings', 'system_settings', 'logs', 'crawler', 'user_management'] %}active{% endif %}"
href="#" role="button" data-bs-toggle="dropdown">
<i class="fas fa-cog me-1"></i>系統管理
</a>
<ul class="dropdown-menu">
<li>
<a class="dropdown-item" href="/user_management">
<i class="fas fa-users-cog me-2"></i>用戶管理
</a>
</li>
<li><hr class="dropdown-divider"></li>
<li>
<a class="dropdown-item" href="/settings">
<i class="fas fa-robot me-2"></i>爬蟲管理
</a>
</li>
<li>
<a class="dropdown-item" href="/crawler_management">
<i class="fas fa-spider me-2"></i>爬蟲設定
</a>
</li>
<li><hr class="dropdown-divider"></li>
<li>
<a class="dropdown-item" href="/system_settings">
<i class="fas fa-sliders-h me-2"></i>系統設定
</a>
</li>
<li>
<a class="dropdown-item" href="/logs">
<i class="fas fa-file-alt me-2"></i>系統日誌
</a>
</li>
</ul>
</li>
</ul>
<!-- 右側區域 -->
<div class="d-flex align-items-center">
<!-- 時間顯示 -->
<span class="navbar-text text-light small me-3">
<i class="fas fa-clock me-1"></i>
<span id="navbar-datetime">{{ datetime_now or '' }}</span>
</span>
</div>
</div>
</div>
</nav>
<!-- 導航列時間更新腳本 -->
<script>
(function() {
function updateNavbarTime() {
const now = new Date();
const formatted = now.getFullYear() + '-' +
String(now.getMonth() + 1).padStart(2, '0') + '-' +
String(now.getDate()).padStart(2, '0') + ' ' +
String(now.getHours()).padStart(2, '0') + ':' +
String(now.getMinutes()).padStart(2, '0') + ':' +
String(now.getSeconds()).padStart(2, '0');
const el = document.getElementById('navbar-datetime');
if (el) el.textContent = formatted;
}
// 每秒更新時間
setInterval(updateNavbarTime, 1000);
})();
</script>