webish: display program/library versions on the welcome page

This commit is contained in:
Brian Warner 2007-06-11 10:51:11 -07:00
parent f619f9ab30
commit 48a8c32ed7
3 changed files with 12 additions and 0 deletions

View File

@ -66,6 +66,12 @@ class Node(service.MultiService):
% (allmydata.__version__, foolscap.__version__, % (allmydata.__version__, foolscap.__version__,
twisted.__version__, zfec.__version__,)) twisted.__version__, zfec.__version__,))
def get_versions(self):
return {'allmydata': allmydata.__version__,
'foolscap': foolscap.__version__,
'twisted': twisted.__version__,
'zfec': zfec.__version__,
}
def startService(self): def startService(self):
# note: this class can only be started and stopped once. # note: this class can only be started and stopped once.

View File

@ -15,6 +15,7 @@
<h2>Grid Status</h2> <h2>Grid Status</h2>
<div>My nodeid: <span n:render="string" n:data="my_nodeid" /></div> <div>My nodeid: <span n:render="string" n:data="my_nodeid" /></div>
<div>My version: <span n:render="string" n:data="version" /></div>
<div>Introducer: <span n:render="string" n:data="introducer_furl" /></div> <div>Introducer: <span n:render="string" n:data="introducer_furl" /></div>
<div>Connected to introducer?: <span n:render="string" n:data="connected_to_introducer" /></div> <div>Connected to introducer?: <span n:render="string" n:data="connected_to_introducer" /></div>
<div>Connected to vdrive?: <span n:render="string" n:data="connected_to_vdrive" /></div> <div>Connected to vdrive?: <span n:render="string" n:data="connected_to_vdrive" /></div>

View File

@ -28,6 +28,11 @@ class Welcome(rend.Page):
addSlash = True addSlash = True
docFactory = getxmlfile("welcome.xhtml") docFactory = getxmlfile("welcome.xhtml")
def data_version(self, ctx, data):
v = IClient(ctx).get_versions()
return "tahoe: %s, zfec: %s, foolscap: %s, twisted: %s" % \
(v['allmydata'], v['zfec'], v['foolscap'], v['twisted'])
def data_my_nodeid(self, ctx, data): def data_my_nodeid(self, ctx, data):
return idlib.b2a(IClient(ctx).nodeid) return idlib.b2a(IClient(ctx).nodeid)
def data_introducer_furl(self, ctx, data): def data_introducer_furl(self, ctx, data):