From b2d4374976b09ac009f2cabaad7a8cb15046e945 Mon Sep 17 00:00:00 2001 From: David Stainton Date: Sat, 14 Jan 2017 01:14:58 +0000 Subject: [PATCH] Add more server info to welcome json page --- src/allmydata/web/root.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/allmydata/web/root.py b/src/allmydata/web/root.py index 0708bab21..2c1b28e2c 100644 --- a/src/allmydata/web/root.py +++ b/src/allmydata/web/root.py @@ -198,17 +198,20 @@ class Root(rend.Page): inevow.IRequest(ctx).setHeader("content-type", "text/plain") intro_summaries = [s.summary for s in self.client.introducer_connection_statuses()] sb = self.client.get_storage_broker() - storage_summaries = [] - for s in sb.get_connected_servers(): - status = s.get_connection_status() - storage_summaries.append(status.summary) + servers = {} + for server in sb.get_known_servers(): + server_id = server.get_serverid() + servers[server_id] = {} + servers[server_id]["connection_status"] = server.get_connection_status().summary + servers[server_id]["available_space"] = server.get_available_space() + servers[server_id]["nickname"] = server.get_nickname() + servers[server_id]["version"] = server.get_version()["application-version"] + servers[server_id]["last_received_data"] = server.rref.getDataLastReceivedAt() data = { "introducers": { "statuses": intro_summaries, }, - "servers": { - "statuses": storage_summaries, - }, + "servers": servers } return simplejson.dumps(data, indent=1) + "\n"