Add download client logos to filter UI with fallback handling
Some checks failed
Build and Push Docker Image / build (push) Successful in 30s
Licence Check / Licence compatibility and copyright header verification (push) Successful in 1m4s
CI / Security audit (push) Has been cancelled
CI / Tests & coverage (push) Has been cancelled

This commit is contained in:
2026-05-20 00:14:20 +01:00
parent 80cf3eaa39
commit f5883d4929
7 changed files with 50 additions and 0 deletions

View File

@@ -1174,6 +1174,21 @@ function updateDownloadClientFilter() {
toggleClientSelection(index, e.target.checked);
});
// Add client icon
const iconWrapper = document.createElement('span');
iconWrapper.className = 'download-client-icon';
const iconImg = document.createElement('img');
iconImg.src = `/images/clients/${client.type}.svg`;
iconImg.alt = `${client.name} icon`;
iconImg.onerror = () => {
// Fallback to text if image fails to load
iconWrapper.textContent = client.type.charAt(0).toUpperCase();
iconWrapper.classList.add('fallback');
};
iconWrapper.appendChild(iconImg);
const label = document.createElement('label');
label.className = 'download-client-option-label';
label.htmlFor = checkboxId;
@@ -1184,6 +1199,7 @@ function updateDownloadClientFilter() {
typeBadge.textContent = client.type;
option.appendChild(checkbox);
option.appendChild(iconWrapper);
option.appendChild(label);
option.appendChild(typeBadge);