From 07ee66bbd283205a7b1674d57d3f4dde01bc5ef9 Mon Sep 17 00:00:00 2001 From: sunhao Date: Fri, 28 Apr 2023 16:33:56 +0800 Subject: [PATCH] * zin: support to show xhprof link on zinbar --- framework/base/router.class.php | 6 ------ www/js/zui3/zin.js | 2 ++ 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/framework/base/router.class.php b/framework/base/router.class.php index d5a31cd0f4..53c27d8ea6 100644 --- a/framework/base/router.class.php +++ b/framework/base/router.class.php @@ -799,12 +799,6 @@ class baseRouter $runID = $xhprofRuns->save_run($log, $type); header("Xhprof-RunID: {$runID}"); - if(class_exists(\zin\zin::class) && isset(\zin\zin::$data['zinDebug'])) - { - $xhprofURL = getWebRoot(true) . "xhprof/xhprof_html/index.php?run={$runID}&source={$type}"; - \zin\zin::$data['zinDebug']['xhprof'] = $xhprofURL; - } - return true; } diff --git a/www/js/zui3/zin.js b/www/js/zui3/zin.js index 9958c3dff0..149d51d973 100644 --- a/www/js/zui3/zin.js +++ b/www/js/zui3/zin.js @@ -289,6 +289,8 @@ task.timerID = 0; task.xhr = requestContent(options, () => { + const runID = task.xhr.getResponseHeader('Xhprof-RunID'); + updateZinbar({id: id, xhprof: `${config.webRoot}xhprof/xhprof_html/index.php?run=${runID}&source=${config.currentModule}_${config.currentMethod}`}); task.xhr = null; fetchTasks.delete(id); });