mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-14 18:48:21 -07:00
feat: Add console log for ajax actions when explain cookie is set (#1940)
This commit is contained in:
parent
28e38aa781
commit
345dd1bc20
2 changed files with 8 additions and 1 deletions
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue