Commit Graph
388 Commits
Author SHA1 Message Date
dev 42c32b2ef9 docs: расширить разделы Закладки и Журнал, добавить универсальный промпт заполнения 2026-10-23 22:39:50 +03:00
dev 5fd99016e6 fix(docs): убрать скачок размера строки при наведении на раздел 2026-10-23 22:04:25 +03:00
dev 0673b0eb37 fix(docs): закрытие модалки картинки по клику на оверлей 2026-10-23 22:02:01 +03:00
dev 97426c70af Документация: разделы и статьи в docs.html
- Добавлены 12 разделов документации: Журнал, Отчёты о занятиях,
  Ученики, Группы, Обратная связь, Короткие сообщения, Чаты, Фото,
  Файлы, Ссылки, Закладки, Заметки (каждый со вступительной статьёй)
- Сид разделов в lib/docs.js (ensureDocsTables) и db/migration.sql
-doc_images добавлен в sweepOrphanedUploads и BROKEN_IMAGE_SOURCES
- Исправлен дубль docSectionIds в backup-restore.js
- Роуты /api/docs/* в server.js
- Страницы public/docs.html, public/docs-public.html, скрипты
  public/js/docs.js, public/js/docs-public.js, public/js/md.js
2026-10-23 21:33:48 +03:00
dev 4ba0f810b2 chore(deploy): remove orphan containers on app recreate 2026-10-23 11:50:15 +03:00
dev 08e99e0c09 fix(restore): guarantee cleanup of uploaded backup archive
Wrap temp-dir removal in removeTempDir() so a failed rmSync cannot hang the async restore handler and leave the archive on disk, close the peek stream descriptor, and clean wido-up-*/wido-rst-* on response finish and the missing-file path.
2026-10-23 11:41:57 +03:00
dev 7d610c549e feat(files): store file sizes, add size range filter and sorting
Adds project_files.size (schema, idempotent migration, ensureFileSizesColumn), records multer size on both upload paths, backfills legacy rows from storage at startup and after restore (lib/file-sizes.js) with a lazy per-row update on read. GET /api/files and /api/files/detached accept min_size/max_size and a whitelisted sort (new/old/size_desc/size_asc); files page gets size and sort selects. size is carried through backup normalize/restore.
2026-10-23 10:25:16 +03:00
dev 621067a880 feat(groups): быстрые фильтры и права тьюторов, права на отчёты о занятии
- фильтры групп по филиалу, тьютору и дню, сохранение в localStorage и сброс
- тьютор может редактировать только свои группы; филиал и тьютора меняет админ
- редактирование отчётов о занятии доступно только автору или админу
2026-10-23 10:12:44 +03:00
dev d0a17c5f62 fix(photo-ai): build weights in an isolated stage and stop blocking app deploys
Prefetch moved to a separate python:3.10-slim stage that only sees weights.py/fetch-weights.py, so editing app.py or vendor/ no longer invalidates the 360 MB weights layer. Weight catalog and download helpers extracted to photo-ai/weights.py; fetch-weights.py no longer imports app (torch). Cache mount switched to sharing=shared: a canceled build could leave the exclusive lock held and hang the next build forever; downloads now use a pid-unique tmp file, so concurrent builds cannot corrupt it. Docs recommend 'docker compose up -d --build app' for app updates instead of rebuilding photo-ai/face-id.
2026-10-23 10:09:58 +03:00
dev 7a2f8893a6 fix(students): scope status constraint lookup and add it without blocking
Check pg_constraint by conname + conrelid so a same-named CHECK on another table cannot skip creation, add the constraint as NOT VALID and validate separately to avoid a long ACCESS EXCLUSIVE lock at boot. Mark lib/students.js as partially extracted in the migration plan.
2026-10-23 09:19:44 +03:00
dev c2cc7db26d feat(students): add active/paused/left status with hidden filter 2026-10-23 09:14:19 +03:00
dev 1da6b5e107 feat(lessons): close modal only via cancel 2026-10-23 08:59:19 +03:00
dev 9f528ba98e fix(photo-ai): retry and resume torch wheel downloads 2026-10-22 23:31:12 +03:00
dev d19611573f fix(photo-ai): persist pip cache to avoid re-downloading torch wheels 2026-10-22 23:19:24 +03:00
dev 816e7b2e38 feat(shorts): keep modal draft and close only via cancel 2026-10-22 22:45:56 +03:00
dev af65b8f3eb docs(tls): point SAN hint at the server certificate 2026-10-22 18:14:48 +03:00
dev ab6ea8a25c docs(tls): clarify root CA backup and readme formatting 2026-10-22 18:12:30 +03:00
dev ba32234217 feat(tls): issue server certificate from internal root CA
Generate a 10-year root CA in entrypoint.sh and sign the server leaf with it. Only the root CA is distributed to clients (including GPO); the leaf is served by the app and is reissued automatically when CERT_HOSTNAMES changes. Update the Windows installer, ZIP package, settings UI and docs for the two-tier scheme.
2026-10-22 18:09:30 +03:00
dev b5eeb5fbdf docs(tls): clarify certificate installer elevation in package readme 2026-10-22 17:58:04 +03:00
dev 2385b37b92 fix(tls): repair Windows certificate installer and verify trust 2026-10-22 17:56:31 +03:00
dev a55eff4004 fix(deploy): grant network.host entitlement for compose bake builds 2026-10-22 17:38:45 +03:00
dev af67526df7 fix(profile): make save button work and verify current password 2026-10-22 17:30:08 +03:00
dev 0ecbca5f13 fix(text-corrector): size threads to available CPUs, keep full context and allow long corrections 2026-10-22 11:57:15 +03:00
dev 9936b68e80 fix(photo-ai): build sdists without isolation to avoid duplicate torch download 2026-10-22 11:26:34 +03:00
dev fc3ea4deaf fix(restore): tolerate empty settings/feedback text and raise settings value cap 2026-10-21 19:31:47 +03:00
dev f2b118c040 fix(s3): raise SeaweedFS volume limit so S3 buckets can allocate volumes 2026-10-21 19:15:57 +03:00
dev e27e8a74a3 fix(restore): allow long feedback_prompts in user_settings 2026-10-21 19:03:24 +03:00
dev 3439d57485 fix(restore): accept originals paths in group photos
- validate group_photos.photo_original_path with the same tolerant helper
  as entries, so /uploads/.originals/<file> no longer fails restore with
  "Invalid upload path"
