fix displaying the protocol speed in the webui
also update the update_ui method in json_api so it gets the status more like how the gtkui does
This commit is contained in:
parent
d27d7c6733
commit
d6e18f7729
|
@ -120,11 +120,11 @@
|
||||||
|
|
||||||
updateStat('traffic', {
|
updateStat('traffic', {
|
||||||
value: {
|
value: {
|
||||||
value: stats.download_rate - stats.payload_download_rate,
|
value: stats.download_protocol_rate,
|
||||||
formatter: Deluge.Formatters.speed
|
formatter: Deluge.Formatters.speed
|
||||||
},
|
},
|
||||||
limit: {
|
limit: {
|
||||||
value: stats.upload_rate - stats.payload_upload_rate,
|
value: stats.upload_protocol_rate,
|
||||||
formatter: Deluge.Formatters.speed
|
formatter: Deluge.Formatters.speed
|
||||||
},
|
},
|
||||||
format: '{0}/{1}'
|
format: '{0}/{1}'
|
||||||
|
|
|
@ -473,11 +473,20 @@ class WebApi(JSONComponent):
|
||||||
def got_connections(connections):
|
def got_connections(connections):
|
||||||
ui_info["stats"]["num_connections"] = connections
|
ui_info["stats"]["num_connections"] = connections
|
||||||
|
|
||||||
|
def got_dht_nodes(nodes):
|
||||||
|
ui_info["stats"]["dht_nodes"] = nodes
|
||||||
|
|
||||||
def got_stats(stats):
|
def got_stats(stats):
|
||||||
ui_info["stats"].update(stats)
|
ui_info["stats"]["upload_rate"] = stats["payload_upload_rate"]
|
||||||
|
ui_info["stats"]["download_rate"] = stats["payload_download_rate"]
|
||||||
|
ui_info["stats"]["download_protocol_rate"] = stats["download_rate"] - stats["payload_download_rate"]
|
||||||
|
ui_info["stats"]["upload_protocol_rate"] = stats["upload_rate"] - stats["payload_upload_rate"]
|
||||||
|
|
||||||
def got_filters(filters):
|
def got_filters(filters):
|
||||||
ui_info["filters"] = filters
|
ui_info["filters"] = filters
|
||||||
|
|
||||||
|
def got_health(health):
|
||||||
|
ui_info["stats"]["has_incoming_connections"] = health
|
||||||
|
|
||||||
def got_torrents(torrents):
|
def got_torrents(torrents):
|
||||||
ui_info["torrents"] = torrents
|
ui_info["torrents"] = torrents
|
||||||
|
@ -491,14 +500,24 @@ class WebApi(JSONComponent):
|
||||||
d2 = client.core.get_filter_tree()
|
d2 = client.core.get_filter_tree()
|
||||||
d2.addCallback(got_filters)
|
d2.addCallback(got_filters)
|
||||||
|
|
||||||
d3 = client.core.get_session_status(["payload_download_rate", "payload_upload_rate",
|
d3 = client.core.get_session_status([
|
||||||
"dht_nodes", "has_incoming_connections", "download_rate", "upload_rate"])
|
"payload_download_rate",
|
||||||
|
"payload_upload_rate",
|
||||||
|
"download_rate",
|
||||||
|
"upload_rate"
|
||||||
|
])
|
||||||
d3.addCallback(got_stats)
|
d3.addCallback(got_stats)
|
||||||
|
|
||||||
d4 = client.core.get_num_connections()
|
d4 = client.core.get_num_connections()
|
||||||
d4.addCallback(got_connections)
|
d4.addCallback(got_connections)
|
||||||
|
|
||||||
|
d5 = client.core.get_dht_nodes()
|
||||||
|
d5.addCallback(got_dht_nodes)
|
||||||
|
|
||||||
|
d6 = client.core.get_health()
|
||||||
|
d6.addCallback(got_health)
|
||||||
|
|
||||||
dl = DeferredList([d1, d2, d3, d4], consumeErrors=True)
|
dl = DeferredList([d1, d2, d3, d4, d5, d6], consumeErrors=True)
|
||||||
dl.addCallback(on_complete)
|
dl.addCallback(on_complete)
|
||||||
return d
|
return d
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue