pool-stats/templates/daily_stats.html
2025-07-04 19:04:24 +03:00

99 lines
2.3 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{{ define "title" }}Daily Stats{{ end }} {{ define "header" }}📊 Pool Daily
Stats{{ end }} {{ define "content" }}
<style>
.worker-rows {
display: none;
}
.expand-btn {
cursor: pointer;
}
.worker-table {
width: 100%;
}
.worker-table th,
.worker-table td {
font-size: 0.9em;
}
</style>
<table>
<thead>
<tr>
<th></th>
<th>Date (UTC)</th>
<th>Share Count</th>
<th>Top Share Diff</th>
<th>Pool Hashrate</th>
</tr>
</thead>
<tbody>
{{ range $i, $ds := .DailyStats }}
<tr>
<td>
<span class="expand-btn" onclick="toggleWorkers({{ $i }})"></span>
</td>
<td>{{ $ds.Date }}</td>
<td>{{ $ds.ShareCount }}</td>
<td>{{ humanDiff $ds.TopShare.SDiff }}</td>
<td>{{ formatHashrate $ds.PoolHashrate }}</td>
</tr>
<tr class="worker-rows" id="workers-{{ $i }}">
<td colspan="5">
<table class="worker-table">
<thead>
<tr>
<th>Shares</th>
<th>Top Share Diff</th>
<th>Hashrate</th>
</tr>
</thead>
<tbody>
{{ range $name, $w := $ds.Workers }}
<tr>
<td>{{ $w.Shares }}</td>
<td>{{ humanDiff $w.TopShare.SDiff }}</td>
<td>{{ formatHashrate $w.Hashrate }}</td>
</tr>
{{ end }}
</tbody>
</table>
</td>
</tr>
{{ else }}
<tr>
<td colspan="5">No stats found for this date range.</td>
</tr>
{{ end }}
</tbody>
</table>
<script>
function toggleWorkers(index) {
const row = document.getElementById(`workers-${index}`);
if (row.style.display === "none" || row.style.display === "") {
row.style.display = "table-row";
} else {
row.style.display = "none";
}
}
</script>
<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" . }}