This commit is contained in:
Jonas Bengtsson
2026-08-30 11:30:09 +02:00
parent 47714fa7e3
commit c139b30f6f
28 changed files with 2100 additions and 34 deletions
+53
View File
@@ -0,0 +1,53 @@
{% extends "base.html" %}
{% block title %}{{ group.name }} — MQTT Ingester{% endblock %}
{% block content %}
<h1>{{ group.name }}</h1>
<section>
<h2>Access rules</h2>
<p class="hint">Glob patterns matched against the full tag name. <code>*</code> matches any sequence (including <code>.</code>). Deny wins over allow. Group rules combine with users' personal rules.</p>
<table>
<thead><tr><th>Kind</th><th>Pattern</th><th></th></tr></thead>
<tbody>
{% for r in rules %}
<tr>
<td><span class="tag {{ r.kind }}">{{ r.kind }}</span></td>
<td><code>{{ r.pattern }}</code></td>
<td>
<form method="post" action="/groups/{{ group.id }}/rules/{{ r.id }}/delete">
<input type="hidden" name="csrf_token" value="{{ identity.csrf_token }}">
<button type="submit" class="link danger">remove</button>
</form>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<form method="post" action="/groups/{{ group.id }}/rules" class="inline-form">
<input type="hidden" name="csrf_token" value="{{ identity.csrf_token }}">
<select name="kind">
<option value="allow">allow</option>
<option value="deny">deny</option>
</select>
<input type="text" name="pattern" placeholder="e.g. 11001.*" required>
<button type="submit">Add rule</button>
</form>
</section>
<section>
<h2>Members</h2>
<form method="post" action="/groups/{{ group.id }}/members" class="stack">
<input type="hidden" name="csrf_token" value="{{ identity.csrf_token }}">
<fieldset>
{% for u in all_users %}
<label class="check">
<input type="checkbox" name="user_ids" value="{{ u.id }}"
{% if u.id in members | map(attribute='id') | list %}checked{% endif %}>
{{ u.username }}
</label>
{% endfor %}
</fieldset>
<button type="submit">Save members</button>
</form>
</section>
{% endblock %}