diff --git a/database/db.go b/database/db.go
index e91bcc9..7391baf 100644
--- a/database/db.go
+++ b/database/db.go
@@ -295,6 +295,9 @@ func GetDailyStats(db *clover.DB, date time.Time) (*models.DailyStats, error) {
}
for workerName, workerShares := range sharesByWorker {
workerHashrate := helpers.CalculateAverageHashrate(workerShares)
+ sort.Slice(workerShares, func(i, j int) bool {
+ return workerShares[i].SDiff > workerShares[j].SDiff
+ })
workerTopShare := workerShares[0] // Already sorted by SDiff
stats.Workers[workerName] = models.WorkerDailyStats{
diff --git a/templates/daily_stats.html b/templates/daily_stats.html
index e7c2f9c..0bc6aa6 100644
--- a/templates/daily_stats.html
+++ b/templates/daily_stats.html
@@ -1,8 +1,25 @@
{{ define "title" }}Daily Stats{{ end }} {{ define "header" }}📊 Pool Daily
Stats{{ end }} {{ define "content" }}
+
+
+ |
Date (UTC) |
Share Count |
Top Share Diff |
@@ -10,21 +27,57 @@ Stats{{ end }} {{ define "content" }}
- {{ range .DailyStats }}
+ {{ range $i, $ds := .DailyStats }}
- {{ .Date }} |
- {{ .ShareCount }} |
- {{ humanDiff .TopShare.SDiff }} |
- {{ formatHashrate .PoolHashrate }} |
+
+ âž•
+ |
+ {{ $ds.Date }} |
+ {{ $ds.ShareCount }} |
+ {{ humanDiff $ds.TopShare.SDiff }} |
+ {{ formatHashrate $ds.PoolHashrate }} |
+
+
+
+
+
+
+ Shares |
+ Top Share Diff |
+ Hashrate |
+
+
+
+ {{ range $name, $w := $ds.Workers }}
+
+ {{ $w.Shares }} |
+ {{ humanDiff $w.TopShare.SDiff }} |
+ {{ formatHashrate $w.Hashrate }} |
+
+ {{ end }}
+
+
+ |
{{ else }}
- No stats found for this date range. |
+ No stats found for this date range. |
{{ end }}
+
+
{{ if .PrevPageAvailable }}