Fixed /stats layout
This commit is contained in:
@@ -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,
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user