feat: Add console log for ajax actions when explain cookie is set (#1940)

This commit is contained in:
Roman Kelesidis 2025-06-11 21:20:08 +03:00 committed by GitHub
commit 345dd1bc20
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 1 deletions

View file

@ -176,6 +176,11 @@ class Ajax
{
$this->response['action'] = $this->action;
// Show ajax action in console log
if (!empty($_COOKIE['explain'])) {
$this->response['console_log'] = 'ajax action: ' . $this->response['action'];
}
if (Dev::sqlDebugAllowed()) {
$this->response['sql_log'] = Dev::getSqlLog();
}

View file

@ -343,12 +343,14 @@ Ajax.prototype = {
}
} else if (response.error_code) {
ajax.showErrorMsg(response.error_msg);
console.log(response.console_log);
$('.loading-1').removeClass('loading-1').html('error');
} else {
ajax.callback[action](response);
ajax.clearActionState(action);
}
if (response.console_log) {
console.log(response.console_log);
}
},
error: function (xml, desc) {