Implement top shares page

This commit is contained in:
Pijus Kamandulis
2025-06-23 14:37:06 +03:00
parent 260d2ec24b
commit d801debaf6
10 changed files with 279 additions and 9 deletions

84
templates/top_shares.html Normal file
View File

@@ -0,0 +1,84 @@
{{ define "top_shares" }}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>ckpool Top Shares</title>
<style>
body {
font-family: sans-serif;
background: #111;
color: #eee;
padding: 20px;
}
table {
width: 100%;
border-collapse: collapse;
margin-bottom: 20px;
}
th,
td {
padding: 8px 12px;
border: 1px solid #444;
text-align: left;
white-space: nowrap;
}
th {
background-color: #222;
}
a.page-link {
margin: 0 5px;
text-decoration: none;
color: #0af;
}
a.page-link.current {
font-weight: bold;
color: #fff;
}
a {
color: #0af;
text-decoration: none;
}
li {
display: inline;
margin: 0 10px;
}
</style>
</head>
<body>
<h1>☀️ Pool Top Shares</h1>
<table>
<thead>
<tr>
<th>Time</th>
<th>Worker</th>
<th>Address</th>
<th>SDiff</th>
<th>Hash</th>
</tr>
</thead>
<tbody>
{{ range .Shares }}
<tr>
<td>{{ formatCreateDate .CreateDate }}</td>
<td>{{ .WorkerName }}</td>
<td>{{ .Address }}</td>
<td>{{ humanDiff .SDiff }}</td>
<td><code style="font-size: small">{{ .Hash }}</code></td>
</tr>
{{ else }}
<tr>
<td colspan="6">No shares found.</td>
</tr>
{{ end }}
</tbody>
</table>
<ul>
<li><a href="/">Home</a></li>
<li><a href="/shares">View Shares</a></li>
<li><a href="/top-shares">Top Shares</a></li>
</ul>
</body>
</html>
{{ end }}