]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
webish: add storage-consumed estimate on welcome page
authorBrian Warner <warner@allmydata.com>
Wed, 6 Feb 2008 03:29:39 +0000 (20:29 -0700)
committerBrian Warner <warner@allmydata.com>
Wed, 6 Feb 2008 03:29:39 +0000 (20:29 -0700)
src/allmydata/web/welcome.xhtml
src/allmydata/webish.py

index 8bafa39f9bb4319f0748b6481a2c992252fa8f52..9967fc6c837d42c3fa7890b4d99a1b7e1424f9c4 100644 (file)
@@ -19,6 +19,9 @@ tool</a> may also be useful.</div>
 <div>My nodeid: <span n:render="string" n:data="my_nodeid" /></div>
 <div>My versions: <span n:render="string" n:data="version" /></div>
 <div>Tahoe code imported from: <span n:render="string" n:data="import_path" /></div>
+<div>My Storage Server: <span n:render="string" n:data="storage" /></div>
+
+<br />
 
 <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>
@@ -26,6 +29,8 @@ tool</a> may also be useful.</div>
 <div>Helper: <span n:render="string" n:data="helper_furl" /></div>
 <div>Connected to helper?: <span n:render="string" n:data="connected_to_helper" /></div>
 
+<br />
+
 <div>Known Storage Servers: <span n:render="string" n:data="known_storage_servers" /></div>
 <div>Connected Storage Servers: <span n:render="string" n:data="connected_storage_servers" /></div>
 
index d5de20ccfed0d0a9ff6b9d415c6fcd730bcbe9b8..bdfe2d61d75c53f70b1840e4a310a061de15fcb2 100644 (file)
@@ -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):