Commit Graph

373 Commits

Author SHA1 Message Date
augushong
c980ebdff0 feat(admin): XHProf 函数监控规则与命中记录 2026-08-15 07:02:37 +08:00
augushong
e57b186126 feat(admin): XHProf 采样列表页
- curd -t ul_xhprof_run 生成三件套(控制器 xhprof.run 子目录形态,model docblock 随生成刷新)
- 只读化:toolbar 清空 + 行内仅详情按钮(open 弹层 xhprof.run/detail?id=N,auth=detail),
  add/edit/delete 等 action 保留靠权限节点不分配拦截(T8 对齐)
- 列渲染:wall_time/cpu_time μs→ms(>1000ms 红色)、memory_peak 字节→MB、
  url 截断 title 全显、method 标签化、request_time 浮点秒→日期时间
- 四组搜索:url like / request_time range / wall_time 下限(前端 ms,后端换算 μs,
  withGet 全量合并写回)/ node_id 下拉(DISTINCT + data_brage 通道)
- 生成前 scheme:sync 修复 request_time 的 null/comment 漂移(T3 手工 ALTER 遗留)
2026-08-15 06:48:45 +08:00
augushong
a43a9a48b9 feat(tools): XHProf 日志导入三层服务与函数监控物化
- XhprofProfileParserService(Base/App):纯数组解析 jsonl 行,
  meta 字段以真实 fixture 为准;simple_url 缺失兜底与采集端回调同算法;
  watch 正则按 callee 物化(ct/wt_sum/wt_max),非法正则编译计 fail 跳过
- XhprofLogReaderService(Base/App):增量读取,半行缓冲超限整行丢弃
  (不照抄 nginx 8MB 强制切行);EOF 无换行半行不 yield 不推进 offset;
  进度不自动落盘,由导入侧在同一事务内显式 savePosition
- XhprofLogImport 定时任务(Base/App):不受 XHPROF_ENABLE 门控,
  runs-*.jsonl 按文件名序增量导入;run 逐条 insert + detail chunk 20
  insertAll + run_watch insertAll 与 position 同事务落盘;导至 EOF 后
  只删已导完文件
- 修复 T1 缺陷:request_time decimal(12,3) 装不下 10 位时间戳,
  Scheme 与 migration 同步改 decimal(13,3)
- 新增 parser 单元测试(真实 fixture 断言,9 用例 42 断言)
  与 jsonl fixture;phpunit 注册 unit 测试套件
2026-08-15 06:11:01 +08:00
augushong
b472df8c1d feat(tools): XHProf 数据清理任务与定时注册 2026-08-15 05:47:34 +08:00
augushong
7e73902325 feat(admin): XHProf 性能日志五张表 Scheme 迁移与模型 2026-08-14 22:04:52 +08:00
augushong
8faa52ce90 feat(nginx-log): 多节点适配(node_id 全链路 + 全局/按节点聚合 + 节点筛选 + v2.4.0 升级脚本)
- 6 张表加 node_id 字段 + position/stat 改复合唯一键(migration)
- 6 个 Scheme 同步 node_id 注解 + 唯一键
- Reader 带 node_id 参数 + 懒加载接管(getLastPosition 回退查 node_id='')
- Aggregator 全局行(node_id='')+ 按节点循环 insertAggregatesForScope
- Stat 所有查询方法加 where node_id 条件
- Dashboard 控制器/视图加节点筛选下拉框 + AJAX 带 node_id
- AccessLog 列表加节点列 + 采集进度卡片显示节点信息
- import 定时任务 run_type 改 all(每节点采集自己的日志)
- v2.4.0 升级脚本追加 ALTER TABLE(幂等 check-then-alter)
- 菜单调整:去掉 Nginx 顶级菜单 + 读取位置管理,改为系统管理下挂两个子菜单
- ulthon-timer 文档补充 run_type=all 多节点部署注意事项
2026-08-08 10:33:20 +08:00
augushong
f1a2e8fd5d fix(nginx-log): service 文件加 Service 后缀(命名规范合规)
F2 Code quality review 发现:3 个新增 service 未遵守
.agents/rules/ulthon-naming-convention.md 第 19 行规定
(service 模块文件名需带 Service 后缀)。

