From 42de2e4d3f7baac653018ac26c97a1453bc99843 Mon Sep 17 00:00:00 2001 From: OoO Date: Wed, 13 May 2026 23:17:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=93=B4=E5=A4=A7=E5=85=A8=E7=AB=99=E9=9F=BF?= =?UTF-8?q?=E6=87=89=E5=BC=8F=E5=AE=88=E9=96=80=E7=AF=84=E5=9C=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.py | 2 +- scripts/check_responsive_overflow.js | 29 ++++++++- templates/ai_intelligence.html | 89 ++++++++++++++++++++++++++++ templates/code_review.html | 44 ++++++++++++++ templates/market_intel/disabled.html | 31 +++++++++- 5 files changed, 190 insertions(+), 5 deletions(-) diff --git a/config.py b/config.py index 0ba1ec6..c5e9f95 100644 --- a/config.py +++ b/config.py @@ -320,7 +320,7 @@ YOUTUBE_API_KEY = os.getenv('YOUTUBE_API_KEY', '') # ========================================== # 系統版本與路徑 # ========================================== -SYSTEM_VERSION = "V10.138" +SYSTEM_VERSION = "V10.139" LOG_FILE_PATH = os.path.join(BASE_DIR, 'logs/system.log') public_url = PUBLIC_URL # 用於模板顯示 diff --git a/scripts/check_responsive_overflow.js b/scripts/check_responsive_overflow.js index 24a247b..4ac01a1 100755 --- a/scripts/check_responsive_overflow.js +++ b/scripts/check_responsive_overflow.js @@ -16,17 +16,43 @@ const DEFAULT_BASE_URL = 'http://127.0.0.1:5003'; const DEFAULT_ROUTES = [ '/', '/edm', + '/festival', + '/mothers_day', + '/valentine_520', + '/labor_day', '/sales_analysis', '/daily_sales', '/monthly_summary_analysis', '/growth_analysis', '/ai_recommend', + '/ai_history', + '/ai_intelligence', '/auto_import', '/vendor-stockout/', '/vendor-stockout/import', '/vendor-stockout/list', + '/vendor-stockout/vendor-management', + '/vendor-stockout/send-email', + '/vendor-stockout/history', '/settings', + '/system_settings', + '/ai_automation_smoke', '/logs', + '/user_management', + '/change_password', + '/login_history', + '/pchome_crawler', + '/price_comparison', + '/trends', + '/notification_templates', + '/brand_assets', + '/market_intel', + '/market_intel/campaigns', + '/market_intel/products', + '/market_intel/matches', + '/market_intel/opportunities', + '/code-review/', + '/cicd', '/observability/overview', '/observability/agent_orchestration', '/observability/business_intel', @@ -264,7 +290,8 @@ async function main() { let metrics = null; try { - const response = await page.goto(url, { waitUntil: 'networkidle', timeout: options.timeoutMs }); + const response = await page.goto(url, { waitUntil: 'domcontentloaded', timeout: options.timeoutMs }); + await page.waitForLoadState('networkidle', { timeout: Math.min(options.timeoutMs, 5000) }).catch(() => {}); status = response ? response.status() : 0; metrics = await collectMetrics(page, options.maxOverflow); if (new URL(metrics.finalUrl).pathname === '/login') { diff --git a/templates/ai_intelligence.html b/templates/ai_intelligence.html index 23504e3..4d73323 100644 --- a/templates/ai_intelligence.html +++ b/templates/ai_intelligence.html @@ -253,6 +253,95 @@ width: 100%; } } + + @media (max-width: 768px) { + .ai-panel .card-header { + align-items: flex-start !important; + flex-direction: column; + gap: 10px; + } + + .ai-panel .card-header > .d-flex { + display: grid !important; + grid-template-columns: 1fr; + width: 100%; + } + + .ai-panel .card-header .form-select, + .ai-panel .card-header .form-control { + width: 100% !important; + } + + .ai-table-scroll { + max-height: none; + overflow: visible; + } + + #competitorTable, + #competitorTable tbody, + #competitorTable tr, + #competitorTable td { + display: block; + width: 100% !important; + } + + #competitorTable thead { + display: none; + } + + #competitorTable tr { + padding: 0.85rem 0.95rem; + border-top: 1px solid rgba(42, 37, 32, 0.08); + } + + #competitorTable tr:first-child { + border-top: 0; + } + + #competitorTable td { + display: grid; + grid-template-columns: 5.8rem minmax(0, 1fr); + gap: 0.65rem; + align-items: start; + padding: 0.36rem 0 !important; + border: 0 !important; + text-align: left !important; + overflow-wrap: anywhere; + white-space: normal; + } + + #competitorTable td::before { + color: var(--momo-text-muted); + font-family: var(--momo-font-mono); + font-size: 0.68rem; + font-weight: 800; + letter-spacing: 0.06em; + text-transform: uppercase; + } + + #competitorTable td[colspan] { + display: block; + } + + #competitorTable td[colspan]::before { + content: none; + display: none; + } + + #competitorTable td:nth-child(1)::before { content: "商品"; } + #competitorTable td:nth-child(2)::before { content: "MOMO"; } + #competitorTable td:nth-child(3)::before { content: "PChome"; } + #competitorTable td:nth-child(4)::before { content: "價差"; } + #competitorTable td:nth-child(5)::before { content: "標籤"; } + #competitorTable td:nth-child(6)::before { content: "分數"; } + #competitorTable td:nth-child(7)::before { content: "更新"; } + + .ai-panel .card-footer { + align-items: flex-start; + flex-direction: column; + gap: 4px; + } + } {% endblock %} diff --git a/templates/code_review.html b/templates/code_review.html index bbbac21..4353831 100644 --- a/templates/code_review.html +++ b/templates/code_review.html @@ -120,6 +120,50 @@ .tab.active { background: #21262d; color: var(--text); border-color: var(--border); } .tab-pane { display: none; } .tab-pane.active { display: block; } + + @media (max-width: 760px) { + .topbar { + flex-wrap: wrap; + padding: 10px 14px; + } + + .topbar h1 { + font-size: 16px; + } + + .layout { + grid-template-columns: 1fr; + height: auto; + min-height: calc(100vh - 49px); + overflow: visible; + } + + .sidebar, + .main { + overflow: visible; + } + + .sidebar { + border-right: 0; + border-bottom: 1px solid var(--border); + } + + .tabs { + flex-wrap: wrap; + } + + .tab { + flex: 1 1 150px; + min-width: 0; + text-align: center; + overflow-wrap: anywhere; + } + + .empty { + padding: 28px 16px; + overflow-wrap: anywhere; + } + } diff --git a/templates/market_intel/disabled.html b/templates/market_intel/disabled.html index dbfce58..2dd84b6 100644 --- a/templates/market_intel/disabled.html +++ b/templates/market_intel/disabled.html @@ -7,9 +7,15 @@ .market-intel-status { display: grid; gap: 1rem; + min-width: 0; + max-width: 100%; } .market-intel-panel { + box-sizing: border-box; + min-width: 0; + max-width: 100%; + overflow: hidden; border: 1px solid var(--momo-border, #d8c8aa); border-radius: 8px; background: @@ -30,16 +36,19 @@ .market-intel-muted { color: var(--momo-muted, #756a5b); margin: 0; + overflow-wrap: anywhere; } .market-intel-flags { display: grid; gap: 0.75rem; - grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); + grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); margin-top: 1rem; + min-width: 0; } .market-intel-flag { + min-width: 0; border-left: 3px solid var(--momo-accent, #c8752d); background: rgba(255, 250, 241, 0.84); padding: 0.8rem 0.9rem; @@ -99,6 +108,7 @@ } .market-intel-pill { + min-width: 0; background: rgba(255, 250, 241, 0.82); border: 1px solid rgba(120, 83, 44, 0.14); border-radius: 8px; @@ -106,6 +116,7 @@ font-family: "JetBrains Mono", monospace; font-size: 0.78rem; font-weight: 700; + overflow-wrap: anywhere; padding: 0.35rem 0.5rem; } @@ -120,9 +131,11 @@ .market-intel-candidate-list { display: grid; gap: 0.75rem; + min-width: 0; } .market-intel-candidate { + min-width: 0; background: rgba(255, 250, 241, 0.82); border: 1px solid rgba(120, 83, 44, 0.14); border-left: 3px solid var(--momo-accent, #c8752d); @@ -146,9 +159,11 @@ .market-intel-operation-list { display: grid; gap: 0.75rem; + min-width: 0; } .market-intel-operation { + min-width: 0; background: rgba(255, 250, 241, 0.82); border: 1px solid rgba(120, 83, 44, 0.14); border-left: 3px solid var(--momo-accent, #c8752d); @@ -173,13 +188,15 @@ .market-intel-check-list { display: grid; gap: 0.6rem; + min-width: 0; } .market-intel-deploy-grid { display: grid; gap: 0.9rem; - grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); + grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); margin-top: 1rem; + min-width: 0; } .market-intel-deploy-section-title { @@ -199,6 +216,7 @@ display: flex; gap: 0.65rem; justify-content: space-between; + min-width: 0; padding: 0.65rem 0.75rem; } @@ -218,6 +236,7 @@ display: block; line-height: 1.45; margin-top: 0.25rem; + overflow-wrap: anywhere; } .market-intel-check span { @@ -228,14 +247,20 @@ white-space: nowrap; } - @media (max-width: 520px) { + @media (max-width: 760px) { .market-intel-preview-head, .market-intel-check { align-items: flex-start; flex-direction: column; } + .market-intel-panel { + padding: 1rem; + } + .market-intel-check span { + max-width: 100%; + overflow-wrap: anywhere; white-space: normal; } }