Some bare minimum of styling the API key page
This commit is contained in:
parent
a408d1dbb0
commit
0627b72031
2 changed files with 17 additions and 3 deletions
|
@ -307,3 +307,17 @@ form {
|
||||||
border-radius: 1em;
|
border-radius: 1em;
|
||||||
padding: 0.5em;
|
padding: 0.5em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.keys ul li {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
|
||||||
|
span {
|
||||||
|
margin-right: 1em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.key-key {
|
||||||
|
max-width: 20em;
|
||||||
|
overflow: clip;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
{% extends "base.html.j2" %}
|
{% extends "base.html.j2" %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h1>User settings</h1>
|
<h1>User settings</h1>
|
||||||
<div class="">
|
<div class="keys">
|
||||||
<h2>API keys</h2>
|
<h2>API keys</h2>
|
||||||
{% with keys = ctx.db.list_keys(ctx.uid) %}
|
{% with keys = ctx.db.list_keys(ctx.uid) %}
|
||||||
<ul>
|
<ul>
|
||||||
{% for id, name, exp in keys if name != 'web session' %}
|
{% for id, name, exp in keys if name != 'web session' %}
|
||||||
<li>
|
<li>
|
||||||
<span class="key-name">{{ name }}</span>
|
<span class="key-name">{{ name or 'anonymous' }}</span>
|
||||||
<span class="key-key">{{ id }}</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>
|
<span class="key-expiration">{{ 'Expires in' if exp else ''}} {{ exp - datetime.now() if exp else 'Never' }}</span>
|
||||||
<form method="post">
|
<form method="post">
|
||||||
<input type="hidden" name="action" value="revoke">
|
<input type="hidden" name="action" value="revoke">
|
||||||
|
|
Loading…
Reference in a new issue