变更:
- 重命名 6 个文件(3 Base + 3 App):
  NginxLogParser(Base)→NginxLogParserService(Base)
  NginxLogReader(Base)→NginxLogReaderService(Base)
  NginxLogAggregator(Base)→NginxLogAggregatorService(Base)
- 同步类名、use、类型 hint、new 引用
- NginxLogReaderServiceBase 异常消息前缀同步加 Service
- controller Base 引用更新(NginxLogImportBase / NginxLogStatAggregateBase)

验证:
- php -l 全部 8 个文件语法通过
- grep 残留旧名 = 0 结果(24 处引用全部带 Service 后缀)
2026-07-28 06:57:13 +08:00
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
augushong
7987001cd2 feat(nginx-log): NginxLogStat dashboard 控制器(Base/App 双层,日/周/月/年聚合)
- extend/base/admin/controller/system/NginxLogStatBase.php:完整逻辑
  - @ControllerAnnotation(title=Nginx访问统计) + @NodeAnotation(title=访问统计)
  - index() 页面/接口同体:isAjax() 返回 JSON,否则 fetch()
  - period 解析:day(24h)/week(7d)/month(30d)/year(12m)/custom,invalid 自动 fallback day
  - custom start>end 自动 swap
  - 整体指标:SUM stat_hour,avg_request_time 按 PV 加权平均
  - 趋势:day 按 stat_hour 聚合补 0-23;week/month/custom 按 stat_date 补日期序列;year 按 (stat_date DIV 100) 聚合补 1-12 月
  - Top N:sysconfig('nginx_log','topn_default',10),topN=0 不截断
  - 跨周期 UV 标注:uv_is_estimate = period !== 'day'
  - 空表/空范围不崩(返回 0/[])
- app/admin/controller/system/NginxLogStat.php:App 入口,仅 extends Base

