后端优化: - 合并 api/routes/stats.py 到 api/routes/proxies.py,统计接口变更为 /api/proxies/stats - 内联 services/settings_service.py:settings.py 和 scheduler.py 直接使用 SettingsRepository - 简化 repositories/proxy_repo.py:提取 _row_to_proxy 辅助函数,消除重复构造代码 - 更新 api/lifespan.py 和 api/deps.py,移除对 settings_service 的依赖 - 从 requirements.txt 移除 websockets 依赖(已废弃的 WebSocket 功能残留) 前端适配: - 更新 frontend/src/api/index.js:stats 接口路径同步为 /api/proxies/stats - 清理 api/index.js 中未使用的 createRequestConfig 和多余 JSDoc 注释 脚本优化: - 移除 script/stop.bat 末尾的 pause,避免自动化调用时挂起
40 lines
1.1 KiB
Batchfile
40 lines
1.1 KiB
Batchfile
@echo off
|
|
chcp 65001 >nul
|
|
echo === Stopping ProxyPool Services ===
|
|
echo.
|
|
|
|
set "BACKEND_PORT=9949"
|
|
set "FRONTEND_PORT=9948"
|
|
set "STOPPED_COUNT=0"
|
|
|
|
echo [1/2] Stopping processes on ports %BACKEND_PORT% and %FRONTEND_PORT%...
|
|
|
|
REM Stop backend port
|
|
for /f "tokens=5" %%a in ('netstat -ano ^| findstr ":%BACKEND_PORT%" ^| findstr "LISTENING"') do (
|
|
for /f "tokens=1" %%b in ('tasklist /FI "PID eq %%a" ^| findstr "%%a"') do (
|
|
taskkill /F /PID %%a >nul 2>&1
|
|
echo Stopped port %BACKEND_PORT% (PID: %%a, Process: %%b)
|
|
set /a STOPPED_COUNT+=1
|
|
)
|
|
)
|
|
|
|
REM Stop frontend port
|
|
for /f "tokens=5" %%a in ('netstat -ano ^| findstr ":%FRONTEND_PORT%" ^| findstr "LISTENING"') do (
|
|
for /f "tokens=1" %%b in ('tasklist /FI "PID eq %%a" ^| findstr "%%a"') do (
|
|
taskkill /F /PID %%a >nul 2>&1
|
|
echo Stopped port %FRONTEND_PORT% (PID: %%a, Process: %%b)
|
|
set /a STOPPED_COUNT+=1
|
|
)
|
|
)
|
|
|
|
echo Stopped %STOPPED_COUNT% process(es)
|
|
echo.
|
|
|
|
echo [2/2] Waiting for processes to fully stop...
|
|
timeout /t 2 /nobreak >nul
|
|
|
|
echo.
|
|
echo === Done ===
|
|
echo All services have been stopped.
|
|
echo.
|