feat: загрузка картинок работ в модалку отзыва через ImgBB

- Добавлена кнопка 'Картинка из работ' в модалку feedbackModal
  (справа от тумблера 'В промпт прошлый отзыв' в одной строке)
- Сетка миниатюр работ ученика из журнала (GET /api/entries)
- Независимый модуль public/js/imgbb.js для загрузки картинок
- Бэкенд-прокси POST /api/feedback/imgbb-upload (обход CORS)
- Настройки feedback_imgbb_url / feedback_imgbb_key в разделе
  'Сторонние сервисы' на settings.html + валидация в PUT /api/settings
- Сиды настроек в db/init.sql и db/migration.sql
- Вставка в #fbText: 'Последня работа.' + ссылка на ImgBB
- charset=utf-8 для HTML-ответов статики (исправление кодировки кириллицы)
This commit is contained in:
dev
2026-10-29 13:16:21 +03:00
parent ca2ead0afc
commit 5e903a1eeb
9 changed files with 301 additions and 5 deletions
+6 -2
View File
@@ -1,6 +1,6 @@
const DIRTY_FIELDS = ['systemName', 'timezone', 'timeFormat', 'spamInterval', 'footerLeft', 'footerRight', 'aiPrompt', 'aiAutoCheck', 'lessonAiPrompt', 'lessonAiEnabled', 'notesAiEnabled', 'shareShowMessage', 'shareShowDate', 'shareShowNames', 'shareShowPhotos', 'cookieNoticeText', 'photoResolution', 'photoQuality', 'photoEngine', 'camEnabled', 'photoAiFaceMode', 'photoAiFaceModel', 'photoAiDevicePref', 'trashPurgeDays', 'notifyEnabled', 'notifyRetentionDays'];
const DIRTY_FIELDS = ['systemName', 'timezone', 'timeFormat', 'spamInterval', 'footerLeft', 'footerRight', 'aiPrompt', 'aiAutoCheck', 'lessonAiPrompt', 'lessonAiEnabled', 'notesAiEnabled', 'shareShowMessage', 'shareShowDate', 'shareShowNames', 'shareShowPhotos', 'cookieNoticeText', 'photoResolution', 'photoQuality', 'photoEngine', 'camEnabled', 'photoAiFaceMode', 'photoAiFaceModel', 'photoAiDevicePref', 'trashPurgeDays', 'notifyEnabled', 'notifyRetentionDays', 'imgbbUrl', 'imgbbKey'];
const NOTIFY_IDS = [];
const SECTION_IDS = ['sec-system', 'sec-stack', 'sec-brand', 'sec-datetime', 'sec-antispam', 'sec-share', 'sec-ai', 'sec-lesson-ai', 'sec-notes-ai', 'sec-achievements', 'sec-tls', 'sec-backup', 'sec-trash', 'sec-form', 'sec-notify', 'sec-photo', 'sec-photo-ai', 'sec-bans'];
const SECTION_IDS = ['sec-system', 'sec-stack', 'sec-brand', 'sec-datetime', 'sec-antispam', 'sec-share', 'sec-ai', 'sec-lesson-ai', 'sec-notes-ai', 'sec-achievements', 'sec-tls', 'sec-backup', 'sec-trash', 'sec-form', 'sec-notify', 'sec-photo', 'sec-photo-ai', 'sec-external-services', 'sec-bans'];
const SPAM_MAX = 10080;
const BAN_REASONS = {
'honeypot': 'Антиспам-поле',
@@ -330,6 +330,8 @@ async function loadSettings() {
const adp = document.getElementById('photoAiDevicePref');
adp.value = ['auto', 'cuda', 'cpu'].includes(s.photo_ai_device_pref) ? s.photo_ai_device_pref : 'auto';
document.getElementById('camEnabled').checked = s.camera_enabled !== 'false';
document.getElementById('imgbbUrl').value = s.feedback_imgbb_url || '';
document.getElementById('imgbbKey').value = s.feedback_imgbb_key || '';
await renderNotifyTypes(s);
snapshotDirty();
updateSpamUi();
@@ -938,6 +940,8 @@ async function saveSettings() {
photo_ai_device_pref: document.getElementById('photoAiDevicePref').value,
camera_enabled: document.getElementById('camEnabled').checked ? 'true' : 'false',
trash_purge_days: String(trashDays),
feedback_imgbb_url: document.getElementById('imgbbUrl').value.trim(),
feedback_imgbb_key: document.getElementById('imgbbKey').value.trim(),
...notifySettingsPayload(notifyRetentionDays),
} })
});