diff --git a/ui/app/controllers/CControllerHostView.php b/ui/app/controllers/CControllerHostView.php index fa49db92ec3..bc8d5cdd138 100644 --- a/ui/app/controllers/CControllerHostView.php +++ b/ui/app/controllers/CControllerHostView.php @@ -125,7 +125,7 @@ class CControllerHostView extends CControllerHost { 'page' => $filter['page'], 'csrf_token' => CCsrfTokenHelper::get('tabfilter') ] - ] + $this->getData($filter); + ]; $response = new CControllerResponseData($data); $response->setTitle(_('Hosts')); diff --git a/ui/app/views/js/monitoring.host.view.js.php b/ui/app/views/js/monitoring.host.view.js.php index b7e6374525d..387d47d4eac 100644 --- a/ui/app/views/js/monitoring.host.view.js.php +++ b/ui/app/views/js/monitoring.host.view.js.php @@ -201,6 +201,18 @@ if ('messages' in response) { this._addRefreshMessage(response.messages); } + + ('debug' in response) && this.refreshDebug(response.debug); + }, + + getCurrentDebugBlock() { + return document.querySelector('.wrapper > .debug-output'); + }, + + refreshDebug(debug) { + this.getCurrentDebugBlock().replaceWith( + new DOMParser().parseFromString(debug, 'text/html').body.firstElementChild + ); }, onDataFail(jqXHR) { diff --git a/ui/app/views/monitoring.host.view.refresh.php b/ui/app/views/monitoring.host.view.refresh.php index 28d7a7c01a7..a7d6a48cd44 100644 --- a/ui/app/views/monitoring.host.view.refresh.php +++ b/ui/app/views/monitoring.host.view.refresh.php @@ -27,4 +27,9 @@ if (($messages = getMessages()) !== null) { $output['messages'] = $messages->toString(); } +if (CWebUser::$data['debug_mode'] == GROUP_DEBUG_MODE_ENABLED) { + CProfiler::getInstance()->stop(); + $output['debug'] = CProfiler::getInstance()->make()->toString(); +} + echo json_encode($output);