Added user photo resizing

This commit is contained in:
2025-10-26 16:26:20 +01:00
parent 7226ee962c
commit 6c42ff500b
4 changed files with 66 additions and 9 deletions

View File

@@ -41,7 +41,7 @@
{
<tr class="user-row">
<td>
<img class="rounded-circle user-icon" src="data:image/jpeg;base64,@userTableViewModel.JpegPhoto" alt="Photo" style="max-width:300px;" />
<img class="rounded-circle user-icon" src="~/Home/UserPhoto?uid=@userTableViewModel.Uid&size=48" alt="Photo" style="width:32px;height:32px;" width="32" height="32" loading="lazy" />
</td>
<td>@userTableViewModel.Uid</td>
<td>@userTableViewModel.Title</td>
@@ -730,13 +730,7 @@
// Photo
const imgEl = row.querySelector('td:first-child img');
const detailPhoto = document.getElementById('detailPhoto');
if (imgEl && imgEl.src.startsWith('data:image')) {
detailPhoto.src = imgEl.src;
detailPhoto.style.display = 'block';
} else {
detailPhoto.style.display = 'none';
}
detailPhoto.src = `/Home/UserPhoto?uid=${data.uid}&size=256`;
detailModal.show();
});
});