Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions static/mailing/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,9 @@ summary:focus-visible,
pattern), not as separate cards. Cells carry right/bottom hairlines pulled
1px past their track so wrapped rows stay divided and the outer edge stays
clean; the wrapping flex cells fill each row, so a partial last row never
leaves a ghost box around empty space. */
leaves a ghost box around empty space. Cells must stay transparent: the
container paints the surface color, and an opaque cell background would
paint over the previous cell's hairline across the 1px overlap. */
.meta-grid {
display: flex;
flex-wrap: wrap;
Expand All @@ -619,7 +621,6 @@ summary:focus-visible,
min-width: 0;
margin: 0;
padding: var(--dk-space-3) var(--dk-space-4);
background: var(--dk-bg-surface);
border: 0;
border-right: 1px solid var(--dk-border-default);
border-bottom: 1px solid var(--dk-border-default);
Expand All @@ -639,7 +640,10 @@ summary:focus-visible,
not as separate cards. Cells carry right/bottom hairlines pulled 1px past
their track so wrapped rows stay divided and the outer edge stays clean;
the wrapping flex cells fill each row, so a partial last row stretches to
the full width and never leaves a ghost box around empty space. */
the full width and never leaves a ghost box around empty space. Cells must
stay transparent: the container paints the page color, and an opaque cell
background would paint over the previous cell's hairline across the 1px
overlap. */
.stats-grid {
display: flex;
flex-wrap: wrap;
Expand All @@ -663,7 +667,6 @@ summary:focus-visible,
align-items: flex-start;
gap: 2px;
padding: var(--dk-space-3) var(--dk-space-4);
background: var(--dk-bg-page);
}

.stats-grid .stat {
Expand Down
34 changes: 19 additions & 15 deletions templates/mailing/operator/admin_api_keys.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<h1>Admin API Keys</h1>
<p>Admin keys manage Relay through <code>/api/admin/</code>. Each key belongs to a staff user and grants access across clients.</p>
</div>
<a href="{% url 'admin:index' %}">Django admin</a>
</div>
{% if raw_key %}
<section class="section">
Expand All @@ -20,19 +19,24 @@ <h2>Save your new key</h2>
<h2>Create a key for your account</h2>
<form method="post">{% csrf_token %}{{ form.as_p }}<button type="submit">Create admin key</button></form>
</section>
<section class="section">
<h2>Keys</h2>
<table>
<thead><tr><th>Name</th><th>Owner</th><th>Prefix</th><th>Last used</th><th>Status</th><th>Action</th></tr></thead>
<tbody>
{% for key in keys %}
<tr>
<td>{{ key.name }}</td><td>{{ key.user.username }}</td><td><code>{{ key.display_prefix }}</code></td>
<td>{{ key.last_used_at|default:"Never" }}</td><td>{% if key.revoked_at %}Revoked{% else %}Active{% endif %}</td>
<td>{% if not key.revoked_at %}<form method="post" action="{% url 'mailing:admin_api_key_revoke' key.id %}">{% csrf_token %}<button type="submit">Revoke</button></form>{% endif %}</td>
</tr>
{% empty %}<tr><td colspan="6">No admin API keys yet.</td></tr>{% endfor %}
</tbody>
</table>
<section class="section panel" aria-labelledby="admin-api-keys-table">
<div class="panel-header">
<h2 id="admin-api-keys-table">Keys</h2>
<span class="muted">{{ keys|length }} key{{ keys|length|pluralize }}</span>
</div>
<div class="table-wrap stack-table">
<table>
<thead><tr><th scope="col">Name</th><th scope="col">Owner</th><th scope="col">Prefix</th><th scope="col">Last used</th><th scope="col">Status</th><th scope="col">Action</th></tr></thead>
<tbody>
{% for key in keys %}
<tr>
<td data-label="Name">{{ key.name }}</td><td data-label="Owner">{{ key.user.username }}</td><td data-label="Prefix"><code>{{ key.display_prefix }}</code></td>
<td data-label="Last used">{{ key.last_used_at|default:"Never" }}</td><td data-label="Status">{% if key.revoked_at %}Revoked{% else %}Active{% endif %}</td>
<td data-label="Action">{% if not key.revoked_at %}<form method="post" action="{% url 'mailing:admin_api_key_revoke' key.id %}">{% csrf_token %}<button type="submit" class="danger">Revoke</button></form>{% endif %}</td>
</tr>
{% empty %}<tr><td colspan="6">No admin API keys yet.</td></tr>{% endfor %}
</tbody>
</table>
</div>
</section>
{% endblock %}
Loading