From: Brian Warner Date: Wed, 6 Feb 2008 03:29:39 +0000 (-0700) Subject: webish: add storage-consumed estimate on welcome page X-Git-Tag: allmydata-tahoe-0.8.0~140 X-Git-Url: https://git.rkrishnan.org/pf/content/en/footer/legal.html?a=commitdiff_plain;h=2f09b03bcc7ea01e0991d1bbf20befb7b865db73;p=tahoe-lafs%2Ftahoe-lafs.git webish: add storage-consumed estimate on welcome page --- diff --git a/src/allmydata/web/welcome.xhtml b/src/allmydata/web/welcome.xhtml index 8bafa39f..9967fc6c 100644 --- a/src/allmydata/web/welcome.xhtml +++ b/src/allmydata/web/welcome.xhtml @@ -19,6 +19,9 @@ tool may also be useful.
My nodeid:
My versions:
Tahoe code imported from:
+
My Storage Server:
+ +
Introducer:
Connected to introducer?:
@@ -26,6 +29,8 @@ tool may also be useful.
Helper:
Connected to helper?:
+
+
Known Storage Servers:
Connected Storage Servers:
diff --git a/src/allmydata/webish.py b/src/allmydata/webish.py index d5de20cc..bdfe2d61 100644 --- a/src/allmydata/webish.py +++ b/src/allmydata/webish.py @@ -1314,9 +1314,17 @@ class Root(rend.Page): return get_package_versions_string() def data_import_path(self, ctx, data): return str(allmydata) - def data_my_nodeid(self, ctx, data): return idlib.nodeid_b2a(IClient(ctx).nodeid) + def data_storage(self, ctx, data): + client = IClient(ctx) + try: + ss = client.getServiceNamed("storage") + except KeyError: + return "Not running" + allocated = ss.allocated_size() + return "about %d bytes allocated" % allocated + def data_introducer_furl(self, ctx, data): return IClient(ctx).introducer_furl def data_connected_to_introducer(self, ctx, data):