From b46ecb4351a8097efc628c435375c52ecb856bf9 Mon Sep 17 00:00:00 2001 From: Gabriele Date: Mon, 8 Dec 2014 22:00:00 +0100 Subject: [PATCH] WebUI: Decrease frequency of updates of property panel Now that the properties are loaded immediately when the selected torrent or the property tab is changed, the frequency of the updates can be reduced without affecting the user experience. New update intervals: * General: 5 seconds (10 if qBT is not reachable) * Tracker list: 10 seconds (20 if qBT is not reachable) * File list: 5 seconds (10 if qBT is not reachable) --- src/webui/www/public/scripts/prop-files.js | 6 +++--- src/webui/www/public/scripts/prop-general.js | 6 +++--- src/webui/www/public/scripts/prop-trackers.js | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/webui/www/public/scripts/prop-files.js b/src/webui/www/public/scripts/prop-files.js index 344522048..e68ab569f 100644 --- a/src/webui/www/public/scripts/prop-files.js +++ b/src/webui/www/public/scripts/prop-files.js @@ -281,7 +281,7 @@ var loadTorrentFilesData = function() { var new_hash = myTable.getCurrentTorrentHash(); if (new_hash == "") { fTable.removeAllRows(); - loadTorrentFilesDataTimer = loadTorrentFilesData.delay(1500); + loadTorrentFilesDataTimer = loadTorrentFilesData.delay(5000); return; } if (new_hash != current_hash) { @@ -295,7 +295,7 @@ var loadTorrentFilesData = function() { method: 'get', onFailure: function() { $('error_div').set('html', '_(qBittorrent client is not reachable)'); - loadTorrentFilesDataTimer = loadTorrentFilesData.delay(2000); + loadTorrentFilesDataTimer = loadTorrentFilesData.delay(10000); }, onSuccess: function(files) { $('error_div').set('html', ''); @@ -334,7 +334,7 @@ var loadTorrentFilesData = function() { else { fTable.removeAllRows(); } - loadTorrentFilesDataTimer = loadTorrentFilesData.delay(1500); + loadTorrentFilesDataTimer = loadTorrentFilesData.delay(5000); } }).send(); } diff --git a/src/webui/www/public/scripts/prop-general.js b/src/webui/www/public/scripts/prop-general.js index 31481e06c..586c66b12 100644 --- a/src/webui/www/public/scripts/prop-general.js +++ b/src/webui/www/public/scripts/prop-general.js @@ -23,7 +23,7 @@ var loadTorrentData = function() { var current_hash = myTable.getCurrentTorrentHash(); if (current_hash == "") { clearData(); - loadTorrentDataTimer = loadTorrentData.delay(1500); + loadTorrentDataTimer = loadTorrentData.delay(5000); return; } // Display hash @@ -35,7 +35,7 @@ var loadTorrentData = function() { method: 'get', onFailure: function() { $('error_div').set('html', '_(qBittorrent client is not reachable)'); - loadTorrentDataTimer = loadTorrentData.delay(2000); + loadTorrentDataTimer = loadTorrentData.delay(10000); }, onSuccess: function(data) { $('error_div').set('html', ''); @@ -72,7 +72,7 @@ var loadTorrentData = function() { else { clearData(); } - loadTorrentDataTimer = loadTorrentData.delay(1500); + loadTorrentDataTimer = loadTorrentData.delay(5000); } }).send(); } diff --git a/src/webui/www/public/scripts/prop-trackers.js b/src/webui/www/public/scripts/prop-trackers.js index 57baa49ce..fd0e7b1d8 100644 --- a/src/webui/www/public/scripts/prop-trackers.js +++ b/src/webui/www/public/scripts/prop-trackers.js @@ -61,7 +61,7 @@ var loadTrackersData = function() { var new_hash = myTable.getCurrentTorrentHash(); if (new_hash == "") { tTable.removeAllRows(); - loadTrackersDataTimer = loadTrackersData.delay(1500); + loadTrackersDataTimer = loadTrackersData.delay(10000); return; } if (new_hash != current_hash) { @@ -75,7 +75,7 @@ var loadTrackersData = function() { method: 'get', onFailure: function() { $('error_div').set('html', '_(qBittorrent client is not reachable)'); - loadTrackersDataTimer = loadTrackersData.delay(2000); + loadTrackersDataTimer = loadTrackersData.delay(20000); }, onSuccess: function(trackers) { $('error_div').set('html', ''); @@ -94,7 +94,7 @@ var loadTrackersData = function() { else { tTable.removeAllRows(); } - loadTrackersDataTimer = loadTrackersData.delay(1500); + loadTrackersDataTimer = loadTrackersData.delay(10000); } }).send(); }