From 1d5afc427fb21fb7b1eb753983ec68ec92fdc259 Mon Sep 17 00:00:00 2001 From: Jakub Kucharovic Date: Tue, 26 Jan 2016 10:12:55 +0100 Subject: [PATCH 1/3] [WebProfilerBundle] Add HTTP return code in the Ajax request list table Q | A ---|--- Bug fix? | no New feature? | yes BC breaks? | no Deprecations? | no Tests pass? | yes Fixed tickets | #17518 License | MIT Doc PR | - --- .../Resources/views/Collector/ajax.html.twig | 1 + .../Resources/views/Profiler/base_js.html.twig | 9 +++++++++ 2 files changed, 10 insertions(+) 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 fe73b662bd31..8734fa8809d2 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/ajax.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/ajax.html.twig @@ -15,6 +15,7 @@ Method + Status URL Time Profile 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 84476a197745..29a448ac04cd 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 @@ -110,6 +110,14 @@ methodCell.textContent = request.method; row.appendChild(methodCell); + var statusCodeCell = document.createElement('td'); + if (request.statusCode) { + statusCodeCell.textContent = request.statusCode; + } else { + statusCodeCell.textContent = '-'; + } + row.appendChild(statusCodeCell); + var pathCell = document.createElement('td'); pathCell.className = 'sf-ajax-request-url'; if ('GET' === request.method) { @@ -241,6 +249,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"); From 2cb84ca182ba96c7e266db8335f974f15b94fe53 Mon Sep 17 00:00:00 2001 From: Jakub Kucharovic Date: Tue, 26 Jan 2016 12:03:54 +0100 Subject: [PATCH 2/3] Added background color according to response --- .../Resources/views/Profiler/base_js.html.twig | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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 29a448ac04cd..2c67be7eb433 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 @@ -111,11 +111,16 @@ row.appendChild(methodCell); var statusCodeCell = document.createElement('td'); - if (request.statusCode) { - statusCodeCell.textContent = request.statusCode; + var statusCode = document.createElement('span'); + if (request.statusCode < 300) { + statusCode.setAttribute('class', 'sf-toolbar-status sf-toolbar-status-green'); + } else if (request.statusCode < 400) { + statusCode.setAttribute('class', 'sf-toolbar-status sf-toolbar-status-yellow'); } else { - statusCodeCell.textContent = '-'; + 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'); From 0c85a1dadb44df8406c1ddf12d49da12d5008b93 Mon Sep 17 00:00:00 2001 From: Jakub Kucharovic Date: Tue, 26 Jan 2016 17:00:50 +0100 Subject: [PATCH 3/3] Removed background color from successful responses --- .../Resources/views/Profiler/base_js.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 2c67be7eb433..4385626eba72 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 @@ -113,7 +113,7 @@ var statusCodeCell = document.createElement('td'); var statusCode = document.createElement('span'); if (request.statusCode < 300) { - statusCode.setAttribute('class', 'sf-toolbar-status sf-toolbar-status-green'); + statusCode.setAttribute('class', 'sf-toolbar-status'); } else if (request.statusCode < 400) { statusCode.setAttribute('class', 'sf-toolbar-status sf-toolbar-status-yellow'); } else { 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