added admin page and audit log viewing
This commit is contained in:
25
internal/handlers/admin_roles.go
Normal file
25
internal/handlers/admin_roles.go
Normal file
@@ -0,0 +1,25 @@
|
||||
package handlers
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"git.haelnorr.com/h/golib/hws"
|
||||
adminview "git.haelnorr.com/h/oslstats/internal/view/adminview"
|
||||
"github.com/uptrace/bun"
|
||||
)
|
||||
|
||||
// AdminRolesPage renders the full admin dashboard page with roles section
|
||||
func AdminRolesPage(s *hws.Server, conn *bun.DB) http.Handler {
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
// TODO: Load roles from database
|
||||
renderSafely(adminview.RolesPage(), s, r, w)
|
||||
})
|
||||
}
|
||||
|
||||
// AdminRolesList shows all roles (HTMX content replacement)
|
||||
func AdminRolesList(s *hws.Server, conn *bun.DB) http.Handler {
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
// TODO: Load roles from database
|
||||
renderSafely(adminview.RolesList(), s, r, w)
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user