tt-help-cli-ycl 1.4.175 → 1.4.176
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
package/src/watch/public/app.js
CHANGED
|
@@ -5563,33 +5563,16 @@ function renderLoginSection(c, userId, loginPorts) {
|
|
|
5563
5563
|
"padding:2px 8px;font-size:11px;background:#333;color:#4ade80;" +
|
|
5564
5564
|
"border:1px solid #444;border-radius:3px;cursor:pointer",
|
|
5565
5565
|
title:
|
|
5566
|
-
"
|
|
5566
|
+
"配置启动时导入登录态的 CDP 端口(逗号分隔,留空清空)\n当前: " +
|
|
5567
5567
|
(configured.length ? configured.join(",") : "无"),
|
|
5568
5568
|
},
|
|
5569
5569
|
(configured.length ? configured.length + "端口" : "未配置") + " ⚙️",
|
|
5570
5570
|
);
|
|
5571
5571
|
|
|
5572
|
-
// 重检按钮:仅已配置端口的在线客户端显示(手动触发立即检测,结果随心跳自动刷新)
|
|
5573
|
-
var recheckBtn = "";
|
|
5574
|
-
if (configured.length && c.clientId) {
|
|
5575
|
-
recheckBtn = tag(
|
|
5576
|
-
"button",
|
|
5577
|
-
{
|
|
5578
|
-
onclick: "wdRecheckLogin('" + esc(c.clientId) + "')",
|
|
5579
|
-
style:
|
|
5580
|
-
"padding:2px 8px;font-size:11px;background:#333;color:#4ade80;" +
|
|
5581
|
-
"border:1px solid #444;border-radius:3px;cursor:pointer",
|
|
5582
|
-
title: "立即重检上次未通过的端口(全部已登录则跳过;结果随心跳自动刷新)",
|
|
5583
|
-
},
|
|
5584
|
-
"重检",
|
|
5585
|
-
);
|
|
5586
|
-
}
|
|
5587
|
-
|
|
5588
5572
|
var head =
|
|
5589
5573
|
styled("span", "font-size:14px", "🔑") +
|
|
5590
|
-
styled("span", "color:#888", "
|
|
5591
|
-
cfgBtn
|
|
5592
|
-
recheckBtn;
|
|
5574
|
+
styled("span", "color:#888", "导入端口:") +
|
|
5575
|
+
cfgBtn;
|
|
5593
5576
|
|
|
5594
5577
|
var wrapStyle =
|
|
5595
5578
|
"margin-top:6px;padding:6px 8px;background:#111;border-radius:6px;" +
|
|
@@ -5772,24 +5755,6 @@ async function wdSetLoginPorts() {
|
|
|
5772
5755
|
}
|
|
5773
5756
|
}
|
|
5774
5757
|
|
|
5775
|
-
// 手动下发登录重检:服务端一次性队列随心跳通知客户端,下一跳立即检测
|
|
5776
|
-
async function wdRecheckLogin(clientId) {
|
|
5777
|
-
try {
|
|
5778
|
-
var res = await fetch("/api/watchdog/recheck-login", {
|
|
5779
|
-
method: "POST",
|
|
5780
|
-
headers: { "Content-Type": "application/json" },
|
|
5781
|
-
body: JSON.stringify({ clientId: clientId }),
|
|
5782
|
-
});
|
|
5783
|
-
var d = await res.json();
|
|
5784
|
-
if (d.ok) {
|
|
5785
|
-
alert("已下发重检,结果随心跳自动刷新");
|
|
5786
|
-
} else {
|
|
5787
|
-
alert("失败: " + (d.error || "未知错误"));
|
|
5788
|
-
}
|
|
5789
|
-
} catch (e) {
|
|
5790
|
-
alert("下发失败: " + e.message);
|
|
5791
|
-
}
|
|
5792
|
-
}
|
|
5793
5758
|
|
|
5794
5759
|
// ── 错误自动切节点配置区域(看门狗面板中每个客户端卡片) ──
|
|
5795
5760
|
|
|
@@ -988,9 +988,9 @@
|
|
|
988
988
|
<div id="wdLoginPortsModal"
|
|
989
989
|
style="display:none;position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,0.6);z-index:9999;align-items:center;justify-content:center">
|
|
990
990
|
<div style="background:#1e1e2e;border:1px solid #333;border-radius:12px;padding:24px;width:90%;max-width:480px">
|
|
991
|
-
<div style="font-size:16px;color:#4ade80;margin-bottom:4px">🔑
|
|
991
|
+
<div style="font-size:16px;color:#4ade80;margin-bottom:4px">🔑 导入端口 — <span id="wdLoginPortsUserId"></span>
|
|
992
992
|
</div>
|
|
993
|
-
<div style="color:#888;font-size:12px;margin-bottom:12px"
|
|
993
|
+
<div style="color:#888;font-size:12px;margin-bottom:12px">配置该客户端启动时导入登录态的 CDP 端口(逗号分隔,如 <b
|
|
994
994
|
style="color:#4ade80">9222,9223,9225</b>)。<br>客户端每隔一段时间自动检测并上报结果,留空保存可清空配置。</div>
|
|
995
995
|
<input id="wdLoginPortsInput" placeholder="9222,9223,9225"
|
|
996
996
|
style="width:100%;padding:8px;background:#111;border:1px solid #333;color:#e0e0e0;border-radius:6px;font-size:13px;box-sizing:border-box">
|
|
@@ -52,6 +52,7 @@ function withTimeout(promise, ms, label) {
|
|
|
52
52
|
|
|
53
53
|
/** 单口导入:起/附 Edge → 验证 → 导出 cookies → 上传。未登录返回 skip */
|
|
54
54
|
async function importPort({ serverUrl, userId, port, proxyServer }) {
|
|
55
|
+
const marker = loadMarker(); // 本地已导入标识(永久只导一次)
|
|
55
56
|
// 探测该口是否已有 Edge 在跑:同步自己起的,导出完关掉;本来就跑着的不动
|
|
56
57
|
let selfStarted = false;
|
|
57
58
|
try {
|
|
@@ -122,7 +123,9 @@ export async function syncLoginStates(opts = {}) {
|
|
|
122
123
|
if (!serverUrl || !userId || !Array.isArray(ports) || ports.length === 0) return summary;
|
|
123
124
|
const deadline = Date.now() + totalTimeoutMs;
|
|
124
125
|
|
|
125
|
-
//
|
|
126
|
+
// 本地标识:永久只导入一次(与账号中心状态无关)
|
|
127
|
+
const marker = loadMarker();
|
|
128
|
+
|
|
126
129
|
// 热路径:本节点此前已成功导入过的口(lastImportFrom 元数据)直接跳过,免重复起 Edge
|
|
127
130
|
const imported = new Set();
|
|
128
131
|
try {
|