mirror of
https://github.com/codex-storage/deluge.git
synced 2025-02-26 01:55:15 +00:00
don't return the username and password for the daemon
This commit is contained in:
parent
d9e67bcebe
commit
7fb09d922a
@ -43,10 +43,10 @@ Deluge.Connections = {
|
|||||||
|
|
||||||
Deluge.Connections.Store = new Ext.data.SimpleStore({
|
Deluge.Connections.Store = new Ext.data.SimpleStore({
|
||||||
fields: [
|
fields: [
|
||||||
{name: 'status', mapping: 5},
|
{name: 'status', mapping: 3},
|
||||||
{name: 'host', mapping: 1},
|
{name: 'host', mapping: 1},
|
||||||
{name: 'port', mapping: 2},
|
{name: 'port', mapping: 2},
|
||||||
{name: 'version', mapping: 6}
|
{name: 'version', mapping: 4}
|
||||||
],
|
],
|
||||||
id: 0
|
id: 0
|
||||||
});
|
});
|
||||||
|
@ -240,7 +240,9 @@ class JSON(resource.Resource):
|
|||||||
return self._exec_remote(method, params), request_id
|
return self._exec_remote(method, params), request_id
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
log.exception(e)
|
log.exception(e)
|
||||||
raise JSONException(e)
|
d = Deferred()
|
||||||
|
d.callback(None)
|
||||||
|
return d, request_id
|
||||||
|
|
||||||
def _on_rpc_request_finished(self, result, response, request):
|
def _on_rpc_request_finished(self, result, response, request):
|
||||||
"""
|
"""
|
||||||
@ -403,18 +405,18 @@ class JSON(resource.Resource):
|
|||||||
|
|
||||||
main_deferred = Deferred()
|
main_deferred = Deferred()
|
||||||
def run_check():
|
def run_check():
|
||||||
if all(map(lambda x: x[5] is not None, hosts.values())):
|
if all(map(lambda x: x[3] is not None, hosts.values())):
|
||||||
main_deferred.callback(hosts.values())
|
main_deferred.callback(hosts.values())
|
||||||
|
|
||||||
def on_connect(result, c, host_id):
|
def on_connect(result, c, host_id):
|
||||||
def on_info(info, c):
|
def on_info(info, c):
|
||||||
hosts[host_id][5] = _("Online")
|
hosts[host_id][3] = _("Online")
|
||||||
hosts[host_id][6] = info
|
hosts[host_id][4] = info
|
||||||
c.disconnect()
|
c.disconnect()
|
||||||
run_check()
|
run_check()
|
||||||
|
|
||||||
def on_info_fail(reason):
|
def on_info_fail(reason):
|
||||||
hosts[host_id][5] = _("Offline")
|
hosts[host_id][3] = _("Offline")
|
||||||
run_check()
|
run_check()
|
||||||
|
|
||||||
d = c.daemon.info()
|
d = c.daemon.info()
|
||||||
@ -423,17 +425,16 @@ class JSON(resource.Resource):
|
|||||||
|
|
||||||
def on_connect_failed(reason, host_id):
|
def on_connect_failed(reason, host_id):
|
||||||
log.exception(reason)
|
log.exception(reason)
|
||||||
hosts[host_id][5] = _("Offline")
|
hosts[host_id][3] = _("Offline")
|
||||||
run_check()
|
run_check()
|
||||||
|
|
||||||
for host in hosts.values():
|
for host in hosts.values():
|
||||||
host_id, host, port, user, password = host[0:5]
|
host_id, host, port, user, password = host[0:5]
|
||||||
hosts[host_id].append(None)
|
hosts[host_id][3:4] = (None, None)
|
||||||
hosts[host_id].append(None)
|
|
||||||
|
|
||||||
if client.connected() and (host, port, user) == client.connection_info():
|
if client.connected() and (host, port, user) == client.connection_info():
|
||||||
def on_info(info):
|
def on_info(info):
|
||||||
hosts[host_id][6] = info
|
hosts[host_id][4] = info
|
||||||
run_check()
|
run_check()
|
||||||
host[5] = _("Connected")
|
host[5] = _("Connected")
|
||||||
client.daemon.info().addCallback(on_info)
|
client.daemon.info().addCallback(on_info)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user