Some bare minimum of styling the API key page

This commit is contained in:
Reid 'arrdem' McKenzie 2023-05-27 00:45:34 -06:00
parent a408d1dbb0
commit 0627b72031
2 changed files with 17 additions and 3 deletions

View file

@ -307,3 +307,17 @@ form {
border-radius: 1em;
padding: 0.5em;
}
.keys ul li {
display: flex;
flex-direction: row;
span {
margin-right: 1em;
}
.key-key {
max-width: 20em;
overflow: clip;
}
}

View file

@ -1,14 +1,14 @@
{% extends "base.html.j2" %}
{% block content %}
<h1>User settings</h1>
<div class="">
<div class="keys">
<h2>API keys</h2>
{% with keys = ctx.db.list_keys(ctx.uid) %}
<ul>
{% for id, name, exp in keys if name != 'web session' %}
<li>
<span class="key-name">{{ name }}</span>
<span class="key-key">{{ id }}</span>
<span class="key-name">{{ name or 'anonymous' }}</span>
<span class="key-key">{{ id[:10] }}...</span>
<span class="key-expiration">{{ 'Expires in' if exp else ''}} {{ exp - datetime.now() if exp else 'Never' }}</span>
<form method="post">
<input type="hidden" name="action" value="revoke">