Files
ToDoList/scripts/stop.bat
祀梦 0ab719500b feat: add WebDAV sync support and startup/shutdown scripts
Backend:
- Add uuid, sync_version, is_deleted fields to all syncable models
- Add SyncSettings model for WebDAV configuration (AES-256-GCM encrypted passwords)
- Add crypto.py: AES-256-GCM encryption derived from JWT_SECRET via PBKDF2
- Add sync_lock.py: thread-level sync lock with 503 middleware for write blocking
- Add webdav.py: WebDAV client using requests (PUT/GET/MKCOL/DELETE)
- Add sync_service.py: push/pull/bidirectional merge with LWW conflict resolution
- Add sync router with 8 endpoints: config, test, push, pull, sync, status, remote delete
- Add UUID backfill for existing records in init_db()
- Add SQLAlchemy before_update event to auto-increment sync_version
- Register sync middleware to block writes during sync (503)

Frontend:
- Add sync API client (WebUI/src/api/sync.ts)
- Add useSyncStore with config, test, push/pull/sync operations
- Add WebDAV config + sync UI in SettingsView
- Add 503 status code handling in axios interceptor
- Add uuid field to all TypeScript type definitions

Scripts:
- Add scripts/start.bat and scripts/stop.bat for project management

Design doc: docs/plan/webdav-sync-design.md
2026-05-17 21:18:54 +08:00

42 lines
1.1 KiB
Batchfile

@echo off
chcp 65001 >nul 2>&1
title 爱莉希雅待办事项 - 停止
echo ====================================================
echo 爱莉希雅待办事项 - 停止脚本
echo ====================================================
echo.
set "PORT=23994"
set "FOUND=0"
:: 查找并终止占用端口的进程
for /f "tokens=5" %%a in ('netstat -ano -p TCP ^| findstr ":%PORT%.*LISTENING"') do (
echo [信息] 发现进程 %%a 占用端口 %PORT%
taskkill /PID %%a /F >nul 2>&1
if errorlevel 1 (
echo [错误] 终止进程 %%a 失败,请尝试手动终止
) else (
echo [成功] 进程 %%a 已终止
set "FOUND=1"
)
)
if "%FOUND%"=="0" (
echo [信息] 端口 %PORT% 未被占用,无需停止
) else (
echo.
echo [信息] 等待端口释放...
timeout /t 2 /nobreak >nul
:: 二次确认
for /f "tokens=5" %%a in ('netstat -ano -p TCP ^| findstr ":%PORT%.*LISTENING"') do (
echo [警告] 端口 %PORT% 仍被进程 %%a 占用,再次尝试终止...
taskkill /PID %%a /F >nul 2>&1
timeout /t 1 /nobreak >nul
)
echo [成功] 项目已停止
)
echo.
pause