1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- {{define "admin"}}
- data := struct {
- Users []gamelangpb.User
- Sessions map[string]gamelangpb.User
- }{
- Users: ws.usermanager.List(),
- Sessions: ws.sessions,
- }
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>admin</title>
- </head>
- <body>
- <h1> Admin </h1><br>
- <h2> current users </h2><br>
- <table style="width:50%">
- <tr>
- <th>Username</th>
- <th>Admin</th>
- </tr>
- {{range $user := .Users }}
- <tr>
- <td>{{$user.Name}}</td>
- <td>{{$user.Admin}}</td>
- </tr>
- {{end}}
- </table>
- <h2> sessions </h2><br>
- <table style="width:50%">
- <tr>
- <th>Session</th>
- <th>Username</th>
- </tr>
- {{range $session, $user := .Sessions }}
- <tr>
- <td>{{$session}}</td>
- <td>{{$user.Name}}</td>
- </tr>
- {{end}}
- </table>
- <h2> worlds </h2><br>
- <table style="width:50%">
- <tr>
- <th>World</th>
- <th>User</th>
- </tr>
- {{range $world := .Worlds}}
- <tr>
- <td>{{$world.Name}}</td>
- <td>{{range $user := $world.Users}}{{$user.Name}} {{end}}</td>
- </tr>
- {{end}}
- </table>
- </body>
- </html>
- {{end}}
|