Fixed /stats layout

This commit is contained in:
2026-06-19 22:49:01 +02:00
parent 63240a6cf7
commit c30399e498
5 changed files with 17 additions and 24 deletions
-18
View File
@@ -219,23 +219,6 @@ func handleStatsDetail(w http.ResponseWriter, r *http.Request) {
}
}
// Beliebteste Seiten nach Impressions.
topPages := []map[string]any{}
if rows, err := db.Query(
`SELECT path, SUM(hits) AS h
FROM impression
GROUP BY path
ORDER BY h DESC
LIMIT 10`); err == nil {
defer rows.Close()
for rows.Next() {
var path string
var hits int64
rows.Scan(&path, &hits)
topPages = append(topPages, map[string]any{"path": path, "hits": hits})
}
}
// Netze nach Betreiber (autonomes System). Leere asn ('') -> "(unbekannt)".
topASNs := []map[string]any{}
if rows, err := db.Query(
@@ -264,7 +247,6 @@ func handleStatsDetail(w http.ResponseWriter, r *http.Request) {
"impressions_total": imprTotal,
"visitors_total": visitorsTotal,
"daily": daily,
"top_pages": topPages,
"top_asns": topASNs,
})
}