Improve index table row switch order

Bit of a corner case, but if we ever encounter an index with a checksum
and version of 0 that resolves then this will ensure the statistics are
consistent between the overall cache and the index row.

Signed-off-by: Graham <gpe@openrs2.org>
Graham 3 years ago
parent c85e8ed873
commit 6f30aebb22
  1. 14
      archive/src/main/resources/org/openrs2/archive/templates/caches/show.html

@ -137,12 +137,6 @@
<code th:text="${entry.checksum}">0</code> <code th:text="${entry.checksum}">0</code>
</td> </td>
<div th:switch="true" th:remove="tag"> <div th:switch="true" th:remove="tag">
<div th:case="${entry.checksum == 0 && entry.version == 0}" th:remove="tag">
<td class="text-center text-muted" colspan="3">N/A</td>
</div>
<div th:case="${!index.resolved}" th:remove="tag">
<td class="text-center table-danger" colspan="3">Index missing</td>
</div>
<div th:case="${index.stats != null}" th:remove="tag"> <div th:case="${index.stats != null}" th:remove="tag">
<td th:classappend="${index.stats.allGroupsValid}? 'table-success' : 'table-warning'" class="text-right"> <td th:classappend="${index.stats.allGroupsValid}? 'table-success' : 'table-warning'" class="text-right">
<span th:text="${#numbers.formatInteger(index.stats.validGroups, 1, 'COMMA')} + '&nbsp;/&nbsp;' + ${#numbers.formatInteger(index.stats.groups, 1, 'COMMA')}"></span> <span th:text="${#numbers.formatInteger(index.stats.validGroups, 1, 'COMMA')} + '&nbsp;/&nbsp;' + ${#numbers.formatInteger(index.stats.groups, 1, 'COMMA')}"></span>
@ -157,9 +151,15 @@
<!--/*@thymesVar id="#byteunits" type="org.openrs2.archive.web.ByteUnits"*/--> <!--/*@thymesVar id="#byteunits" type="org.openrs2.archive.web.ByteUnits"*/-->
<td th:text="${#byteunits.format(index.stats.size)}" class="text-right">0 B</td> <td th:text="${#byteunits.format(index.stats.size)}" class="text-right">0 B</td>
</div> </div>
<div th:case="true" th:remove="tag"> <div th:case="${index.resolved}" th:remove="tag">
<td class="text-center" colspan="3">Calculating...</td> <td class="text-center" colspan="3">Calculating...</td>
</div> </div>
<div th:case="${entry.checksum != 0 || entry.version != 0}" th:remove="tag">
<td class="text-center table-danger" colspan="3">Index missing</td>
</div>
<div th:case="true" th:remove="tag">
<td class="text-center text-muted" colspan="3">N/A</td>
</div>
</div> </div>
</tr> </tr>
</tbody> </tbody>

Loading…
Cancel
Save