WebUI: Allow to display only hostname in the Tracker column

It is now possible to display only hostname in the Tracker column.
Closes #11357.
PR #21243.
This commit is contained in:
skomerko 2024-09-01 10:34:49 +02:00 committed by GitHub
parent fc82abe7f6
commit 9d0fa213be
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 68 additions and 47 deletions

View file

@ -1248,6 +1248,14 @@ window.qBittorrent.DynamicTable ??= (() => {
}
};
// tracker
this.columns["tracker"].updateTd = function(td, row) {
const value = this.getRowValue(row);
const tracker = displayFullURLTrackerColumn ? value : window.qBittorrent.Misc.getHost(value);
td.textContent = tracker;
td.title = value;
};
// dl_limit, up_limit
this.columns["dl_limit"].updateTd = function(td, row) {
const speed = this.getRowValue(row);
@ -1424,7 +1432,7 @@ window.qBittorrent.DynamicTable ??= (() => {
break; // do nothing
default:
if (!useSubcategories) {
if (categoryHash !== window.qBittorrent.Client.genHash(row["full_data"].category))
if (categoryHash !== window.qBittorrent.Misc.genHash(row["full_data"].category))
return false;
}
else {
@ -1449,7 +1457,7 @@ window.qBittorrent.DynamicTable ??= (() => {
break; // do nothing
default: {
const tagHashes = row["full_data"].tags.split(", ").map(tag => window.qBittorrent.Client.genHash(tag));
const tagHashes = row["full_data"].tags.split(", ").map(tag => window.qBittorrent.Misc.genHash(tag));
if (!tagHashes.contains(tagHash))
return false;
break;