[WebProfilerBundle] Filter links in search results
This commit is contained in:
parent
1054dd7f28
commit
4bffacc942
@ -207,6 +207,7 @@ class ProfilerController
|
|||||||
}
|
}
|
||||||
|
|
||||||
return new Response($this->twig->render('@WebProfiler/Profiler/toolbar.html.twig', array(
|
return new Response($this->twig->render('@WebProfiler/Profiler/toolbar.html.twig', array(
|
||||||
|
'request' => $request,
|
||||||
'position' => $position,
|
'position' => $position,
|
||||||
'profile' => $profile,
|
'profile' => $profile,
|
||||||
'templates' => $this->getTemplateManager()->getTemplates($profile),
|
'templates' => $this->getTemplateManager()->getTemplates($profile),
|
||||||
@ -242,13 +243,13 @@ class ProfilerController
|
|||||||
$limit =
|
$limit =
|
||||||
$token = null;
|
$token = null;
|
||||||
} else {
|
} else {
|
||||||
$ip = $session->get('_profiler_search_ip');
|
$ip = $request->query->get('ip', $session->get('_profiler_search_ip'));
|
||||||
$method = $session->get('_profiler_search_method');
|
$method = $request->query->get('method', $session->get('_profiler_search_method'));
|
||||||
$url = $session->get('_profiler_search_url');
|
$url = $request->query->get('url', $session->get('_profiler_search_url'));
|
||||||
$start = $session->get('_profiler_search_start');
|
$start = $request->query->get('start', $session->get('_profiler_search_start'));
|
||||||
$end = $session->get('_profiler_search_end');
|
$end = $request->query->get('end', $session->get('_profiler_search_end'));
|
||||||
$limit = $session->get('_profiler_search_limit');
|
$limit = $request->query->get('limit', $session->get('_profiler_search_limit'));
|
||||||
$token = $session->get('_profiler_search_token');
|
$token = $request->query->get('token', $session->get('_profiler_search_token'));
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Response(
|
return new Response(
|
||||||
@ -295,6 +296,7 @@ class ProfilerController
|
|||||||
$limit = $request->query->get('limit');
|
$limit = $request->query->get('limit');
|
||||||
|
|
||||||
return new Response($this->twig->render('@WebProfiler/Profiler/results.html.twig', array(
|
return new Response($this->twig->render('@WebProfiler/Profiler/results.html.twig', array(
|
||||||
|
'request' => $request,
|
||||||
'token' => $token,
|
'token' => $token,
|
||||||
'profile' => $profile,
|
'profile' => $profile,
|
||||||
'tokens' => $this->profiler->find($ip, $url, $limit, $method, $start, $end),
|
'tokens' => $this->profiler->find($ip, $url, $limit, $method, $start, $end),
|
||||||
@ -351,6 +353,7 @@ class ProfilerController
|
|||||||
$tokens = $this->profiler->find($ip, $url, $limit, $method, $start, $end);
|
$tokens = $this->profiler->find($ip, $url, $limit, $method, $start, $end);
|
||||||
|
|
||||||
return new RedirectResponse($this->generator->generate('_profiler_search_results', array(
|
return new RedirectResponse($this->generator->generate('_profiler_search_results', array(
|
||||||
|
'request' => $request,
|
||||||
'token' => $tokens ? $tokens[0]['token'] : 'empty',
|
'token' => $tokens ? $tokens[0]['token'] : 'empty',
|
||||||
'ip' => $ip,
|
'ip' => $ip,
|
||||||
'method' => $method,
|
'method' => $method,
|
||||||
|
@ -64,7 +64,7 @@
|
|||||||
{{ include('@WebProfiler/Icon/search.svg') }} <span class="hidden-small">Search</span>
|
{{ include('@WebProfiler/Icon/search.svg') }} <span class="hidden-small">Search</span>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
{{ render(path('_profiler_search_bar')) }}
|
{{ render(path('_profiler_search_bar', request.query.all)) }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -365,6 +365,32 @@ tr.status-warning td {
|
|||||||
.highlight .number { color: #F5871F; font-weight: bold; }
|
.highlight .number { color: #F5871F; font-weight: bold; }
|
||||||
.highlight .error { color: #C82829; }
|
.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
|
{# Layout
|
||||||
========================================================================= #}
|
========================================================================= #}
|
||||||
.container {
|
.container {
|
||||||
@ -849,6 +875,14 @@ table.logs .metadata strong {
|
|||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#search-results .sf-search {
|
||||||
|
visibility: hidden;
|
||||||
|
margin-left: 2px;
|
||||||
|
}
|
||||||
|
#search-results tr:hover .sf-search {
|
||||||
|
visibility: visible;
|
||||||
|
}
|
||||||
|
|
||||||
{# Small screens
|
{# Small screens
|
||||||
========================================================================= #}
|
========================================================================= #}
|
||||||
|
|
||||||
|
@ -31,9 +31,30 @@
|
|||||||
<td class="text-center">
|
<td class="text-center">
|
||||||
<span class="label {{ css_class }}">{{ result.status_code|default('n/a') }}</span>
|
<span class="label {{ css_class }}">{{ result.status_code|default('n/a') }}</span>
|
||||||
</td>
|
</td>
|
||||||
<td class="nowrap">{{ result.ip }}</td>
|
<td>
|
||||||
<td>{{ result.method }}</td>
|
<span class="nowrap">{{ result.ip }}</span>
|
||||||
<td class="break-long-words">{{ result.url }}</td>
|
{% if request.session is not null %}
|
||||||
|
<a href="{{ path('_profiler_search_results', request.query.all|merge({'ip': result.ip, 'token': result.token})) }}" title="Search">
|
||||||
|
<span title="Search" class="sf-icon sf-search">{{ include('@WebProfiler/Icon/search.svg') }}</span>
|
||||||
|
</a>
|
||||||
|
{% endif %}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{ result.method }}
|
||||||
|
{% if request.session is not null %}
|
||||||
|
<a href="{{ path('_profiler_search_results', request.query.all|merge({'method': result.method, 'token': result.token})) }}" title="Search">
|
||||||
|
<span title="Search" class="sf-icon sf-search">{{ include('@WebProfiler/Icon/search.svg') }}</span>
|
||||||
|
</a>
|
||||||
|
{% endif %}
|
||||||
|
</td>
|
||||||
|
<td class="break-long-words">
|
||||||
|
{{ result.url }}
|
||||||
|
{% if request.session is not null %}
|
||||||
|
<a href="{{ path('_profiler_search_results', request.query.all|merge({'url': result.url, 'token': result.token})) }}" title="Search">
|
||||||
|
<span title="Search" class="sf-icon sf-search">{{ include('@WebProfiler/Icon/search.svg') }}</span>
|
||||||
|
</a>
|
||||||
|
{% endif %}
|
||||||
|
</td>
|
||||||
<td class="text-small">
|
<td class="text-small">
|
||||||
<span class="nowrap">{{ result.time|date('d-M-Y') }}</span>
|
<span class="nowrap">{{ result.time|date('d-M-Y') }}</span>
|
||||||
<span class="nowrap newline">{{ result.time|date('H:i:s') }}</span>
|
<span class="nowrap newline">{{ result.time|date('H:i:s') }}</span>
|
||||||
|
Reference in New Issue
Block a user