Files
DHCP Service Bot 90736253b1 Initial commit: DHCP Web Manager
Flask-based web UI for managing ISC DHCP server (dhcpd).

Features:
- subnet / static host binding CRUD via web
- listen interface configuration (INTERFACESv4)
- active lease query + pool utilization stats
- service status, reload/restart, syntax check
- user auth + operation logs
- automatic backup before each config change
- safe change pipeline: write file → dhcpd -t → systemctl restart + is-active verify
- error messages include journalctl tail for diagnosis
2026-07-09 17:09:23 +08:00

44 lines
1.4 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{% extends "base.html" %}
{% block title %}静态绑定{% endblock %}
{% block content %}
<div class="page-head">
<h1>静态绑定(host 声明)</h1>
{% if is_admin %}<a href="{{ url_for('host_new') }}" class="btn btn-primary">+ 新增绑定</a>{% endif %}
</div>
{% if hosts %}
<table class="data-table">
<thead>
<tr>
<th>主机名</th>
<th>MAC</th>
<th>固定 IP</th>
<th>操作</th>
</tr>
</thead>
<tbody>
{% for h in hosts %}
<tr>
<td><strong>{{ h.name }}</strong></td>
<td><code>{{ h.mac }}</code></td>
<td><code>{{ h.ip }}</code></td>
<td class="actions">
{% if is_admin %}
<a href="{{ url_for('host_edit', name=h.name) }}" class="btn btn-sm">编辑</a>
<form method="post" action="{{ url_for('host_delete', name=h.name) }}"
onsubmit="return confirm('确认删除 host {{ h.name }}');" style="display:inline">
<button type="submit" class="btn btn-sm btn-danger">删除</button>
</form>
{% else %}<span class="muted"></span>{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<div class="card empty">
<p>暂无静态绑定</p>
{% if is_admin %}<a href="{{ url_for('host_new') }}" class="btn btn-primary">+ 新增第一个</a>{% endif %}
</div>
{% endif %}
{% endblock %}