Add server-side image thumbnails (sharp): /uploads/thumb/<name> route, ?thumb=1 on file endpoints, disk-cached 480px WebP previews; grids now load thumbnails with lazy loading
This commit is contained in:
@@ -56,7 +56,7 @@ function renderRecent(rows) {
|
||||
el.innerHTML = rows.map(e => `
|
||||
<div class="recent-item">
|
||||
${e.photo_path
|
||||
? `<img src="${API}${e.photo_path}" data-img="${API}${e.photo_path}" alt="">`
|
||||
? `<img src="${thumbSrc(e.photo_path)}" data-img="${API}${e.photo_path}" loading="lazy" decoding="async" alt="">`
|
||||
: `<div class="thumb"><i data-lucide="graduation-cap"></i></div>`}
|
||||
<div class="r-info">
|
||||
<div class="r-name">${esc(e.student_name)}</div>
|
||||
@@ -95,7 +95,7 @@ function renderPhotos(rows) {
|
||||
if (!rows.length) { el.innerHTML = '<div class="dash-empty">Фото групп пока нет</div>'; return; }
|
||||
el.innerHTML = rows.map(p => `
|
||||
<div class="dash-photo" title="${esc(p.group_name)}">
|
||||
<img src="${API}${p.photo_path}" data-img="${API}${p.photo_path}" alt="">
|
||||
<img src="${thumbSrc(p.photo_path)}" data-img="${API}${p.photo_path}" loading="lazy" decoding="async" alt="">
|
||||
${p.caption ? `<div class="pcap">${esc(p.caption)}</div>` : ''}
|
||||
</div>`).join('');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user