From 074d68d67fe6f5891b5f8a1ab3884ebf558cbe0b Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Sun, 25 Mar 2018 13:25:04 +0200 Subject: [PATCH] Improved the Ajax profiler panel when there are exceptions --- .../Resources/views/Collector/ajax.html.twig | 2 +- .../Resources/views/Profiler/base_js.html.twig | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/ajax.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/ajax.html.twig index 5df0d9ea9bd0f..36bb1f1760661 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/ajax.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/ajax.html.twig @@ -14,12 +14,12 @@ + - diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig index 65bc491882f0a..7febef69fcccb 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig @@ -132,6 +132,10 @@ var row = document.createElement('tr'); request.DOMNode = row; + var profilerCell = document.createElement('td'); + profilerCell.textContent = 'n/a'; + row.appendChild(profilerCell); + var methodCell = document.createElement('td'); methodCell.textContent = request.method; row.appendChild(methodCell); @@ -164,10 +168,6 @@ durationCell.textContent = 'n/a'; row.appendChild(durationCell); - var profilerCell = document.createElement('td'); - profilerCell.textContent = 'n/a'; - row.appendChild(profilerCell); - row.className = 'sf-ajax-request sf-ajax-request-loading'; tbody.insertBefore(row, tbody.firstChild); @@ -182,11 +182,11 @@ pendingRequests--; var row = request.DOMNode; /* Unpack the children from the row */ - var methodCell = row.children[0]; - var statusCodeCell = row.children[2]; + var profilerCell = row.children[0]; + var methodCell = row.children[1]; + var statusCodeCell = row.children[3]; var statusCodeElem = statusCodeCell.children[0]; - var durationCell = row.children[4]; - var profilerCell = row.children[5]; + var durationCell = row.children[5]; if (request.error) { row.className = 'sf-ajax-request sf-ajax-request-error'; @@ -217,7 +217,7 @@ if (request.profilerUrl) { profilerCell.textContent = ''; var profilerLink = document.createElement('a'); - profilerLink.setAttribute('href', request.profilerUrl); + profilerLink.setAttribute('href', request.statusCode < 400 ? request.profilerUrl : request.profilerUrl + '?panel=exception'); profilerLink.textContent = request.profile; profilerCell.appendChild(profilerLink); }
Profile Method Type Status URL TimeProfile