feat: 配置功能仅admin可用,operator隐藏配置按钮+后端403拦截

- devices.html: 注入 USER_ROLE 全局变量
- devices.js: 配置按钮仅 USER_ROLE===admin 时渲染
- fixture.py: 页面/指令/保存三个路由均校验 admin 角色
This commit is contained in:
wangfq
2026-06-09 15:36:08 +08:00
parent e863dfbe2f
commit 8aaa8440d1
3 changed files with 10 additions and 1 deletions

View File

@@ -22,7 +22,7 @@ function renderTable(devices) {
<td>${d.last_login || '-'}</td>
<td>
<button class="btn-test" onclick="location.href='/test/${d.id}'">测试</button>
<button class="btn-config" onclick="location.href='/fixture/${d.id}'">配置</button>
${USER_ROLE === 'admin' ? `<button class="btn-config" onclick="location.href='/fixture/${d.id}'">配置</button>` : ''}
</td>
</tr>
`).join("");