mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-10-29 08:58:22 +08:00
- CURD 生成模板 index.code 删除 6 个 data-auth 属性行,生成页面零权限声明 - extend/base 13 个列表页 index.html 清理全部 data-auth-* 声明(含注释文本同步改写) - system/host/index.js 的 set-master 按钮 auth 改写为全节点 'system.host/setMaster' (驼峰动作段逐字保留,parseNodeStr 仅 snake 化控制器段);system/auth 的 assignUsers 解析后与注册节点逐字相等,无需改写 - 行为变化:system/uploadfile 页原 data-auth-add/edit/delete 误映射 system.menu/* (上游模板复制残留),删除后按钮按本页 system.uploadfile/* 节点判定——该页 控制器仅注册 delete 动作,非超管用户的添加按钮从此正确隐藏(现状是 有 system.menu/add 权限即显示但点击被后端拒绝),data-auth-edit 为死属性 (本页无编辑按钮) - VersionBase::VERSION v2.7.0 → v2.8.0,使 admin-core.js 静态引用缓存键 (?t=get_site_version_key())失效,防下游升级后旧缓存 js 叠加新布局导致 非超管按钮全隐
47 lines
2.3 KiB
PHP
47 lines
2.3 KiB
PHP
$(function(){
|
|
ua.table.render({
|
|
toolbar: ['refresh'],
|
|
init: init,
|
|
cols: [[
|
|
{type: 'checkbox'},
|
|
{field: 'id', title: 'ID'},
|
|
{field: 'node_id', title: '节点ID'},
|
|
{field: 'ip_address', title: 'IP地址'},
|
|
{field: 'status', search: 'select', selectList: ua.getDataBrage('select_list_status'), title: '状态', templet: ua.table.switch},
|
|
{field: 'is_master', search: 'select', selectList: ua.getDataBrage('select_list_is_master'), title: '节点角色', templet: function(data) {
|
|
if (data.is_master == 1) {
|
|
return '<span class="layui-badge layui-bg-green">主节点</span>';
|
|
}
|
|
return '<span class="layui-badge layui-bg-gray">从节点</span>';
|
|
}},
|
|
{field: 'last_heartbeat_at', title: '最后心跳时间'},
|
|
{field: 'os_info', title: '系统信息'},
|
|
{field: 'php_version', title: 'PHP版本'},
|
|
{field: 'cpu_load', title: 'CPU负载'},
|
|
{field: 'memory_usage', title: '内存占用'},
|
|
{field: 'disk_free', title: '磁盘可用空间'},
|
|
{field: 'disk_total', title: '磁盘总空间'},
|
|
{field: 'create_time', title: '首次运行时间'},
|
|
{width: 200, title: '操作', templet: ua.table.tool, operat: [
|
|
[{
|
|
text: '设为主节点',
|
|
url: init.set_master_url,
|
|
method: 'request',
|
|
field: function(data) {
|
|
return {node_id: data.node_id};
|
|
},
|
|
auth: 'system.host/setMaster',
|
|
class: 'layui-btn layui-btn-xs layui-btn-warm',
|
|
title: '确认将该节点设为主节点?切换后原主节点将变为从节点。',
|
|
_if: function(data) {
|
|
return data.status == 1 && data.is_master != 1;
|
|
}
|
|
}]
|
|
], fixed:'right'},
|
|
|
|
]],
|
|
});
|
|
|
|
ua.listen();
|
|
})
|