From: Kevin Reid Date: Tue, 26 May 2009 23:25:45 +0000 (-0700) Subject: Modify markup of Tahoe web pages to be more amenable to styling; some minor changes... X-Git-Tag: trac-3900~16 X-Git-Url: https://git.rkrishnan.org/pf/content/en/footer/%3C?a=commitdiff_plain;h=23441389a572f6a37350b8eea81651fbb619f658;p=tahoe-lafs%2Ftahoe-lafs.git Modify markup of Tahoe web pages to be more amenable to styling; some minor changes of wording. --- diff --git a/src/allmydata/test/test_checker.py b/src/allmydata/test/test_checker.py index 8dc24489..a63db06b 100644 --- a/src/allmydata/test/test_checker.py +++ b/src/allmydata/test/test_checker.py @@ -103,7 +103,7 @@ class WebResultsRendering(unittest.TestCase, WebRenderingMixin): s = self.remove_tags(html) self.failUnlessIn("File Check Results for SI=2k6avp", s) # abbreviated self.failUnlessIn("Not Recoverable! : rather dead", s) - self.failUnlessIn("Corrupt shares: sh#2 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa (peer-0)", s) + self.failUnlessIn("Corrupt shares: Share ID Nickname Node ID sh#2 peer-0 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", s) html = self.render2(w) s = self.remove_tags(html) diff --git a/src/allmydata/test/test_system.py b/src/allmydata/test/test_system.py index c1c9b08a..964af2e3 100644 --- a/src/allmydata/test/test_system.py +++ b/src/allmydata/test/test_system.py @@ -1101,12 +1101,13 @@ class SystemTest(SystemTestMixin, unittest.TestCase): public = "uri/" + self._root_directory_uri d = getPage(base) def _got_welcome(page): - expected = "Connected Storage Servers: %d" % (self.numclients) + # XXX This test is oversensitive to formatting + expected = "Connected to %d\n of %d known storage servers:" % (self.numclients, self.numclients) self.failUnless(expected in page, "I didn't see the right 'connected storage servers'" " message in: %s" % page ) - expected = "My nodeid: %s" % (b32encode(self.clients[0].nodeid).lower(),) + expected = "My nodeid: %s" % (b32encode(self.clients[0].nodeid).lower(),) self.failUnless(expected in page, "I didn't see the right 'My nodeid' message " "in: %s" % page) diff --git a/src/allmydata/test/test_web.py b/src/allmydata/test/test_web.py index b99e26ab..78c3e62d 100644 --- a/src/allmydata/test/test_web.py +++ b/src/allmydata/test/test_web.py @@ -879,10 +879,10 @@ class Web(WebMixin, WebErrorMixin, testutil.StallMixin, unittest.TestCase): # the FILE reference points to a URI, but it should end in bar.txt bar_url = ("%s/file/%s/@@named=/bar.txt" % (ROOT, urllib.quote(self._bar_txt_uri))) - get_bar = "".join([r'', + get_bar = "".join([r'FILE', + r'\s+', r'bar.txt' % bar_url, r'', - r'\s+FILE', r'\s+%d' % len(self.BAR_CONTENTS), ]) self.failUnless(re.search(get_bar, res), res) @@ -904,8 +904,8 @@ class Web(WebMixin, WebErrorMixin, testutil.StallMixin, unittest.TestCase): # the DIR reference just points to a URI sub_url = ("%s/uri/%s/" % (ROOT, urllib.quote(self._sub_uri))) - get_sub = ((r'sub' % sub_url) - + r'\s+DIR') + get_sub = ((r'DIR') + +r'\s+sub' % sub_url) self.failUnless(re.search(get_sub, res), res) d.addCallback(_check) @@ -921,8 +921,8 @@ class Web(WebMixin, WebErrorMixin, testutil.StallMixin, unittest.TestCase): d.addCallback(lambda res: self.GET(self.public_url, followRedirect=True)) def _check3(res): - self.failUnless(re.search(r'reedownlee' - '\s+DIR-RO', res)) + self.failUnless(re.search('DIR-RO' + r'\s+reedownlee', res), res) d.addCallback(_check3) # and an empty directory @@ -1895,7 +1895,7 @@ class Web(WebMixin, WebErrorMixin, testutil.StallMixin, unittest.TestCase): # Fetch the welcome page. d = self.GET("/") def _after_get_welcome_page(res): - MKDIR_BUTTON_RE=re.compile('
', re.I) + MKDIR_BUTTON_RE=re.compile('', re.I) mo = MKDIR_BUTTON_RE.search(res) formaction = mo.group(1) formt = mo.group(2) diff --git a/src/allmydata/web/check_results.py b/src/allmydata/web/check_results.py index 6eaf4be4..03c689c2 100644 --- a/src/allmydata/web/check_results.py +++ b/src/allmydata/web/check_results.py @@ -97,10 +97,13 @@ class ResultsBase: for (serverid, si, shnum) in data["list-corrupt-shares"]: nickname = c.get_nickname_for_peerid(serverid) badsharemap.append(T.tr[T.td["sh#%d" % shnum], - T.td[T.tt[base32.b2a(serverid)], - " (", nickname, ")"], + T.td[T.div(class_="nickname")[nickname], + T.div(class_="nodeid")[T.tt[base32.b2a(serverid)]]], ]) - add("Corrupt shares", T.table(border="1")[badsharemap]) + add("Corrupt shares", T.table()[ + T.tr[T.th["Share ID"], + T.th(class_="nickname-and-peerid")[T.div["Nickname"], T.div(class_="nodeid")["Node ID"]]], + badsharemap]) else: add("Corrupt shares", "none") @@ -122,11 +125,12 @@ class ResultsBase: shareid_s = shareid nickname = c.get_nickname_for_peerid(serverid) sharemap.append(T.tr[T.td[shareid_s], - T.td[T.tt[base32.b2a(serverid)], - " (", nickname, ")"], + T.td[T.div(class_="nickname")[nickname], + T.div(class_="nodeid")[T.tt[base32.b2a(serverid)]]] ]) add("Good Shares (sorted in share order)", - T.table(border="1")[sharemap]) + T.table()[T.tr[T.th["Share ID"], T.th(class_="nickname-and-peerid")[T.div["Nickname"], T.div(class_="nodeid")["Node ID"]]], + sharemap]) add("Recoverable Versions", data["count-recoverable-versions"]) @@ -145,14 +149,16 @@ class ResultsBase: shareids = servers.get(serverid, []) shareids.reverse() shareids_s = [ T.tt[shareid, " "] for shareid in sorted(shareids) ] - servermap.append(T.tr[T.td[T.tt[base32.b2a(serverid)], - " (", nickname, ")"], - T.td[shareids_s] ]) + servermap.append(T.tr[T.td[T.div(class_="nickname")[nickname], + T.div(class_="nodeid")[T.tt[base32.b2a(serverid)]]], + T.td[shareids_s], + ]) num_shares_left -= len(shareids) if not num_shares_left: break add("Share Balancing (servers in permuted order)", - T.table(border="1")[servermap]) + T.table()[T.tr[T.th(class_="nickname-and-peerid")[T.div["Nickname"], T.div(class_="nodeid")["Node ID"]], T.th["Share IDs"]], + servermap]) return T.ul[r] diff --git a/src/allmydata/web/deep-check-and-repair-results.xhtml b/src/allmydata/web/deep-check-and-repair-results.xhtml index 3724d169..b440de7e 100644 --- a/src/allmydata/web/deep-check-and-repair-results.xhtml +++ b/src/allmydata/web/deep-check-and-repair-results.xhtml @@ -69,7 +69,7 @@
- +
diff --git a/src/allmydata/web/deep-check-results.xhtml b/src/allmydata/web/deep-check-results.xhtml index 8c4fb931..daf1943b 100644 --- a/src/allmydata/web/deep-check-results.xhtml +++ b/src/allmydata/web/deep-check-results.xhtml @@ -43,7 +43,7 @@

