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 {
border-bottom: 1px solid #bbb; border-bottom: 1px solid #bbb;
} }
#error_div {
color: #f00;
font-weight: bold;
}
h4 { h4 {
font-size: 11px; font-size: 11px;
} }

2
src/webui/index.html

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

10
src/webui/scripts/client.js

@ -78,7 +78,13 @@ window.addEvent('domready', function(){
var request = new Request.JSON({ var request = new Request.JSON({
url: url, url: url,
method: 'get', 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){ if(events){
// Add new torrents or update them // Add new torrents or update them
unfinished_hashes = myTable.getRowIds(); unfinished_hashes = myTable.getRowIds();
@ -145,7 +151,7 @@ window.addEvent('domready', function(){
}); });
} }
waiting=false; waiting=false;
ajaxfn.delay(1000); ajaxfn.delay(2000);
} }
}).send(); }).send();
} }

Loading…
Cancel
Save