diff --git a/plugins/Stats/StatsPlugin.py b/plugins/Stats/StatsPlugin.py index 4b815e6f..333630b2 100644 --- a/plugins/Stats/StatsPlugin.py +++ b/plugins/Stats/StatsPlugin.py @@ -9,7 +9,7 @@ from Config import config @PluginManager.registerTo("UiRequest") class UiRequestPlugin(object): - def formatTableRow(self, row): + def formatTableRow(self, row, class_name=""): back = [] for format, val in row: if val is None: @@ -22,7 +22,7 @@ class UiRequestPlugin(object): else: formatted = format % val back.append("
id | proto | type | ip | open | crypt | ping | " + yield "
---|
id | type | ip | open | crypt | ping | " yield "buff | bad | idle | open | delay | cpu | out | in | last sent | " - yield "waiting | version | sites | wait | version | sites | " for connection in main.file_server.connections: if "cipher" in dir(connection.sock): cipher = connection.sock.cipher()[0] @@ -101,7 +102,6 @@ class UiRequestPlugin(object): cipher = connection.crypt yield self.formatTableRow([ ("%3d", connection.id), - ("%s", connection.protocol), ("%s", connection.type), ("%s:%s", (connection.ip, connection.port)), ("%s", connection.handshake.get("port_opened")), @@ -112,7 +112,7 @@ class UiRequestPlugin(object): ("since", max(connection.last_send_time, connection.last_recv_time)), ("since", connection.start_time), ("%.3f", connection.last_sent_time - connection.last_send_time), - ("%.3fs", connection.cpu_time), + ("%.3f", connection.cpu_time), ("%.0fkB", connection.bytes_sent / 1024), ("%.0fkB", connection.bytes_recv / 1024), ("%s", connection.last_cmd), @@ -139,8 +139,8 @@ class UiRequestPlugin(object): for site in sorted(self.server.sites.values(), lambda a, b: cmp(a.address,b.address)): yield self.formatTableRow([ ( - """%s""", - (site.settings["serving"], site.address, site.address) + """%s""", + (site.address, site.address) ), ("%s", [peer.connection.id for peer in site.peers.values() if peer.connection and peer.connection.connected]), ("%s/%s/%s", ( @@ -154,7 +154,7 @@ class UiRequestPlugin(object): )), ("%.0fkB", site.settings.get("bytes_sent", 0) / 1024), ("%.0fkB", site.settings.get("bytes_recv", 0) / 1024), - ]) + ], "serving-%s" % site.settings["serving"]) yield "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|