Files
Aruba-PoE/srv/poe_manager/templates/switche.html
Tim Eertmoed df000eace9 revert 74617a1e0f
revert srv/poe_manager/templates/switche.html aktualisiert
2025-10-07 18:19:42 +02:00

54 lines
2.2 KiB
HTML

{% extends "base.html" %}
{% block content %}
<h2>Switche</h2>
{% if current_user.is_admin %}
<h4>Neuen Switch hinzufügen</h4>
<form method="post" class="row g-2 mb-4">
<input type="hidden" name="add_switch" value="1">
<div class="col"><input type="text" name="hostname" placeholder="Hostname" class="form-control" required></div>
<div class="col"><input type="text" name="ip" placeholder="IP-Adresse" class="form-control" required></div>
<div class="col"><input type="text" name="username" placeholder="Username" class="form-control" required></div>
<div class="col"><input type="password" name="password" placeholder="Password" class="form-control" required></div>
<div class="col"><button class="btn btn-success w-100">Hinzufügen</button></div>
</form>
{% endif %}
<table class="table table-bordered">
<thead>
<tr>
<th>Hostname</th>
<th>IP-Adresse</th>
<th>Username</th>
{% if current_user.is_admin %}<th>Aktionen</th>{% endif %}
</tr>
</thead>
<tbody>
{% for s in switches %}
<tr>
{% if current_user.is_admin %}
<form method="post">
<input type="hidden" name="edit_switch" value="1">
<input type="hidden" name="old_hostname" value="{{ s['hostname'] }}">
<td><input name="hostname" value="{{ s['hostname'] }}" class="form-control" required></td>
<td><input name="ip" value="{{ s['ip'] }}" class="form-control" required></td>
<td><input name="username" value="{{ s['username'] }}" class="form-control" required></td>
<td class="d-flex gap-1">
<button class="btn btn-primary btn-sm">Speichern</button>
<button name="delete_switch" value="{{ s['hostname'] }}" class="btn btn-danger btn-sm"
onclick="return confirm('Willst du den Switch wirklich löschen?');">Löschen</button>
</td>
</form>
{% else %}
<td>{{ s['hostname'] }}</td>
<td>{{ s['ip'] }}</td>
<td>{{ s['username'] }}</td>
{% endif %}
</tr>
{% endfor %}
</tbody>
</table>
{% endblock %}