vpn: add support for custom keys
Custom keys are created by admin and specify networks directly, bypassing AD permissions. They are intended to join managed devices into networks where users are not allowed to create keys themselves. Also comprehend a set directly.
This commit is contained in:
parent
1b26f0738a
commit
3c25cbe88a
8 changed files with 152 additions and 42 deletions
|
@ -68,12 +68,37 @@ V nastavitvah lahko dodate ali odstranite vnose <code>AllowedIPs</code>. Ti dolo
|
|||
<h1>Ključi</h1>
|
||||
<p>
|
||||
Če ključa ne uporabljamo, smo ga izgubili ali so nam ga ukradli, ga tukaj odstranimo. Trenutno so registrirani ključi:
|
||||
<ul class="keys" style="list-style: none;"></ul>
|
||||
<p class="keys" id="active-key-warning" style="margin-top: 0;">
|
||||
|
||||
<table class="keys">
|
||||
<thead><th><th>Ključ<th>IP<th>IPv6<th>Naprava
|
||||
<tbody>
|
||||
</table>
|
||||
|
||||
<p class="keys" id="active-key-warning">
|
||||
<font color="red"><sup>★</sup></font> Ta ključ uporablja trenutna povezava. Če ga odstranite, bo prekinjena.
|
||||
</section>
|
||||
|
||||
<script type="text/javascript" src="{{ url_for('static', filename='qrcode.js') }}"></script>
|
||||
<script type="text/javascript" src="{{ url_for('static', filename='wireguard.js') }}"></script>
|
||||
<script type="text/javascript" src="{{ url_for('static', filename='vpn.js') }}"></script>
|
||||
<script type="text/javascript">
|
||||
const endpoint = 'list';
|
||||
function update(keys) {
|
||||
const keytab = document.querySelector('table.keys > tbody');
|
||||
const warning = document.querySelector('p#active-key-warning');
|
||||
keytab.innerHTML = ''
|
||||
warning.hidden = true;
|
||||
for (const key of keys) {
|
||||
const row = keytab.insertRow();
|
||||
row.insertCell().innerHTML = '<button onclick="delKey(\'' + key.key + '\');">✖</button>';
|
||||
row.insertCell().innerHTML = '<code>' + key.key + '</code>';
|
||||
row.insertCell().innerHTML = key.ip;
|
||||
row.insertCell().innerHTML = key.ip6 || '';
|
||||
row.insertCell().innerHTML = key.name + (key.active ? '<font color="red">★</font>' : '');
|
||||
if (key.active)
|
||||
warning.hidden = false;
|
||||
}
|
||||
document.querySelector('section.keys').style.display = (keys.length ? 'unset' : 'none');
|
||||
}
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue