ddstats-server/views/pages/stats.njk
2021-11-05 21:05:02 +01:00

33 lines
1.1 KiB
Plaintext

{% extends "../templates/basic.njk" %}
{% import "../components/_utils.njk" as utils %}
{% set stats = data.stats %}
{% block body %}
<main class="flex-container">
<div class="stats">
<h1>
Current server status
</h1>
<table>
<tr>
<td>Uptime:</td>
<td>{{ utils.fancyTime(stats.uptimeMillis / 1000) }}</td>
</tr>
<tr>
<td>Uptime seconds:</td>
<td>{{ stats.uptimeSeconds }}</td>
</tr>
<tr>
<td>Database size:</td>
<td>{{ stats.db.size.kbytes }} KB || {{ stats.db.size.mbytes | round(2) }} MB || {{ stats.db.size.gbytes | round(2) }} GB</td>
</tr>
<tr>
<td>Database status:</td>
<td>{{ "Currently updating the database..." if stats.db.currentlyUpdating else "Last update was at " + stats.db.lastUpdate }}</td>
</tr>
</table>
</div>
</main>
{% endblock %}