- devices.html: 注入 USER_ROLE 全局变量 - devices.js: 配置按钮仅 USER_ROLE===admin 时渲染 - fixture.py: 页面/指令/保存三个路由均校验 admin 角色
28 lines
667 B
HTML
28 lines
667 B
HTML
{% extends "base.html" %}
|
|
{% block title %}设备列表 - EDC 工装管理系统{% endblock %}
|
|
|
|
{% block content %}
|
|
<h2>联网终端列表</h2>
|
|
<table id="device-table">
|
|
<thead>
|
|
<tr>
|
|
<th>设备编码</th>
|
|
<th>名称</th>
|
|
<th>IP 地址</th>
|
|
<th>在线状态</th>
|
|
<th>固件版本</th>
|
|
<th>最后上线</th>
|
|
<th>操作</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody></tbody>
|
|
</table>
|
|
{% endblock %}
|
|
|
|
{% block scripts %}
|
|
<script>
|
|
const USER_ROLE = "{{ current_user.role }}";
|
|
</script>
|
|
<script src="{{ url_for('static', filename='js/devices.js') }}"></script>
|
|
{% endblock %}
|