mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-07 02:22:48 +08:00
T10: TimerConfig CURD - task management with run_type/status editing,
manual trigger button, task_name read-only, no add/delete
T11: TimerLog CURD - read-only log viewer with filters and color badges
T12: Host list enhanced - is_master column, setMaster button
48 lines
2.4 KiB
PHP
48 lines
2.4 KiB
PHP
$(function(){
|
|
ua.table.render({
|
|
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: 300, title: '操作', templet: ua.table.tool, operat: [
|
|
'edit',
|
|
[{
|
|
text: '设为主节点',
|
|
url: init.set_master_url,
|
|
method: 'request',
|
|
field: function(data) {
|
|
return {node_id: data.node_id};
|
|
},
|
|
auth: 'set-master',
|
|
class: 'layui-btn layui-btn-xs layui-btn-warm',
|
|
title: '确认将该节点设为主节点?切换后原主节点将变为从节点。',
|
|
_if: function(data) {
|
|
return data.status == 1 && data.is_master != 1;
|
|
}
|
|
}],
|
|
'delete'
|
|
], fixed:'right'},
|
|
|
|
]],
|
|
});
|
|
|
|
ua.listen();
|
|
})
|