mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-08-30 04:35:33 +08:00
fix(admin): 修复详情页弹层内接口请求路径解析错误
This commit is contained in:
@@ -33,10 +33,13 @@ $(function () {
|
||||
};
|
||||
|
||||
// 接口模式请求同一路由(Accept: application/json 触发页面/接口同体的接口分支)
|
||||
// url 用当前页完整地址:相对地址的解析基准是"当前 URL 目录",
|
||||
// 详情页自身位于 /admin/xhprof.run/detail,相对 'xhprof.run/detail' 会被
|
||||
// 拼成 /admin/xhprof.run/xhprof.run/detail 导致 404;当前页 URL 即同体
|
||||
// API 端点(id 已在 location.search 中,勿重复拼接 data)
|
||||
$.ajax({
|
||||
url: 'xhprof.run/detail',
|
||||
url: location.pathname + location.search,
|
||||
type: 'get',
|
||||
data: {id: runId},
|
||||
headers: {Accept: 'application/json'},
|
||||
dataType: 'json',
|
||||
success: function (res) {
|
||||
|
||||
@@ -74,7 +74,7 @@ pre { padding: 10px; overflow-x: auto; border: 1px solid #e5e5e5; }
|
||||
<table>
|
||||
<tr><th>#</th><th>缺陷</th><th>处置</th></tr>
|
||||
<tr><td>B1(已修复)</td><td>app/admin/view/xhprof/run_watch/index.js:26 调用 window.UA_CORE.util.toDateString —— UA_CORE 全项目零定义(T7 笔误 API),浏览器抛 "Cannot read properties of undefined (reading 'util')",命中记录页数据行渲染崩溃</td><td class="pass">照抄 T5 formatRequestTime 纯 JS 实现替换(保留 isNaN 兜底);实测 32 行正常渲染、console 0 error;fix 提交入库</td></tr>
|
||||
<tr><td>B2(已上报,不在 T9 修复范围)</td><td>app/admin/view/xhprof/run/detail.js:37 $.ajax 用裸相对 URL 'xhprof.run/detail',在 /admin/xhprof.run/detail iframe 内解析为 /admin/xhprof.run/xhprof.run/detail → 404,详情页函数表与 SQL 摘要在浏览器端加载失败(服务端渲染的头部统计正常;API 层功能本身正常)</td><td class="warn">上报编排器;建议修法 url: ua.url('xhprof.run/detail')(属 T6 文件,T9 红线禁止改动)</td></tr>
|
||||
<tr><td>B2(已修复)</td><td>app/admin/view/xhprof/run/detail.js $.ajax 用裸相对 URL 'xhprof.run/detail',相对地址的解析基准是"当前 URL 目录":详情页自身位于 /admin/xhprof.run/detail(基准目录 /admin/xhprof.run/),拼出 /admin/xhprof.run/xhprof.run/detail → 404,函数表与 SQL 摘要在浏览器端加载失败(服务端渲染的头部统计正常;API 层功能本身正常)</td><td class="pass">改为 url: location.pathname + location.search(当前页 URL 即同体 API 端点,对后台入口自定义改名免疫),并删除 data:{id}(id 已在 query 中防重复拼接);弹层与非弹层两上下文实测:函数表 Top100 加载(函数总数 568,main() 在列)、SQL 摘要条有值(1.17s / 16.76% / 90 函数 / 138 次)、console 0 error;fix 提交入库</td></tr>
|
||||
</table>
|
||||
|
||||
<h2>六、关键命令与输出摘录</h2>
|
||||
@@ -102,15 +102,15 @@ $env:XHPROF_ENABLE='false'; docker compose ... up -d # 8 请求全 200,jsonl
|
||||
<h2>七、截图存证(6 张,1920x1080 + 390x844)</h2>
|
||||
<div class="shots">
|
||||
<figure><img src="../../runtime/agents/xhprof-backend-screenshots/01-run-index-1920.png" alt="采样列表 1920"><figcaption>01 采样列表(1920x1080,共 23 条,无添加按钮)</figcaption></figure>
|
||||
<figure><img src="../../runtime/agents/xhprof-backend-screenshots/02-run-detail-1920.png" alt="运行详情 1920"><figcaption>02 运行详情(1920x1080,头部统计正常;函数表受 B2 影响未加载,已上报)</figcaption></figure>
|
||||
<figure><img src="../../runtime/agents/xhprof-backend-screenshots/02-run-detail-1920.png" alt="运行详情 1920"><figcaption>02 运行详情(1920x1080,B2 修复后:函数表 Top100 加载、SQL 摘要有值、main() 在列)</figcaption></figure>
|
||||
<figure><img src="../../runtime/agents/xhprof-backend-screenshots/03-watch-index-1920.png" alt="监控规则 1920"><figcaption>03 监控规则(1920x1080,3 条预置规则)</figcaption></figure>
|
||||
<figure><img src="../../runtime/agents/xhprof-backend-screenshots/04-run-watch-index-1920.png" alt="命中记录 1920"><figcaption>04 命中记录(1920x1080,B1 修复后 32 行正常渲染 + 超阈值徽章)</figcaption></figure>
|
||||
<figure><img src="../../runtime/agents/xhprof-backend-screenshots/05-run-index-390.png" alt="采样列表 390"><figcaption>05 采样列表(390x844,横向滚动不崩)</figcaption></figure>
|
||||
<figure><img src="../../runtime/agents/xhprof-backend-screenshots/06-run-detail-390.png" alt="运行详情 390"><figcaption>06 运行详情(390x844,统计卡片纵向堆叠不崩)</figcaption></figure>
|
||||
<figure><img src="../../runtime/agents/xhprof-backend-screenshots/06-run-detail-390.png" alt="运行详情 390"><figcaption>06 运行详情(390x844,B2 修复后:函数表加载、统计卡片纵向堆叠不崩)</figcaption></figure>
|
||||
</div>
|
||||
|
||||
<h2>八、结论</h2>
|
||||
<p>6 组主链断言 + 4 条失败路径 + 3 条回归(+终态恢复)全部通过;页面 QA 两分辨率不崩。XHProf 后台化全链路(采集 → jsonl 落盘 → 定时导入入库 → watch 物化 → 后台三页面 → 过期清理)在真实容器环境验证可用。遗留 B2(详情页浏览器端 ajax 相对路径 404)已上报编排器,不影响列表/命中/监控页面与服务端 API。</p>
|
||||
<p>6 组主链断言 + 4 条失败路径 + 3 条回归(+终态恢复)全部通过;页面 QA 两分辨率不崩。XHProf 后台化全链路(采集 → jsonl 落盘 → 定时导入入库 → watch 物化 → 后台三页面 → 过期清理)在真实容器环境验证可用。T9 期间发现的两处前端缺陷(B1 命中记录页假 API、B2 详情页相对路径 404)均已修复并浏览器实测通过,无遗留问题。</p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user