1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-26 09:37:56 +00:00

fix: show announce url origin in inspector tier list (#5382)

This commit is contained in:
Charles Kerr 2023-04-12 20:44:26 -05:00 committed by GitHub
parent c3038d8ed7
commit 8dbf40613a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -739,13 +739,14 @@ export class Inspector extends EventTarget {
tier_div.classList.add('tier-list-row', index % 2 ? 'odd' : 'even'); tier_div.classList.add('tier-list-row', index % 2 ? 'odd' : 'even');
let element = document.createElement('div'); let element = document.createElement('div');
let site = '';
try {
site = new URL(tracker.announce).origin;
} catch {
site = [tracker.sitename || tracker.host || tracker.announce];
}
element.classList.add('tier-list-tracker'); element.classList.add('tier-list-tracker');
setTextContent( setTextContent(element, `${site} - tier ${tracker.tier + 1}`);
element,
`${tracker.sitename || tracker.host || tracker.announce} - tier ${
tracker.tier + 1
}`
);
element.setAttribute('title', tracker.announce); element.setAttribute('title', tracker.announce);
tier_div.append(element); tier_div.append(element);