diff --git a/app.py b/app.py index da7f658..48f5417 100644 --- a/app.py +++ b/app.py @@ -95,8 +95,8 @@ except Exception as e: sys_log.error(f"無法檢測磁碟空間: {e}") # 🚩 系統版本定義 (備份與顯示用) -# 🚩 2026-05-01 V10.73: Move AI intelligence center onto V2 shell -SYSTEM_VERSION = "V10.73" +# 🚩 2026-05-01 V10.74: Move AI history page onto V2 shell +SYSTEM_VERSION = "V10.74" # ========================================== # 🔒 SQL Injection 防護函數 diff --git a/config.py b/config.py index 3ea3222..156be7c 100644 --- a/config.py +++ b/config.py @@ -254,7 +254,7 @@ YOUTUBE_API_KEY = os.getenv('YOUTUBE_API_KEY', '') # ========================================== # 系統版本與路徑 # ========================================== -SYSTEM_VERSION = "V10.73" +SYSTEM_VERSION = "V10.74" LOG_FILE_PATH = os.path.join(BASE_DIR, 'logs/system.log') public_url = PUBLIC_URL # 用於模板顯示 diff --git a/templates/ai_history.html b/templates/ai_history.html index cc8b9d6..896bf69 100644 --- a/templates/ai_history.html +++ b/templates/ai_history.html @@ -1,26 +1,23 @@ -{% extends 'base.html' %} +{% extends 'ewoooc_base.html' %} {% block title %}AI 生成歷史 - WOOO TECH{% endblock %} -{% block content %} -
+{% block ewooo_content %} +
-
-
-
-
-

- AI 生成歷史 -

-

查看、管理和複用之前生成的文案

-
- -
+
+
+

+ + AI 生成歷史 +

+

查看、管理和複用資料庫內已生成的文案與操作紀錄。

-
+ +
@@ -87,7 +84,7 @@
-
+
@@ -239,23 +236,121 @@
+{% endblock %} + +{% block extra_css %} {% endblock %} diff --git a/tests/test_frontend_v2_assets.py b/tests/test_frontend_v2_assets.py index edb0f4a..ca3ab7c 100644 --- a/tests/test_frontend_v2_assets.py +++ b/tests/test_frontend_v2_assets.py @@ -178,6 +178,29 @@ def test_ai_intelligence_uses_v2_shell_and_real_runtime_apis(): assert "ai_price_recommendations" in route_source +def test_ai_history_uses_v2_shell_and_real_history_apis(): + template = (ROOT / "templates/ai_history.html").read_text(encoding="utf-8") + route_source = (ROOT / "routes/ai_routes.py").read_text(encoding="utf-8") + + assert "{% extends 'ewoooc_base.html' %}" in template + assert "{% block ewooo_content %}" in template + assert "{% block extra_css %}" in template + assert "ai-history-hero" in template + assert "ai-history-panel" in template + assert "fetch('/api/ai/statistics?days=30')" in template + assert "fetch(`/api/ai/history?${params}`)" in template + assert "fetch(`/api/ai/history/${id}`" in template + assert "fetch('/api/ai/history/batch'" in template + assert "mock" not in template.lower() + assert "假商品" not in template + + assert "@ai_bp.route('/ai_history')" in route_source + assert "render_template('ai_history.html')" in route_source + assert "@ai_bp.route('/api/ai/history')" in route_source + assert "ai_history_service.get_history_list" in route_source + assert "ai_history_service.get_statistics" in route_source + + def test_dashboard_v2_restores_real_price_history_chart(): route_source = (ROOT / "routes/api_routes.py").read_text(encoding="utf-8") dashboard = (ROOT / "templates/dashboard_v2.html").read_text(encoding="utf-8")