Files

66 lines
2.3 KiB
HTML

{% extends "base.html" %}
{% block content %}
<div style="display:flex; justify-content:space-between; align-items:center; margin-bottom:16px;">
<h1>{{ config.name }}</h1>
<div>
<form class="inline" method="post" action="/configs/{{ config.id }}/refresh">
<button type="submit" class="btn btn-primary">&#8635; Force Refresh</button>
</form>
<form class="inline" method="post" action="/configs/{{ config.id }}/delete"
onsubmit="return confirm('Delete this config?')">
<button type="submit" class="btn btn-danger">Delete</button>
</form>
</div>
</div>
<div class="card">
<h2>Client URL</h2>
<div class="token-url">{{ request.url.scheme }}://{{ request.url.netloc }}/config/{{ config.token }}.yaml</div>
</div>
<div class="card">
<h2>Base YAML</h2>
<form method="post" action="/configs/{{ config.id }}">
<textarea name="base_yaml" style="min-height:300px;">{{ config.base_yaml }}</textarea>
<div style="margin-top:10px;">
<button type="submit" class="btn btn-primary">Save YAML</button>
</div>
</form>
</div>
<div class="card">
<div style="display:flex; justify-content:space-between; align-items:center; margin-bottom:12px;">
<h2 style="margin:0;">Subscriptions</h2>
<a href="/configs/{{ config.id }}/subscriptions/new" class="btn btn-primary btn-sm">+ Add</a>
</div>
{% if subscriptions %}
<table>
<thead>
<tr><th>Name</th><th>URL</th><th>Last Fetched</th><th></th></tr>
</thead>
<tbody>
{% for sub in subscriptions %}
<tr>
<td>{{ sub.name }}</td>
<td style="font-family:monospace;font-size:.8rem;">{{ sub.url }}</td>
<td>{{ sub.last_fetched_at.strftime('%Y-%m-%d %H:%M') if sub.last_fetched_at else '—' }}</td>
<td>
<form class="inline" method="post" action="/subscriptions/{{ sub.id }}/delete">
<button type="submit" class="btn btn-danger btn-sm">Delete</button>
</form>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p style="color:#666;">No subscriptions. Add one above.</p>
{% endif %}
</div>
<div style="margin-top:8px;">
<a href="/configs/{{ config.id }}/logs" class="btn" style="background:#6b7280;color:#fff;">View Export Logs</a>
<a href="/" class="btn" style="background:#6b7280;color:#fff;margin-left:8px;">&#8592; Back</a>
</div>
{% endblock %}