fix: Windows兼容 + Textual 8.x + MD3 SVG图标替代emoji

1. Windows: reuse_port 仅非win32平台启用
2. Textual 8.2.7: refresh() 加 **kwargs 兼容 repaint 参数
3. WebUI: 设置页/插件页 emoji → SVG (fill:currentColor 日夜间适配)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
qinglong
2026-06-13 20:42:22 +08:00
parent 9a9a2975de
commit cc50ecb813
8 changed files with 44 additions and 18 deletions
+9 -5
View File
@@ -48,11 +48,15 @@ class InternetService:
self.http_runner = web.AppRunner(self.http_app)
await self.http_runner.setup()
# SO_REUSEPORT: Linux/macOS only, Windows 不支持
import sys as _sys
_reuse_port = _sys.platform != "win32"
# 1. 启动 HTTP 站点
try:
self.site = web.TCPSite(
self.http_runner, self.http_host, self.http_port,
reuse_address=True, reuse_port=True
self.http_runner, self.http_host, self.http_port,
reuse_address=True, reuse_port=_reuse_port,
)
await self.site.start()
logger.info(f"✅ HTTP 服务已绑定: {self.http_host}:{self.http_port}")
@@ -60,12 +64,12 @@ class InternetService:
logger.error(f"❌ HTTP 端口 {self.http_port} 绑定失败: {e}")
await self.http_runner.cleanup()
return False
# 2. 启动 WebSocket 站点 (独立端口)
try:
self.ws_site = web.TCPSite(
self.http_runner, self.ws_host, self.ws_port,
reuse_address=True, reuse_port=True
self.http_runner, self.ws_host, self.ws_port,
reuse_address=True, reuse_port=_reuse_port,
)
await self.ws_site.start()
logger.info(f"✅ WebSocket 服务已绑定: {self.ws_host}:{self.ws_port}")