Skip to content

Commit 9192e1b

Browse files
kucharovicfabpot
authored andcommitted
[WebProfilerBundle] Add HTTP return code in the Ajax request list table
1 parent cb16bff commit 9192e1b

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<thead>
1616
<tr>
1717
<th>Method</th>
18+
<th>Status</th>
1819
<th>URL</th>
1920
<th>Time</th>
2021
<th>Profile</th>

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,19 @@
110110
methodCell.textContent = request.method;
111111
row.appendChild(methodCell);
112112
113+
var statusCodeCell = document.createElement('td');
114+
var statusCode = document.createElement('span');
115+
if (request.statusCode < 300) {
116+
statusCode.setAttribute('class', 'sf-toolbar-status');
117+
} else if (request.statusCode < 400) {
118+
statusCode.setAttribute('class', 'sf-toolbar-status sf-toolbar-status-yellow');
119+
} else {
120+
statusCode.setAttribute('class', 'sf-toolbar-status sf-toolbar-status-red');
121+
}
122+
statusCode.textContent = request.statusCode || '-';
123+
statusCodeCell.appendChild(statusCode);
124+
row.appendChild(statusCodeCell);
125+
113126
var pathCell = document.createElement('td');
114127
pathCell.className = 'sf-ajax-request-url';
115128
if ('GET' === request.method) {
@@ -241,6 +254,7 @@
241254
stackElement.duration = new Date() - stackElement.start;
242255
stackElement.loading = false;
243256
stackElement.error = self.status < 200 || self.status >= 400;
257+
stackElement.statusCode = self.status;
244258
stackElement.profile = self.getResponseHeader("X-Debug-Token");
245259
stackElement.profilerUrl = self.getResponseHeader("X-Debug-Token-Link");
246260

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy