fix: make service update page operator friendly
Some checks failed
CD Pipeline / deploy (push) Has been cancelled
Some checks failed
CD Pipeline / deploy (push) Has been cancelled
This commit is contained in:
@@ -402,7 +402,7 @@ YOUTUBE_API_KEY = os.getenv('YOUTUBE_API_KEY', '')
|
||||
# ==========================================
|
||||
# 系統版本與路徑
|
||||
# ==========================================
|
||||
SYSTEM_VERSION = "V10.721"
|
||||
SYSTEM_VERSION = "V10.722"
|
||||
LOG_FILE_PATH = os.path.join(BASE_DIR, 'logs/system.log')
|
||||
public_url = PUBLIC_URL # 用於模板顯示
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
> **最後更新**: 2026-06-27 (台北時間)
|
||||
> **狀態**: 🟢 四 AI Agent 自動化閉環已落地;LLM 路由紅線升級為 Ollama-first 三主機級聯;PChome 後台業績匯入韌性已補強;產品定位正名為「PChome 業績成長自動化作戰系統」;外部市場來源正規化層、自動同步、作戰清單與價格參考表優先讀取、CSV 備援預檢、前台操作入口、高可見頁面繁中化守門、比價/作戰 UI 工作台化、跨平台來源治理與商品身份 UI 契約已建立,GCP embedding 熔斷延後處理、110 proxy rescue 與 direct host health skip 已建立
|
||||
> **適用版本**: V10.721
|
||||
> **適用版本**: V10.722
|
||||
|
||||
---
|
||||
|
||||
@@ -806,3 +806,4 @@ POSTGRES_HOST=momo-db
|
||||
| 2026-06-26 | 商品來源頁不得提供 raw JSON 匯出 | V10.719 起 `/pchome_crawler` 改為「PChome 商品監控」營運清單,只提供表格與賣場清單 CSV;前台不得出現 `exportJson`、`JSON.stringify(currentProducts)`、`圖片URL`、`商品URL` 或 raw JSON 檔名。 |
|
||||
| 2026-06-27 | 設定頁監控來源不得直接外露 crawler 命名 | V10.720 起 `/settings` 的商品監控來源由 API 邊界轉為營運名稱與說明,前端卡片再以 `escapeHtml(monitorText(...))` 顯示;啟停與頻率更新訊息統一使用「監控來源」,不得回傳「爬蟲 XXX 已啟用」這類工程主語。 |
|
||||
| 2026-06-27 | 監控來源 API 不回傳前台不需要的內部設定欄位 | V10.721 起 `/api/crawlers` 的設定頁 response 會移除 `function`、`page_type`、`status`、`paused_date`,只保留前台需要的名稱、說明、啟用狀態、頻率、活動代碼與營運提示。 |
|
||||
| 2026-06-27 | 服務更新監控頁不得以內部工具名當主語 | V10.722 起 `/cicd` 可見文字使用「測試站、正式站、監控圖表、自動化流程、今日更新」;前台模板不得用 `issue.error_log` 判斷顯示診斷資料,也不得顯示 `UAT 狀態`、`PROD 狀態`、`Grafana`、`n8n` 作為主按鈕文字。 |
|
||||
|
||||
@@ -502,7 +502,7 @@
|
||||
<div class="card">
|
||||
<div class="stat-box">
|
||||
<div class="stat-value text-info" id="statToday">-</div>
|
||||
<div class="stat-label">今日部署</div>
|
||||
<div class="stat-label">今日更新</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -510,7 +510,7 @@
|
||||
<div class="card">
|
||||
<div class="stat-box">
|
||||
<div id="uatStatus" class="stat-value">-</div>
|
||||
<div class="stat-label">UAT 狀態</div>
|
||||
<div class="stat-label">測試站狀態</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -518,7 +518,7 @@
|
||||
<div class="card">
|
||||
<div class="stat-box">
|
||||
<div id="prodStatus" class="stat-value">-</div>
|
||||
<div class="stat-label">PROD 狀態</div>
|
||||
<div class="stat-label">正式站狀態</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -574,12 +574,12 @@
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<button class="action-btn danger w-100" onclick="triggerRollback('uat')">
|
||||
<i class="bi bi-arrow-counterclockwise"></i>回滾 UAT
|
||||
<i class="bi bi-arrow-counterclockwise"></i>回復測試站
|
||||
</button>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<button class="action-btn danger w-100" onclick="triggerRollback('prod')">
|
||||
<i class="bi bi-arrow-counterclockwise"></i>回滾 PROD
|
||||
<i class="bi bi-arrow-counterclockwise"></i>回復正式站
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -594,12 +594,12 @@
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<a href="http://192.168.0.110:30030" target="_blank" class="btn btn-outline-info w-100">
|
||||
<i class="bi bi-graph-up me-2"></i>Grafana
|
||||
<i class="bi bi-graph-up me-2"></i>監控圖表
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<a href="http://192.168.0.110:5678" target="_blank" class="btn btn-outline-warning w-100">
|
||||
<i class="bi bi-diagram-2 me-2"></i>n8n
|
||||
<i class="bi bi-diagram-2 me-2"></i>自動化流程
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
@@ -721,7 +721,7 @@
|
||||
${issue.error ? `<br><span class="text-muted">已記錄診斷線索</span>` : ''}
|
||||
</div>
|
||||
${issue.fix_suggestion ? `<div class="issue-suggestion">💡 ${escapeHtml(issue.fix_suggestion)}</div>` : ''}
|
||||
${issue.error_log ? `<div class="error-log-preview">已保留診斷資料,請由維護者查看。</div>` : ''}
|
||||
${(issue.error || issue.fix_suggestion) ? `<div class="error-log-preview">已保留診斷資料,請由維護者查看。</div>` : ''}
|
||||
</div>
|
||||
<div class="issue-actions">
|
||||
${issue.auto_fixable ? `
|
||||
@@ -1100,8 +1100,8 @@
|
||||
|
||||
// 服務修復
|
||||
async function triggerFullRepair() {
|
||||
const env = prompt('請輸入要修復的環境 (uat 或 prod):', 'uat');
|
||||
if (!env || !['uat', 'prod'].includes(env)) {
|
||||
const env = normalizeEnvInput(prompt('請輸入要修復的環境:測試站 或 正式站', '測試站'));
|
||||
if (!env) {
|
||||
showNotification('取消', '無效的環境');
|
||||
return;
|
||||
}
|
||||
@@ -1132,8 +1132,8 @@
|
||||
|
||||
// 診斷
|
||||
async function runDiagnosis() {
|
||||
const env = prompt('請輸入要診斷的環境 (uat 或 prod):', 'uat');
|
||||
if (!env || !['uat', 'prod'].includes(env)) {
|
||||
const env = normalizeEnvInput(prompt('請輸入要診斷的環境:測試站 或 正式站', '測試站'));
|
||||
if (!env) {
|
||||
showNotification('取消', '無效的環境');
|
||||
return;
|
||||
}
|
||||
@@ -1199,6 +1199,13 @@
|
||||
return labels[env] || '指定環境';
|
||||
}
|
||||
|
||||
function normalizeEnvInput(value) {
|
||||
const text = String(value || '').trim().toLowerCase();
|
||||
if (['uat', 'test', '測試', '測試站'].includes(text)) return 'uat';
|
||||
if (['prod', 'production', '正式', '正式站'].includes(text)) return 'prod';
|
||||
return '';
|
||||
}
|
||||
|
||||
function displayRefName(ref) {
|
||||
const labels = { main: '正式版更新', master: '正式版更新', dev: '測試版更新', uat: '測試版更新', prod: '正式版更新' };
|
||||
return labels[ref] || '服務更新';
|
||||
|
||||
@@ -797,6 +797,15 @@ def test_utility_pages_keep_operator_copy_professional():
|
||||
assert "情境 × 知識命中矩陣" in ai_calls
|
||||
assert "服務更新監控" in cicd_dashboard
|
||||
assert "正式服務更新與可用性監控" in cicd_dashboard
|
||||
assert "測試站狀態" in cicd_dashboard
|
||||
assert "正式站狀態" in cicd_dashboard
|
||||
assert "監控圖表" in cicd_dashboard
|
||||
assert "自動化流程" in cicd_dashboard
|
||||
assert "issue.error_log" not in cicd_dashboard
|
||||
assert "UAT 狀態" not in cicd_dashboard
|
||||
assert "PROD 狀態" not in cicd_dashboard
|
||||
assert ">Grafana<" not in cicd_dashboard
|
||||
assert ">n8n<" not in cicd_dashboard
|
||||
assert "供貨風險" in stockout_index
|
||||
assert "無服務資料 / 未連線" in host_health
|
||||
assert "部署檢查已排入背景處理" in observability_js
|
||||
|
||||
Reference in New Issue
Block a user