tt-help-cli-ycl 1.4.136 → 1.4.140

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.
@@ -3645,9 +3645,13 @@ function renderOfflineCard(
3645
3645
  loginPorts,
3646
3646
  ) {
3647
3647
  var cmdCount = cmds ? cmds.length : 0;
3648
- return styled(
3648
+ return tag(
3649
3649
  "div",
3650
- "background:#1e1e2e;border:2px solid #f87171;border-radius:12px;padding:16px;opacity:0.9",
3650
+ {
3651
+ class: "wd-client-card",
3652
+ style:
3653
+ "background:#1e1e2e;border:2px solid #f87171;border-radius:12px;padding:16px;opacity:0.9",
3654
+ },
3651
3655
  styled(
3652
3656
  "div",
3653
3657
  "display:flex;justify-content:space-between;align-items:center;margin-bottom:8px",
@@ -3873,11 +3877,15 @@ function renderClientCard(
3873
3877
  ),
3874
3878
  );
3875
3879
 
3876
- return styled(
3880
+ return tag(
3877
3881
  "div",
3878
- "background:#1e1e2e;border:2px solid " +
3879
- borderColor +
3880
- ";border-radius:12px;padding:16px",
3882
+ {
3883
+ class: "wd-client-card",
3884
+ style:
3885
+ "background:#1e1e2e;border:2px solid " +
3886
+ borderColor +
3887
+ ";border-radius:12px;padding:16px",
3888
+ },
3881
3889
  header +
3882
3890
  styled("div", "color:#888;font-size:12px", osStr) +
3883
3891
  styled("div", "color:#888;font-size:12px;margin-bottom:6px", infoLine) +
@@ -4353,10 +4361,11 @@ function renderProxySection(c, userId) {
4353
4361
  var h = c.clashHealth;
4354
4362
  if (!h || !h.node) return "";
4355
4363
  var nodes = (h.meta && h.meta.healthyNodes) || [];
4364
+ var delays = (h.meta && h.meta.healthyNodeDelays) || {};
4356
4365
  var hasNodes = nodes.length > 0;
4357
4366
  return (
4358
4367
  renderProxyLine(h, nodes, userId, 0, hasNodes) +
4359
- renderNodeList(nodes, h.node, userId, 0)
4368
+ renderNodeList(nodes, h.node, userId, 0, delays)
4360
4369
  );
4361
4370
  }
4362
4371
 
@@ -4364,10 +4373,11 @@ function renderProxySection(c, userId) {
4364
4373
  function renderProxyChannel(ch, userId) {
4365
4374
  if (!ch || !ch.node) return "";
4366
4375
  var nodes = (ch.meta && ch.meta.healthyNodes) || [];
4376
+ var delays = (ch.meta && ch.meta.healthyNodeDelays) || {};
4367
4377
  var hasNodes = nodes.length > 0;
4368
4378
  return (
4369
4379
  renderProxyLine(ch, nodes, userId, ch.port || 0, hasNodes) +
4370
- renderNodeList(nodes, ch.node, userId, ch.port || 0)
4380
+ renderNodeList(nodes, ch.node, userId, ch.port || 0, delays)
4371
4381
  );
4372
4382
  }
4373
4383
 
@@ -4417,31 +4427,49 @@ function renderProxyLine(h, nodes, userId, port, hasNodes) {
4417
4427
  }
4418
4428
 
4419
4429
  /** 节点列表面板(默认隐藏) */
4420
- function renderNodeList(nodes, currentNode, userId, port) {
4430
+ function renderNodeList(nodes, currentNode, userId, port, delays) {
4421
4431
  if (!nodes || !nodes.length) return "";
4432
+ delays = delays || {};
4422
4433
 
4423
4434
  var items = "";
4424
4435
  for (var i = 0; i < nodes.length; i++) {
4425
- items += renderNodeItem(nodes[i], nodes[i] === currentNode, userId, port);
4436
+ items += renderNodeItem(
4437
+ nodes[i],
4438
+ nodes[i] === currentNode,
4439
+ userId,
4440
+ port,
4441
+ delays[nodes[i]],
4442
+ );
4426
4443
  }
4427
4444
 
4428
4445
  var id = "wdNodes-" + wdEscId(userId) + "-" + port;
4446
+ var expanded = _wdExpandedNodes[wdEscId(userId) + "-" + (port || 0)];
4429
4447
  return (
4430
4448
  '<div id="' +
4431
4449
  id +
4432
4450
  '" style="margin-top:4px;border:1px solid #2a2a3a;' +
4433
- 'border-radius:6px;overflow:hidden;display:none">' +
4451
+ "border-radius:6px;overflow:hidden;display:" +
4452
+ (expanded ? "block" : "none") +
4453
+ '">' +
4434
4454
  items +
4435
4455
  "</div>"
4436
4456
  );
4437
4457
  }
4438
4458
 
4439
4459
  /** 单个节点行 */
4440
- function renderNodeItem(name, isActive, userId, port) {
4460
+ function renderNodeItem(name, isActive, userId, port, delay) {
4441
4461
  var color = isActive ? "#4ade80" : "#888";
4442
4462
  var bg = isActive ? "background:#1a3a2a;" : "";
4443
4463
  var dot = isActive ? "●" : "○";
4444
4464
  var textColor = isActive ? "#4ade80" : "#aaa";
4465
+ var delayTag =
4466
+ typeof delay === "number" && delay > 0
4467
+ ? '<span style="color:' +
4468
+ (isActive ? "#6ee7a0" : "#777") +
4469
+ ';font-size:10px">' +
4470
+ Math.round(delay) +
4471
+ "ms</span>"
4472
+ : "";
4445
4473
  var action = isActive
4446
4474
  ? '<span style="margin-left:auto;color:#555;font-size:10px">当前</span>'
4447
4475
  : "<button onclick=\"wdSwitchNode('" +
@@ -4455,7 +4483,7 @@ function renderNodeItem(name, isActive, userId, port) {
4455
4483
  'color:#fff;border:none;border-radius:2px;cursor:pointer">切换</button>';
4456
4484
 
4457
4485
  return (
4458
- '<div style="padding:3px 8px;display:flex;align-items:center;gap:6px;font-size:11px;' +
4486
+ '<div class="wd-hover-row" style="padding:3px 8px;display:flex;align-items:center;gap:6px;font-size:11px;' +
4459
4487
  bg +
4460
4488
  '">' +
4461
4489
  '<span style="color:' +
@@ -4468,6 +4496,7 @@ function renderNodeItem(name, isActive, userId, port) {
4468
4496
  '">' +
4469
4497
  name +
4470
4498
  "</span>" +
4499
+ delayTag +
4471
4500
  action +
4472
4501
  "</div>"
4473
4502
  );
@@ -4475,16 +4504,24 @@ function renderNodeItem(name, isActive, userId, port) {
4475
4504
 
4476
4505
  // ── 交互函数 ──
4477
4506
 
4507
+ // 节点列表面板展开状态(key: userId-port → true),自动刷新重渲染时保持展开
4508
+ var _wdExpandedNodes = {};
4509
+
4478
4510
  function wdEscId(s) {
4479
4511
  return (s || "").replace(/[^a-zA-Z0-9_-]/g, "_");
4480
4512
  }
4481
4513
 
4482
4514
  function wdToggleNodes(userId, port) {
4483
- var el = document.getElementById(
4484
- "wdNodes-" + wdEscId(userId) + "-" + (port || 0),
4485
- );
4515
+ var key = wdEscId(userId) + "-" + (port || 0);
4516
+ var el = document.getElementById("wdNodes-" + key);
4486
4517
  if (!el) return;
4487
- el.style.display = el.style.display === "none" ? "block" : "none";
4518
+ var nowHidden = el.style.display === "none";
4519
+ el.style.display = nowHidden ? "block" : "none";
4520
+ if (nowHidden) {
4521
+ _wdExpandedNodes[key] = true;
4522
+ } else {
4523
+ delete _wdExpandedNodes[key];
4524
+ }
4488
4525
  }
4489
4526
 
4490
4527
  function wdSwitchNode(userId, node, port) {
@@ -4578,9 +4615,13 @@ function renderCmdRows(myCmds, userId, procs, isOnline, llmAnalysis, clientId) {
4578
4615
  var restart = p && p.restartCount > 0 ? String(p.restartCount) : "0";
4579
4616
 
4580
4617
  var prefix = "wd-" + esc(userId) + "-" + idx;
4581
- html += styled(
4618
+ html += tag(
4582
4619
  "div",
4583
- "display:grid;grid-template-columns:1fr 50px 55px 55px 50px 80px 40px;gap:4px;padding:4px 0;align-items:center;font-size:12px;border-top:1px solid #1a1a2a",
4620
+ {
4621
+ class: "wd-hover-row",
4622
+ style:
4623
+ "display:grid;grid-template-columns:1fr 50px 55px 55px 50px 80px 40px;gap:4px;padding:4px 0;align-items:center;font-size:12px;border-top:1px solid #1a1a2a",
4624
+ },
4584
4625
  styled(
4585
4626
  "span",
4586
4627
  "color:" +
@@ -4710,9 +4751,13 @@ function renderCmdRows(myCmds, userId, procs, isOnline, llmAnalysis, clientId) {
4710
4751
  var sc = p.status === "running" ? "#4ade80" : "#f87171";
4711
4752
  var oid = p.pid || p.cmdId || "?";
4712
4753
  var opre = "wd-" + esc(userId) + "-orphan-" + esc(String(oid));
4713
- html += styled(
4754
+ html += tag(
4714
4755
  "div",
4715
- "display:grid;grid-template-columns:1fr 50px 55px 55px 50px 80px 40px;gap:4px;padding:4px 0;align-items:center;font-size:12px;border-top:1px solid #1a1a2a;opacity:0.5",
4756
+ {
4757
+ class: "wd-hover-row",
4758
+ style:
4759
+ "display:grid;grid-template-columns:1fr 50px 55px 55px 50px 80px 40px;gap:4px;padding:4px 0;align-items:center;font-size:12px;border-top:1px solid #1a1a2a;opacity:0.5",
4760
+ },
4716
4761
  styled(
4717
4762
  "span",
4718
4763
  "color:#666;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:monospace",
@@ -4795,8 +4840,7 @@ function wdShowLogsModal(clientId, cmdId, title) {
4795
4840
  _wdLogs.deadline = Date.now() + 90000;
4796
4841
  _wdLogs.gotFirst = false;
4797
4842
  document.getElementById("wdLogsTitle").textContent = "📄 " + title;
4798
- document.getElementById("wdLogsStatus").textContent =
4799
- "⏳ 已请求客户端回传…";
4843
+ document.getElementById("wdLogsStatus").textContent = "⏳ 已请求客户端回传…";
4800
4844
  document.getElementById("wdLogsContent").textContent =
4801
4845
  "等待客户端心跳回传日志…\n(心跳周期 ≤15s,最长等待 90s;拿到后会实时刷新)";
4802
4846
  document.getElementById("wdLogsModal").style.display = "flex";
@@ -118,6 +118,24 @@ body {
118
118
  margin-top: 2px;
119
119
  }
120
120
 
121
+ /* 看门狗面板:列表行 hover 高亮(内联背景用 !important 覆盖,移开后自动恢复) */
122
+ .wd-hover-row {
123
+ transition: background 0.08s ease;
124
+ }
125
+
126
+ .wd-hover-row:hover {
127
+ background: rgba(96, 165, 250, 0.12) !important;
128
+ }
129
+
130
+ /* 看门狗面板:客户端卡片 hover 微亮(不改边框,保留离线红色警示) */
131
+ .wd-client-card {
132
+ transition: background 0.15s ease;
133
+ }
134
+
135
+ .wd-client-card:hover {
136
+ background: #232338 !important;
137
+ }
138
+
121
139
  .stat-card.clickable {
122
140
  cursor: pointer;
123
141
  }