hosts_app/templates/local_defaults.html
Mateusz Gruszczyński 7706a521b4 remove dynamic hosts
2025-03-10 16:04:04 +01:00

55 lines
1.7 KiB
HTML

{% extends "base.html" %}
{% block title %}Definiowanie wpisów z dynamicznymi zmiennymi{% endblock %}
{% block content %}
<div class="card">
<div class="card-header">
<h3>Ustaw domyślne wpisy /etc/hosts z dynamicznymi zmiennymi</h3>
</div>
<div class="card-body">
<form method="POST">
<div class="row">
<div class="col-md-6">
<label class="form-label">Adres IP</label>
<input type="text" class="form-control" name="ip_address" placeholder="np. 127.0.0.1" required>
</div>
<div class="col-md-6">
<label class="form-label">Hostname</label>
<input type="text" class="form-control" name="hostname" placeholder="np. localhost" required>
</div>
</div>
<button type="submit" class="btn btn-primary mt-3">Dodaj wpis</button>
</form>
<table class="table table-striped mt-4">
<thead>
<tr>
<th>ID</th>
<th>Adres IP</th>
<th>Hostname</th>
<th>Zmienna dynamiczna</th>
<th>Akcje</th>
</tr>
</thead>
<tbody>
{% for e in entries %}
<tr>
<td>{{ e.id }}</td>
<td>{{ e.ip_address }}</td>
<td>{{ e.hostname }}</td>
<td>{{ e.dynamic_variable or '—' }}</td>
<td>
<form method="POST" action="{{ url_for('delete_local_default', entry_id=e.id) }}" onsubmit="return confirm('Usunąć wpis?');">
<button class="btn btn-danger btn-sm">Usuń</button>
</form>
</td>
</tr>
{% else %}
<tr><td colspan="5">Brak zdefiniowanych wpisów.</td></tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
{% endblock %}