重构了main.html的主函数

重构了大量的页面的sidebar
优化了代码结构
This commit is contained in:
2026-02-02 09:22:52 +08:00
33 changed files with 5566 additions and 2383 deletions

View File

@@ -120,15 +120,16 @@ def start_api():
print(f"❌ 找不到主程序文件: {main_py}")
return False
# 启动进程
# 启动进程(不重定向输出,让 Python logging 模块自己处理日志文件)
env = os.environ.copy()
env['PYTHONUNBUFFERED'] = '1'
log_file = open(os.devnull, 'w') # 忽略输出
proc = subprocess.Popen(
[str(venv_python), str(main_py)],
cwd=str(SCRIPT_DIR),
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
stdout=log_file,
stderr=log_file,
text=True,
bufsize=1,
env=env
@@ -172,11 +173,12 @@ def start_web():
env = os.environ.copy()
env['PYTHONUNBUFFERED'] = '1'
log_file = open(os.devnull, 'w') # 忽略输出
proc = subprocess.Popen(
[sys.executable, '-m', 'http.server', str(web_port)],
cwd=str(web_root),
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
stdout=log_file,
stderr=log_file,
text=True,
bufsize=1,
env=env