diff --git a/app.py b/app.py index c006dec..4c08258 100644 --- a/app.py +++ b/app.py @@ -129,9 +129,9 @@ else: TEMPLATE_DIR = os.path.join(BASE_DIR, 'templates') STATIC_DIR = os.path.join(BASE_DIR, 'web/static') -# 檢查關鍵模板是否存在 -if not os.path.exists(os.path.join(TEMPLATE_DIR, 'dashboard.html')): - sys_log.warning(f"[Web] [Template] ⚠️ 警告: 找不到 dashboard.html | Path: {TEMPLATE_DIR}") +# 檢查關鍵模板是否存在。正式商品看板已遷移到 V3 shell。 +if not os.path.exists(os.path.join(TEMPLATE_DIR, 'dashboard_v2.html')): + sys_log.warning(f"[Web] [Template] ⚠️ 警告: 找不到 dashboard_v2.html | Path: {TEMPLATE_DIR}") app = Flask(__name__, template_folder=TEMPLATE_DIR, diff --git a/config.py b/config.py index 8a116db..f1a7cf4 100644 --- a/config.py +++ b/config.py @@ -320,7 +320,7 @@ YOUTUBE_API_KEY = os.getenv('YOUTUBE_API_KEY', '') # ========================================== # 系統版本與路徑 # ========================================== -SYSTEM_VERSION = "V10.151" +SYSTEM_VERSION = "V10.152" LOG_FILE_PATH = os.path.join(BASE_DIR, 'logs/system.log') public_url = PUBLIC_URL # 用於模板顯示 diff --git a/templates/403.html b/templates/403.html index 5bb5127..a1382c6 100644 --- a/templates/403.html +++ b/templates/403.html @@ -1,87 +1,22 @@ - - -
- - -{{ legacy_bridge_body|default('這個舊入口已接到新版 EwoooC V3 設計系統。') }}
+ +管理系統爬蟲的啟用狀態和執行頻率
-sudo systemctl restart momo-scheduler| - 分類 {% if - current_sort == 'category' %}{% else - %}{% endif %} - | -- 商品名稱 {% if - current_sort == 'name' %}{% else - %}{% endif %} - | -- 當天價格 {% if - current_sort == 'price' %}{% else - %}{% endif %} - | -- 昨日漲跌 - {% if current_sort == 'yesterday_change' %}{% else - %}{% endif %} - | -- 週漲跌 {% if - current_sort == 'week_change' %}{% else - %}{% endif %} - | -- 更新時間 {% if - current_sort == 'timestamp' %}{% else - %}{% endif %} - | -- 上架時間 - | -
|---|---|---|---|---|---|---|
| {{ item.record.product.category }} - | -
-
-
-
- {% if item.record.product.image_url %}
-
-
- 無圖
- {% endif %}
-
- {% set safe_product_url = item.safe_momo_url or '#' %}
-
- {{ item.record.product.name }}
-
-
-
-
- ID: {{ item.record.product.i_code }}
-
- {% if item.status == 'PRICE_UP' %}
- 漲價
- {% elif item.status == 'PRICE_DOWN' %}
- 降價
- {% elif item.status == 'DELISTED' %}
- 下架
- {% endif %}
-
- |
- {% set tooltip_content %}
- - ${{ item.record.price | number_format }} - | -
- {% if item.yesterday_diff != 0 %}
- {% set old_price = item.record.price - item.yesterday_diff %}
- {% set percent_change = (item.yesterday_diff / old_price * 100) | round(1) if old_price
- > 0 else 0 %}
-
- {{ '▲' if item.yesterday_diff > 0 else '▼' }} {{
- item.yesterday_diff | abs | number_format }}
- ({{ percent_change }}%)
-
- {% else %}
- -
- {% endif %}
- |
- - {% if item.stats['7d_diff'] > 0 %} - +{{ item.stats['7d_diff'] | number_format }} - {% elif item.stats['7d_diff'] < 0 %} {{ item.stats['7d_diff'] | - number_format }} - {% else %} - - - {% endif %} - | -{{ item.record.timestamp.strftime('%m-%d %H:%M') }} - | -- {% if item.safe_created_at %} - {{ item.safe_created_at.strftime('%m-%d %H:%M') }} - {% else %} - - - {% endif %} - | -
| - {% if search_query %} - 找不到與「{{ search_query }}」相關的商品 - {% else %} - 沒有符合條件的商品 - {% endif %} - | -||||||
- 活動時間: {{ activity_time }} | - 最後更新: {{ last_update }} | - 商品總數: {{ total_edm_products }} -
-| 分類 | -- {% set next_order_name = 'asc' if current_sort == 'name' and current_order == 'desc' else ('default' if current_sort == 'name' and current_order == 'asc' else 'desc') %} - - 商品資訊 {% if current_sort == 'name' %}{% else %}{% endif %} - - | -- {% set next_order_price = 'asc' if current_sort == 'price' and current_order == 'desc' else ('default' if current_sort == 'price' and current_order == 'asc' else 'desc') %} - - 價格 {% if current_sort == 'price' %}{% else %}{% endif %} - - | -- {% if current_promo_page == 'edm' %} - {% set next_order_qty = 'asc' if current_sort == 'remain_qty' and current_order == 'desc' else ('default' if current_sort == 'remain_qty' and current_order == 'asc' else 'desc') %} - - 倒數組數 {% if current_sort == 'remain_qty' %}{% else %}{% endif %} - - {% else %} - 狀態 - {% endif %} - | -
|---|---|---|---|
| - {% if item.main_category %} - {% set badge_attr = 'style="background-color: ' ~ item.category_color ~ '; color: #333;"' %} - {{ item.main_category }} - {% else %} - 未分類 - {% endif %} - | -
-
-
-
- {% if item.image_url %}
-
- 無圖
- {% endif %}
-
-
- {{ item.name }}
-
-
-
-
- ID: {{ item.i_code }}
-
- {% if item.status_change == 'NEW' %}
- NEW
- {% elif item.status_change == 'PRICE_DOWN' %}
- 降價
- {% elif item.status_change == 'PRICE_UP' %}
- 漲價
- {% elif item.status_change == 'DELISTED' or item.status_change == 'SLOT_END' %}
- 下架
- {% endif %}
-
- {% if item.discount_text %}
- {{ item.discount_text }}
- {% endif %}
-
- |
-
- {% if item.previous_price and item.price and item.previous_price != item.price %}
- {% set diff = item.price - item.previous_price %}
- {% set percent = ((diff|abs) / item.previous_price * 100) | round | int %}
-
- {% if diff < 0 %}
-
- ▼ {{ (diff|abs) | number_format }} ({{ percent }}%)
- {% else %}
- - ${{ item.previous_price | number_format }} - ${{ item.price | number_format }} -
- ▲ {{ diff | number_format }} ({{ percent }}%)
- {% endif %}
- {% else %}
- ${{ (item.price | number_format) if item.price is not none else 'N/A' }}
- {% endif %}
- - ${{ item.previous_price | number_format }} - ${{ item.price | number_format }} - |
-
- {% if current_promo_page == 'edm' %}
- {% set tooltip_content %}
-
- 📈 當日銷售歷程:
- {% endset %}
- - {% for h in item.qty_history %} - {{ h.time }} 剩 {{ h.qty }} 組 - {% endfor %} - 1 %}
- data-bs-toggle="tooltip"
- data-bs-html="true"
- title="{{ tooltip_content }}"
- {% endif %}>
- {% if item.remain_qty is not none %}
- 🔥 {{ item.remain_qty | number_format }}組
- {% else %}
- -
- {% endif %}
-
- {% else %}
- 活動中
- {% endif %}
- |
-
上傳包含缺貨商品資料的 Excel 檔案,系統會自動檢測並匯入
-支援格式: Excel (.xlsx, .xls)
- -
- 為了提供更穩定的網站服務
-系統正在進行必要的維護與優化
-造成不便,敬請見諒
- -上傳包含缺貨商品資料的 Excel 檔案,系統會自動檢測並匯入
-支援格式: Excel (.xlsx, .xls)
- -管理缺貨商品資料、廠商聯絡資訊,並自動發送缺貨通知郵件
-| - | 批次 | -廠商代碼 | -廠商名稱 | -商品ID | -商品名稱 | -缺貨天數 | -日均銷量 | -可賣量 | -狀態 | -匯入時間 | -操作 | -
|---|---|---|---|---|---|---|---|---|---|---|---|
|
-
- 載入中... - |
- |||||||||||
上傳包含缺貨商品資料的 Excel 檔案,系統會自動檢測並匯入
-支援格式: Excel (.xlsx, .xls)
- -| ID | -批次編號 | -廠商 | -收件者 | -主旨 | -商品數 | -狀態 | -發送時間 | -
|---|---|---|---|---|---|---|---|
| - 載入中... - | -|||||||
| 廠商代碼 | -廠商名稱 | -郵件地址 | -郵件數量 | -操作 | -
|---|---|---|---|---|
|
-
- 載入中... - |
- ||||
支援格式: Excel (.xlsx, .xls)
-
- 必要欄位:來源供應商編號、來源供應商名稱
- 選填欄位:Mail(支援多個郵件用逗號或分號分隔)
-