|
|
@@ -218,23 +218,29 @@ class Route_Debug extends RouteBase {
|
|
|
}
|
|
|
return [
|
|
|
'date' => '<nobr>' . $dbg['date'] . '</nobr>',
|
|
|
+ '@style[date]' => "width:1%",
|
|
|
'type' => $dbg['type'],
|
|
|
- 'msg' => $dbg['msg'],
|
|
|
+ '@style[type]' => "width:1%",
|
|
|
+ 'msg' => UI::h('div', ['style'=>'max-width:360px; overflow-x:auto'], $dbg['msg']),
|
|
|
// 'log' => (!empty($dbg['log'])) ? json_encode($dbg['log']) : '',
|
|
|
- 'log' => UI::h('div', [
|
|
|
+ '@style[msg]' => "width:360px",
|
|
|
+ 'log' => UI::h('div', [], [
|
|
|
+ UI::h('div', [
|
|
|
'title' => htmlspecialchars( ('sql' == $dbg['type'] && is_string($dbg['log'])) ? $dbg['log'] : var_export($dbg['log'], true) ),
|
|
|
'onClick' => "return p5DBG__showLogTrace(this, event)",
|
|
|
'style' => "cursor:pointer"
|
|
|
- ], str_replace(array('\n', '\t'), ' ', substr(htmlspecialchars(json_encode($dbg['log'])), 0, 100)) . ' ...'
|
|
|
- ),
|
|
|
- 'trace' => UI::h('div', [
|
|
|
+ ], str_replace(array('\n', '\t'), ' ', substr(htmlspecialchars(json_encode($dbg['log'])), 0, 100)) . ' ...')
|
|
|
+ ]),
|
|
|
+ 'trace' => UI::h('div', [], [
|
|
|
+ UI::h('div', [
|
|
|
'title' => htmlspecialchars($dbg['trace']),
|
|
|
'onClick' => "return p5DBG__showLogTrace(this, event)",
|
|
|
'style' => "cursor:pointer"
|
|
|
], ('Exception' == $dbg['type'])
|
|
|
? "Code: {$dbg['log']['code']}, File: {$dbg['log']['file']}"
|
|
|
: '...'
|
|
|
- ),
|
|
|
+ )
|
|
|
+ ]),
|
|
|
];
|
|
|
},
|
|
|
explode("\n", $content)
|
|
|
@@ -244,16 +250,18 @@ class Route_Debug extends RouteBase {
|
|
|
function p5DBG__showLogTrace(n, e) {
|
|
|
if (!e) return false;
|
|
|
if (e.target && 'PRE' == e.target.tagName) return false;
|
|
|
- if (n.lastChild.tagName == 'PRE') {
|
|
|
- if ('none' == n.lastChild.style.display) {
|
|
|
- n.lastChild.style.display = 'block'
|
|
|
+ var preNode = n.parentNode.lastChild
|
|
|
+ if (preNode.tagName == 'PRE') {
|
|
|
+ if ('none' == preNode.style.display) {
|
|
|
+ preNode.style.display = 'block'
|
|
|
} else {
|
|
|
- n.lastChild.style.display = 'none'
|
|
|
+ preNode.style.display = 'none'
|
|
|
}
|
|
|
} else {
|
|
|
var pre = document.createElement('pre')
|
|
|
pre.appendChild( document.createTextNode(n.title) )
|
|
|
- n.appendChild(pre)
|
|
|
+ pre.style.maxWidth = '600px'
|
|
|
+ n.parentNode.appendChild(pre)
|
|
|
}
|
|
|
}
|
|
|
");
|