35 lines
1.2 KiB
HTML
35 lines
1.2 KiB
HTML
{% extends "base.html" %}
|
||
{% block title %}API Keys - Postcard Manager{% endblock %}
|
||
{% block content %}
|
||
<div class="section-header">
|
||
<h1>API Keys</h1>
|
||
<form method="post" action="/api-keys">
|
||
<button type="submit" class="btn btn-primary">+ 创建新 Key</button>
|
||
</form>
|
||
</div>
|
||
{% if keys %}
|
||
<table>
|
||
<thead><tr><th>Key</th><th>创建时间</th><th>操作</th></tr></thead>
|
||
<tbody>
|
||
{% for k in keys %}
|
||
<tr>
|
||
<td><code>{{ k.key }}</code></td>
|
||
<td>{{ k.created_at.strftime('%Y-%m-%d %H:%M') }}</td>
|
||
<td>
|
||
<form method="post" action="/api-keys/{{ k.id }}/delete" class="inline">
|
||
<button type="submit" class="btn btn-danger btn-sm" onclick="return confirm('确定删除该 Key?')">删除</button>
|
||
</form>
|
||
</td>
|
||
</tr>
|
||
{% endfor %}
|
||
</tbody>
|
||
</table>
|
||
{% else %}
|
||
<p class="empty">还没有 API Key,点击上方按钮创建一个。</p>
|
||
{% endif %}
|
||
<section class="section" style="margin-top:2rem">
|
||
<h2>使用说明</h2>
|
||
<pre>curl -H "Authorization: Bearer YOUR_API_KEY" http://localhost:8000/api/profiles</pre>
|
||
</section>
|
||
{% endblock %}
|