- accept legacy flat values in both photo_original_path columns
- preserve users.avatar in normalizeRestoreData and the restore INSERT
- add selftests for originals paths and avatars
2026-10-21 18:36:01 +03:00
dev 697aac9b87 fix(restore): allow backups of any size
- default BACKUP_UPLOAD_LIMIT_MB to 0 (no hard cap, disk is the limit);
  a positive value still enables multer fileSize
- scale request timeout by the configured limit and keep up to 24h when
  unlimited, cap headersTimeout at 120s
- check Content-Length and free space before upload (413/507) and map
  multer ENOSPC to 507
- drop the hardcoded 500 MB fallback in the settings restore pre-check
- cover new limit/timeout helpers in backup.selftest.js
- update env template, compose, README, AGENTS and API docs
2026-10-21 18:13:24 +03:00
dev 19f63a4064 fix(restore): survive large backups, disk-full and proxy limits
- extract restore helpers into lib/restore.js (space check, tar entry
  filter, temp dir sweep)
- reject tar entries outside staging and symlinks/hardlinks
- map ENOSPC/EQUOT to 507 with clear messages, keep data_restored flag
  when files fail after commit
- raise request timeout using BACKUP_UPLOAD_LIMIT_MB and expose
  backup_upload_limit_mb via public settings
- upload restore archive via XHR with progress, size pre-check and
  readable server errors in settings UI
