53 lines
1.5 KiB
HTML
53 lines
1.5 KiB
HTML
{% extends 'base.html' %}
|
||
{% block title %}VLAN Groups{% endblock %}
|
||
|
||
{% block content %}
|
||
<h1 class="page-title">VLAN Groups</h1>
|
||
|
||
<form method="POST" action="{{ url_for('group.add_group_route') }}" style="margin-bottom: 1rem;">
|
||
<input type="text" name="vlan_id" placeholder="VLAN ID" required pattern="[0-9]+" style="width: 80px;">
|
||
<input type="text" name="description" placeholder="Group Description">
|
||
<button type="submit">➕ Add Group</button>
|
||
</form>
|
||
|
||
<table class="styled-table">
|
||
<thead>
|
||
<tr>
|
||
<th>VLAN ID</th>
|
||
<th>Description</th>
|
||
<th>User Count</th>
|
||
<th>Actions</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
{% for group in groups %}
|
||
<tr>
|
||
<td>{{ group.vlan_id }}</td>
|
||
<td>
|
||
<form method="POST" action="{{ url_for('group.update_description_route') }}" class="inline-form">
|
||
<input type="hidden" name="group_id" value="{{ group.vlan_id }}">
|
||
<input type="text" name="description" value="{{ group.description or '' }}">
|
||
<button type="submit" title="Save">💾</button>
|
||
</form>
|
||
</td>
|
||
<td>{{ group.user_count }}</td>
|
||
<td>
|
||
<form method="POST" action="{{ url_for('group.delete_group_route') }}" onsubmit="return confirm('Delete this group?');">
|
||
<input type="hidden" name="group_id" value="{{ group.vlan_id }}">
|
||
<button type="submit">❌</button>
|
||
</form>
|
||
</td>
|
||
</tr>
|
||
{% endfor %}
|
||
</tbody>
|
||
</table>
|
||
|
||
<style>
|
||
form.inline-form {
|
||
display: inline-flex;
|
||
gap: 4px;
|
||
align-items: center;
|
||
}
|
||
</style>
|
||
{% endblock %}
|