feat: 配置功能仅admin可用,operator隐藏配置按钮+后端403拦截
- devices.html: 注入 USER_ROLE 全局变量 - devices.js: 配置按钮仅 USER_ROLE===admin 时渲染 - fixture.py: 页面/指令/保存三个路由均校验 admin 角色
This commit is contained in:
@@ -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("");
|
||||
|
||||
Reference in New Issue
Block a user