Skip to content

Commit

Permalink
feat(系统状态): 添加NyxBot版本显示并优化硬盘信息展示
Browse files Browse the repository at this point in the history
  • Loading branch information
KingPrimes committed Dec 2, 2024
1 parent f0af1f5 commit 431ec2b
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions Template/html/systemInfo.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,24 +75,35 @@
<div class="sys-info">
<div th:text="'操作系统:'+${info.sysInfo.osName}"></div>
<div th:text="'系统架构:'+${info.sysInfo.osArch}"></div>
<div th:text="'NyxBot当前版本:'+${info.jarVersion}"></div>
</div>
</td>

</tr>
</table>
<table class="sys-file-info">
<tr>
<td th:colspan="${#arrays.length(info.sysFileInfo)}" style="font-size: 2em">硬盘</td>
<td th:colspan="${#lists.size(info.sysFileInfo)}" style="font-size: 2em">硬盘</td>
</tr>
<tr>
<td th:each="file:${info.sysFileInfo}">
<div th:text="'文件类型:'+${file.typeName}"></div>
<div th:text="'总大小:'+${file.total}"></div>
<div th:text="'剩余大小:'+${file.free}"></div>
<div th:text="'已经使用量:'+${file.used}"></div>
<!-- 使用一个外部迭代器来创建行 -->
<tr th:each="row, rowStat:${#numbers.sequence(0, #lists.size(info.sysFileInfo) - 1, 2)}">
<!-- 第一个td -->
<td>
<div th:text="'文件类型:'+${info.sysFileInfo[row].typeName}"></div>
<div th:text="'总大小:'+${info.sysFileInfo[row].total}"></div>
<div th:text="'剩余大小:'+${info.sysFileInfo[row].free}"></div>
<div th:text="'已经使用量:'+${info.sysFileInfo[row].used}"></div>
</td>
<!-- 第二个td,如果存在的话 -->
<td th:if="${row + 1 < #lists.size(info.sysFileInfo)}">
<div th:text="'文件类型:'+${info.sysFileInfo[row + 1].typeName}"></div>
<div th:text="'总大小:'+${info.sysFileInfo[row + 1].total}"></div>
<div th:text="'剩余大小:'+${info.sysFileInfo[row + 1].free}"></div>
<div th:text="'已经使用量:'+${info.sysFileInfo[row + 1].used}"></div>
</td>
</tr>
</table>

</div>
</body>
</html>

0 comments on commit 431ec2b

Please # to comment.