- 新增 /device-logs 设备事件日志管理页 (admin 权限) - 支持按设备序列号/事件类型筛选查询 - 支持 admin 按条件删除日志 - 不同事件类型彩色标识 (在线=绿, 离线=红, 通信不良=橙) - 新增 /api/devices/<id>/status 设备状态 API - 设备列表页:每 5s 异步刷新所有设备在线状态 - 测试操作页:顶部显示设备状态,每 5s 异步刷新 - dnt_info state 支持三态显示 (在线/离线/通信不良) - 导航栏增加「设备日志」入口 (admin only)
31 lines
1.3 KiB
HTML
31 lines
1.3 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="zh-CN">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>{% block title %}EDC 工装管理系统{% endblock %}</title>
|
|
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
|
|
</head>
|
|
<body>
|
|
<nav class="top-menu">
|
|
<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 %}
|
|
<span class="user-info">
|
|
{% if current_user.is_authenticated %}
|
|
{{ current_user.username }} ({{ current_user.role }})
|
|
<a href="/logout">退出</a>
|
|
{% endif %}
|
|
</span>
|
|
</nav>
|
|
<main class="container">
|
|
{% block content %}{% endblock %}
|
|
</main>
|
|
{% block scripts %}{% endblock %}
|
|
</body>
|
|
</html>
|