Corrupt Shares

If repair fails, these shares need to be manually inspected and removed.

-
Relative Path Healthy Pre-Repair
+
@@ -63,7 +63,7 @@

All Results

-
Server Server Nickname
+
diff --git a/src/allmydata/web/directory.py b/src/allmydata/web/directory.py index ac0b09e8..5c83b51b 100644 --- a/src/allmydata/web/directory.py +++ b/src/allmydata/web/directory.py @@ -533,7 +533,7 @@ class DirectoryAsHTML(rend.Page): def render_header(self, ctx, data): si_s = abbreviated_dirnode(self.node) - header = ["Directory SI=%s" % si_s] + header = ["Directory SI=", T.span(class_="data-chars")[si_s]] if self.node.is_readonly(): header.append(" (read-only)") return ctx.tag[header] diff --git a/src/allmydata/web/directory.xhtml b/src/allmydata/web/directory.xhtml index e167aeba..6dd6a57b 100644 --- a/src/allmydata/web/directory.xhtml +++ b/src/allmydata/web/directory.xhtml @@ -5,44 +5,46 @@ -

+

-
Refresh this view
-
+
Relative Path Healthy
- - - - - - - - - - - - - - - - - - - - - -
FilenameTypeSizeTimes
directory is empty
+ + + + + + + + + + + + + + + + + + + + + + +
TypeFilenameSizeTimes
This directory is empty.
+