added admin page and audit log viewing
This commit is contained in:
25
internal/handlers/admin_permissions.go
Normal file
25
internal/handlers/admin_permissions.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"
|
||||
)
|
||||
|
||||
// AdminPermissionsPage renders the full admin dashboard page with permissions section
|
||||
func AdminPermissionsPage(s *hws.Server, conn *bun.DB) http.Handler {
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
// TODO: Load permissions from database
|
||||
renderSafely(adminview.PermissionsPage(), s, r, w)
|
||||
})
|
||||
}
|
||||
|
||||
// AdminPermissionsList shows all permissions (HTMX content replacement)
|
||||
func AdminPermissionsList(s *hws.Server, conn *bun.DB) http.Handler {
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
// TODO: Load permissions from database
|
||||
renderSafely(adminview.PermissionsList(), s, r, w)
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user