mirror of
https://gitee.com/xmz7891/ykxmz.git
synced 2026-10-18 21:50:44 +00:00
被控端 - 修复 MTU 问题:夹 MSS + 路径 MTU 探测(公网可用率 48% -> 100%) - 复用 HTTP 连接(免掉每次新建 TLS 的 30% 握手失败) - 每分钟回头找局域网,自动切回快 400 倍的路径 - 画面心跳帧:静止时省流量,客户端仍知道流是活的 - 锁屏时给出可操作的提示 手表端 - 内置 GTS Root R4 / GlobalSign Root CA,修 SSLHandshakeException - 连接错误翻译成人话(证书/时间/解析/超时分别提示) - 经中转连上后用服务器报的地址刷新已配对记录 - 新增局域网连接页面、服务器延迟检测 服务器端 - 支持 chunked 请求体(修每 16 秒一次的连接错乱与大面积 502) - 网络调优脚本 net-tune.sh(开机自动应用) - 管理页:批量删除、网络体检、下载区 - 隧道改 HTTP/2 + 双连接 文档 - 许可协议 / 安装前必读 / 安装后须知(作者:小麦子)
84 lines
3.4 KiB
Python
84 lines
3.4 KiB
Python
# -*- coding: utf-8 -*-
|
||
"""更新过时断言:局域网功能已经(按要求)加回来了。
|
||
|
||
背景:
|
||
早先用户要求"既然用中转站了,局域网那套删掉",
|
||
于是 test_watch_relayonly.py 里写了:
|
||
没有 Discovery 调用 / 没有「自动搜索电脑」/ 没有 DiscoveryCore
|
||
后来用户又要求"首页加一个进入局域网连接页面",
|
||
这些断言就过时了 —— 功能回来了,断言还说不能有。
|
||
|
||
现在正确的设计是:
|
||
* 首页**默认**还是"输入配对码连接"(走中转)
|
||
* 但多了一个「局域网连接(同一个 WiFi)」入口,进去能搜局域网
|
||
* 原来那种"自动搜索弹一堆结果在首页"的旧交互不在了
|
||
"""
|
||
from __future__ import annotations
|
||
|
||
import ast
|
||
import sys
|
||
from pathlib import Path
|
||
|
||
TEST = Path(r"C:\Users\shu\Desktop\deepseekagent\LanRemote\_tests"
|
||
r"\test_watch_relayonly.py")
|
||
|
||
OLD = ''' print()
|
||
print("二、局域网那套已清掉")
|
||
check("没有 Discovery 调用", "Discovery." not in code)
|
||
check("没有 foundBox", "foundBox" not in code)
|
||
check("没有 discovering", "discovering" not in code)
|
||
check("没有「手动输入地址」按钮",
|
||
'bigButton("手动输入地址"' not in code)
|
||
check("没有 toggleManual", "toggleManual" not in code)
|
||
check("没有 hostInput", "hostInput" not in code)
|
||
check("没有 portInput", "portInput" not in code)
|
||
check("没有「自动搜索电脑」", "自动搜索电脑" not in code)
|
||
check("没有 DiscoveryCore 引用", "DiscoveryCore" not in code)'''
|
||
|
||
NEW = ''' print()
|
||
print("二、局域网入口按新设计存在(但不再是旧交互)")
|
||
# 注意:早期这里断言的是"局域网那套已清掉",
|
||
# 那是用户要求删除时的版本。后来用户又要求把局域网连接加回来
|
||
# (首页 -> 局域网连接页面 -> 搜索/直连),所以这些断言反过来了。
|
||
check("首页有局域网入口",
|
||
'bigButton("局域网连接(同一个 WiFi)"' in code)
|
||
check("有独立的局域网页面", "private void buildLanPanel()" in code)
|
||
check("页面里能广播搜索", "Discovery.search(" in code)
|
||
check("用 DiscoveryCore 的结果类型", "DiscoveryCore.Found" in code)
|
||
# 旧交互确实不该再有:首页直接弹搜索框、手动填 IP 那一套
|
||
check("首页没有旧的「自动搜索电脑」按钮",
|
||
'bigButton("自动搜索电脑"' not in code)
|
||
check("没有旧的手动输入地址按钮",
|
||
'bigButton("手动输入地址"' not in code)
|
||
check("没有 toggleManual(旧交互)", "toggleManual" not in code)
|
||
check("首页没有裸的 hostInput", "hostInput" not in code)'''
|
||
|
||
# 顺带:标题也要改,不然读起来矛盾
|
||
TITLE_OLD = 'print("二、局域网那套已清掉")'
|
||
TITLE_NEW = 'print("二、局域网入口(新设计)")'
|
||
|
||
|
||
def main() -> int:
|
||
text = TEST.read_text(encoding="utf-8")
|
||
if "局域网入口按新设计存在" in text:
|
||
print(" 已经更新过")
|
||
return 0
|
||
if OLD not in text:
|
||
print(" [失败] 锚点没找到")
|
||
return 1
|
||
|
||
text = text.replace(OLD, NEW, 1)
|
||
TEST.write_text(text, encoding="utf-8", newline="\n")
|
||
|
||
try:
|
||
ast.parse(text)
|
||
print(" 已更新过时的局域网断言")
|
||
except SyntaxError as exc:
|
||
print(f" 语法错误: 行 {exc.lineno}: {exc.msg}")
|
||
return 1
|
||
return 0
|
||
|
||
|
||
if __name__ == "__main__":
|
||
sys.exit(main())
|