feat: edc-web 设备日志管理页 + 在线状态实时刷新

- 新增 /device-logs 设备事件日志管理页 (admin 权限)
  - 支持按设备序列号/事件类型筛选查询
  - 支持 admin 按条件删除日志
  - 不同事件类型彩色标识 (在线=绿, 离线=红, 通信不良=橙)
- 新增 /api/devices/<id>/status 设备状态 API
- 设备列表页:每 5s 异步刷新所有设备在线状态
- 测试操作页:顶部显示设备状态,每 5s 异步刷新
- dnt_info state 支持三态显示 (在线/离线/通信不良)
- 导航栏增加「设备日志」入口 (admin only)
This commit is contained in:
wangfq
2026-06-10 09:14:32 +08:00
parent 60c11fe719
commit ee136cc707
11 changed files with 366 additions and 7 deletions

View File

@@ -11,6 +11,7 @@
<a href="/" class="{% if request.path == '/' %}active{% endif %}">设备</a>
<a href="/test-data" class="{% if request.path == '/test-data' %}active{% endif %}">测试信息</a>
{% if current_user.is_authenticated and current_user.role == 'admin' %}
<a href="/device-logs" class="{% if request.path == '/device-logs' %}active{% endif %}">设备日志</a>
<a href="/logs/" class="{% if request.path == '/logs/' %}active{% endif %}">操作日志</a>
<a href="/users/" class="{% if request.path == '/users/' %}active{% endif %}">用户管理</a>
{% endif %}