From cff0e3b32004d8fbf8c1918843b16d805867b200 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Tue, 27 Oct 2015 12:50:35 +0100 Subject: [PATCH 1/2] Fixed Ajax panel loading in the toolbar --- Resources/views/Profiler/base_js.html.twig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Resources/views/Profiler/base_js.html.twig b/Resources/views/Profiler/base_js.html.twig index d733f1d0..c247a8fc 100644 --- a/Resources/views/Profiler/base_js.html.twig +++ b/Resources/views/Profiler/base_js.html.twig @@ -171,6 +171,8 @@ var text = requestStack.length + ' AJAX request' + (requestStack.length > 1 ? 's' : ''); infoSpan.textContent = text; } + + ajaxToolbarPanel.style.display = 'block'; } else { ajaxToolbarPanel.style.display = 'none'; } From d7f08f800dbe57052ad69a824bfb2c231b24f153 Mon Sep 17 00:00:00 2001 From: Richard Date: Mon, 26 Oct 2015 10:43:18 +0100 Subject: [PATCH 2/2] [WebProfilerBundle] Filter links in search results --- Controller/ProfilerController.php | 17 ++++++----- Resources/views/Profiler/layout.html.twig | 2 +- Resources/views/Profiler/profiler.css.twig | 34 ++++++++++++++++++++++ Resources/views/Profiler/results.html.twig | 27 +++++++++++++++-- 4 files changed, 69 insertions(+), 11 deletions(-) diff --git a/Controller/ProfilerController.php b/Controller/ProfilerController.php index 0adda784..51a52099 100644 --- a/Controller/ProfilerController.php +++ b/Controller/ProfilerController.php @@ -207,6 +207,7 @@ public function toolbarAction(Request $request, $token) } return new Response($this->twig->render('@WebProfiler/Profiler/toolbar.html.twig', array( + 'request' => $request, 'position' => $position, 'profile' => $profile, 'templates' => $this->getTemplateManager()->getTemplates($profile), @@ -242,13 +243,13 @@ public function searchBarAction(Request $request) $limit = $token = null; } else { - $ip = $session->get('_profiler_search_ip'); - $method = $session->get('_profiler_search_method'); - $url = $session->get('_profiler_search_url'); - $start = $session->get('_profiler_search_start'); - $end = $session->get('_profiler_search_end'); - $limit = $session->get('_profiler_search_limit'); - $token = $session->get('_profiler_search_token'); + $ip = $request->query->get('ip', $session->get('_profiler_search_ip')); + $method = $request->query->get('method', $session->get('_profiler_search_method')); + $url = $request->query->get('url', $session->get('_profiler_search_url')); + $start = $request->query->get('start', $session->get('_profiler_search_start')); + $end = $request->query->get('end', $session->get('_profiler_search_end')); + $limit = $request->query->get('limit', $session->get('_profiler_search_limit')); + $token = $request->query->get('token', $session->get('_profiler_search_token')); } return new Response( @@ -295,6 +296,7 @@ public function searchResultsAction(Request $request, $token) $limit = $request->query->get('limit'); return new Response($this->twig->render('@WebProfiler/Profiler/results.html.twig', array( + 'request' => $request, 'token' => $token, 'profile' => $profile, 'tokens' => $this->profiler->find($ip, $url, $limit, $method, $start, $end), @@ -351,6 +353,7 @@ public function searchAction(Request $request) $tokens = $this->profiler->find($ip, $url, $limit, $method, $start, $end); return new RedirectResponse($this->generator->generate('_profiler_search_results', array( + 'request' => $request, 'token' => $tokens ? $tokens[0]['token'] : 'empty', 'ip' => $ip, 'method' => $method, diff --git a/Resources/views/Profiler/layout.html.twig b/Resources/views/Profiler/layout.html.twig index 17aa3474..e2bc8f80 100644 --- a/Resources/views/Profiler/layout.html.twig +++ b/Resources/views/Profiler/layout.html.twig @@ -64,7 +64,7 @@ {{ include('@WebProfiler/Icon/search.svg') }} Search - {{ render(path('_profiler_search_bar')) }} + {{ render(path('_profiler_search_bar', request.query.all)) }} diff --git a/Resources/views/Profiler/profiler.css.twig b/Resources/views/Profiler/profiler.css.twig index f8cc0236..2f057958 100644 --- a/Resources/views/Profiler/profiler.css.twig +++ b/Resources/views/Profiler/profiler.css.twig @@ -365,6 +365,32 @@ tr.status-warning td { .highlight .number { color: #F5871F; font-weight: bold; } .highlight .error { color: #C82829; } +{# Icons + ========================================================================= #} +.sf-icon { + vertical-align: middle; + background-repeat: no-repeat; + background-size: contain; + width: 16px; + height: 16px; + display: inline-block; +} +.sf-icon svg { + width: 16px; + height: 16px; +} +.sf-icon.sf-medium, +.sf-icon.sf-medium svg { + width: 24px; + height: 24px; +} +.sf-icon.sf-large, +.sf-icon.sf-large svg { + width: 32px; + height: 32px; +} + + {# Layout ========================================================================= #} .container { @@ -849,6 +875,14 @@ table.logs .metadata strong { vertical-align: middle; } +#search-results .sf-search { + visibility: hidden; + margin-left: 2px; +} +#search-results tr:hover .sf-search { + visibility: visible; +} + {# Small screens ========================================================================= #} diff --git a/Resources/views/Profiler/results.html.twig b/Resources/views/Profiler/results.html.twig index 1c847157..cd9fd06c 100644 --- a/Resources/views/Profiler/results.html.twig +++ b/Resources/views/Profiler/results.html.twig @@ -31,9 +31,30 @@ {{ result.status_code|default('n/a') }} - {{ result.ip }} - {{ result.method }} - {{ result.url }} + + {{ result.ip }} + {% if request.session is not null %} + + {{ include('@WebProfiler/Icon/search.svg') }} + + {% endif %} + + + {{ result.method }} + {% if request.session is not null %} + + {{ include('@WebProfiler/Icon/search.svg') }} + + {% endif %} + + + {{ result.url }} + {% if request.session is not null %} + + {{ include('@WebProfiler/Icon/search.svg') }} + + {% endif %} + {{ result.time|date('d-M-Y') }} {{ result.time|date('H:i:s') }}