@@ 6,17 6,15 @@ import (
"git.sr.ht/~inferiormartin/badger/config"
"git.sr.ht/~inferiormartin/badger/model"
"git.sr.ht/~inferiormartin/badger/user"
- "html/template"
- "io/fs"
- "log"
- "net/http"
- "time"
-
"github.com/go-chi/chi/v5"
"github.com/go-chi/chi/v5/middleware"
"github.com/jmoiron/sqlx"
_ "github.com/lib/pq"
"github.com/vaughan0/go-ini"
+ "html/template"
+ "io/fs"
+ "log"
+ "net/http"
)
//go:embed templates/*.html static/* model.json
@@ 24,7 22,6 @@ var content embed.FS
type App struct {
Config *ini.File
- StartTime time.Time
Template *template.Template
AppName string
Advanced *Advanced
@@ 83,9 80,8 @@ func Default() *App {
}
app := &App{
- Config: cfg,
- StartTime: time.Now(),
- Template: tmpl,
+ Config: cfg,
+ Template: tmpl,
ModelDb: &ModelDb{
Db: modelDb,
querySources: map[string]QuerySource{},
@@ 21,7 21,6 @@ func (app *App) onDiagnostics() http.HandlerFunc {
data := make(map[string]any)
- data["uptime"] = app.StartTime
data["os"] = runtime.GOOS
data["arch"] = runtime.GOARCH
data["go"] = runtime.Version()