mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-01-12 07:52:38 +00:00
Use SlotsSequenceElement to render corrupt shares
This commit is contained in:
parent
46cb3b6bc3
commit
4e594b09bf
@ -560,22 +560,22 @@ class DeepCheckResultsRendererElement(Element, ResultsBase, ReloadMixin):
|
||||
return tag
|
||||
return ""
|
||||
|
||||
# TODO: Probably should use SlotsSequenceElement to render this.
|
||||
@renderer
|
||||
def corrupt_shares(self, req, tag):
|
||||
return self.monitor.get_status().get_corrupt_shares()
|
||||
shares = self.monitor.get_status().get_corrupt_shares()
|
||||
problems = []
|
||||
|
||||
@renderer
|
||||
def share_problem(self, req, tag):
|
||||
# def render_share_problem(self, req, tag):
|
||||
server, storage_index, sharenum = data
|
||||
nickname = server.get_nickname()
|
||||
tag.fillSlots("serverid", server.get_name())
|
||||
if nickname:
|
||||
tag.fillSlots("nickname", self._html(nickname))
|
||||
tag.fillSlots("si", self._render_si_link(ctx, storage_index))
|
||||
tag.fillSlots("shnum", str(sharenum))
|
||||
return tag
|
||||
for share in shares:
|
||||
server, storage_index, sharenum = share
|
||||
problem = {
|
||||
"serverid": server.get_name(),
|
||||
"nickname": self._html(nickname),
|
||||
"si": self._render_si_link(req, storage_index),
|
||||
"shnum": str(sharenum),
|
||||
}
|
||||
problems.append(problem)
|
||||
|
||||
return SlotsSequenceElement(tag, problems)
|
||||
|
||||
@renderer
|
||||
def return_to(self, req, tag):
|
||||
|
@ -43,13 +43,13 @@
|
||||
<h2>Corrupt Shares</h2>
|
||||
<p>If repair fails, these shares need to be manually inspected and removed.</p>
|
||||
<table t:render="corrupt_shares">
|
||||
<tr t:pattern="header">
|
||||
<tr t:render="header">
|
||||
<td>Server</td>
|
||||
<td>Server Nickname</td>
|
||||
<td>Storage Index</td>
|
||||
<td>Share Number</td>
|
||||
</tr>
|
||||
<tr t:pattern="item" t:render="share_problem">
|
||||
<tr t:render="item">
|
||||
<td><t:slot name="serverid"/></td>
|
||||
<td><t:slot name="nickname"/></td>
|
||||
<td><t:slot name="si"/></td>
|
||||
|
Loading…
Reference in New Issue
Block a user