Correct usage of SlotsSequenceElement

This commit is contained in:
Sajith Sasidharan 2020-07-15 17:07:54 -04:00
parent 8fedbd52c2
commit a13ec344b9
2 changed files with 17 additions and 9 deletions

View File

@ -748,7 +748,7 @@ class DeepCheckAndRepairResultsRendererElement(Element, ResultsBase, ReloadMixin
cr = r.get_pre_repair_results()
if not cr.is_healthy():
problem = self._join_pathstring(path), ": ", self._html(cr.get_summary())
problems.append(problem)
problems.append({"problem": problem})
return SlotsSequenceElement(tag, problems)
@ -770,7 +770,7 @@ class DeepCheckAndRepairResultsRendererElement(Element, ResultsBase, ReloadMixin
cr = r.get_post_repair_results()
if not cr.is_healthy():
problem = self._join_pathstring(path), ": ", self._html(cr.get_summary())
problems.append(problem)
problems.append({"problem": problem})
return SlotsSequenceElement(tag, problems)
@ -784,7 +784,7 @@ class DeepCheckAndRepairResultsRendererElement(Element, ResultsBase, ReloadMixin
def servers_with_corrupt_shares(self, req, tag):
# TODO: this was originally unimplemented before porting to
# twisted.web.template; leaving it as such.
corrupt = []
corrupt = [{"share":"unimplemented"}]
return SlotsSequenceElement(tag, corrupt)
@renderer
@ -797,7 +797,7 @@ class DeepCheckAndRepairResultsRendererElement(Element, ResultsBase, ReloadMixin
def post_repair_corrupt_shares(self, req, tag):
# TODO: this was not implemented before porting to
# twisted.web.template; leaving it as such.
corrupt = []
corrupt = [{"share":"unimplemented"}]
return SlotsSequenceElement(tag, corrupt)
@renderer

View File

@ -35,7 +35,9 @@
<h2>Files/Directories That Had Problems:</h2>
<ul t:render="pre_repair_problems">
<li t:render="item"/>
<li t:render="item">
<t:slot name="problem" />
</li>
<li t:render="empty">None</li>
</ul>
</div>
@ -44,7 +46,9 @@
<div t:render="post_repair_problems_p">
<h2>Files/Directories That Still Have Problems:</h2>
<ul t:render="post_repair_problems">
<li t:render="item"/>
<li t:render="item">
<t:slot name="problem" />
</li>
<li t:render="empty">None</li>
</ul>
</div>
@ -52,7 +56,9 @@
<div t:render="servers_with_corrupt_shares_p">
<h2>Servers on which corrupt shares were found</h2>
<ul t:render="servers_with_corrupt_shares">
<li t:render="item"/>
<li t:render="item">
<t:slot name="share" />
</li>
<li t:render="empty">None</li>
</ul>
</div>
@ -61,7 +67,9 @@
<h2>Remaining Corrupt Shares</h2>
<p>These shares need to be manually inspected and removed.</p>
<ul t:render="post_repair_corrupt_shares">
<li t:render="item"/>
<li t:render="item">
<t:slot name="share" />
</li>
<li t:render="empty">None</li>
</ul>
</div>
@ -70,7 +78,7 @@
<div>
<table t:render="all_objects">
<tr t:pattern="header">
<tr t:render="header">
<th>Relative Path</th>
<th>Healthy Pre-Repair</th>
<th>Recoverable Pre-Repair</th>