WebUI: Access element attribute/property natively in log tables

This commit is contained in:
skomerko 2025-02-17 16:33:21 +01:00
commit ae91c2f5d6

View file

@ -3258,7 +3258,8 @@ window.qBittorrent.DynamicTable ??= (() => {
initColumnsFunctions: function() { initColumnsFunctions: function() {
this.columns["timestamp"].updateTd = function(td, row) { this.columns["timestamp"].updateTd = function(td, row) {
const date = new Date(this.getRowValue(row) * 1000).toLocaleString(); const date = new Date(this.getRowValue(row) * 1000).toLocaleString();
td.set({ text: date, title: date }); td.textContent = date;
td.title = date;
}; };
this.columns["type"].updateTd = function(td, row) { this.columns["type"].updateTd = function(td, row) {
@ -3286,7 +3287,8 @@ window.qBittorrent.DynamicTable ??= (() => {
addClass = "logUnknown"; addClass = "logUnknown";
break; break;
} }
td.set({ text: logLevel, title: logLevel }); td.textContent = logLevel;
td.title = logLevel;
td.closest("tr").className = `logTableRow${addClass}`; td.closest("tr").className = `logTableRow${addClass}`;
}; };
}, },
@ -3333,7 +3335,8 @@ window.qBittorrent.DynamicTable ??= (() => {
this.columns["timestamp"].updateTd = function(td, row) { this.columns["timestamp"].updateTd = function(td, row) {
const date = new Date(this.getRowValue(row) * 1000).toLocaleString(); const date = new Date(this.getRowValue(row) * 1000).toLocaleString();
td.set({ text: date, title: date }); td.textContent = date;
td.title = date;
}; };
this.columns["blocked"].updateTd = function(td, row) { this.columns["blocked"].updateTd = function(td, row) {
@ -3346,7 +3349,8 @@ window.qBittorrent.DynamicTable ??= (() => {
status = "QBT_TR(Banned)QBT_TR[CONTEXT=ExecutionLogWidget]"; status = "QBT_TR(Banned)QBT_TR[CONTEXT=ExecutionLogWidget]";
addClass = "peerBanned"; addClass = "peerBanned";
} }
td.set({ text: status, title: status }); td.textContent = status;
td.title = status;
td.closest("tr").className = `logTableRow${addClass}`; td.closest("tr").className = `logTableRow${addClass}`;
}; };
}, },