From d93b51e859a9ccca3f61f0435fab45d7b3655955 Mon Sep 17 00:00:00 2001 From: dev Date: Thu, 15 Oct 2026 16:36:46 +0300 Subject: [PATCH] feat(journal): preview last attachments and photos in report card --- public/js/files.js | 2 +- server.js | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/public/js/files.js b/public/js/files.js index 043bd2a..a197482 100644 --- a/public/js/files.js +++ b/public/js/files.js @@ -48,7 +48,7 @@ function fileCardHTML(f) { ${thumb}
📎 Файл -
${isImageFile(f.name) ? esc(f.name) : `${esc(f.name)}`}
+ ${meta} ${time} ${action} diff --git a/server.js b/server.js index a75b05c..2fa6010 100644 --- a/server.js +++ b/server.js @@ -9267,6 +9267,12 @@ app.get('/api/files/:token', fileLimiter, async (req, res) => { if (!key) return res.status(404).json({ error: 'File missing' }); if (isImageName(r.name)) { if (req.query.thumb) return sendImageThumb(res, key); + if (req.query.download) { + if (!(await storage.streamTo(res, key, { download: true, name: r.name })) && !res.headersSent) { + return res.status(404).json({ error: 'File missing' }); + } + return; + } const ok = await storage.streamTo(res, key, { cacheControl: 'public, max-age=31536000, immutable' }); if (!ok && !res.headersSent) return res.status(404).json({ error: 'File missing' }); return;