diag.bat: full status dump - code age, components, processes, ports, live API

This commit is contained in:
Sadmin committed 2026-11-02 19:32:13 +03:00
1 parent 55bf9cd21e
commit 5a5cc41eba
1 file changed
+38 -19
+38 -19
View File
@@ -1,22 +1,41 @@
@echo off @echo off
REM Diagnostic: shows what is installed and starts the service in the foreground REM Full diagnosis: code version on disk, components, processes, ports, live API checks.
cd /d %~dp0 cd /d %~dp0
echo === 1. venv present? title DIAG-dump
if exist venv\Scripts\python.exe (echo venv OK) else echo VENV MISSING - run install.bat first
echo === 2. installed packages: echo === 1. kit root layout (C:\docchecker expected):
if exist venv\Scripts\python.exe venv\Scripts\python.exe -m pip list 2>nul | findstr /i "fastapi uvicorn httpx docx openpyxl pptx multipart" dir /b "%~dp0..\.." 2>nul | findstr /i "setup_online exceptions app repo.zip"
echo === 3. app.py / static location: echo --- exceptions file(s):
if exist app.py echo app.py here (delivery) if exist "%~dp0..\..\exceptions.txt" echo C:\docchecker\exceptions.txt PRESENT
if exist ..\app.py echo app.py in parent folder if exist "%~dp0exceptions.txt" echo delivery\exceptions.txt PRESENT
if exist static echo static here (delivery) if exist "%~dp0..\exceptions.txt" echo parent\exceptions.txt PRESENT
if exist ..\static echo static in parent folder
echo === 4. starting service from kit root (watch for errors; window stays open)... echo === 2. code version on disk:
set "SRV=%~dp0" findstr /c:"exceptions" "%~dp0..\app.py" >nul 2>nul && echo app.py: NEW (has exceptions) || echo app.py: OLD - code not updated
if not exist "%SRV%static" set "SRV=%~dp0.." findstr /c:"dlw" "%~dp0..\static\index.html" >nul 2>nul && echo index.html: NEW (docx + word list buttons) || echo index.html: OLD - html report only
cd /d "%SRV%"
set LT_URL=http://127.0.0.1:8010 echo === 3. delivery components:
set LLM_BASE_URL=http://127.0.0.1:11434/v1 if exist "%~dp0OllamaSetup.exe" echo OllamaSetup.exe: PRESENT || echo OllamaSetup.exe: MISSING
set LLM_MODEL=qwen3-4b-instruct if exist "%~dp0jre17\jre\bin\java.exe" echo jre17: PRESENT || echo jre17: MISSING
"%~dp0venv\Scripts\python.exe" -m uvicorn app:app --host 127.0.0.1 --port 8011 if exist "%~dp0languagetool\languagetool-server.jar" echo languagetool: PRESENT || echo languagetool: MISSING
echo === service stopped. If there is an error above - send a photo of this window if exist "%~dp0venv\Scripts\python.exe" echo venv: PRESENT || echo venv: MISSING
if exist "%~dp0..\app.py" echo parent app.py: PRESENT || echo parent app.py: MISSING
echo === 4. running processes (java / python / ollama):
tasklist 2>nul | findstr /i "java.exe python.exe ollama.exe"
echo === 5. listening ports 8010/8011:
netstat -ano 2>nul | findstr ":8010 :8011" | findstr "LISTENING"
echo === 6. live checks:
curl -s --max-time 8 http://127.0.0.1:8011/api/health
echo.
curl -s --max-time 8 -o nul -w "LT 8010: HTTP %%{http_code}" http://127.0.0.1:8010/v2/languages
echo.
curl -s --max-time 8 -o nul -w "LLM 11434: HTTP %%{http_code}" http://127.0.0.1:11434/api/tags
echo.
ollama list 2>nul
echo ============================================================
echo Send a photo of this whole window.
pause pause