- document large-archive restore on a remote server
2026-10-21 17:58:46 +03:00
dev d33bf62a7d style(report-card): move wave-bl into footer, resize waves 2026-10-20 15:43:54 +03:00
dev 451ca278cc feat(report-card): decorative waves + exclude current entry from student works 2026-10-20 15:36:14 +03:00
dev ea8722b544 Add migration plan for server.js -> lib decomposition (copy→switch) 2026-10-19 23:46:08 +03:00
dev 5c6c46620d docs(agents): require extracting new logic from server.js into lib/ 2026-10-19 19:14:28 +03:00
dev bd6523cecf feat(lesson-reports): allow changing group on report edit with clash check 2026-10-19 14:39:47 +03:00
dev 7478031b14 feat(shorts): usage-chip shows usage date, author pill styled like fb-author 2026-10-19 14:39:20 +03:00
dev f3bb424d22 feat(shorts): компактный режим списка с группировкой по теме и дате 2026-10-18 21:26:41 +03:00
dev 4216173d30 fix(photo-enhance): restore dead sliders in enhanceModal and harden save
- re-bind input listeners for #enhanceBrightness/#enhanceContrast/#enhanceSaturate/#enhanceDenoise/#enhanceSharp -> scheduleEnhancePreview (lost in f5910d9)
- new "Только эффекты" button in #cpuEnhanceModal footer: applies slider effects via CPU pipeline (mode=cpu, face=off) in one click, no photo-ai/model
- harden saveEnhance: null-guard enhanceEntryId/enhanceSourceImg/btn, AbortController timeouts on applyAiResult (15s), canvas upload (30s), refreshEntryCard; guard runPhotoAi btn.disabled
2026-10-17 12:27:13 +03:00
dev f5910d9524 feat(photo): CPU-обработка фото с пайплайном sharp
- новые эндпоинты: /api/entries/:id/photo/cpu-analyze, cpu-preview, enhance-cpu
- серверный пайплайн sharp: Lanczos ×2, median+blur, CLAHE, modulate, tint, linear, sharpen, mozjpeg
- авто-подбор параметров по статистике фото, превью ограничено 1400px
- worker: CPU-постобработка поверх результата photo-ai, no-op при нейтральных значениях
- модалка #cpuEnhanceModal: сравнение оригинал/результат, зум, 8 ползунков, режимы auto/ai/cpu, горячие клавиши
- индикатор прогресса фото-ИИ остаётся видимым до загрузки результата
2026-10-17 11:23:40 +03:00
dev 1d74813b0f fix(photo-ai): keep loading progress visible until result loads 2026-10-17 01:20:40 +03:00
dev afd5b2dd18 feat(tls): self-signed certificate generation, Windows installer and settings UI 2026-10-17 01:12:52 +03:00
dev 3b51d2cdf5 feat(feedback): rewrite feedback card layout and author badge 2026-10-17 01:12:50 +03:00
dev 2f8c2da280 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.
2026-10-17 00:17:00 +03:00
dev 9ae54da2e4 feat(profile): personal account page with own-profile editing
Add public/profile.html + public/js/profile.js: hash-routed page with
tabs for personal data, password, AI models, prompts and branches
(admin-only), plus clickable counters for the user's own work.

Server:
- users gains email/phone/avatar (init.sql, migration.sql, ensureUserTables)
- GET /api/users/:id — self or admin, returns created_at and branch_ids
- GET /api/users/:id/stats — entries/shorts/feedbacks/lessons/groups counts
- PUT /api/users/:id/profile — name/email/phone/password, audit user.profile.update
- POST /api/users/:id/avatar — upload.single('photo'), audit user.avatar.update
- safeUser() now exposes email/phone/avatar/created_at
- users.avatar added to sweepOrphanedUploads and BROKEN_IMAGE_SOURCES
- getPersonalAiModels()/resolveUserAiProfile() for personal AI profiles;
  POST /api/shorts/ai-correct resolves them and 400s on unknown profile

Frontend:
- sidebar entry "Профиль"; .btn-secondary/.btn-xs/.muted in admin.css
- profile.js saves AI and prompt tabs as two independent PUTs
- feedback.js and shorts.js now fill model selects from
  GET /api/ai/profiles/options by role (admin sees system profiles,
  tutor sees native + own models) so the choice is actually persisted

Docs: AGENTS.md 3h updated, new section 3p.
2026-10-16 23:49:29 +03:00
dev 76cab1b97a feat(journal): add logo toggle and report card improvements 2026-10-15 21:00:35 +03:00
dev 97058673c7 feat(feedback): add prev-date endpoint, resident last_date, works display, mark stripe update 2026-10-15 20:17:28 +03:00
dev d93b51e859 feat(journal): preview last attachments and photos in report card 2026-10-15 16:36:46 +03:00
dev 3150d41fa5 feat(journal): превью последних вложений и фото с занятий в карточке отчёта
- эндпоинты /api/students/image-files-by-name и /api/students/works-by-name (requireAuth, branchScope)
- галерея вложений карточки грузится асинхронно по имени ученика, кэш по имени
- новый тумблер «Фото на занятиях» (localStorage reportCardStudentWorks)
- выравнивание высоты галереи, обработка landscape-фото, CSS .sc-w__*
- shorts: правка выравнивания автора в строке
2026-10-15 12:51:18 +03:00
dev 3929290635 feat(journal): превью вложений и навигация по лайтбоксу в карточке отчёта 2026-10-15 00:22:01 +03:00
dev 8a520b84fe feat(journal): скелетон загрузки фото в списке записей 2026-10-14 23:45:35 +03:00