Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 074d68d

Browse files
committed
Improved the Ajax profiler panel when there are exceptions
1 parent 4a602ca commit 074d68d

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/ajax.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414
<table class="sf-toolbar-ajax-requests">
1515
<thead>
1616
<tr>
17+
<th>Profile</th>
1718
<th>Method</th>
1819
<th>Type</th>
1920
<th>Status</th>
2021
<th>URL</th>
2122
<th>Time</th>
22-
<th>Profile</th>
2323
</tr>
2424
</thead>
2525
<tbody class="sf-toolbar-ajax-request-list"></tbody>

src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,10 @@
132132
var row = document.createElement('tr');
133133
request.DOMNode = row;
134134
135+
var profilerCell = document.createElement('td');
136+
profilerCell.textContent = 'n/a';
137+
row.appendChild(profilerCell);
138+
135139
var methodCell = document.createElement('td');
136140
methodCell.textContent = request.method;
137141
row.appendChild(methodCell);
@@ -164,10 +168,6 @@
164168
durationCell.textContent = 'n/a';
165169
row.appendChild(durationCell);
166170
167-
var profilerCell = document.createElement('td');
168-
profilerCell.textContent = 'n/a';
169-
row.appendChild(profilerCell);
170-
171171
row.className = 'sf-ajax-request sf-ajax-request-loading';
172172
tbody.insertBefore(row, tbody.firstChild);
173173
@@ -182,11 +182,11 @@
182182
pendingRequests--;
183183
var row = request.DOMNode;
184184
/* Unpack the children from the row */
185-
var methodCell = row.children[0];
186-
var statusCodeCell = row.children[2];
185+
var profilerCell = row.children[0];
186+
var methodCell = row.children[1];
187+
var statusCodeCell = row.children[3];
187188
var statusCodeElem = statusCodeCell.children[0];
188-
var durationCell = row.children[4];
189-
var profilerCell = row.children[5];
189+
var durationCell = row.children[5];
190190
191191
if (request.error) {
192192
row.className = 'sf-ajax-request sf-ajax-request-error';
@@ -217,7 +217,7 @@
217217
if (request.profilerUrl) {
218218
profilerCell.textContent = '';
219219
var profilerLink = document.createElement('a');
220-
profilerLink.setAttribute('href', request.profilerUrl);
220+
profilerLink.setAttribute('href', request.statusCode < 400 ? request.profilerUrl : request.profilerUrl + '?panel=exception');
221221
profilerLink.textContent = request.profile;
222222
profilerCell.appendChild(profilerLink);
223223
}

0 commit comments

Comments
 (0)