diff --git a/cmd/wg-portal/assets/tpl/admin_user_index.gohtml b/cmd/wg-portal/assets/tpl/admin_user_index.gohtml index c0f2de9..c14501a 100644 --- a/cmd/wg-portal/assets/tpl/admin_user_index.gohtml +++ b/cmd/wg-portal/assets/tpl/admin_user_index.gohtml @@ -19,10 +19,10 @@ {{template "prt_flashes.gohtml" .}}
-
+

All Users

-
+
M
@@ -30,17 +30,19 @@ - - - - - + + + + + + - {{range $i, $u :=.Users}} + {{range $i, $u := $.Users}} + @@ -62,11 +64,7 @@ {{template "prt_footer.gohtml" .}} - - - - \ No newline at end of file diff --git a/cmd/wg-portal/ui/pages_admin_user.go b/cmd/wg-portal/ui/pages_admin_user.go index 7b5e2a5..c3f35dc 100644 --- a/cmd/wg-portal/ui/pages_admin_user.go +++ b/cmd/wg-portal/ui/pages_admin_user.go @@ -9,14 +9,17 @@ func (h *handler) handleAdminUserIndexGet() gin.HandlerFunc { return func(c *gin.Context) { currentSession := h.session.GetData(c) + users, err := h.backend.GetAllUsers() + if err != nil { + // TODO + } c.HTML(http.StatusOK, "admin_user_index.gohtml", gin.H{ - "Route": c.Request.URL.Path, - "Alerts": h.session.GetFlashes(c), - "Session": currentSession, - "Static": h.getStaticData(), - "Interface": nil, // TODO: load interface specified in the session - "InterfaceNames": map[string]string{"wgX": "wgX descr"}, + "Route": c.Request.URL.Path, + "Alerts": h.session.GetFlashes(c), + "Session": currentSession, + "Static": h.getStaticData(), + "Users": users, }) } }
E-Mail Lastname Firstname Source Is Admin ID E-Mail Lastname Firstname Source Is Admin
{{$u.Identifier}} {{$u.Email}} {{$u.Lastname}} {{$u.Firstname}}