性能:stat_hour 10 万行 + period=year 服务端 < 700ms(< 2s 要求)
依赖:T1 stat 模型、T9 Aggregate;blocks:T13 视图
2026-07-28 06:17:22 +08:00
augushong
2b677c6f89 feat(nginx-log): NginxLogStatAggregate 定时任务 + timer config 注册 2026-07-28 06:02:07 +08:00
augushong
8eaa672ed6 feat(nginx-log): NginxLogClean 定时任务 + timer config 注册(完成 3 个 nginx 任务) 2026-07-28 06:00:15 +08:00
augushong
13b1313e92 feat(nginx-log): NginxLogImport 定时任务 + timer config 注册(Base/App 双层) 2026-07-28 05:48:46 +08:00
augushong
ceb73c750a feat(nginx-log): NginxLogAggregator 聚合 service(Base/App 双层,delete-then-insert 幂等) 2026-07-28 00:52:51 +08:00
augushong
9fe55f81bf feat(nginx-log): NginxLogReader 增量读取 service(Base/App 双层,含轮转检测) 2026-07-28 00:39:11 +08:00
augushong
7d707c2150 feat(nginx-log): NginxLogParser 解析器 service(Base/App 双层) 2026-07-28 00:38:25 +08:00
augushong
0d19881a22 feat(nginx-log): 新增 6 张表 phinx migration + Scheme + model 2026-07-28 00:03:49 +08:00
augushong
908f84ee9f refactor(timer): TimerLog 控制器迁移到 Base 层 + toolbar 与事件监听修正
控制器逻辑移入 extend/base/admin/controller/system/TimerLogBase.php,app 层改为空壳继承。index.js 补 toolbar:[] + defaultToolbar:['filter'](B 类只读页面),修正 ua.table.on → layui.table.on。

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-07-25 22:39:53 +08:00
augushong
009647f96f refactor(timer): TimerConfig 控制器与视图迁移到 Base 层
控制器逻辑移入 extend/base/admin/controller/system/TimerConfigBase.php,app 层改为空壳继承。9 个视图文件迁移到 extend/base/admin/view/system/timer_config/。index.js 补 toolbar: ['refresh', 'export'] 声明(C 类页面,去掉默认的 add/delete)。

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-07-25 22:39:20 +08:00
augushong
12fe271ce0 feat(timer): 编辑页并发数配置表单
edit 表单放行 concurrency 字段,空值=继承代码默认写 NULL,正整数=覆盖。前端联动提示语义。

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-07-25 21:58:20 +08:00
augushong
41a0f99735 feat(timer): 列表页节点视角下拉与归属可视化
新增节点视角下拉(全局/指定节点),calcOwnership 计算任务归属,触发操作联动节点选择器定向 trigger_node_id,并发列双通道显示(默认/覆盖值)。

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-07-25 21:58:07 +08:00
augushong
f13384403a feat(timer): 后台触发/编辑/节点列表控制器改造
trigger 定向 trigger_node_id 必填穿透 status;edit/modify 改 concurrency 后 Cache::inc 递增脏标记触发立即 reload(D18);hostList 返回在线节点;normalizeConcurrency 归一化入库值。

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-07-25 21:57:56 +08:00
augushong
236a343fa9 feat(timer): 新增并发数/触发节点/触发时间三字段及幂等分发
Scheme 定义 concurrency(nullable)/trigger_node_id/last_trigger_time 三字段,Model 声明属性,v2.3.0 分发代码幂等 ALTER 保证升级自动同步。

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-07-25 21:57:14 +08:00
augushong
387d89c596 breaking(stack): 彻底移除 stack:mode 命令(含 app/extend/base/注册) 2026-07-22 00:50:56 +08:00
augushong
600ee5b085 refactor(agents): 删除 tools:agent:publish 命令,补全 helper.php 函数覆盖机制,修正多处文档 bug
- 删除 tools:agent:publish 整套(不再兼容多套 IDE,只保留 .agents 目录)
- helper.php 全部 27 个全局函数加 if (!function_exists()) 包裹,项目侧可在 app/common.php 定义同名函数覆盖
- ulthon-file-override-mechanism.md 新增全局函数覆盖章节
- AGENTS.md 删除智能体指导章节,PHP 8+ 改为 8.0+,MySQL 8+ 改为 5.7+
- AGENTS.md 项目结构树补全 tests/、extend/think/、source/ 子项
- README.md PHP 版本统一为 8.0+
- ulthon-base-app-architecture SKILL 路径补 admin/service/ 段
- ulthon-tools-http-call SKILL 补 --page-data 参数
- ulthon-naming-convention 补元数据头
- ulthon-update-workflow 统一 extend/think/ 归类
2026-07-21 19:35:28 +08:00
augushong
3f7050bf65 feat(test): 框架测试基建基类TestCaseBase+app层入口+冒烟测试
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-07-18 00:12:41 +08:00
augushong
e558a97e91 fix(host): 防止主节点重复并修复 setMaster 权限
Clear all is_master flags before electing new master to prevent multiple master records. Fix setMaster annotation from @auth true to proper @NodeAnotation format so permission node is generated correctly.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-26 18:33:46 +08:00
augushong
a47bbb2c6a fix(timer): 自动记录执行日志并捕获结果
Add execute() wrapper in TimerControllerBase that wraps do() with logStart/logEnd, captures return value to result field. Change site URL routing from /do to /execute with task_name injection. Add result field to system_timer_log scheme.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-26 18:33:45 +08:00
augushong
e1bf94a55e feat(timer): 新增日志每日自动清理定时任务
- New LogClean timer controller (site type, frequency 86400s)
- run_type defaults to auto, only one node cleans per day
- Cleans system_timer_log records older than 30 days
2026-05-26 18:33:45 +08:00
augushong
90e584f5a1 feat(timer): 新增定时器配置、日志和主机的后台管理界面
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
2026-05-26 18:33:43 +08:00
augushong
25fab093fa feat(timer): 新增 run_type 调度、host_id 投递和日志清理
T7: TimerBase shouldExecuteTask() - main/auto/all/manual/disabled modes
    with two-phase DB row lock for auto mode
