From: Brian Warner Date: Fri, 27 Feb 2009 02:58:38 +0000 (-0700) Subject: web: improve layout of storage status with a table X-Git-Url: https://git.rkrishnan.org/pf/content?a=commitdiff_plain;h=8251572e016b5f9049f845891a82c6a93589ea9a;p=tahoe-lafs%2Ftahoe-lafs.git web: improve layout of storage status with a table --- diff --git a/src/allmydata/test/test_storage.py b/src/allmydata/test/test_storage.py index 770c6fd1..1d4b846e 100644 --- a/src/allmydata/test/test_storage.py +++ b/src/allmydata/test/test_storage.py @@ -1530,7 +1530,9 @@ class WebStatus(unittest.TestCase, pollmixin.PollMixin): def test_util(self): w = StorageStatus(None) self.failUnlessEqual(w.render_space(None, None), "?") - self.failUnlessEqual(w.render_space(None, 10e6), "10.00 MB (10000000)") + self.failUnlessEqual(w.render_space(None, 10e6), "10000000") + self.failUnlessEqual(w.render_abbrev_space(None, None), "?") + self.failUnlessEqual(w.render_abbrev_space(None, 10e6), "10.00 MB") self.failUnlessEqual(remove_prefix("foo.bar", "foo."), "bar") self.failUnlessEqual(remove_prefix("foo.bar", "baz."), None) diff --git a/src/allmydata/web/storage.py b/src/allmydata/web/storage.py index c0ad5cbd..60774da1 100644 --- a/src/allmydata/web/storage.py +++ b/src/allmydata/web/storage.py @@ -25,10 +25,15 @@ class StorageStatus(rend.Page): def render_bool(self, ctx, data): return {True: "Yes", False: "No"}[bool(data)] + def render_abbrev_space(self, ctx, size): + if size is None: + return "?" + return abbreviate_space(size) + def render_space(self, ctx, size): if size is None: return "?" - return "%s (%d)" % (abbreviate_space(size), size) + return "%d" % size def data_stats(self, ctx, data): # FYI: 'data' appears to be self, rather than the StorageServer diff --git a/src/allmydata/web/storage_status.xhtml b/src/allmydata/web/storage_status.xhtml index 379b23cd..2e570aaf 100644 --- a/src/allmydata/web/storage_status.xhtml +++ b/src/allmydata/web/storage_status.xhtml @@ -12,23 +12,45 @@ - + + + - + + + + + - + + + + - + + + + - + + + + + - + + +
Total disk space:
() +
Disk space used:-
- () +
- ======
====== + +
Disk space free (root): - [see 1]
()[see 1]
Disk space free (non-root): - [see 2]
()[see 2]
Reserved space:-
- () +
- ======
====== + +
Space Available to Tahoe:
() +