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
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
{% extends "base.html" %}
|
||||
{% block title %}操作日志{% endblock %}
|
||||
{% block content %}
|
||||
<div class="page-head">
|
||||
<h1>操作日志</h1>
|
||||
<span class="muted">共 {{ total }} 条</span>
|
||||
</div>
|
||||
|
||||
<table class="data-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>时间</th>
|
||||
<th>用户</th>
|
||||
<th>操作</th>
|
||||
<th>对象</th>
|
||||
<th>结果</th>
|
||||
<th>消息</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for l in logs %}
|
||||
<tr>
|
||||
<td><span class="small">{{ l.timestamp.strftime('%Y-%m-%d %H:%M:%S') }}</span></td>
|
||||
<td>{{ l.user }}</td>
|
||||
<td><code>{{ l.action }}</code></td>
|
||||
<td><code>{{ l.target }}</code></td>
|
||||
<td>
|
||||
{% if l.result == 'ok' %}
|
||||
<span class="badge badge-ok">{{ l.result }}</span>
|
||||
{% else %}
|
||||
<span class="badge badge-warn">{{ l.result }}</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td><span class="small">{{ l.message }}</span></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
{% if pages > 1 %}
|
||||
<div class="pager">
|
||||
{% if page > 1 %}<a href="?page={{ page-1 }}" class="btn">← 上一页</a>{% endif %}
|
||||
<span class="muted">第 {{ page }} / {{ pages }} 页</span>
|
||||
{% if page < pages %}<a href="?page={{ page+1 }}" class="btn">下一页 →</a>{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user