Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
26 lines
1.8 KiB
HTML
26 lines
1.8 KiB
HTML
{% extends "base.html" %}
|
|
{% block title %}Admin — IP-labels{% endblock %}
|
|
{% block body %}
|
|
<h1>IP → label & land</h1>
|
|
<p class="lead">Mærk kendte IP-adresser. Nøgle = præcis IP eller præfiks (fx <code>192.168.</code>). Land = ISO-kode (fx <code>dk</code>) der overstyrer geolokation. Gemmes live til NPMplus.</p>
|
|
{% if saved %}<div class="flash">{{ saved }}</div>{% endif %}
|
|
<form method="post" action="/admin/ip-labels">
|
|
<table id="tbl" style="margin-top:1rem">
|
|
<thead><tr><th style="width:40%">IP / præfiks</th><th>Label</th><th style="width:90px">Land</th><th style="width:40px"></th></tr></thead>
|
|
<tbody>
|
|
{% for r in rows %}
|
|
<tr><td><input name="ip" value="{{ r.ip }}"></td><td><input name="label" value="{{ r.label }}"></td><td><input name="country" value="{{ r.country }}"></td><td><button type="button" class="btn secondary" onclick="this.closest('tr').remove()">✕</button></td></tr>
|
|
{% endfor %}
|
|
<tr><td><input name="ip" placeholder="fx 192.168."></td><td><input name="label" placeholder="Hjemme"></td><td><input name="country" placeholder="dk"></td><td><button type="button" class="btn secondary" onclick="this.closest('tr').remove()">✕</button></td></tr>
|
|
</tbody>
|
|
</table>
|
|
<p style="margin-top:1rem;display:flex;gap:.6rem">
|
|
<button type="button" class="btn secondary" onclick="addRow()">+ Tilføj række</button>
|
|
<button type="submit" class="btn">Gem</button>
|
|
</p>
|
|
</form>
|
|
<script>
|
|
function addRow(){var t=document.querySelector('#tbl tbody');var tr=document.createElement('tr');tr.innerHTML='<td><input name="ip"></td><td><input name="label"></td><td><input name="country"></td><td><button type="button" class="btn secondary" onclick="this.closest(\'tr\').remove()">✕</button></td>';t.appendChild(tr);}
|
|
</script>
|
|
{% endblock %}
|