Browse Source

- Add notification in WebUI when qBittorrent is unreachable

adaptive-webui-19844
Christophe Dumez 16 years ago
parent
commit
112bcd7255
  1. 5
      src/webui/css/style.css
  2. 2
      src/webui/index.html
  3. 10
      src/webui/scripts/client.js

5
src/webui/css/style.css

@ -44,6 +44,11 @@ h2 { @@ -44,6 +44,11 @@ h2 {
border-bottom: 1px solid #bbb;
}
#error_div {
color: #f00;
font-weight: bold;
}
h4 {
font-size: 11px;
}

2
src/webui/index.html

@ -64,7 +64,7 @@ @@ -64,7 +64,7 @@
<a id="pauseAllButton"><img class="mochaToolButton" title="Pause All" src="images/skin/pause_all.png"/></a>
</div>
</div>
<div id="pageWrapper">
<div id="pageWrapper"> <span id="error_div"></span>
<div id="myTabs" class="toolbarTabs">
<ul class="mootabs_title">
<li title="Tab1"><a>Downloads</a></li>

10
src/webui/scripts/client.js

@ -78,7 +78,13 @@ window.addEvent('domready', function(){ @@ -78,7 +78,13 @@ window.addEvent('domready', function(){
var request = new Request.JSON({
url: url,
method: 'get',
onComplete: function(events) {
onFailure: function() {
$('error_div').set('html', 'qBittorrent client is not reachable');
waiting=false;
ajaxfn.delay(2000);
},
onSuccess: function(events) {
$('error_div').set('html', '');
if(events){
// Add new torrents or update them
unfinished_hashes = myTable.getRowIds();
@ -145,7 +151,7 @@ window.addEvent('domready', function(){ @@ -145,7 +151,7 @@ window.addEvent('domready', function(){
});
}
waiting=false;
ajaxfn.delay(1000);
ajaxfn.delay(2000);
}
}).send();
}

Loading…
Cancel
Save