Delete log file for May 14, 2026, to clean up unnecessary data and maintain log management.

This commit is contained in:
ash66
2026-05-18 13:29:57 +08:00
parent 35cd927d02
commit 86b9ac806a
13 changed files with 7359 additions and 1654 deletions

105
dev.bat
View File

@@ -92,7 +92,7 @@ echo.
exit /b 0
:setup
call :ensure_log_dir
if not exist "%LOG_DIR%" mkdir "%LOG_DIR%"
echo.
echo ========================================
echo AI+合规智能中枢 - 环境初始化
@@ -303,7 +303,7 @@ echo Unknown argument: %~1
exit /b 1
:status
call :ensure_log_dir
if not exist "%LOG_DIR%" mkdir "%LOG_DIR%"
echo.
echo ========================================
echo AI+合规智能中枢 - 服务状态
@@ -313,39 +313,47 @@ echo.
echo API service:
set "API_PID="
set "API_RUNNING=0"
set "API_LISTENER="
set "API_DISPLAY_PID="
if exist "%API_PID_FILE%" set /p API_PID=<"%API_PID_FILE%"
if defined API_PID (
call :pid_exists %API_PID%
if not errorlevel 1 (
set "API_RUNNING=1"
echo Status: running
echo PID: %API_PID%
goto api_health
) else (
call :pid_exists !API_PID!
if errorlevel 1 (
del /q "%API_PID_FILE%" >nul 2>nul
set "API_PID="
)
)
call :get_listener_pid %API_PORT% API_LISTENER
if defined API_LISTENER (
set "API_RUNNING=1"
echo Status: running (no PID file)
echo PID: %API_LISTENER%
) else (
echo Status: stopped
goto api_done
)
:api_health
if "%API_RUNNING%"=="1" (
call :check_api_health
if not errorlevel 1 (
echo Health: ok
) else (
echo Health: failed
set "API_RUNNING=1"
set "API_DISPLAY_PID=!API_PID!"
)
)
if "%API_RUNNING%"=="1" goto api_running
call :get_listener_pid %API_PORT% API_LISTENER
if defined API_LISTENER goto api_listener
echo Status: stopped
goto api_done
:api_running
echo Status: running
if defined API_DISPLAY_PID echo PID: !API_DISPLAY_PID!
call :check_api_health
if errorlevel 1 (
echo Health: failed
) else (
echo Health: ok
)
goto api_done
:api_listener
echo Status: running (no PID file)
echo PID: !API_LISTENER!
call :check_api_health
if errorlevel 1 (
echo Health: failed
) else (
echo Health: ok
)
:api_done
echo URL: http://localhost:%API_PORT%
echo Docs: http://localhost:%API_PORT%/docs
@@ -353,26 +361,35 @@ echo.
echo Frontend service:
set "FRONTEND_PID="
set "FRONTEND_RUNNING=0"
set "FRONTEND_LISTENER="
set "FRONTEND_DISPLAY_PID="
if exist "%FRONTEND_PID_FILE%" set /p FRONTEND_PID=<"%FRONTEND_PID_FILE%"
if defined FRONTEND_PID (
call :pid_exists %FRONTEND_PID%
if not errorlevel 1 (
echo Status: running
echo PID: %FRONTEND_PID%
goto frontend_done
) else (
call :pid_exists !FRONTEND_PID!
if errorlevel 1 (
del /q "%FRONTEND_PID_FILE%" >nul 2>nul
set "FRONTEND_PID="
) else (
set "FRONTEND_RUNNING=1"
set "FRONTEND_DISPLAY_PID=!FRONTEND_PID!"
)
)
if "%FRONTEND_RUNNING%"=="1" goto frontend_running
call :get_listener_pid %FRONTEND_PORT% FRONTEND_LISTENER
if defined FRONTEND_LISTENER (
echo Status: running (no PID file)
echo PID: %FRONTEND_LISTENER%
) else (
echo Status: stopped
)
if defined FRONTEND_LISTENER goto frontend_listener
echo Status: stopped
goto frontend_done
:frontend_running
echo Status: running
if defined FRONTEND_DISPLAY_PID echo PID: !FRONTEND_DISPLAY_PID!
goto frontend_done
:frontend_listener
echo Status: running (no PID file)
echo PID: !FRONTEND_LISTENER!
:frontend_done
echo Mode: %FRONTEND_MODE%
@@ -417,7 +434,7 @@ if /I "%~3"=="--follow" (
exit /b %errorlevel%
:start_api_background
call :ensure_log_dir
if not exist "%LOG_DIR%" mkdir "%LOG_DIR%"
if not exist "%VENV_PYTHON%" (
echo Virtual environment not found. Run dev.bat setup first.
exit /b 1
@@ -471,7 +488,7 @@ exit /b %errorlevel%
:start_frontend
set "MODE=%~1"
if "%MODE%"=="" set "MODE=%FRONTEND_MODE%"
call :ensure_log_dir
if not exist "%LOG_DIR%" mkdir "%LOG_DIR%"
where npm >nul 2>nul || (
echo npm was not found. Install Node.js 20+ first.
@@ -569,10 +586,6 @@ if defined FRONTEND_PORT_PID (
echo Frontend is not running.
exit /b 0
:ensure_log_dir
if not exist "%LOG_DIR%" mkdir "%LOG_DIR%"
exit /b 0
:validate_mode
if /I "%~1"=="dev" exit /b 0
if /I "%~1"=="static" exit /b 0