Files
sub-provider/templates/sources.html
2026-04-20 14:16:09 +08:00

56 lines
2.2 KiB
HTML

{% extends "base.html" %}
{% block content %}
<div class="stack">
<div>
<h1>Sources</h1>
<p class="muted">管理订阅源。先做最小可用版本:增改删和启停。</p>
</div>
<div class="card">
<h2>New / Edit Source</h2>
<form method="post" action="/admin/sources" class="stack">
<div class="grid-2">
<div><label>Key</label><input name="key" required placeholder="airport-d"></div>
<div><label>Display Name</label><input name="display_name" placeholder="D"></div>
<div><label>Kind</label><select name="kind"><option value="auto">auto</option><option value="clash_yaml">clash_yaml</option><option value="base64_uri">base64_uri</option><option value="uri">uri</option></select></div>
<div><label>Cache TTL Seconds</label><input name="cache_ttl_seconds" placeholder="900"></div>
</div>
<div><label>URL</label><input name="url" required></div>
<div class="grid-2">
<div><label>Prefix</label><input name="prefix"></div>
<div><label>Suffix</label><input name="suffix"></div>
<div><label>Include Regex</label><input name="include_regex"></div>
<div><label>Exclude Regex</label><input name="exclude_regex"></div>
</div>
<label class="inline"><input type="checkbox" name="enabled" checked style="width:auto"> Enabled</label>
<div class="actions"><button type="submit">Save Source</button></div>
</form>
</div>
<div class="card">
<h2>Existing Sources</h2>
<table>
<thead>
<tr><th>Key</th><th>Type</th><th>URL</th><th>Prefix</th><th>Status</th><th></th></tr>
</thead>
<tbody>
{% for source in sources %}
<tr>
<td>{{ source.key }}</td>
<td>{{ source.kind }}</td>
<td class="muted">{{ source.url }}</td>
<td>{{ source.prefix }}</td>
<td>{{ "enabled" if source.enabled else "disabled" }}</td>
<td>
<form method="post" action="/admin/sources/{{ source.key }}/delete" onsubmit="return confirm('Delete source {{ source.key }}?')">
<button type="submit" class="secondary">Delete</button>
</form>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
{% endblock %}