Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a949484

Browse filesBrowse files
committed
feature #26665 Improved the Ajax profiler panel when there are exceptions (javiereguiluz)
This PR was merged into the 4.1-dev branch. Discussion ---------- Improved the Ajax profiler panel when there are exceptions | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #26646 | License | MIT | Doc PR | - This makes the following changes in the Ajax panel: * The `Profiler` column is now the first one. * When the response status code is `400` or higher, the profiler link points to the exception panel instead of the default request/response panel ![ajax-panel](https://user-images.githubusercontent.com/73419/37874477-52cf3888-3030-11e8-8042-23351f2e7a0f.png) Commits ------- 074d68d Improved the Ajax profiler panel when there are exceptions
2 parents be1b55b + 074d68d commit a949484
Copy full SHA for a949484

File tree

Expand file treeCollapse file tree

2 files changed

+10
-10
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+10
-10
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/ajax.html.twig
+1-1Lines 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

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig
+9-9Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.