Add AI-check details modal on worker page and raise backup upload limit

This commit is contained in:
dev
2026-09-11 16:26:30 +03:00
parent ee19da7fa0
commit 4db02d75bc
6 changed files with 51 additions and 3 deletions
+4 -1
View File
@@ -749,6 +749,8 @@ async function aiCorrectText(text) {
}
}
const BACKUP_UPLOAD_LIMIT_MB = parseInt(process.env.BACKUP_UPLOAD_LIMIT_MB || '500', 10);
const uploadBackup = multer({
storage: multer.diskStorage({
destination: (_, __, cb) => {
@@ -760,7 +762,7 @@ const uploadBackup = multer({
cb(null, `backup-${Date.now()}${ext}`);
},
}),
limits: { fileSize: 50 * 1024 * 1024 },
limits: { fileSize: BACKUP_UPLOAD_LIMIT_MB * 1024 * 1024 },
});
const SAFE_NAME = /^[\w,.()-]+$/;
@@ -2633,6 +2635,7 @@ app.get('/api/ai/status', requireAdmin, async (_, res) => {
),
pool.query(
`SELECT e.id, e.student_name, e.ai_status, e.ai_checked_at, e.ai_error, g.name AS group_name,
e.description_original, e.description_ai,
(e.description_ai IS NOT NULL AND e.description_original IS NOT NULL AND e.description_ai <> e.description_original) AS changed
FROM entries e JOIN groups g ON g.id = e.group_id
WHERE e.ai_checked_at IS NOT NULL AND e.deleted_at IS NULL