go-micro.dev/v5@v5.12.0/cmd/micro/web/templates/auth_users.html (about)

     1  {{define "content"}}
     2  <h2 class="text-2xl font-bold mb-4">User Accounts</h2>
     3  <table style="margin-bottom:2em;">
     4    <thead>
     5      <tr><th>ID</th><th>Type</th><th>Scopes</th><th>Metadata</th><th>Delete</th></tr>
     6    </thead>
     7    <tbody>
     8      {{range .Users}}
     9      <tr>
    10        <td>{{.ID}}</td>
    11        <td>{{.Type}}</td>
    12        <td>{{range .Scopes}}<code>{{.}}</code> {{end}}</td>
    13        <td>
    14          {{range $k, $v := .Metadata}}
    15            {{if ne $k "password_hash"}}
    16              <b>{{$k}}</b>: {{$v}} 
    17            {{end}}
    18          {{end}}
    19        </td>
    20        <td>
    21          <form method="POST" action="/auth/users" style="display:inline; padding: 0; border: 0">
    22            <input type="hidden" name="delete" value="{{.ID}}">
    23            <button type="submit" onclick="return confirm('Delete user {{.ID}}?')">Delete</button>
    24          </form>
    25        </td>
    26      </tr>
    27      {{end}}
    28    </tbody>
    29  </table>
    30  <h3 style="margin-bottom:1em;">Create New User</h3>
    31  <form method="POST" action="/auth/users">
    32    <input name="id" placeholder="Username" required style="margin-right:1em;">
    33    <input name="password" type="password" placeholder="Password" required style="margin-right:1em;">
    34    <select name="type" style="margin-right:1em;">
    35      <option value="user">User</option>
    36      <option value="admin">Admin</option>
    37    </select>
    38    <button type="submit">Create</button>
    39  </form>
    40  {{end}}