Peer enhancements: notes, traffic quotas with auto-disable, batch create, usage tracking; relay subnets for bridging into other tunnels

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
This commit is contained in:
lofyer
2026-07-04 07:34:57 +08:00
co-authored by factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
parent d97ae64c85
commit c4dc22074e
10 changed files with 209 additions and 13 deletions
+17
View File
@@ -13,6 +13,19 @@
</p>
<p class="muted">Created {{ peer.created_at.strftime("%Y-%m-%d %H:%M") }}</p>
{% if peer.expires_at %}<p class="muted">Expires {{ peer.expires_at.strftime("%Y-%m-%d %H:%M") }}</p>{% endif %}
<p>Usage: {{ peer.cum_total | fmt_bytes }}
{% if peer.quota_bytes %} / {{ peer.quota_bytes | fmt_bytes }}
{% if peer.over_quota %}<span class="badge err">over quota</span>{% endif %}
{% endif %}
</p>
<form method="post" action="/peers/{{ peer.id }}/update" class="stack">
<label class="muted">Note <input name="note" value="{{ peer.note }}"></label>
<label class="muted">Quota GiB
<input name="quota_gib" type="number" step="0.1" min="0" class="narrow"
value="{{ '%.1f' % (peer.quota_bytes / 1073741824) if peer.quota_bytes else '' }}" placeholder="0 = unlimited">
</label>
<button type="submit">Save</button>
</form>
</div>
<div class="card">
<h3>Live status</h3>
@@ -40,6 +53,10 @@
onsubmit="return confirm('Rotate keys? The old client config stops working immediately.')">
<button type="submit">Rotate keys</button>
</form>
<form method="post" action="/peers/{{ peer.id }}/reset-usage" class="inline"
onsubmit="return confirm('Reset usage counters to zero?')">
<button type="submit">Reset usage</button>
</form>
<form method="post" action="/peers/{{ peer.id }}/delete" class="inline"
onsubmit="return confirm('Delete peer {{ peer.name }}?')">
<button type="submit" class="danger">Delete</button>