mirror of
https://gitee.com/xmz7891/ykxmz.git
synced 2026-10-18 17:10:43 +00:00
阶段3 管理页 - 清掉全部深色主题残留(地址框 #0b1220、按钮悬停 #262c36、 删除按钮 #2d1214 等 11 处),现在 0 处深色 - 接口全部正常:health / downloads / netcheck 阶段4 局域网诊断 - 查清楚"电脑不在同一网络"是怎么回事:被控端是**对的** (lan_ips() 报 ['192.168.2.64', '169.254.83.107'],真实地址排第一), 是手表当时真不在 192.168.2.x —— 可能连了 5G 频段的另一个路由器,或开着移动数据 - 所以改了手表的提示:不再只说"不在同一网络", 而是把**双方地址都打出来**,用户一眼能看出是网段不同还是连错 WiFi - 端到端验证局域网路径:认证 1 ms,功能列表 207 项 阶段1 结论修正(一天内推翻自己两次,如实记录) - 第一次判断"优选 IP 无用":错。半小时内确实能避开超时 IP - 第二次固定优选 IP:也错。那些实测 138ms 的 IP 半小时后全不通了 —— Cloudflare anycast 可达性随运营商路由变化,固定 IP 等于钉死到会失效的地址 - 最终:不固定,靠 GeoDNS + cloudflared 重试 + ha-connections 2 冗余 - 撤销后立即变好:连接稳定 2 条、超时告警 0 次、设备侧延迟 4.40s -> 1.66s - **真正的瓶颈**:分段实测发现本机到 Cloudflare 的**裸 RTT 就 1439 ms**, 比经隧道的请求(1215 ms)还慢。说明瓶颈是这条网络的 4G 上行本身, 不是设备的隧道。公网侧已无优化空间。 - 局域网 118 ms vs 公网 1215 ms,快 10 倍 —— 这才是该走的路 阶段5 验收 - 全量回归 29 项全通过 - 设备侧验收 38 项全通过 - 成品:setup exe 14.37 MB / server zip / watch apk,已同步到设备下载区
122 lines
4.0 KiB
Python
122 lines
4.0 KiB
Python
# -*- coding: utf-8 -*-
|
|
r'''清掉管理页剩下的深色主题残留。
|
|
|
|
管理页整体已经改成白色了(--bg:#ffffff),
|
|
但 CSS 里还有几处是给深色底配的,在白底上很扎眼:
|
|
|
|
.url{background:#0b1220} 深藏青的地址框
|
|
button:hover{background:#262c36} 深灰悬停
|
|
tbody tr:hover td{#1b222c} 深灰行悬停
|
|
tr.picked td{#1c2733} 深色选中行
|
|
button.del{background:#2d1214} 暗红删除按钮
|
|
.dot{background:#484f58} 深灰圆点
|
|
a.logout{border-bottom:#484f58} 深灰虚线下划线
|
|
|
|
换成浅色系。
|
|
'''
|
|
from __future__ import annotations
|
|
|
|
import ast
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
ROOT = Path(r"C:\Users\shu\Desktop\deepseekagent\LanRemote")
|
|
RELAY = ROOT / "relay" / "relay.py"
|
|
|
|
# (旧, 新, 说明)
|
|
FIXES = [
|
|
# 公网地址框:深藏青 -> 浅蓝
|
|
("background:#0b1220;border:1px solid #1f6feb44",
|
|
"background:#f6f8fa;border:1px solid #d0d7de",
|
|
"地址框底色"),
|
|
("color:#0969da;word-break:break-all;\n background:#f6f8fa",
|
|
"color:#0969da;word-break:break-all;\n background:#f6f8fa",
|
|
"(保持)"),
|
|
# 按钮悬停
|
|
("button:hover{background:#262c36;border-color:#484f58}",
|
|
"button:hover{background:#f3f4f6;border-color:#d1d5db}",
|
|
"按钮悬停"),
|
|
("button.primary:hover{background:#4a95f8;border-color:#4a95f8}",
|
|
"button.primary:hover{background:#1d4ed8;border-color:#1d4ed8}",
|
|
"主按钮悬停"),
|
|
# 删除按钮:暗红 -> 浅红
|
|
("button.del{background:#2d1214;border-color:#6e2b2b;color:#ff7b72}",
|
|
"button.del{background:#fff5f5;border-color:#ffc9c9;color:#c92a2a}",
|
|
"删除按钮"),
|
|
("button.del:hover{background:#4a1a1e;border-color:#a33;color:#ffa198}",
|
|
"button.del:hover{background:#ffe3e3;border-color:#ffa8a8;color:#a61b1b}",
|
|
"删除按钮悬停"),
|
|
# 表格行悬停
|
|
("tbody tr:hover td{background:#1b222c}",
|
|
"tbody tr:hover td{background:#f6f8fa}",
|
|
"表格行悬停"),
|
|
# 选中行
|
|
("tr.picked td{background:#1c2733}",
|
|
"tr.picked td{background:#eff6ff}",
|
|
"选中行"),
|
|
("tr.picked:hover td{background:#213042}",
|
|
"tr.picked:hover td{background:#dbeafe}",
|
|
"选中行悬停"),
|
|
# 圆点
|
|
("vertical-align:middle;background:#484f58}",
|
|
"vertical-align:middle;background:#d0d7de}",
|
|
"状态圆点"),
|
|
# 退出登录的下划线
|
|
("border-bottom:1px dashed #484f58;transition:.12s}",
|
|
"border-bottom:1px dashed #d0d7de;transition:.12s}",
|
|
"退出登录下划线"),
|
|
# 提示条阴影(白底上要淡一点)
|
|
("box-shadow:0 8px 24px #0008;opacity:0;",
|
|
"box-shadow:0 8px 24px #0002;opacity:0;",
|
|
"提示条阴影"),
|
|
]
|
|
|
|
|
|
def main() -> int:
|
|
text = RELAY.read_text(encoding="utf-8")
|
|
changed = []
|
|
|
|
for old, new, why in FIXES:
|
|
if old == new:
|
|
continue
|
|
if new in text:
|
|
continue
|
|
if old in text:
|
|
text = text.replace(old, new)
|
|
changed.append(why)
|
|
|
|
if changed:
|
|
RELAY.write_text(text, encoding="utf-8", newline="\n")
|
|
print(" 改了:")
|
|
for c in changed:
|
|
print(" " + c)
|
|
else:
|
|
print(" 没有要改的")
|
|
|
|
try:
|
|
ast.parse(text)
|
|
print(" 语法 OK")
|
|
except SyntaxError as exc:
|
|
print(" [失败] 语法错误: 行 %s: %s" % (exc.lineno, exc.msg))
|
|
return 1
|
|
|
|
# 复核:还有没有深色残留
|
|
print()
|
|
print(" 残留的深色值检查:")
|
|
DARK = ["#0b1220", "#262c36", "#1b222c", "#1c2733", "#213042",
|
|
"#2d1214", "#4a1a1e", "#484f58", "#2a313c", "#0d1117"]
|
|
left = [c for c in DARK if c in text]
|
|
if left:
|
|
print(" 还有: %s" % " ".join(left))
|
|
for c in left:
|
|
import re
|
|
for m in re.finditer(r".*" + re.escape(c) + r".*", text):
|
|
print(" %s" % m.group(0).strip()[:80])
|
|
else:
|
|
print(" 无 ✓")
|
|
return 0
|
|
|
|
|
|
if __name__ == "__main__":
|
|
sys.exit(main())
|