Browse Source

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)
adaptive-webui-19844
Gabriele 10 years ago
parent
commit
b46ecb4351
  1. 6
      src/webui/www/public/scripts/prop-files.js
  2. 6
      src/webui/www/public/scripts/prop-general.js
  3. 6
      src/webui/www/public/scripts/prop-trackers.js

6
src/webui/www/public/scripts/prop-files.js

@ -281,7 +281,7 @@ var loadTorrentFilesData = function() { @@ -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() { @@ -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() { @@ -334,7 +334,7 @@ var loadTorrentFilesData = function() {
else {
fTable.removeAllRows();
}
loadTorrentFilesDataTimer = loadTorrentFilesData.delay(1500);
loadTorrentFilesDataTimer = loadTorrentFilesData.delay(5000);
}
}).send();
}

6
src/webui/www/public/scripts/prop-general.js

@ -23,7 +23,7 @@ var loadTorrentData = function() { @@ -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() { @@ -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() { @@ -72,7 +72,7 @@ var loadTorrentData = function() {
else {
clearData();
}
loadTorrentDataTimer = loadTorrentData.delay(1500);
loadTorrentDataTimer = loadTorrentData.delay(5000);
}
}).send();
}

6
src/webui/www/public/scripts/prop-trackers.js

@ -61,7 +61,7 @@ var loadTrackersData = function() { @@ -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() { @@ -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() { @@ -94,7 +94,7 @@ var loadTrackersData = function() {
else {
tTable.removeAllRows();
}
loadTrackersDataTimer = loadTrackersData.delay(1500);
loadTrackersDataTimer = loadTrackersData.delay(10000);
}
}).send();
}

Loading…
Cancel
Save