Skip to content

Commit

Permalink
[WebProfilerBundle] Add HTTP return code in the Ajax request list table
Browse files Browse the repository at this point in the history
  • Loading branch information
kucharovic authored and fabpot committed Jan 27, 2016
1 parent cb16bff commit 9192e1b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
Expand Up @@ -15,6 +15,7 @@
<thead>
<tr>
<th>Method</th>
<th>Status</th>
<th>URL</th>
<th>Time</th>
<th>Profile</th>
Expand Down
Expand Up @@ -110,6 +110,19 @@
methodCell.textContent = request.method;
row.appendChild(methodCell);
var statusCodeCell = document.createElement('td');
var statusCode = document.createElement('span');
if (request.statusCode < 300) {
statusCode.setAttribute('class', 'sf-toolbar-status');
} else if (request.statusCode < 400) {
statusCode.setAttribute('class', 'sf-toolbar-status sf-toolbar-status-yellow');
} else {
statusCode.setAttribute('class', 'sf-toolbar-status sf-toolbar-status-red');
}
statusCode.textContent = request.statusCode || '-';
statusCodeCell.appendChild(statusCode);
row.appendChild(statusCodeCell);
var pathCell = document.createElement('td');
pathCell.className = 'sf-ajax-request-url';
if ('GET' === request.method) {
Expand Down Expand Up @@ -241,6 +254,7 @@
stackElement.duration = new Date() - stackElement.start;
stackElement.loading = false;
stackElement.error = self.status < 200 || self.status >= 400;
stackElement.statusCode = self.status;
stackElement.profile = self.getResponseHeader("X-Debug-Token");
stackElement.profilerUrl = self.getResponseHeader("X-Debug-Token-Link");
Expand Down

2 comments on commit 9192e1b

@PeterFour
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the max-width: 480px on .sf-toolbar-info make the content disapear on the right when displaying url

@javiereguiluz
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PeterFour please open a new issue here https://github.com/symfony/symfony/issues/new so we can discuss about that. If possible, paste a screenshot of the error. Thanks!

Please sign in to comment.