diff --git a/internal/admin/web/app.js b/internal/admin/web/app.js index 2524a4e..83628de 100644 --- a/internal/admin/web/app.js +++ b/internal/admin/web/app.js @@ -13,6 +13,7 @@ const TITLES = { let overviewTimer = null; let logStop = null; let lastOverview = null; +let pxMode = "basic"; // 代理线路页签:basic=基础线路 pool=代理池,重渲染后保留 /* ── helpers ─────────────────────────────────────────────── */ function toast(msg, kind) { @@ -56,7 +57,9 @@ const fmtBytes = n => n > 1048576 ? (n / 1048576).toFixed(1) + "MB" : n > 1024 ? const timeStr = t => new Date(t).toLocaleTimeString("zh-CN", { hour12: false }); function switchHTML(id, checked) { - return ``; + // id 可能含模型名/站点码等配置里的任意字符,必须转义,否则闭合属性后 + // 会把后面的 checked/span 拆成攻击者可控的标记。 + return ``; } /* ── auth ────────────────────────────────────────────────── */ @@ -330,75 +333,92 @@ PAGES.proxy = async () => { const p = ov.proxy; const pool = ov.proxypool || { xray: {}, entries: [], subscriptions: [], sticky: {} }; view.innerHTML = ` -
-

主线路

-
-
- - -
-
支持 http:// · https:// · socks5://
-
-

降级策略

-
-
-
-
-
-
-
${switchHTML("px-cross", p.cross_site_failover)}
- -
-
主线路在 slow-start 内无首事件,或输出内容前失败时,自动切换到备用线路。
+
+

出站线路

+
+ +
-

备用线路

-
-
#地址
-
当前生效顺序:${ov.cache.routes.map(r => `${esc(r.name)} → ${esc(r.proxy)}`).join(" ")}
+
+ +
+
+

主线路

+
+
+ + +
+
支持 http:// · https:// · socks5://
+
+

限流与故障切换

+
+
+
+
+
+
+
${switchHTML("px-cross", p.cross_site_failover)}
+ +
+
主线路在 slow-start 内无首事件,或输出内容前失败时,自动切换到备用线路。
+
+
+

备用线路

+
+
#地址
+
当前生效顺序:${ov.cache.routes.map(r => `${esc(r.name)} → ${esc(r.proxy)}`).join(" ")}
+
-
-

代理池 · Xray 核心

-
-
${switchHTML("pool-en", pool.enabled)}
-
-
+ +