diff --git a/console-ui/public/portal/index.html b/console-ui/public/portal/index.html index b0a51b8..9278fac 100644 --- a/console-ui/public/portal/index.html +++ b/console-ui/public/portal/index.html @@ -415,6 +415,18 @@ if (!window.ARCRUN_API_BASE) { 文件整理成知識卡的部分,請在同步小幫手(電腦上的托盤圖示)的「AI 設定…」填一把 Gemini API Key。 + +
+
疑難排解
+
搜尋或同步有問題時,可以匯出一份狀態檔給我們,幫你更快找到問題(只有統計數字,不含你的任何文件內容)。
+
+ +
+
+
@@ -924,6 +936,39 @@ function taipeiMonthDay(ms) { var d = new Date(ms + TAIPEI_OFFSET_MS); return { dropSession(); }); + // ── 檢修孔(2026-08-07 leo 直接指令)────────────────────────────────────── + // 「按鈕下載一個檔案,把檔案發給我」:按下去打 /portal/data/diagnostics, + // 存成單一 JSON 檔(不是要解壓的一包)直接觸發瀏覽器下載。不彈視窗、不要求 + // 用戶理解內容——他只需要按一下、把跳出來的檔案傳給我們。 + (function () { + var btn = $('st-diag-export'); + if (!btn) return; + btn.addEventListener('click', function () { + var st = $('st-diag-status'); + btn.disabled = true; + st.textContent = '匯出中…'; + fetch(API_BASE + '/portal/data/diagnostics', { headers: authHeaders() }) + .then(function (r) { return safeJson(r).then(function (d) { return { ok: r.ok, status: r.status, d: d }; }); }) + .then(function (x) { + btn.disabled = false; + if (guard401(x.status)) return; + if (!x.ok) { st.textContent = '匯出失敗,請稍後再試'; return; } + var blob = new Blob([JSON.stringify(x.d, null, 2)], { type: 'application/json' }); + var url = URL.createObjectURL(blob); + var a = document.createElement('a'); + var stamp = new Date().toISOString().slice(0, 19).replace(/[:T]/g, '-'); + a.href = url; + a.download = 'arcrun-diagnostics-' + stamp + '.json'; + document.body.appendChild(a); + a.click(); + document.body.removeChild(a); + setTimeout(function () { URL.revokeObjectURL(url); }, 2000); + st.textContent = '已下載——把這個檔案傳給我們就可以了'; + }) + .catch(function (e) { btn.disabled = false; st.textContent = friendlyErr(e); }); + }); + })(); + // t87 07-28 leo:知識庫網址 helper(只有 origin,不含 /portal/# 後綴),兩處 UI 共用 function copyOriginUrl(btn) { var url = location.origin;