Files
ulthon_admin/app/admin/view/nginx/log_position/index.js
augushong d5329cdd45 feat(nginx-log): curd 生成 raw/position 后台并改只读
- NginxAccessLog + NginxLogPosition Scheme 加 #[Component] 注解
- Scheme Table name 补 ul_ 前缀(curd 严格校验要求)
- curd 生成 nginx 模块完整后台(controller/model/view/js)
- Base/App 双层只读控制器(参照 TimerLogBase 范式)
  - AccessLogBase: add/edit/delete/modify 全部 error
  - LogPositionBase: 同上
- 视图改造:
  - access_log 裁剪到 8 列核心字段(time_local/method/uri/status/remote_addr/request_time/body_bytes_sent/http_user_agent)
  - status/request_time 自定义 badge 渲染
  - toolbar 清空 + operat 仅保留详情(B 类只读页面)
  - log_position 全字段 + 只读化
- HTTP 验证:index 200 OK + add/edit/delete/modify 全部返回错误
2026-07-28 06:21:13 +08:00

42 lines
1.8 KiB
PHP

$(function(){
ua.table.render({
init: init,
toolbar: [],
defaultToolbar: ['filter'],
cols: [[
{type: 'checkbox'},
{field: 'id', title: 'ID', width: 80},
{field: 'file_path', title: '文件路径', minWidth: 250},
{field: 'inode', title: 'inode', width: 120},
{field: 'offset', title: '偏移量', width: 120},
{field: 'last_read_time', title: '最后读取时间', width: 170, search: 'range', templet: ua.table.date},
{field: 'last_line_hash', title: '最后行哈希', width: 160, search: false},
{field: 'parse_fail_count', title: '失败次数', width: 100, search: 'number_limit', templet: function(d) {
var c = parseInt(d.parse_fail_count);
if (c > 0) return '<span class="layui-badge layui-bg-red">' + c + '</span>';
return '<span class="layui-badge layui-bg-green">0</span>';
}},
{field: 'parse_fail_samples', title: '失败样本', minWidth: 200, search: false},
{field: 'create_time', title: '创建时间', width: 170, search: 'range', templet: ua.table.date},
{field: 'update_time', title: '更新时间', width: 170, search: false, templet: ua.table.date},
{
width: 100, title: '操作', templet: ua.table.tool, fixed: 'right', operat: [
[{
class: 'layui-btn layui-btn-primary layui-btn-xs',
method: 'tab',
field: 'id',
text: '详情',
title: '查看详情',
auth: 'read',
url: init.readUrl,
icon: ''
}]
]
},
]],
});
ua.listen();
})