Extract page layout
This commit is contained in:
@@ -1,67 +1,19 @@
|
||||
{{define "index"}}
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>Share Stats</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: sans-serif;
|
||||
background: #111;
|
||||
color: #eee;
|
||||
text-align: center;
|
||||
padding: 2em;
|
||||
}
|
||||
table {
|
||||
margin: auto;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
th,
|
||||
td {
|
||||
padding: 0.5em 1em;
|
||||
border: 1px solid #444;
|
||||
}
|
||||
th {
|
||||
background-color: #222;
|
||||
}
|
||||
tr:nth-child(even) {
|
||||
background-color: #1a1a1a;
|
||||
}
|
||||
a {
|
||||
color: #0af;
|
||||
text-decoration: none;
|
||||
}
|
||||
li {
|
||||
display: inline;
|
||||
margin: 0 10px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>🌟 Pool Share Stats</h1>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>Range</th>
|
||||
<th>Highest Share Diff</th>
|
||||
<th>Time</th>
|
||||
</tr>
|
||||
{{ range .Stats }}
|
||||
<tr>
|
||||
<td>{{ .TimeWindowName }}</td>
|
||||
<td>
|
||||
{{ if ne .SDiff 0.0 }} {{ humanDiff .SDiff }} {{ else }} - {{ end }}
|
||||
</td>
|
||||
<td>{{ formatCreateDate .Time }}</td>
|
||||
</tr>
|
||||
{{ end }}
|
||||
</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 }}
|
||||
{{ define "title" }}Share Stats{{ end }} {{ define "header" }}🌟 Pool Share
|
||||
Stats{{ end }} {{ define "content" }}
|
||||
<table>
|
||||
<tr>
|
||||
<th>Range</th>
|
||||
<th>Highest Share Diff</th>
|
||||
<th>Time</th>
|
||||
</tr>
|
||||
{{ range .Stats }}
|
||||
<tr>
|
||||
<td>{{ .TimeWindowName }}</td>
|
||||
<td>
|
||||
{{ if ne .SDiff 0.0 }} {{ humanDiff .SDiff }} {{ else }} - {{ end }}
|
||||
</td>
|
||||
<td>{{ formatCreateDate .Time }}</td>
|
||||
</tr>
|
||||
{{ end }}
|
||||
</table>
|
||||
{{ end }} {{ template "layout" . }}
|
||||
|
||||
67
templates/layout.html
Normal file
67
templates/layout.html
Normal file
@@ -0,0 +1,67 @@
|
||||
{{ define "layout" }}
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>{{ template "title" . }}</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: sans-serif;
|
||||
background: #111;
|
||||
color: #eee;
|
||||
padding: 20px;
|
||||
text-align: center;
|
||||
}
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
margin: auto;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
table.fw {
|
||||
width: 100%;
|
||||
}
|
||||
th,
|
||||
td {
|
||||
padding: 8px 12px;
|
||||
border: 1px solid #444;
|
||||
text-align: left;
|
||||
white-space: nowrap;
|
||||
}
|
||||
th {
|
||||
background-color: #222;
|
||||
}
|
||||
tr:nth-child(even) {
|
||||
background-color: #1a1a1a;
|
||||
}
|
||||
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>{{ template "header" . }}</h1>
|
||||
|
||||
{{ template "content" . }} {{ template "navigation" . }}
|
||||
</body>
|
||||
</html>
|
||||
{{ end }} {{ define "navigation" }}
|
||||
<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>
|
||||
{{ end }}
|
||||
@@ -1,104 +1,48 @@
|
||||
{{ define "share_list" }}
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>ckpool Share Browser</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 Share Browser</h1>
|
||||
{{ define "title" }}Share Browser{{ end }} {{ define "header" }}☀️ Pool Share
|
||||
Browser{{ end }} {{ define "content" }}
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Time</th>
|
||||
<th>Worker</th>
|
||||
<th>Address</th>
|
||||
<th>SDiff</th>
|
||||
<th>Result</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>{{ if .Result }}✔️{{ else }}❌{{ end }}</td>
|
||||
<td><code style="font-size: small">{{ .Hash }}</code></td>
|
||||
</tr>
|
||||
{{ else }}
|
||||
<tr>
|
||||
<td colspan="6">No shares found.</td>
|
||||
</tr>
|
||||
{{ end }}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Time</th>
|
||||
<th>Worker</th>
|
||||
<th>Address</th>
|
||||
<th>SDiff</th>
|
||||
<th>Result</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>{{ if .Result }}✔️{{ else }}❌{{ end }}</td>
|
||||
<td><code style="font-size: small">{{ .Hash }}</code></td>
|
||||
</tr>
|
||||
{{ else }}
|
||||
<tr>
|
||||
<td colspan="6">No shares found.</td>
|
||||
</tr>
|
||||
{{ end }}
|
||||
</tbody>
|
||||
</table>
|
||||
<div>
|
||||
{{ if gt .Page 1 }}
|
||||
<a class="page-link" href="?page={{ sub .Page 1 }}">« Prev</a>
|
||||
{{ end }} {{ if gt .Page 2 }}
|
||||
<a class="page-link" href="?page=1">1</a>
|
||||
{{ if gt .Page 3 }}
|
||||
<span class="page-link">...</span>
|
||||
{{ end }} {{ end }}
|
||||
|
||||
<div>
|
||||
{{ if gt .Page 1 }}
|
||||
<a class="page-link" href="?page={{ sub .Page 1 }}">« Prev</a>
|
||||
{{ end }} {{ if gt .Page 2 }}
|
||||
<a class="page-link" href="?page=1">1</a>
|
||||
{{ if gt .Page 3 }}
|
||||
<span class="page-link">...</span>
|
||||
{{ end }} {{ end }}
|
||||
<a class="page-link current" href="?page={{ .Page }}">{{ .Page }}</a>
|
||||
|
||||
<a class="page-link current" href="?page={{ .Page }}">{{ .Page }}</a>
|
||||
|
||||
{{ if .HasMore }}
|
||||
<span class="page-link">...</span>
|
||||
<a class="page-link" href="?page={{ add .Page 1 }}">Next »</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
|
||||
<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 }}
|
||||
{{ if .HasMore }}
|
||||
<span class="page-link">...</span>
|
||||
<a class="page-link" href="?page={{ add .Page 1 }}">Next »</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }} {{ template "layout" . }}
|
||||
|
||||
@@ -1,84 +1,27 @@
|
||||
{{ 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 }}
|
||||
{{ define "title" }}Top Shares{{ end }} {{ define "header" }}☀️ Pool Top
|
||||
Shares{{ end }} {{ define "content" }}
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Time</th>
|
||||
<th>Worker</th>
|
||||
<th>SDiff</th>
|
||||
<th>Hash</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{ range .Shares }}
|
||||
<tr>
|
||||
<td>{{ formatCreateDate .CreateDate }}</td>
|
||||
<td>{{ .WorkerName }}</td>
|
||||
<td>{{ humanDiff .SDiff }}</td>
|
||||
<td><code style="font-size: small">{{ .Hash }}</code></td>
|
||||
</tr>
|
||||
{{ else }}
|
||||
<tr>
|
||||
<td colspan="4">No shares found.</td>
|
||||
</tr>
|
||||
{{ end }}
|
||||
</tbody>
|
||||
</table>
|
||||
{{ end }} {{ template "layout" . }}
|
||||
|
||||
Reference in New Issue
Block a user