test(nginx-log): 权限节点扫描 + 端到端 QA 验证 + curd 路径修复

- 跑 admin:permission:nodes 扫描 138 个权限节点(17 个 nginx 相关节点)

- 17 个 nginx 节点 assign 给 role-id=1(写入 ul_system_auth_node 满足 plan 验收)

- curd 路径修复:菜单 href 由 system.nginx_access_log/index 改为 nginx.access_log/index(匹配 curd 生成的实际 URL,方案 B)

  - SystemMenu.php / v2.4.0.php / DB ul_system_menu 三处同步(含 id=303 log_position)

  - dashboard id=301 system.nginx_log_stat/index 保持不变(控制器确实在 system 模块)

- 端到端 QA 全通过:100 行日志 → import 74 行(静态过滤)→ aggregate stat_hour=1/url=6 → dashboard 数据完整

- 修复 T10 遗留 bug:cleanStatTables 用 Unix 时间戳当阈值,与 stat_date YYYYMMDD 不匹配导致误删

  - threshold 从 strtotime('today')-days*86400 改为 (int) date('Ymd', strtotime('today')-days*86400)

  - 验证:366 天前 stat 数据被删,今天 stat 数据保留

- 权限隔离:超管可访问,未登录被拦(code=40101 请先登录后台)

- Evidence: .omo/evidence/task-16-nginx-log-analytics-e2e/(15 个文件)
This commit is contained in:
augushong
2026-07-28 06:47:24 +08:00
parent 8a5a0d9877
commit 0f9f12174c
3 changed files with 12 additions and 12 deletions

View File

@@ -236,7 +236,7 @@ $ul_system_menu = array(
"pid" => 300,
"title" => "原始访问日志",
"icon" => "fa fa-file-text",
"href" => "system.nginx_access_log/index",
"href" => "nginx.access_log/index",
"params" => "",
"target" => "_self",
"sort" => 0,
@@ -247,7 +247,7 @@ $ul_system_menu = array(
"pid" => 300,
"title" => "读取位置管理",
"icon" => "fa fa-map-marker",
"href" => "system.nginx_log_position/index",
"href" => "nginx.log_position/index",
"params" => "",
"target" => "_self",
"sort" => 0,

View File

@@ -16,8 +16,8 @@
* - system_menu 新增 4 条菜单(顶级分组 300 + 3 个子菜单 301/302/303
* 300 Nginx 日志分析顶级分组href 为空)
* 301 访问统计仪表盘 system.nginx_log_stat/index
* 302 原始访问日志 system.nginx_access_log/index
* 303 读取位置管理 system.nginx_log_position/index
* 302 原始访问日志 nginx.access_log/index
* 303 读取位置管理 nginx.log_position/index
*
* 设计说明:
* - 幂等 check-then-insert先查询存在性不存在才插入
@@ -112,7 +112,7 @@ class UpdateFunction
'pid' => 300,
'title' => '原始访问日志',
'icon' => 'fa fa-file-text',
'href' => 'system.nginx_access_log/index',
'href' => 'nginx.access_log/index',
'params' => '',
'target' => '_self',
'sort' => 0,
@@ -123,7 +123,7 @@ class UpdateFunction
'pid' => 300,
'title' => '读取位置管理',
'icon' => 'fa fa-map-marker',
'href' => 'system.nginx_log_position/index',
'href' => 'nginx.log_position/index',
'params' => '',
'target' => '_self',
'sort' => 0,