feat: 增加 analyst 角色——仅测试数据查询/下载+修改密码

This commit is contained in:
wangfq
2026-06-11 17:21:49 +08:00
parent 317c15aff2
commit 17e1d232e8
5 changed files with 26 additions and 1 deletions

View File

@@ -8,7 +8,9 @@
</head>
<body>
<nav class="top-menu">
{% if current_user.is_authenticated and current_user.role != 'analyst' %}
<a href="/" class="{% if request.path == '/' %}active{% endif %}">设备</a>
{% endif %}
<a href="/test-data" class="{% if request.path == '/test-data' %}active{% endif %}">测试信息</a>
{% if current_user.is_authenticated and current_user.role in ('admin', 'manager') %}
<a href="/device-logs" class="{% if request.path == '/device-logs' %}active{% endif %}">设备日志</a>

View File

@@ -12,6 +12,7 @@
<label>角色:
<select id="new-role" style="margin:0 8px;">
<option value="operator">operator</option>
<option value="analyst">analyst</option>
<option value="manager">manager</option>
<option value="admin">admin</option>
</select>
@@ -52,6 +53,7 @@ async function loadUsers() {
<td>
<select onchange="updateUser(${u.id}, this, 'role')" data-field="role">
<option value="operator" ${u.role==='operator'?'selected':''}>operator</option>
<option value="analyst" ${u.role==='analyst'?'selected':''}>analyst</option>
<option value="manager" ${u.role==='manager'?'selected':''}>manager</option>
<option value="admin" ${u.role==='admin'?'selected':''}>admin</option>
</select>