From 45135be03fc53d0718b62ba99c628e296e9d03b0 Mon Sep 17 00:00:00 2001 From: Yoann MOROCUTTI Date: Tue, 16 Dec 2025 09:31:01 +0100 Subject: [PATCH] feat: Remove unused HTML style element to avoid CSP errors. Symfony classes have been used instead to format toolbar and profiler panel [csp] --- Resources/public/simple-http-bundle.css | 18 ++- .../views/Collector/partials/call.html.twig | 1 - .../Collector/partials/summary.html.twig | 40 ++--- Resources/views/Collector/profiler.html.twig | 146 +++--------------- 4 files changed, 60 insertions(+), 145 deletions(-) diff --git a/Resources/public/simple-http-bundle.css b/Resources/public/simple-http-bundle.css index 2ee0358..06e2e26 100644 --- a/Resources/public/simple-http-bundle.css +++ b/Resources/public/simple-http-bundle.css @@ -238,7 +238,6 @@ button[data-simple-http-replay] img.rotating { background: none; } - .simple-http-badge { display: inline-block; background: #CCC; @@ -248,10 +247,23 @@ button[data-simple-http-replay] img.rotating { color: white; } - - .http-call__title__method, .http-call__path { font-weight: bold; color: #222; +} + +.http-call__title__method { + display: inline-block; + vertical-align: top; +} + +.http-call__path { + text-overflow: ellipsis; + width: 85%; + white-space: nowrap; + display: inline-block; + overflow-x: hidden; + text-decoration: none; + border-bottom: 0; } \ No newline at end of file diff --git a/Resources/views/Collector/partials/call.html.twig b/Resources/views/Collector/partials/call.html.twig index 0feb068..444504b 100644 --- a/Resources/views/Collector/partials/call.html.twig +++ b/Resources/views/Collector/partials/call.html.twig @@ -2,7 +2,6 @@

- {#Replay#} {{ call.request.method }} {{ call.request.requestUri }}
{{ call.request.schemeAndHttpHost }} diff --git a/Resources/views/Collector/partials/summary.html.twig b/Resources/views/Collector/partials/summary.html.twig index 367d23c..e20a446 100644 --- a/Resources/views/Collector/partials/summary.html.twig +++ b/Resources/views/Collector/partials/summary.html.twig @@ -4,26 +4,26 @@ - - + - + Duration total {{ '%0.2f'|format(time.total * 1000) ~ 'ms' }}, + + wait {{ '%0.2f'|format(time.connection * 1000) ~ 'ms' }} ({{ connection_percent|number_format(0) }}%), + process {{ '%0.2f'|format((time.total - time.connection) * 1000) ~ 'ms' }} ({{ process_percent|number_format(0) }}%) + +
- {% if sfDebugLink %} - - - Symfony External debug link - - {% endif %} - {% if debugLink %} - - - External debug link - - {% endif %} +
+ {% if sfDebugLink %} + + + Symfony External debug link + + {% endif %} + {% if debugLink %} + + + External debug link + + {% endif %} - Duration total {{ time.total|simple_http_format_ms }}, - - wait {{ time.connection|simple_http_format_ms }} ({{ connection_percent|number_format(0) }}%), - process {{ (time.total - time.connection)|simple_http_format_ms }} ({{ process_percent|number_format(0) }}%) -
diff --git a/Resources/views/Collector/profiler.html.twig b/Resources/views/Collector/profiler.html.twig index afc0f07..c246e63 100644 --- a/Resources/views/Collector/profiler.html.twig +++ b/Resources/views/Collector/profiler.html.twig @@ -1,78 +1,22 @@ {% extends '@WebProfiler/Profiler/layout.html.twig' %} -{% macro css_custom_status_styles() %} - - -{% endmacro %} - - - {% block toolbar %} - - {% set icon %} - - {% import _self as customMacro %} - {{ customMacro.css_custom_status_styles() }} - - - - - {% if collector.hasServerErrors %} - {{ collector.serverErrorsCount }} - {% endif %} - {% if collector.hasClientErrors %} - {{ collector.clientErrorsCount }} - {% endif %} - {% if collector.countSuccessfullRequest %} - {{ collector.countSuccessfullRequest }} - {% endif %} - - - {{ collector.totalTime|simple_http_format_ms }} - - - {% endset %} + {% set icon %} + + + + + + {{ collector.countRequests }} + + in + {{ '%0.2f'|format(collector.totalTime) }} + s + + {% endset %} {% set text %} - {% for index, call in collector.calls %} -