From 9f5075e83d34ac1edd5dc5c49bb5f3ed8a219cd8 Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Tue, 3 Jun 2008 15:02:10 -0700 Subject: [PATCH] web: make nickname more visible in the welcome page, closes #361 --- src/allmydata/test/test_web.py | 1 + src/allmydata/web/root.py | 6 ++++-- src/allmydata/web/welcome.xhtml | 5 ++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/allmydata/test/test_web.py b/src/allmydata/test/test_web.py index 35379ed5..5ae18a51 100644 --- a/src/allmydata/test/test_web.py +++ b/src/allmydata/test/test_web.py @@ -27,6 +27,7 @@ class FakeIntroducerClient: class FakeClient(service.MultiService): nodeid = "fake_nodeid" + nickname = "fake_nickname" basedir = "fake_basedir" def get_versions(self): return {'allmydata': "fake", diff --git a/src/allmydata/web/root.py b/src/allmydata/web/root.py index 561bb988..f2aafd24 100644 --- a/src/allmydata/web/root.py +++ b/src/allmydata/web/root.py @@ -128,6 +128,8 @@ class Root(rend.Page): return str(allmydata) def data_my_nodeid(self, ctx, data): return idlib.nodeid_b2a(IClient(ctx).nodeid) + def data_my_nickname(self, ctx, data): + return IClient(ctx).nickname def render_services(self, ctx, data): ul = T.ul() @@ -198,8 +200,8 @@ class Root(rend.Page): def render_service_row(self, ctx, data): (service_name, nodeid, rsc) = data - ctx.fillSlots("peerid", "%s %s" % (idlib.nodeid_b2a(nodeid), - rsc.nickname)) + ctx.fillSlots("peerid", idlib.nodeid_b2a(nodeid)) + ctx.fillSlots("nickname", rsc.nickname) if rsc.rref: rhost = rsc.remote_host if nodeid == IClient(ctx).nodeid: diff --git a/src/allmydata/web/welcome.xhtml b/src/allmydata/web/welcome.xhtml index c930c206..d82498a8 100644 --- a/src/allmydata/web/welcome.xhtml +++ b/src/allmydata/web/welcome.xhtml @@ -13,6 +13,7 @@

Status of this Client

My nodeid:
+
My nickname:
My versions:
Tahoe code imported from:
Services Running:
@@ -45,7 +46,8 @@
- + + @@ -54,6 +56,7 @@ + -- 2.45.2
PeerID / NicknamePeerIDNickname Connected? Since Announced