feat: 添加依赖自动检测与安装、选项记忆、KDocs登录优化

- 新增依赖检测模块:启动时自动检测wkhtmltoimage和Playwright Chromium
- 新增依赖安装对话框:缺失时提示用户一键下载安装
- 修复选项记忆功能:浏览类型、自动截图、自动上传选项现在会保存
- 优化KDocs登录检测:未登录时自动切换到金山文档页面并显示二维码
- 简化日志输出:移除debug信息,保留用户友好的状态提示
- 新增账号变化信号:账号管理页面的修改会自动同步到浏览任务页面

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-19 01:28:06 +08:00
parent 83fef6dff2
commit 9743186a9e
11 changed files with 713 additions and 506 deletions

View File

@@ -79,6 +79,14 @@ class ZSGLConfig:
index_url_pattern: str = "index.aspx"
@dataclass
class TaskConfig:
"""浏览任务配置"""
browse_type: str = "应读" # 浏览类型
auto_screenshot: bool = True # 浏览后自动截图
auto_upload: bool = False # 截图后自动上传
@dataclass
class AppConfig:
"""应用总配置"""
@@ -87,6 +95,7 @@ class AppConfig:
screenshot: ScreenshotConfig = field(default_factory=ScreenshotConfig)
proxy: ProxyConfig = field(default_factory=ProxyConfig)
zsgl: ZSGLConfig = field(default_factory=ZSGLConfig)
task: TaskConfig = field(default_factory=TaskConfig)
theme: str = "light" # light/dark
def to_dict(self) -> dict:
@@ -130,6 +139,11 @@ class AppConfig:
"login_url": self.zsgl.login_url,
"index_url_pattern": self.zsgl.index_url_pattern,
},
"task": {
"browse_type": self.task.browse_type,
"auto_screenshot": self.task.auto_screenshot,
"auto_upload": self.task.auto_upload,
},
"theme": self.theme,
}
@@ -191,6 +205,14 @@ class AppConfig:
index_url_pattern=zsgl_data.get("index_url_pattern", "index.aspx"),
)
# 加载任务配置
task_data = data.get("task", {})
config.task = TaskConfig(
browse_type=task_data.get("browse_type", "应读"),
auto_screenshot=task_data.get("auto_screenshot", True),
auto_upload=task_data.get("auto_upload", False),
)
# 主题
config.theme = data.get("theme", "light")