Implement daily stats

This commit is contained in:
Pijus Kamandulis
2025-06-23 21:35:16 +03:00
parent 4ddd9abd2e
commit b89a1a2a7e
8 changed files with 318 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
{{ define "title" }}Daily Stats{{ end }} {{ define "header" }}📊 Pool Daily
Stats{{ end }} {{ define "content" }}
<table>
<thead>
<tr>
<th>Date (UTC)</th>
<th>Share Count</th>
<th>Top Share Diff</th>
<th>Pool Hashrate</th>
</tr>
</thead>
<tbody>
{{ range .DailyStats }}
<tr>
<td>{{ .Date }}</td>
<td>{{ .ShareCount }}</td>
<td>{{ humanDiff .TopShare.SDiff }}</td>
<td>{{ formatHashrate .PoolHashrate }}</td>
</tr>
{{ else }}
<tr>
<td colspan="4">No stats found for this date range.</td>
</tr>
{{ end }}
</tbody>
</table>
<div>
{{ if .PrevPageAvailable }}
<a class="page-link" href="?start={{ .PrevPageStart }}&end={{ .PrevPageEnd }}"
>&laquo; Prev</a
>
{{ end }}
<a class="page-link current" href="?start={{ .Start }}&end={{ .End }}"
>{{ .Start }} - {{ .End }}</a
>
{{ if .NextPageAvailable }}
<a class="page-link" href="?start={{ .NextPageStart }}&end={{ .NextPageEnd }}"
>Next &raquo;</a
>
{{ end }}
</div>
{{ end }} {{ template "layout" . }}

View File

@@ -63,5 +63,6 @@
<li><a href="/">Home</a></li>
<li><a href="/shares">View Shares</a></li>
<li><a href="/top-shares">Top Shares</a></li>
<li><a href="/daily-stats">Daily Stats</a></li>
</ul>
{{ end }}