From e1f8e6aa6f07c833d010a033cd46c342e4ed9d5c Mon Sep 17 00:00:00 2001 From: Thomas Piccirello Date: Sun, 26 Nov 2017 19:37:20 -0500 Subject: [PATCH 1/3] Reposition Total Size column to match gui --- src/webui/www/public/scripts/dynamicTable.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/webui/www/public/scripts/dynamicTable.js b/src/webui/www/public/scripts/dynamicTable.js index d1b8475d5..0ecb8bd5f 100644 --- a/src/webui/www/public/scripts/dynamicTable.js +++ b/src/webui/www/public/scripts/dynamicTable.js @@ -733,6 +733,7 @@ var TorrentsTable = new Class({ this.newColumn('state_icon', 'cursor: default', '', 22, true); this.newColumn('name', '', 'QBT_TR(Name)QBT_TR[CONTEXT=TorrentModel]', 200, true); this.newColumn('size', '', 'QBT_TR(Size)QBT_TR[CONTEXT=TorrentModel]', 100, true); + this.newColumn('total_size', '', 'QBT_TR(Total Size)QBT_TR[CONTEXT=TorrentModel]', 100, false); this.newColumn('progress', '', 'QBT_TR(Done)QBT_TR[CONTEXT=TorrentModel]', 85, true); this.newColumn('status', '', 'QBT_TR(Status)QBT_TR[CONTEXT=TorrentModel]', 100, true); this.newColumn('num_seeds', '', 'QBT_TR(Seeds)QBT_TR[CONTEXT=TorrentModel]', 100, true); @@ -757,7 +758,6 @@ var TorrentsTable = new Class({ this.newColumn('ratio_limit', '', 'QBT_TR(Ratio Limit)QBT_TR[CONTEXT=TorrentModel]', 100, false); this.newColumn('seen_complete', '', 'QBT_TR(Last Seen Complete)QBT_TR[CONTEXT=TorrentModel]', 100, false); this.newColumn('last_activity', '', 'QBT_TR(Last Activity)QBT_TR[CONTEXT=TorrentModel]', 100, false); - this.newColumn('total_size', '', 'QBT_TR(Total Size)QBT_TR[CONTEXT=TorrentModel]', 100, false); this.columns['state_icon'].onclick = ''; this.columns['state_icon'].dataProperties[0] = 'state'; From ee37f1db3d48ab57d497d432299bf3dfd16a23b6 Mon Sep 17 00:00:00 2001 From: Thomas Piccirello Date: Mon, 27 Nov 2017 00:21:19 -0500 Subject: [PATCH 2/3] Add Tags columns --- src/webui/btjson.cpp | 2 ++ src/webui/www/public/scripts/dynamicTable.js | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/src/webui/btjson.cpp b/src/webui/btjson.cpp index 12140902f..5979aede3 100644 --- a/src/webui/btjson.cpp +++ b/src/webui/btjson.cpp @@ -94,6 +94,7 @@ static const char KEY_TORRENT_STATE[] = "state"; static const char KEY_TORRENT_SEQUENTIAL_DOWNLOAD[] = "seq_dl"; static const char KEY_TORRENT_FIRST_LAST_PIECE_PRIO[] = "f_l_piece_prio"; static const char KEY_TORRENT_CATEGORY[] = "category"; +static const char KEY_TORRENT_TAGS[] = "tags"; static const char KEY_TORRENT_SUPER_SEEDING[] = "super_seeding"; static const char KEY_TORRENT_FORCE_START[] = "force_start"; static const char KEY_TORRENT_SAVE_PATH[] = "save_path"; @@ -370,6 +371,7 @@ namespace if (torrent->hasMetadata()) ret[KEY_TORRENT_FIRST_LAST_PIECE_PRIO] = torrent->hasFirstLastPiecePriority(); ret[KEY_TORRENT_CATEGORY] = torrent->category(); + ret[KEY_TORRENT_TAGS] = torrent->tags().toList().join(", "); ret[KEY_TORRENT_SUPER_SEEDING] = torrent->superSeeding(); ret[KEY_TORRENT_FORCE_START] = torrent->isForced(); ret[KEY_TORRENT_SAVE_PATH] = Utils::Fs::toNativePath(torrent->savePath()); diff --git a/src/webui/www/public/scripts/dynamicTable.js b/src/webui/www/public/scripts/dynamicTable.js index 0ecb8bd5f..c6e62058c 100644 --- a/src/webui/www/public/scripts/dynamicTable.js +++ b/src/webui/www/public/scripts/dynamicTable.js @@ -743,6 +743,7 @@ var TorrentsTable = new Class({ this.newColumn('eta', '', 'QBT_TR(ETA)QBT_TR[CONTEXT=TorrentModel]', 100, true); this.newColumn('ratio', '', 'QBT_TR(Ratio)QBT_TR[CONTEXT=TorrentModel]', 100, true); this.newColumn('category', '', 'QBT_TR(Category)QBT_TR[CONTEXT=TorrentModel]', 100, true); + this.newColumn('tags', '', 'QBT_TR(Tags)QBT_TR[CONTEXT=TorrentModel]', 100, true); this.newColumn('added_on', '', 'QBT_TR(Added On)QBT_TR[CONTEXT=TorrentModel]', 100, true); this.newColumn('completion_on', '', 'QBT_TR(Completed On)QBT_TR[CONTEXT=TorrentModel]', 100, false); this.newColumn('tracker', '', 'QBT_TR(Tracker)QBT_TR[CONTEXT=TorrentModel]', 100, false); @@ -961,6 +962,9 @@ var TorrentsTable = new Class({ td.set('html', html); }; + // tags + this.columns['tags'].updateTd = this.columns['name'].updateTd; + // added on this.columns['added_on'].updateTd = function (td, row) { var date = new Date(this.getRowValue(row) * 1000).toLocaleString(); From a05562cdc5ad5a36a9ace0701cde7f4fb2b651e2 Mon Sep 17 00:00:00 2001 From: Thomas Piccirello Date: Mon, 27 Nov 2017 01:35:15 -0500 Subject: [PATCH 3/3] Add Time Active column --- src/webui/btjson.cpp | 2 ++ src/webui/www/public/scripts/dynamicTable.js | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/src/webui/btjson.cpp b/src/webui/btjson.cpp index 5979aede3..db7f318da 100644 --- a/src/webui/btjson.cpp +++ b/src/webui/btjson.cpp @@ -114,6 +114,7 @@ static const char KEY_TORRENT_LAST_SEEN_COMPLETE_TIME[] = "seen_complete"; static const char KEY_TORRENT_LAST_ACTIVITY_TIME[] = "last_activity"; static const char KEY_TORRENT_TOTAL_SIZE[] = "total_size"; static const char KEY_TORRENT_AUTO_TORRENT_MANAGEMENT[] = "auto_tmm"; +static const char KEY_TORRENT_TIME_ACTIVE[] = "time_active"; // Peer keys static const char KEY_PEER_IP[] = "ip"; @@ -389,6 +390,7 @@ namespace ret[KEY_TORRENT_RATIO_LIMIT] = torrent->maxRatio(); ret[KEY_TORRENT_LAST_SEEN_COMPLETE_TIME] = torrent->lastSeenComplete().toTime_t(); ret[KEY_TORRENT_AUTO_TORRENT_MANAGEMENT] = torrent->isAutoTMMEnabled(); + ret[KEY_TORRENT_TIME_ACTIVE] = torrent->activeTime(); if (torrent->isPaused() || torrent->isChecking()) ret[KEY_TORRENT_LAST_ACTIVITY_TIME] = 0; diff --git a/src/webui/www/public/scripts/dynamicTable.js b/src/webui/www/public/scripts/dynamicTable.js index c6e62058c..a7fe85e5b 100644 --- a/src/webui/www/public/scripts/dynamicTable.js +++ b/src/webui/www/public/scripts/dynamicTable.js @@ -754,6 +754,7 @@ var TorrentsTable = new Class({ this.newColumn('downloaded_session', '', 'QBT_TR(Session Download)QBT_TR[CONTEXT=TorrentModel]', 100, false); this.newColumn('uploaded_session', '', 'QBT_TR(Session Upload)QBT_TR[CONTEXT=TorrentModel]', 100, false); this.newColumn('amount_left', '', 'QBT_TR(Remaining)QBT_TR[CONTEXT=TorrentModel]', 100, false); + this.newColumn('time_active', '', 'QBT_TR(Time Active)QBT_TR[CONTEXT=TorrentModel]', 100, false); this.newColumn('save_path', '', 'QBT_TR(Save path)QBT_TR[CONTEXT=TorrentModel]', 100, false); this.newColumn('completed', '', 'QBT_TR(Completed)QBT_TR[CONTEXT=TorrentModel]', 100, false); this.newColumn('ratio_limit', '', 'QBT_TR(Ratio Limit)QBT_TR[CONTEXT=TorrentModel]', 100, false); @@ -1021,6 +1022,12 @@ var TorrentsTable = new Class({ else td.set('html', 'QBT_TR(%1 ago)QBT_TR[CONTEXT=TransferListDelegate]'.replace('%1', friendlyDuration((new Date()) / 1000 - val, true))); }; + + // time active + this.columns['time_active'].updateTd = function (td, row) { + var time = this.getRowValue(row); + td.set('html', friendlyDuration(time)); + }; }, applyFilter : function (row, filterName, categoryHash) {