diff --git a/src/views/debug/detail.php b/src/views/debug/detail.php index 1895637..6494d05 100644 --- a/src/views/debug/detail.php +++ b/src/views/debug/detail.php @@ -12,7 +12,7 @@ CSS ); -$this->registerJs(<<registerJs(<<<'JS' function syntaxHighlight(json) { json = json.replace(/&/g, '&').replace(//g, '>'); return json.replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g, function (match) { @@ -42,8 +42,11 @@ function syntaxHighlight(json) { $.ajax({ type: 'POST', url: $(this).attr('href'), + beforeSend: function(xhr) { + xhr.setRequestHeader('X-CSRF-Token', $('meta[name=csrf-token]').attr('content')) + }, success: function (data, status, xhr) { - result.find('.result').html( syntaxHighlight( JSON.stringify( data.result, undefined, 10) ) ); + result.find('.result').html($('
').html(syntaxHighlight(JSON.stringify( data.result, undefined, 2))));
                 result.find('.time').html(data.time);
             },
             error: function (jqXHR, textStatus, errorThrown) {
@@ -74,7 +77,7 @@ function syntaxHighlight(json) {
                 getDuration() ?>
                 
                     getMethod() ?> getUrlEncoded() ?>
-

getBodyEncoded() ?>

+

getBodyEncoded() ?>

getTrace() ?>