T8: TimerControllerBase - host_id param, logStart/logEnd methods
    TimerServiceBase - inject host_id into site URLs
T9: TimerLogClean command - php think admin:timer:log:clean --days=30
2026-05-26 18:33:42 +08:00
augushong
abeac2c3cb feat(timer): 新增配置同步到数据库及主节点选举
T5: TimerServiceBase.syncConfigToDatabase() - syncs task config to DB
T6: HostServiceBase - auto master election, stale node detection,
    getMasterNode/setMasterNode methods
2026-05-26 18:33:41 +08:00
augushong
d719a99d14 feat(timer): 新增多节点定时器协调的 Scheme 定义 2026-05-26 18:33:41 +08:00
augushong
db057aa90e feat(stack): 切换模式时自动删除多余的管理文件
All checks were successful
build-and-deploy / 直传代码并部署到 Host15 (push) Successful in 1m0s
- 重写 getModePlan: 跳过目标模式和 default 都不存在的文件 (不再抛异常)
- 重写 applyMode: 切换模式后自动清理孤立的管理文件, 删除前备份以支持 rollback
- 修复 HOSTPORT 为 3306 (容器内部端口, 非宿主机映射端口)
- 增加 backup_id 空值保护: 无备份时不执行删除
2026-04-29 23:35:56 +08:00
augushong
b44fcfd86c feat(stack): 新增 stack 模式管理功能
- 新增 `php think admin:stack:mode` 命令,支持 list/use/current/rollback 操作
- 新增 StackModeService 服务,负责模式切换、备份与回滚逻辑
- 在 source/stack/ 目录下添加 default、full、base-build 三种模式的配置文件
- 更新 UlthonAdminService 以注册新的命令行工具
2026-04-24 23:20:13 +08:00
augushong
8cc08bcb8c feat: 发布智能体版 2026-03-26 20:22:34 +08:00
augushong
1a88ff286e feat(uniapp): 集成 Pinia 状态管理并实现用户认证流程 2026-02-01 12:01:37 +08:00
augushong
5bee1b3733 feat(console): 添加 --force-force 参数以跳过所有交互确认 2026-01-31 23:00:51 +08:00
augushong
e8f58ef322 feat(command): 新增数据库调试命令行工具集 2026-01-26 23:10:10 +08:00
augushong
6eefa1cd2e refactor(admin): 重构系统状态模块以支持模块化结构 2026-01-23 00:02:51 +08:00
augushong
3a4194d3e9 feat: 新增系统状态页面功能 2026-01-22 23:28:13 +08:00
augushong
23826cd06e refactor(scheme): 优化数据库同步逻辑并增加备份表检查 2026-01-09 22:26:34 +08:00
augushong
edeae731f0 refactor: 删除废弃的scheme类文件 2026-01-09 21:40:20 +08:00
augushong
6b4a67aeb4 feat(scheme): 新增多个数据模型类文件 2026-01-09 21:38:25 +08:00
augushong
8de6b99bb3 feat(scheme): 新增数据库表结构同步方案 2026-01-09 21:08:51 +08:00
augushong
00af0fa628 feat: 去掉控制器中的运行节点注册机制 2025-08-24 14:01:36 +08:00
augushong
a9d1429000 feat: 增加内置节点注册任务;优化定时器代码结构; 2025-08-23 23:22:52 +08:00
augushong
b1a6b37ee0 feat: 增加主机节点表结构代码 2025-08-23 22:44:47 +08:00
augushong
46722e5a66 feat: 增加主机节点服务类 2025-08-23 22:30:33 +08:00
augushong
d3e85fa552 feat: 升级权限管理模式 2025-03-20 16:57:05 +08:00
augushong
3f48492089 增加数据库的文件字段数据迁移 2024-10-25 20:47:21 +08:00