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

33 lines
1.4 KiB
HTML

{% extends "base.html" %}
{% block title %}{{ host.name|default('新增') }} · 静态绑定{% endblock %}
{% block content %}
<div class="page-head">
<h1>{% if host.name %}编辑 host {{ host.name }}{% else %}新增静态绑定{% endif %}</h1>
<a href="{{ url_for('host_list') }}" class="btn btn-muted">← 返回</a>
</div>
<form method="post" class="card form">
<div class="grid-2">
<label>主机名
<input type="text" name="name" value="{{ form.name or host.name }}"
placeholder="printer-hall" required
pattern="[A-Za-z0-9_\-\.]{1,63}">
</label>
<label>MAC 地址
<input type="text" name="mac" value="{{ form.mac or host.mac }}"
placeholder="aa:bb:cc:dd:ee:ff" required
pattern="([0-9a-fA-F]{2}[:\-]){5}[0-9a-fA-F]{2}">
</label>
<label>固定 IP
<input type="text" name="ip" value="{{ form.ip or host.ip }}"
placeholder="192.168.1.50" required
pattern="\d{1,3}(\.\d{1,3}){3}">
</label>
</div>
<div class="form-actions">
<button type="submit" class="btn btn-primary">保存并应用</button>
<a href="{{ url_for('host_list') }}" class="btn btn-muted">取消</a>
</div>
<p class="muted small">保存后会自动 reload dhcpd。客户端重启网络或重新获取 IP 后生效。</p>
</form>
{% endblock %}