WebUI: Improve sort order in Status column

This commit adds custom compare function to Status column (same sort order as in the GUI).

Closes #15499.
PR #21570.
This commit is contained in:
skomerko 2024-10-19 10:25:30 +02:00 committed by GitHub
parent 8e941a06f1
commit 7031c52d16
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 31 additions and 2 deletions

View file

@ -1102,6 +1102,10 @@ window.qBittorrent.DynamicTable ??= (() => {
td.title = status;
};
this.columns["status"].compareRows = function(row1, row2) {
return compareNumbers(row1.full_data._statusOrder, row2.full_data._statusOrder);
};
// priority
this.columns["priority"].updateTd = function(td, row) {
const queuePos = this.getRowValue(row);