mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-22 14:23:57 -07:00
feat: Add console log for ajax actions when explain cookie is set
This commit is contained in:
parent
28e38aa781
commit
e2bf14af1f
2 changed files with 8 additions and 1 deletions
|
@ -176,6 +176,11 @@ class Ajax
|
||||||
{
|
{
|
||||||
$this->response['action'] = $this->action;
|
$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()) {
|
if (Dev::sqlDebugAllowed()) {
|
||||||
$this->response['sql_log'] = Dev::getSqlLog();
|
$this->response['sql_log'] = Dev::getSqlLog();
|
||||||
}
|
}
|
||||||
|
|
|
@ -343,12 +343,14 @@ Ajax.prototype = {
|
||||||
}
|
}
|
||||||
} else if (response.error_code) {
|
} else if (response.error_code) {
|
||||||
ajax.showErrorMsg(response.error_msg);
|
ajax.showErrorMsg(response.error_msg);
|
||||||
console.log(response.console_log);
|
|
||||||
$('.loading-1').removeClass('loading-1').html('error');
|
$('.loading-1').removeClass('loading-1').html('error');
|
||||||
} else {
|
} else {
|
||||||
ajax.callback[action](response);
|
ajax.callback[action](response);
|
||||||
ajax.clearActionState(action);
|
ajax.clearActionState(action);
|
||||||
}
|
}
|
||||||
|
if (response.console_log) {
|
||||||
|
console.log(response.console_log);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
error: function (xml, desc) {
|
error: function (xml, desc) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue