fix shit
This commit is contained in:
@@ -4,11 +4,16 @@ import (
|
||||
"html/template"
|
||||
"net/http"
|
||||
|
||||
"pool-stats/database"
|
||||
"pool-stats/stats"
|
||||
|
||||
"github.com/ostafen/clover/v2"
|
||||
)
|
||||
|
||||
func (h database.Handlers) IndexHandler(w http.ResponseWriter, r *http.Request) {
|
||||
type Handlers struct {
|
||||
DB *clover.DB
|
||||
}
|
||||
|
||||
func (h Handlers) IndexHandler(w http.ResponseWriter, r *http.Request) {
|
||||
shareStats, err := stats.GetStats(h.DB)
|
||||
if err != nil {
|
||||
http.Error(w, "Failed to load stats", 500)
|
||||
@@ -17,4 +22,4 @@ func (h database.Handlers) IndexHandler(w http.ResponseWriter, r *http.Request)
|
||||
|
||||
tmpl := template.Must(template.ParseFiles("templates/index.html"))
|
||||
tmpl.Execute(w, shareStats)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user