feat(notes,profile): trash for notes and personal model connection check

Notes:
- soft delete via deleted_at/purge_at with trashPurgeDays(), restore and
  permanent-delete routes, ?deleted=1 list switch
- GET /api/notes now always returns only own notes (admin included)
- purge user_notes in purgeScheduledDeletions(), skip deleted rows in
  reorder and in the note title worker
- deleted_at/purge_at in init.sql, migration.sql, ensureUserNotesTable(),
  normalizeRestoreData and restore-insert

Profile:
- POST /api/user-settings/models/test probes a personal model from the
  client payload (works before save), shared probeAiModel() with the admin
  profile test, AI_MODEL_TEST_TIMEOUT_MS env in .env.example/compose
- "Проверить" button in the model list and in the model form
- password fields: autocomplete hints, values cleared on every toggle

Notes page: #notesDeleted trash toggle, deleted card state, restore/permanent
actions; fmtTs() uses the global fmtDateTime() instead of the non-existent
window.datetime.
This commit is contained in:
dev
2026-10-17 00:17:00 +03:00
parent 9ae54da2e4
commit 2f8c2da280
12 changed files with 303 additions and 71 deletions
+2
View File
@@ -34,6 +34,8 @@ AI_MODEL_REPO=Qwen/Qwen2.5-1.5B-Instruct-GGUF
AI_PROMPT=Ты — редактор текстов. Исправь ТОЛЬКО грамматические, орфографические и пунктуационные ошибки в тексте. Приведи к правильному регистру буквы. НЕ меняй слова, структуру предложений, стиль или смысл текста. Верни ТОЛЬКО исправленный текст без пояснений.
# Таймаут запроса к AI (мс), по умолчанию 120000 (2 минуты)
AI_REQUEST_TIMEOUT_MS=120000
# Таймаут проверки подключения к модели (мс), по умолчанию 15000 (15 секунд)
AI_MODEL_TEST_TIMEOUT_MS=15000
# === Cloudflare Tunnel (контейнер cloudflared) ===
# По умолчанию — Quick Tunnel на trycloudflare.com: случайный публичный URL,