diff --git a/deluge/ui/webui/webui_plugin/render.py b/deluge/ui/webui/webui_plugin/render.py index f6fca2f94..c04ee42fc 100644 --- a/deluge/ui/webui/webui_plugin/render.py +++ b/deluge/ui/webui/webui_plugin/render.py @@ -115,6 +115,11 @@ def altrow(reset = False): irow = irow % 2 return "altrow%s" % irow +def deluge_int(val): + if val == -1 : + return _("Unlimited") + return val + template.Template.globals.update({ 'sort_head': template_sort_head, 'part_stats':template_part_stats, @@ -123,6 +128,7 @@ template.Template.globals.update({ '_': _ , #gettext/translations 'str': str, #because % in templetor is broken. 'int':int, + 'deluge_int':deluge_int, 'sorted': sorted, 'altrow':altrow, 'get_config': get_config, diff --git a/deluge/ui/webui/webui_plugin/static/images/tango/connections.png b/deluge/ui/webui/webui_plugin/static/images/tango/connections.png new file mode 100644 index 000000000..b57c65c86 Binary files /dev/null and b/deluge/ui/webui/webui_plugin/static/images/tango/connections.png differ diff --git a/deluge/ui/webui/webui_plugin/templates/advanced/part_stats.html b/deluge/ui/webui/webui_plugin/templates/advanced/part_stats.html index 0a11c0bf4..dd582d8ff 100644 --- a/deluge/ui/webui/webui_plugin/templates/advanced/part_stats.html +++ b/deluge/ui/webui/webui_plugin/templates/advanced/part_stats.html @@ -19,16 +19,17 @@ $:render.part_button('POST', '/logout', _('Logout'), 'tango/system-log-out.png')
$stats.num_connections ($deluge_int(stats.max_num_connections))
+
+
$stats.download_rate ($deluge_int(stats.max_download))
+
+
$stats.upload_rate ($deluge_int(stats.max_upload))
+
+DHT: $stats.dht_nodes
+
+$:render.part_button('GET', '/config/', _('Settings'), 'tango/preferences-system.png')
diff --git a/deluge/ui/webui/webui_plugin/utils.py b/deluge/ui/webui/webui_plugin/utils.py
index e84e0d2ab..07d3f9d8b 100644
--- a/deluge/ui/webui/webui_plugin/utils.py
+++ b/deluge/ui/webui/webui_plugin/utils.py
@@ -122,6 +122,8 @@ def get_stats():
ws.async_proxy.get_num_connections(dict_cb("num_connections",stats))
ws.async_proxy.get_config_value(dict_cb('max_num_connections',stats)
,"max_connections_global")
+ ws.async_proxy.get_dht_nodes(dict_cb('dht_nodes',stats))
+
ws.async_proxy.force_call(block=True)