initial commit

This commit is contained in:
boris
2025-09-30 09:24:25 +01:00
committed by boris
parent a783a12c97
commit c7770ea03b
4695 changed files with 525784 additions and 0 deletions

View File

@@ -0,0 +1,50 @@
{% set status_code = profile.statuscode|default(0) %}
{% set interrupted = command_collector is same as false ? null : command_collector.interruptedBySignal %}
{% set css_class = status_code == 113 or interrupted is not null ? 'status-warning' : status_code > 0 ? 'status-error' : 'status-success' %}
<div class="terminal status {{ css_class }}">
<div class="container">
<h2>
<span class="status-request-method">
{{ profile.method|upper }}
</span>
<span class="status-command">
{{ profile.url }}
</span>
</h2>
<dl class="metadata">
{% if interrupted %}
<span class="status-response-status-code">Interrupted</span>
<dt>Signal</dt>
<dd class="status-response-status-text">{{ interrupted }}</dd>
<dt>Exit code</dt>
<dd class="status-response-status-text">{{ status_code }}</dd>
{% elseif status_code == 0 %}
<span class="status-response-status-code">Success</span>
{% elseif status_code > 0 %}
<span class="status-response-status-code">Error</span>
<dt>Exit code</dt>
<dd class="status-response-status-text"><span class="status-response-status-code">{{ status_code }}</span></dd>
{% endif %}
{% if request_collector.requestserver.has('SYMFONY_CLI_BINARY_NAME') %}
<dt>Symfony CLI</dt>
<dd>v{{ request_collector.requestserver.get('SYMFONY_CLI_VERSION') }}</dd>
{% endif %}
<dt>Application</dt>
<dd>
<a href="{{ path('_profiler_search_results', { token: token, limit: 10, ip: profile.ip, type: 'command' }) }}">{{ profile.ip }}</a>
</dd>
<dt>Profiled on</dt>
<dd><time data-convert-to-user-timezone data-render-as-datetime datetime="{{ profile.time|date('c') }}">{{ profile.time|date('r') }}</time></dd>
<dt>Token</dt>
<dd>{{ profile.token }}</dd>
</dl>
</div>
</div>

View File

@@ -0,0 +1,99 @@
{% set status_code = request_collector ? request_collector.statuscode|default(0) : 0 %}
{% set css_class = status_code > 399 ? 'status-error' : status_code > 299 ? 'status-warning' : 'status-success' %}
{% if request_collector and request_collector.redirect %}
{% set redirect = request_collector.redirect %}
{% set link_to_source_code = redirect.controller.class is defined ? redirect.controller.file|file_link(redirect.controller.line) %}
{% set redirect_route_name = '@' ~ redirect.route %}
<div class="status status-compact status-warning">
<span class="icon icon-redirect">{{ source('@WebProfiler/Icon/redirect.svg') }}</span>
<span class="status-response-status-code">{{ redirect.status_code }}</span> redirect from
<span class="status-request-method">{{ redirect.method }}</span>
{% if link_to_source_code %}
<a href="{{ link_to_source_code }}" title="{{ redirect.controller.file }}">{{ redirect_route_name }}</a>
{% else %}
{{ redirect_route_name }}
{% endif %}
(<a href="{{ path('_profiler', { token: redirect.token, panel: request.query.get('panel', 'request') }) }}">{{ redirect.token }}</a>)
</div>
{% endif %}
<div class="status {{ css_class }}">
{% if status_code > 399 %}
<p class="status-error-details">
<span class="icon">{{ source('@WebProfiler/Icon/alert-circle.svg') }}</span>
<span class="status-response-status-code">Error {{ status_code }}</span>
<span class="status-response-status-text">{{ request_collector.statusText }}</span>
</p>
{% endif %}
<h2>
<span class="status-request-method">
{{ profile.method|upper }}
</span>
{% set profile_title = profile.url|length < 160 ? profile.url : profile.url[:160] ~ '…' %}
{% if profile.method|upper in ['GET', 'HEAD'] %}
<a href="{{ profile.url }}">{{ profile_title }}</a>
{% else %}
{{ profile_title }}
{% endif %}
</h2>
<dl class="metadata">
{% if status_code < 400 %}
<dt>Response</dt>
<dd>
<span class="status-response-status-code">{{ status_code }}</span>
<span class="status-response-status-text">{{ request_collector.statusText }}</span>
</dd>
{% endif %}
{% set referer = request_collector ? request_collector.requestheaders.get('referer') : null %}
{% if referer %}
<dt></dt>
<dd>
<span class="icon icon-referer">{{ source('@WebProfiler/Icon/referrer.svg') }}</span>
<a href="{{ referer }}" class="referer">Browse referrer URL</a>
</dd>
{% endif %}
<dt>IP</dt>
<dd>
<a href="{{ path('_profiler_search_results', { token: token, limit: 10, ip: profile.ip }) }}">{{ profile.ip }}</a>
</dd>
<dt>Profiled on</dt>
<dd><time data-convert-to-user-timezone data-render-as-datetime datetime="{{ profile.time|date('c') }}">{{ profile.time|date('r') }}</time></dd>
<dt>Token</dt>
<dd>{{ profile.token }}</dd>
</dl>
</div>
{% if request_collector and request_collector.forwardtoken -%}
{% set forward_profile = profile.childByToken(request_collector.forwardtoken) %}
{% set controller = forward_profile ? forward_profile.collector('request').controller : 'n/a' %}
<div class="status status-compact status-compact-forward">
<span class="icon icon-forward">{{ source('@WebProfiler/Icon/forward.svg') }}</span>
Forwarded to
{% set link = controller.file is defined ? controller.file|file_link(controller.line) : null -%}
{%- if link %}<a href="{{ link }}" title="{{ controller.file }}">{% endif -%}
{% if controller.class is defined %}
{{- controller.class|abbr_class|striptags -}}
{{- controller.method ? ' :: ' ~ controller.method -}}
{% else %}
{{- controller -}}
{% endif %}
{%- if link %}</a>{% endif %}
(<a href="{{ path('_profiler', { token: request_collector.forwardtoken }) }}">{{ request_collector.forwardtoken }}</a>)
</div>
{%- endif %}

View File

@@ -0,0 +1 @@
{% block panel '' %}

View File

@@ -0,0 +1,22 @@
<div class="table-with-search-field">
<table class="{{ class|default('') }}">
<thead>
<tr>
<th scope="col" class="key">{{ labels is defined ? labels[0] : 'Key' }}</th>
<th scope="col">{{ labels is defined ? labels[1] : 'Value' }}</th>
</tr>
</thead>
<tbody>
{% for key in bag.keys|sort %}
<tr>
<th>{{ key }}</th>
<td>{{ profiler_dump(bag.get(key), maxDepth=maxDepth|default(0)) }}</td>
</tr>
{% else %}
<tr>
<td colspan="2">(no data)</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>

View File

@@ -0,0 +1,48 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="{{ _charset }}" />
<meta name="robots" content="noindex,nofollow" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<meta name="view-transition" content="same-origin">
<title>{% block title %}Symfony Profiler{% endblock %}</title>
{% set request_collector = profile is defined ? profile.collectors.request|default(null) : null %}
{% set status_code = request_collector is not null ? request_collector.statuscode|default(0) : 0 %}
{% set favicon_color = status_code > 399 ? 'b41939' : status_code > 299 ? 'af8503' : '000000' %}
<link rel="icon" type="image/svg+xml" href="data:image/svg+xml,%3Csvg viewBox='0 0 600 600' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd' clip-rule='evenodd' stroke-linejoin='round' stroke-miterlimit='2'%3E%3Cstyle%3E%23circle %7B fill: %23{{ favicon_color }}; %7D %23sf %7B fill: %23ffffff; %7D%3C/style%3E%3Cpath fill='none' d='M0 0h600v600H0z'/%3E%3CclipPath id='a'%3E%3Cpath d='M0 0h600v600H0z'/%3E%3C/clipPath%3E%3Cg clip-path='url(%23a)'%3E%3Cpath id='circle' d='M599.985 299.974c0 165.696-134.307 300.024-300.003 300.024C134.302 599.998 0 465.67 0 299.974 0 134.304 134.302-.002 299.982-.002c165.696 0 300.003 134.307 300.003 299.976z' fill-rule='nonzero'/%3E%3Cpath id='sf' d='M431.154 110.993c-30.474 1.043-57.08 17.866-76.884 41.076-21.926 25.49-36.508 55.696-47.03 86.55-18.791-15.416-33.282-35.364-63.457-44.04-23.311-6.702-47.794-3.948-70.314 12.833-10.667 7.965-18.016 19.995-21.51 31.34-9.05 29.416 9.506 55.61 17.942 65.004l18.444 19.743c3.792 3.879 12.95 13.983 8.467 28.458-4.82 15.764-23.809 25.938-43.285 19.958-8.703-2.67-21.199-9.147-18.396-18.257 1.145-3.739 3.82-6.553 5.264-9.74 1.305-2.788 1.941-4.858 2.337-6.099 3.557-11.602-1.31-26.714-13.747-30.56-11.613-3.562-23.488-.738-28.094 14.202-5.22 16.979 2.905 47.795 46.436 61.206 51 15.694 94.13-12.084 100.249-48.287 3.857-22.675-6.392-39.536-25.147-61.2l-15.293-16.92c-9.254-9.248-12.437-25.018-2.856-37.134 8.093-10.233 19.6-14.581 38.476-9.457 27.543 7.468 39.809 26.58 60.285 41.996-8.44 27.741-13.977 55.584-18.973 80.548l-3.07 18.626c-14.636 76.766-25.816 118.939-54.856 143.144-5.858 4.167-14.218 10.399-26.821 10.843-6.622.203-8.757-4.355-8.847-6.344-.15-4.628 3.755-6.756 6.349-8.837 3.889-2.124 9.757-5.633 9.356-16.882-.423-13.293-11.431-24.815-27.35-24.286-11.919.402-30.09 11.608-29.4 32.149.701 21.22 20.472 37.118 50.288 36.107 15.935-.535 51.528-7.018 86.592-48.699 40.82-47.8 52.235-102.576 60.82-142.673l9.591-52.946a177.574 177.574 0 0017.209 1.22c50.844 1.075 76.257-25.249 76.653-44.41.257-11.591-7.6-23.011-18.61-22.739-7.863.22-17.759 5.473-20.123 16.353-2.332 10.671 16.17 20.316 1.712 29.704-10.27 6.643-28.683 11.319-54.615 7.526l4.712-26.061c9.623-49.416 21.493-110.193 66.528-111.68 3.284-.155 15.282.139 15.56 8.088.08 2.637-.582 3.332-3.68 9.393-3.166 4.729-4.36 8.773-4.204 13.394.433 12.608 10.024 20.91 23.916 20.429 18.572-.626 23.906-18.7 23.6-27.998-.759-21.846-23.776-35.647-54.224-34.641z' fill-rule='nonzero'/%3E%3C/g%3E%3C/svg%3E"/>
{% block head %}
{% block stylesheets %}
<style{% if csp_style_nonce is defined and csp_style_nonce %} nonce="{{ csp_style_nonce }}"{% endif %}>
{{ include('@WebProfiler/Profiler/profiler.css.twig') }}
</style>
{% endblock %}
{% block javascripts %}
{% endblock %}
{% endblock %}
</head>
<body>
<script{% if csp_script_nonce is defined and csp_script_nonce %} nonce="{{ csp_script_nonce }}"{% endif %}>
if (null === localStorage.getItem('symfony/profiler/theme') || 'theme-auto' === localStorage.getItem('symfony/profiler/theme')) {
document.body.classList.add((matchMedia('(prefers-color-scheme: dark)').matches ? 'theme-dark' : 'theme-light'));
// needed to respond dynamically to OS changes without having to refresh the page
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', (e) => {
document.body.classList.remove('theme-light', 'theme-dark');
document.body.classList.add(e.matches ? 'theme-dark' : 'theme-light');
});
} else {
document.body.classList.add(localStorage.getItem('symfony/profiler/theme'));
}
document.body.classList.add(localStorage.getItem('symfony/profiler/width') || 'width-normal');
document.body.classList.add(
(navigator.appVersion.indexOf('Win') !== -1) ? 'windows' : (navigator.appVersion.indexOf('Mac') !== -1) ? 'macos' : 'linux'
);
</script>
{% block body '' %}
</body>
</html>

View File

@@ -0,0 +1,280 @@
{# This file is partially duplicated in src/Symfony/Component/ErrorHandler/Resources/assets/js/exception.js.
If you make any change in this file, verify the same change is needed in the other file. #}
{# CAUTION: the contents of this file are processed by Twig before loading
them as JavaScript source code. Always use '/*' comments instead
of '//' comments to avoid impossible-to-debug side-effects #}
<script{% if csp_script_nonce is defined and csp_script_nonce %} nonce="{{ csp_script_nonce }}"{% endif %}>
window.addEventListener('DOMContentLoaded', () => {
new SymfonyProfiler();
});
class SymfonyProfiler {
constructor() {
this.#createTabs();
this.#createTableSearchFields();
this.#createToggles();
this.#createCopyToClipboard();
this.#convertDateTimesToUserTimezone();
}
#createTabs() {
/* the accessibility options of this component have been defined according to: */
/* www.w3.org/WAI/ARIA/apg/example-index/tabs/tabs-manual.html */
const tabGroups = document.querySelectorAll('.sf-tabs:not([data-processed=true])');
/* create the tab navigation for each group of tabs */
tabGroups.forEach((tabGroup, i) => {
const tabs = tabGroup.querySelectorAll(':scope > .tab');
const tabNavigation = document.createElement('div');
tabNavigation.classList.add('tab-navigation');
tabNavigation.setAttribute('role', 'tablist');
let selectedTabId = `tab-${i}-0`; /* select the first tab by default */
tabs.forEach((tab, j) => {
const tabId = `tab-${i}-${j}`;
const tabTitle = tab.querySelector('.tab-title').innerHTML;
const tabNavigationItem = document.createElement('button');
tabNavigationItem.classList.add('tab-control');
tabNavigationItem.setAttribute('data-tab-id', tabId);
tabNavigationItem.setAttribute('role', 'tab');
tabNavigationItem.setAttribute('aria-controls', tabId);
if (tab.classList.contains('active')) { selectedTabId = tabId; }
if (tab.classList.contains('disabled')) {
tabNavigationItem.classList.add('disabled');
}
tabNavigationItem.innerHTML = tabTitle;
tabNavigation.appendChild(tabNavigationItem);
const tabContent = tab.querySelector('.tab-content');
tabContent.parentElement.setAttribute('id', tabId);
});
tabGroup.insertBefore(tabNavigation, tabGroup.firstChild);
document.querySelector('[data-tab-id="' + selectedTabId + '"]').classList.add('active');
});
/* display the active tab and add the 'click' event listeners */
tabGroups.forEach((tabGroup) => {
const tabs = tabGroup.querySelectorAll(':scope > .tab-navigation .tab-control');
tabs.forEach((tab) => {
const tabId = tab.getAttribute('data-tab-id');
const tabPanel = document.getElementById(tabId);
tabPanel.setAttribute('role', 'tabpanel');
tabPanel.setAttribute('aria-labelledby', tabId);
tabPanel.querySelector('.tab-title').className = 'hidden';
if (tab.classList.contains('active')) {
tabPanel.className = 'block';
tab.setAttribute('aria-selected', 'true');
tab.removeAttribute('tabindex');
} else {
tabPanel.className = 'hidden';
tab.removeAttribute('aria-selected');
tab.setAttribute('tabindex', '-1');
}
tab.addEventListener('click', function(e) {
let activeTab = e.target || e.srcElement;
/* needed because when the tab contains HTML contents, user can click */
/* on any of those elements instead of their parent '<button>' element */
while ('button' !== activeTab.tagName.toLowerCase()) {
activeTab = activeTab.parentNode;
}
/* get the full list of tabs through the parent of the active tab element */
const tabs = Array.from(activeTab.parentNode.children);
tabs.forEach((tab) => {
const tabId = tab.getAttribute('data-tab-id');
document.getElementById(tabId).className = 'hidden';
tab.classList.remove('active');
tab.removeAttribute('aria-selected');
tab.setAttribute('tabindex', '-1');
});
activeTab.classList.add('active');
activeTab.setAttribute('aria-selected', 'true');
activeTab.removeAttribute('tabindex');
const activeTabId = activeTab.getAttribute('data-tab-id');
document.getElementById(activeTabId).className = 'block';
});
});
tabGroup.setAttribute('data-processed', 'true');
});
}
#createTableSearchFields() {
document.querySelectorAll('div.table-with-search-field').forEach((tableWrapper, i) => {
const searchField = document.createElement('input');
searchField.type = 'search';
searchField.placeholder = 'search...';
searchField.id = `table-search-field-${i}`;
searchField.classList.add(`table-search-field-input`);
searchField.autocapitalize = 'off';
searchField.autocomplete = 'off';
searchField.autocorrect = 'off';
tableWrapper.insertBefore(searchField, tableWrapper.firstChild);
const labelField = document.createElement('label');
labelField.htmlFor = `table-search-field-${i}`;
labelField.classList.add(`table-search-field-label`);
labelField.textContent = 'Search inside the contents of the table';
tableWrapper.insertBefore(labelField, tableWrapper.firstChild);
searchField.addEventListener('input', () => {
const query = searchField.value.toLowerCase();
let allRowsAreHidden = true;
tableWrapper.querySelectorAll('tbody tr').forEach((row) => {
const rowMatchesQuery = row.textContent.toLowerCase().includes(query);
row.style.display = rowMatchesQuery ? '' : 'none';
if (rowMatchesQuery) {
allRowsAreHidden = false;
}
});
/* if there are no results and all rows are hidden, show a message to avoid confusion */
const noResultsElement = tableWrapper.querySelector('.no-results-message');
if (allRowsAreHidden) {
if (null === noResultsElement) {
const noResultsElement = document.createElement('p');
noResultsElement.textContent = 'No results found.';
noResultsElement.classList.add('no-results-message');
tableWrapper.appendChild(noResultsElement);
} else {
noResultsElement.style.display = '';
}
} else {
if (null !== noResultsElement) {
noResultsElement.style.display = 'none';
}
}
});
});
}
#createToggles() {
const toggles = document.querySelectorAll('.sf-toggle:not([data-processed=true])');
toggles.forEach((toggle) => {
const elementSelector = toggle.getAttribute('data-toggle-selector');
const element = document.querySelector(elementSelector);
element.classList.add('sf-toggle-content');
if (toggle.hasAttribute('data-toggle-initial') && 'display' === toggle.getAttribute('data-toggle-initial')) {
toggle.classList.add('sf-toggle-on');
element.classList.add('sf-toggle-visible');
} else {
toggle.classList.add('sf-toggle-off');
element.classList.add('sf-toggle-hidden');
}
toggle.addEventListener('click', (e) => {
const toggle = e.currentTarget;
if (e.target.closest('a, .sf-toggle') !== toggle) {
return;
}
e.preventDefault();
if ('' !== window.getSelection().toString()) {
/* Don't do anything on text selection */
return;
}
const element = document.querySelector(toggle.getAttribute('data-toggle-selector'));
toggle.classList.toggle('sf-toggle-on');
toggle.classList.toggle('sf-toggle-off');
element.classList.toggle('sf-toggle-hidden');
element.classList.toggle('sf-toggle-visible');
/* the toggle doesn't change its contents when clicking on it */
if (!toggle.hasAttribute('data-toggle-alt-content')) {
return;
}
if (!toggle.hasAttribute('data-toggle-original-content')) {
toggle.setAttribute('data-toggle-original-content', toggle.innerHTML);
}
const currentContent = toggle.innerHTML;
const originalContent = toggle.getAttribute('data-toggle-original-content');
const altContent = toggle.getAttribute('data-toggle-alt-content');
toggle.innerHTML = currentContent !== altContent ? altContent : originalContent;
});
toggle.setAttribute('data-processed', 'true');
});
}
#createCopyToClipboard() {
if (!navigator.clipboard) {
return;
}
const copyToClipboardElements = document.querySelectorAll('[data-clipboard-text]');
copyToClipboardElements.forEach((copyToClipboardElement) => {
copyToClipboardElement.classList.remove('hidden');
copyToClipboardElement.addEventListener('click', (e) => {
/* Prevents from disallowing clicks on "copy to clipboard" elements inside toggles */
e.stopPropagation();
navigator.clipboard.writeText(copyToClipboardElement.getAttribute('data-clipboard-text'));
let oldContent = copyToClipboardElement.textContent;
copyToClipboardElement.textContent = `✅ Copied!`;
copyToClipboardElement.disabled = true;
setTimeout(() => {
copyToClipboardElement.textContent = oldContent;
copyToClipboardElement.disabled = false;
}, 7000);
});
});
}
#convertDateTimesToUserTimezone() {
const userTimezoneName = Intl.DateTimeFormat().resolvedOptions().timeZone;
document.querySelectorAll('time[data-convert-to-user-timezone]').forEach((timeElement) => {
const iso8601Datetime = timeElement.getAttribute('datetime');
const dateInUserTimezone = new Date(iso8601Datetime);
let options = {};
if (timeElement.hasAttribute('data-render-as-datetime')) {
options = {
year: 'numeric', month: 'long', day: 'numeric',
hour: 'numeric', minute: 'numeric', second: 'numeric'
};
} else if (timeElement.hasAttribute('data-render-as-date')) {
options = { year: 'numeric', month: 'long', day: 'numeric' };
} else if (timeElement.hasAttribute('data-render-as-time')) {
options = { hour: 'numeric', minute: 'numeric', second: 'numeric' };
}
if (timeElement.hasAttribute('data-render-with-millisecond-precision')) {
options.fractionalSecondDigits = 3;
}
/* dates/times are always rendered in English to match the rest of the Profiler interface */
timeElement.textContent = dateInUserTimezone.toLocaleString('en', options);
if (undefined !== userTimezoneName) {
const existingTitle = timeElement.getAttribute('title');
const newTitle = null === existingTitle
? `Date/times shown in your timezone: ${userTimezoneName}`
: existingTitle + ` (date/times shown in your timezone: ${userTimezoneName})`;
timeElement.setAttribute('title', newTitle);
}
});
}
}
</script>

View File

@@ -0,0 +1,25 @@
{% block toolbar %}
{% set icon %}
{{ source('@WebProfiler/Icon/symfony.svg') }}
<span class="sf-toolbar-value sf-toolbar-ajax-request-counter">
Loading&hellip;
</span>
{% endset %}
{% set text %}
<div class="sf-toolbar-info-piece">
<b>Loading the web debug toolbar&hellip;</b>
</div>
<div class="sf-toolbar-info-piece">
Attempt #<span id="sfLoadCounter-{{ token }}"></span>
</div>
<div class="sf-toolbar-info-piece">
<b>
<button class="sf-cancel-button" type="button" id="sfLoadCancel-{{ token }}" title="Cancel loading">Cancel</button>
</b>
</div>
{% endset %}
{{ include('@WebProfiler/Profiler/toolbar_item.html.twig', { link: profiler_url }) }}
{% endblock %}

View File

@@ -0,0 +1,12 @@
<div id="header">
<h1><a href="{{ path('_profiler_home') }}">{{ source('@WebProfiler/Icon/symfony.svg') }} Symfony Profiler</a></h1>
<div class="search">
<form method="get" action="https://symfony.com/search" target="_blank">
<div class="form-row">
<input name="q" id="search-id" type="search" placeholder="search on symfony.com" aria-label="Search on symfony.com">
<button type="submit" class="visually-hidden">Search</button>
</div>
</form>
</div>
</div>

View File

@@ -0,0 +1,22 @@
{% extends '@WebProfiler/Profiler/layout.html.twig' %}
{% set messages = {
'no_token' : {
status: 'error',
title: (token|default('') == 'latest') ? 'There are no profiles' : 'Token not found',
message: (token|default('') == 'latest') ? 'No profiles found.' : 'Token "' ~ token|default('') ~ '" not found.'
}
} %}
{% block summary %}
<div class="status status-{{ messages[about].status }}">
<div class="container">
<h2>{{ messages[about].status|title }}</h2>
</div>
</div>
{% endblock %}
{% block panel %}
<h2>{{ messages[about].title }}</h2>
<p>{{ messages[about].message }}</p>
{% endblock %}

View File

@@ -0,0 +1,76 @@
{% extends '@WebProfiler/Profiler/base.html.twig' %}
{% block body %}
<div class="container">
{{ include('@WebProfiler/Profiler/header.html.twig', {profile_type: profile_type}, with_context = false) }}
<div id="summary">
{% block summary %}
{% if profile is defined %}
{% set request_collector = profile.collectors.request|default(false) %}
{{ include('@WebProfiler/Profiler/_%s_summary.html.twig'|format(profile_type), {
profile: profile,
command_collector: profile.collectors.command|default(false) ,
request_collector: request_collector,
request: request,
token: token
}, with_context=false) }}
{% endif %}
{% endblock %}
</div>
<div id="content">
<div id="main">
<div id="sidebar">
{% block sidebar %}
<div id="sidebar-contents">
<div id="sidebar-shortcuts">
{% block sidebar_shortcuts_links %}
<div class="shortcuts">
<a class="btn btn-link" href="{{ path('_profiler_search', { limit: 10, type: profile_type }) }}">{{ source('@WebProfiler/Icon/search.svg') }} Search profiles</a>
<a class="btn btn-link" href="{{ path('_profiler', { token: 'latest', type: profile_type }|merge(request.query.all)) }}">Latest</a>
</div>
{% endblock sidebar_shortcuts_links %}
</div>
{% if templates is defined %}
<ul id="menu-profiler">
{% if 'request' is same as(profile_type) %}
{% set excludes = ['command'] %}
{% elseif 'command' is same as(profile_type) %}
{% set excludes = ['request', 'router'] %}
{% endif %}
{% for name, template in templates|filter((t, n) => n not in excludes) %}
{% set menu -%}
{%- if block('menu', template) is defined -%}
{% with { collector: profile.getcollector(name), profiler_markup_version: profiler_markup_version } %}
{{- block('menu', template) -}}
{% endwith %}
{%- endif -%}
{%- endset %}
{% if menu is not empty %}
<li class="{{ name }} {{ name == panel ? 'selected' }}">
<a href="{{ path('_profiler', { token: token, panel: name, type: profile_type }) }}">{{ menu|raw }}</a>
</li>
{% endif %}
{% endfor %}
</ul>
{% endif %}
</div>
{{ include('@WebProfiler/Profiler/settings.html.twig') }}
{% endblock sidebar %}
</div>
<div id="collector-wrapper">
<div id="collector-content">
{{ include('@WebProfiler/Profiler/base_js.html.twig') }}
{% block panel '' %}
</div>
</div>
</div>
</div>
</div>
{% endblock %}

View File

@@ -0,0 +1,80 @@
#header {
margin-bottom: 30px;
}
#source {
background: var(--page-background);
border: 1px solid var(--menu-border-color);
box-shadow: 0 0 0 5px var(--page-background);
border-radius: 6px;
margin: 0 30px 45px 0;
max-width: 960px;
padding: 15px 20px;
}
.width-full #source {
max-width: unset;
width: 100%;
}
#source code {
font-size: 15px;
}
#source .source-file-name {
border-bottom: 1px solid var(--table-border-color);
font-size: 18px;
font-weight: 500;
margin: 0 0 15px 0;
padding: 0 0 15px;
}
#source .source-file-name small {
color: var(--color-muted);
}
#source .source-content {
overflow-x: auto;
}
#source .source-content ol {
margin: 0;
}
#source .source-content ol li {
margin: 0 0 2px 0;
padding-left: 5px;
white-space: preserve nowrap;
}
#source .source-content ol li::marker {
color: var(--color-muted);
font-family: var(--font-family-monospace);
padding-right: 5px;
}
#source .source-content li.selected {
background: var(--yellow-100);
border-radius: 4px;
}
.theme-dark #source .source-content li.selected {
background: var(--gray-600);
}
#source .source-content li.selected::marker {
color: var(--color-text);
font-weight: bold;
}
#source span[style="color: #FF8000"] { color: var(--highlight-comment) !important; }
#source span[style="color: #007700"] { color: var(--highlight-keyword) !important; }
#source span[style="color: #0000BB"] { color: var(--color-text) !important; }
#source span[style="color: #DD0000"] { color: var(--highlight-string) !important; }
.file-metadata dt {
color: var(--header-metadata-key);
display: block;
font-weight: bold;
}
.file-metadata dd {
color: var(--header-metadata-value);
margin: 5px 0 20px;
/* needed to break the long file paths */
overflow-wrap: break-word;
word-wrap: break-word;
word-break: break-all;
}

View File

@@ -0,0 +1,64 @@
{% extends '@WebProfiler/Profiler/base.html.twig' %}
{% block head %}
<style>
{{ include('@WebProfiler/Profiler/profiler.css.twig') }}
{{ include('@WebProfiler/Profiler/open.css.twig') }}
</style>
{% endblock %}
{% block body %}
<div class="container">
{{ include('@WebProfiler/Profiler/header.html.twig', with_context = false) }}
{% set source = file_info.pathname|file_excerpt(line, -1) %}
<div id="content">
<div id="main">
<div id="source">
<h1 class="source-file-name">{{ file }}{% if 0 < line %} <small>line {{ line }}</small>{% endif %}</h1>
<div class="source-content">
{% if source is null %}
<p class="empty empty-panel">The file is not readable.</p>
{% else %}
{{ source|raw }}
{% endif %}
</div>
</div>
<div id="sidebar">
<dl class="file-metadata">
<dt>Filepath:</dt>
<dd>{{ file_info.pathname }}</dd>
<dt>Last modified:</dt>
<dd>{{ file_info.mTime|date }}</dd>
<dt>Size:</dt>
{% set file_size_in_kb = file_info.size / 1024 %}
{% set file_num_lines = source|split("\n")|length - 1 %}
<dd>
{{ file_size_in_kb < 1 ? file_info.size ~ ' bytes' : file_size_in_kb|number_format(0) ~ ' KB' }}
/ {{ file_num_lines }} lines
</dd>
</dl>
<a class="doc-link" href="https://symfony.com/doc/{{ constant('Symfony\\Component\\HttpKernel\\Kernel::VERSION') }}/reference/configuration/framework.html#ide" rel="help">Open this file in your IDE?</a>
</div>
</div>
</div>
</div>
<script>
window.addEventListener('load', function () {
const selectedLineElement = document.querySelector('.source-content li.selected');
if (null === selectedLineElement) {
return;
}
const selectedLineYCoordinate = selectedLineElement.getBoundingClientRect().y;
console.log(selectedLineYCoordinate);
window.scrollTo({ top: selectedLineYCoordinate - 20, left: 0, behavior: 'smooth' });
});
</script>
{% endblock %}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,138 @@
{% extends '@WebProfiler/Profiler/layout.html.twig' %}
{% macro profile_search_filter(request, result, property) %}
{%- if request.hasSession -%}
<a href="{{ path('_profiler_search_results', request.query.all|merge({token: result.token})|merge({ (property): result[property] })) }}" title="Search"><span title="Search" class="sf-icon sf-search">{{ source('@WebProfiler/Icon/search.svg') }}</span></a>
{%- endif -%}
{% endmacro %}
{% block head %}
{{ parent() }}
<style>
#search-results td {
font-family: var(--font-family-system);
vertical-align: middle;
}
#search-results .sf-search {
visibility: hidden;
margin-left: 2px;
}
#search-results tr:hover .sf-search {
visibility: visible;
}
#search-results .sf-search svg {
stroke-width: 3;
}
</style>
{% endblock %}
{% block summary %}
<div class="status">
<h2>Profile Search</h2>
</div>
{% endblock %}
{% block sidebar_search_css_class %}{% endblock %}
{% block sidebar_shortcuts_links %}
{{ parent() }}
{{ render(controller('web_profiler.controller.profiler::searchBarAction', query={type: profile_type }|merge(request.query.all))) }}
{% endblock %}
{% block panel %}
<div class="sf-tabs" data-processed="true">
<div class="tab-navigation" role="tablist">
<button class="tab-control {{ 'request' == profile_type ? 'active' }}" role="tab" {{ 'request' == profile_type ? 'aria-selected="true"' : 'tabindex="-1"' }} >
<a href="{{ path('_profiler_search_results', {token: 'empty', limit: 10}) }}">
HTTP Requests
</a>
</button>
<button class="tab-control {{ 'command' == profile_type ? 'active' }}" role="tab" {{ 'command' == profile_type ? 'aria-selected="true"' : 'tabindex="-1"' }}>
<a href="{{ path('_profiler_search_results', {token: 'empty', limit: 10, type: 'command'}) }}">
Console Commands
</a>
</button>
</div>
</div>
<h2>{{ tokens ? tokens|length : 'No' }} results found</h2>
{% if tokens %}
<table id="search-results">
<thead>
<tr>
<th scope="col" class="text-center">
{% if 'command' == profile_type %}
Exit code
{% else %}
Status
{% endif %}
</th>
<th scope="col">
{% if 'command' == profile_type %}
Application
{% else %}
IP
{% endif %}
</th>
<th scope="col">
{% if 'command' == profile_type %}
Mode
{% else %}
Method
{% endif %}
</th>
<th scope="col">
{% if 'command' == profile_type %}
Command
{% else %}
URL
{% endif %}
</th>
<th scope="col">Time</th>
<th scope="col">Token</th>
</tr>
</thead>
<tbody>
{% for result in tokens %}
{% if 'command' == profile_type %}
{% set css_class = result.status_code == 113 ? 'status-warning' : result.status_code > 0 ? 'status-error' : 'status-success' %}
{% else %}
{% set css_class = result.status_code|default(0) > 399 ? 'status-error' : result.status_code|default(0) > 299 ? 'status-warning' : 'status-success' %}
{% endif %}
<tr>
<td class="text-center">
<span class="label {{ css_class }}">{{ result.status_code|default('n/a') }}</span>
</td>
<td>
<span class="nowrap">{{ result.ip }} {{ _self.profile_search_filter(request, result, 'ip') }}</span>
</td>
<td>
<span class="nowrap">{{ result.method }} {{ _self.profile_search_filter(request, result, 'method') }}</span>
</td>
<td class="break-long-words">
{{ result.url }}
{{ _self.profile_search_filter(request, result, 'url') }}
</td>
<td class="text-small">
<time data-convert-to-user-timezone data-render-as-date datetime="{{ result.time|date('c') }}">
{{ result.time|date('d-M-Y') }}
</time>
<time class="newline" data-convert-to-user-timezone data-render-as-time datetime="{{ result.time|date('c') }}">
{{ result.time|date('H:i:s') }}
</time>
</td>
<td class="nowrap"><a href="{{ path('_profiler', { token: result.token }) }}">{{ result.token }}</a></td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<div class="empty empty-panel">
<p>The query returned no result.</p>
</div>
{% endif %}
{% endblock %}

View File

@@ -0,0 +1,93 @@
<div id="sidebar-search">
<form action="{{ path('_profiler_search') }}" method="get">
<div class="form-group">
<label for="ip">
{% if 'command' == profile_type %}
Application
{% else %}
IP
{% endif %}
</label>
<input type="text" name="ip" id="ip" value="{{ ip }}">
</div>
<div class="form-group-row">
<div class="form-group">
<label for="method">
{% if 'command' == profile_type %}
Mode
{% else %}
Method
{% endif %}
</label>
<select name="method" id="method">
<option value="">Any</option>
{% if 'command' == profile_type %}
{% set methods = ['BATCH', 'INTERACTIVE'] %}
{% else %}
{% set methods = ['DELETE', 'GET', 'HEAD', 'PATCH', 'POST', 'PUT'] %}
{% endif %}
{% for m in methods %}
<option {{ m == method ? 'selected="selected"' }}>{{ m }}</option>
{% endfor %}
</select>
</div>
<div class="form-group">
<label for="status_code">
{% if 'command' == profile_type %}
Exit code
{% set min_and_max = 'min=%d max=%d'|format(0, 255) %}
{% else %}
Status
{% set min_and_max = 'min=%d max=%d'|format(100, 599) %}
{% endif %}
</label>
<input type="number" name="status_code" id="status_code" {{ min_and_max }} value="{{ status_code }}">
</div>
</div>
<div class="form-group">
<label for="url">
{% if 'command' == profile_type %}
Command
{% else %}
URL
{% endif %}
</label>
<input type="text" name="url" id="url" value="{{ url }}">
</div>
<div class="form-group">
<label for="token">Token</label>
<input type="text" name="token" id="token" size="8" value="{{ token }}">
</div>
<div class="form-group">
<label for="start">From</label>
<input type="date" name="start" id="start" value="{{ start }}">
</div>
<div class="form-group">
<label for="end">Until</label>
<input type="date" name="end" id="end" value="{{ end }}">
</div>
<div class="form-group-row form-group-row-search-button">
<div class="form-group">
<label for="limit">Results</label>
<select name="limit" id="limit">
{% for l in [10, 50, 100] %}
<option {{ l == limit ? 'selected="selected"' }}>{{ l }}</option>
{% endfor %}
</select>
</div>
<input type="hidden" name="type" value="{{ profile_type }}">
<div class="form-group">
<button type="submit" class="btn btn-sm">Search</button>
</div>
</div>
</form>
</div>

View File

@@ -0,0 +1,316 @@
<style>
:root {
--settings-modal-shadow: 0 0 0 1px var(--gray-400), 5px 5px 20px 0 var(--gray-800);
--settings-modal-header-background: var(--gray-200);
--settings-modal-content-background: var(--gray-100);
--settings-option-background: var(--page-background);
--settings-option-border-color: var(--gray-300);
--settings-option-color: var(--color-text);
--settings-option-icon-color: var(--gray-400);
--settings-option-active-border-color: #3b82f6;
--settings-option-active-background: #eff6ff;
--settings-option-active-color: var(--color-text);
--settings-option-active-icon-color: var(--gray-400);
}
.theme-dark {
--settings-modal-shadow: 0 0 0 1px var(--gray-600), 5px 5px 10px 0 var(--gray-900);
--settings-modal-header-background: var(--gray-800);
--settings-modal-content-background: var(--gray-700);
--settings-option-background: transparent;
--settings-option-border-color: var(--gray-500);
--settings-option-color: var(--color-text);
--settings-option-icon-color: var(--gray-300);
--settings-option-active-border-color: #93c5fd;
--settings-option-active-background: var(--gray-700);
--settings-option-active-color: var(--color-text);
--settings-option-active-icon-color: #93c5fd;
}
#open-settings {
color: var(--color-muted);
align-items: center;
display: flex;
margin: 10px 0 5px;
}
#open-settings .icon {
margin-right: 4px;
}
#open-settings .icon, #open-settings svg {
height: 18px;
width: 18px;
}
.modal-wrap {
-webkit-transition-duration: 0.3s;
-webkit-transition-property: opacity, visibility;
-webkit-transition-timing-function: ease-in-out;
align-items: center;
background: rgba(0, 0, 0, 0.70);
display: flex;
backdrop-filter: blur(2px);
height: 100%;
justify-content: center;
left: 0;
opacity: 0;
overflow: auto;
position: fixed;
top: 0;
transition-duration: 0.3s;
transition-property: opacity, visibility;
transition-timing-function: ease-in-out;
visibility: hidden;
width: 100%;
z-index: 100000;
}
.modal-wrap.visible {
opacity: 1;
visibility: visible;
}
.modal-wrap .modal-container {
border-radius: 6px;
box-shadow: var(--settings-modal-shadow);
color: var(--color-text);
margin: 1em;
max-width: 94%;
width: 600px;
}
.modal-wrap .modal-header {
align-items: center;
background: var(--settings-modal-header-background);
border-top-left-radius: 6px;
border-top-right-radius: 6px;
display: flex;
justify-content: space-between;
padding: 15px 30px;
}
.modal-wrap .modal-header h3 {
margin: 0;
}
.modal-wrap .modal-header .close-modal {
background: transparent;
border: 0;
color: var(--color-muted);
cursor: pointer;
font-size: 28px;
line-height: 1;
}
.modal-wrap .modal-header .close-modal:hover { opacity: 1; }
.modal-wrap .modal-content {
background: var(--settings-modal-content-background);
border-bottom-left-radius: 6px;
border-bottom-right-radius: 6px;
margin: 0;
padding: 15px 30px;
z-index: 100000;
}
.modal-content h4 {
font-size: 18px;
margin: 0 0 10px;
}
.modal-content .settings-group + h4 {
margin-top: 30px;
}
.modal-content .settings-group {
border: 1px solid var(--settings-option-border-color);
border-radius: 4px;
display: flex;
margin-bottom: 15px;
}
.modal-content .settings-group label {
cursor: pointer;
display: flex;
flex: 1;
font-size: 16px;
margin: 0;
}
.modal-content .settings-group label input {
position: absolute;
clip: rect(0, 0, 0, 0);
pointer-events: none;
opacity: 0;
}
.modal-content .settings-group:has(input:focus-visible) {
outline: 2px dotted var(--settings-option-active-border-color);
outline-offset: 2px;
}
.modal-content .settings-group label input:checked + p {
box-shadow: inset 0 0 0 2px var(--settings-option-active-border-color);
background-color: var(--settings-option-active-background);
color: var(--settings-option-active-color);
}
.modal-content .settings-group label input:checked + p svg {
color: var(--settings-option-active-icon-color);
}
.modal-content .settings-group label p {
align-items: center;
background: var(--settings-option-background);
color: var(--settings-option-color);
flex: 1;
font-size: 14px;
margin: 0;
padding: 10px 15px;
text-align: center;
}
.modal-content .settings-group label:first-child p {
border-top-left-radius: 4px;
border-bottom-left-radius: 4px;
}
.modal-content .settings-group label:last-child p {
border-top-right-radius: 4px;
border-bottom-right-radius: 4px;
}
.modal-content .settings-group label + label p {
border-left: 1px solid var(--settings-option-border-color);
}
.modal-content label p span {
display: block;
font-size: 16px;
}
.modal-content label p abbr {
border: 0;
text-decoration: none;
}
.modal-content label svg {
color: var(--settings-option-icon-color);
height: 36px;
width: 36px;
}
@media (max-width: 768px) {
#open-settings {
color: transparent;
}
#sidebar:hover #open-settings, #sidebar.expanded #open-settings {
color: var(--color-muted);
}
}
</style>
<a href="#" id="open-settings">
<span class="icon">{{ source('@WebProfiler/Icon/settings.svg') }}</span>
Profiler settings
</a>
<div class="modal-wrap" id="profiler-settings">
<div class="modal-container">
<div class="modal-header">
<h3>Configuration Settings</h3>
<button aria-label="Close" class="close-modal">&times;</button>
</div>
<div class="modal-content">
<h4>Theme</h4>
<div class="settings-group">
<label for="settings-theme-auto">
<input class="config-option" type="radio" name="theme" value="auto" id="settings-theme-auto">
<p>
{{ source('@WebProfiler/Icon/settings-theme-system.svg') }}
<span>System / OS</span>
</p>
</label>
<label for="settings-theme-light">
<input class="config-option" type="radio" name="theme" value="light" id="settings-theme-light">
<p>
{{ source('@WebProfiler/Icon/settings-theme-light.svg') }}
<span>Light</span>
</p>
</label>
<label for="settings-theme-dark">
<input class="config-option" type="radio" name="theme" value="dark" id="settings-theme-dark">
<p>
{{ source('@WebProfiler/Icon/settings-theme-dark.svg') }}
<span>Dark</span>
</p>
</label>
</div>
<h4>Page Width</h4>
<div class="settings-group">
<label for="settings-width-normal">
<input class="config-option" type="radio" name="width" value="normal" id="settings-width-normal">
<p>
{{ source('@WebProfiler/Icon/settings-width-fixed.svg') }}
<span>Fixed width</span>
</p>
</label>
<label for="settings-width-full">
<input class="config-option" type="radio" name="width" value="full" id="settings-width-full">
<p>
{{ source('@WebProfiler/Icon/settings-width-fitted.svg') }}
<span>Fit to window</span>
</p>
</label>
</div>
</div>
</div>
</div>
<script>
(function() {
const configOptions = document.querySelectorAll('.config-option');
[...configOptions].forEach(option => {
option.addEventListener('change', function (event) {
const optionName = option.name;
const optionValue = option.value;
const settingName = 'symfony/profiler/' + optionName;
const settingValue = optionName + '-' + optionValue;
localStorage.setItem(settingName, settingValue);
document.body.classList.forEach((cssClass) => {
if (cssClass.startsWith(optionName)) {
document.body.classList.remove(cssClass);
}
});
const resolvedSettingValue = 'theme-auto' === settingValue
? (matchMedia('(prefers-color-scheme: dark)').matches ? 'theme-dark' : 'theme-light')
: settingValue;
document.body.classList.add(resolvedSettingValue);
if (resolvedSettingValue.startsWith('theme-')) {
document.body.style.colorScheme = resolvedSettingValue.endsWith('-light') ? 'light' : 'dark';
}
});
});
const openModalButton = document.getElementById('open-settings');
const modalWindow = document.getElementById('profiler-settings');
const closeModalButton = document.getElementsByClassName('close-modal')[0];
const modalWrapper = document.getElementsByClassName('modal-wrap')[0];
const closeModal = () => {
modalWindow.classList.remove('visible');
setTimeout(() => openModalButton.focus(), 30);
};
openModalButton.addEventListener('click', function(event) {
document.getElementById('settings-' + (localStorage.getItem('symfony/profiler/theme') || 'theme-auto')).checked = 'checked';
document.getElementById('settings-' + (localStorage.getItem('symfony/profiler/width') || 'width-normal')).checked = 'checked';
modalWindow.classList.toggle('visible');
setTimeout(() => closeModalButton.focus(), 30);
event.preventDefault();
});
closeModalButton.addEventListener('click', closeModal);
modalWrapper.addEventListener('click', function(event) {
if (event.target == event.currentTarget) {
closeModal();
}
});
modalWrapper.addEventListener('keydown', function(event) {
if (event.key === 'Esc' || event.key === 'Escape') {
closeModal();
}
});
})();
</script>

View File

@@ -0,0 +1,18 @@
<div class="table-with-search-field">
<table class="{{ class|default('') }}">
<thead>
<tr>
<th scope="col" class="key">{{ labels is defined ? labels[0] : 'Key' }}</th>
<th scope="col">{{ labels is defined ? labels[1] : 'Value' }}</th>
</tr>
</thead>
<tbody>
{% for key in data|keys|sort %}
<tr>
<th scope="row">{{ key }}</th>
<td>{{ profiler_dump(data[key]) }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>

View File

@@ -0,0 +1,679 @@
.sf-toolbarreset {
--sf-toolbar-font-family-system: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
--sf-toolbar-font-family-monospace: "Ubuntu Mono", "JetBrains Mono", ui-monospace, "Roboto Mono", SFMono-Regular, Menlo, Monaco, Consolas,"Liberation Mono", "Courier New", monospace;
--sf-toolbar-white: #fff;
--sf-toolbar-black: #000;
--sf-toolbar-gray-50: #fafafa;
--sf-toolbar-gray-100: #f5f5f5;
--sf-toolbar-gray-200: #e5e5e5;
--sf-toolbar-gray-300: #d4d4d4;
--sf-toolbar-gray-400: #a3a3a3;
--sf-toolbar-gray-500: #737373;
--sf-toolbar-gray-600: #525252;
--sf-toolbar-gray-700: #404040;
--sf-toolbar-gray-800: #262626;
--sf-toolbar-gray-900: #171717;
--sf-toolbar-red-50: #FEFBFC;
--sf-toolbar-red-100: #FCE9ED;
--sf-toolbar-red-200: #F5B8C5;
--sf-toolbar-red-300: #EF869C;
--sf-toolbar-red-400: #E85574;
--sf-toolbar-red-500: #E1244B;
--sf-toolbar-red-600: #B41939;
--sf-toolbar-red-700: #83122A;
--sf-toolbar-red-800: #510B1A;
--sf-toolbar-red-900: #20040A;
--sf-toolbar-yellow-50: #fef7e1;
--sf-toolbar-yellow-100: #fef2cd;
--sf-toolbar-yellow-200: #fde496;
--sf-toolbar-yellow-300: #fcd55f;
--sf-toolbar-yellow-400: #fbc728;
--sf-toolbar-yellow-500: #e6af05;
--sf-toolbar-yellow-600: #af8503;
--sf-toolbar-yellow-700: #785b02;
--sf-toolbar-yellow-800: #413101;
--sf-toolbar-yellow-900: #0a0800;
--sf-toolbar-green-50: #eff5f5;
--sf-toolbar-green-100: #deeaea;
--sf-toolbar-green-200: #bbd5d5;
--sf-toolbar-green-300: #99bfbf;
--sf-toolbar-green-400: #76a9a9;
--sf-toolbar-green-500: #598e8e;
--sf-toolbar-green-600: #436c6c;
--sf-toolbar-green-700: #2e4949;
--sf-toolbar-green-800: #182727;
--sf-toolbar-green-900: #030404;
}
.sf-toolbar-clearer {
clear: both;
height: 36px;
}
.sf-toolbarreset *:not(svg rect) {
box-sizing: content-box;
vertical-align: baseline;
letter-spacing: normal;
width: auto;
}
.sf-toolbarreset {
background-color: var(--sf-toolbar-gray-800);
bottom: 0;
box-shadow: inset 0 1px 0 var(--sf-toolbar-black), 0 -1px 0 rgba(0, 0, 0, 0.5);
color: var(--sf-toolbar-gray-200);
font: 11px var(--sf-toolbar-font-family-system);
left: 0;
margin: 0;
padding: 0 36px 0 0;
position: fixed;
right: 0;
text-align: left;
text-transform: none;
z-index: 99999;
direction: ltr;
/* neutralize the aliasing defined by external CSS styles */
-webkit-font-smoothing: subpixel-antialiased;
-moz-osx-font-smoothing: auto;
}
.sf-toolbarreset abbr {
border: dashed var(--sf-toolbar-gray-500);
border-width: 0 0 1px;
}
.sf-toolbarreset svg,
.sf-toolbarreset img {
height: 20px;
width: 20px;
display: inline-block;
}
.sf-toolbarreset .sf-cancel-button {
color: var(--sf-toolbar-gray-700);
}
.sf-toolbarreset .sf-toolbar-toggle-button {
background: var(--sf-toolbar-gray-800);
color: var(--sf-toolbar-gray-300);
display: block;
position: absolute;
top: 1px;
right: 0;
width: 36px;
height: 35px;
cursor: pointer;
text-align: center;
border: none;
margin: 0;
padding: 0;
outline: none;
}
.sf-toolbarreset .sf-toolbar-toggle-button:hover {
background: var(--sf-toolbar-gray-700);
}
.sf-toolbar.sf-toolbar-closed .sf-toolbar-clearer {
display: none;
}
.sf-toolbar.sf-toolbar-closed .sf-toolbarreset .sf-toolbar-block {
display: none;
}
.sf-toolbar.sf-toolbar-closed .sf-toolbarreset .sf-toolbar-toggle-button {
top: -37px;
}
.sf-toolbar .sf-toolbar-toggle-button i {
display: block;
height: 35px;
place-content: center;
}
.sf-toolbar.sf-toolbar-opened .sf-toolbar-toggle-button .sf-toolbar-icon-closed {
display: none;
}
.sf-toolbar.sf-toolbar-opened .sf-toolbar-toggle-button .sf-toolbar-icon-opened {
display: block;
}
.sf-toolbar.sf-toolbar-closed .sf-toolbar-toggle-button .sf-toolbar-icon-closed {
display: block;
}
.sf-toolbar.sf-toolbar-closed .sf-toolbar-toggle-button .sf-toolbar-icon-opened {
display: none;
}
.sf-toolbar.sf-toolbar-closed .sf-toolbarreset .sf-toolbar-toggle-button {
border-top: 2px solid var(--sf-toolbar-gray-800);
}
.sf-toolbar-block {
cursor: default;
display: block;
float: left;
height: 36px;
margin-right: 0;
position: relative;
white-space: nowrap;
max-width: 15%;
}
.sf-toolbar-block > a,
.sf-toolbar-block > a:hover {
display: block;
text-decoration: none;
background-color: transparent;
color: inherit;
}
.sf-toolbar-block span {
display: inline-block;
}
.sf-toolbar-block .sf-toolbar-value {
color: var(--sf-toolbar-gray-100);
font-size: 13px;
line-height: 36px;
padding: 0;
}
.sf-toolbar-block .sf-toolbar-label,
.sf-toolbar-block .sf-toolbar-class-separator {
color: var(--sf-toolbar-gray-400);
font-size: 12px;
margin-left: 2px;
}
.sf-toolbar-block .sf-toolbar-info {
border-collapse: collapse;
display: table;
z-index: 100000;
}
.sf-toolbar-block hr {
border-top: 1px solid var(--sf-toolbar-gray-500);
margin: 4px 0;
padding-top: 4px;
}
.sf-toolbar-block .sf-toolbar-info-piece {
/* this 'border-bottom' trick is needed because 'margin-bottom' doesn't work for table rows */
border-bottom: solid transparent 3px;
display: table-row;
}
.sf-toolbar-block .sf-toolbar-info-piece-additional,
.sf-toolbar-block .sf-toolbar-info-piece-additional-detail {
display: none;
}
.sf-toolbar-block .sf-toolbar-info-group {
margin-bottom: 4px;
padding-bottom: 2px;
border-bottom: 1px solid #333333;
}
.sf-toolbar-block .sf-toolbar-info-group:last-child {
margin-bottom: 0;
padding-bottom: 0;
border-bottom: none;
}
.sf-toolbar-block .sf-toolbar-info-piece .sf-toolbar-status {
border-radius: 4px;
padding: 2px 5px;
margin-bottom: 0;
}
.sf-toolbar-block .sf-toolbar-info-piece .sf-toolbar-status + .sf-toolbar-status {
margin-left: 4px;
}
.sf-toolbar-block .sf-toolbar-info-piece:last-child {
margin-bottom: 0;
}
div.sf-toolbar .sf-toolbar-block .sf-toolbar-info-piece a {
color: #99CDD8;
text-decoration: underline;
}
div.sf-toolbar .sf-toolbar-block a:hover {
text-decoration: none;
}
.sf-toolbar-block .sf-toolbar-info-piece b {
color: var(--sf-toolbar-gray-400);
display: table-cell;
font-size: 11px;
padding: 4px 8px 4px 0;
}
.sf-toolbar-block:not(.sf-toolbar-block-dump) .sf-toolbar-info-piece span {
color: var(--sf-toolbar-gray-100);
}
.sf-toolbar-block .sf-toolbar-info-piece span {
font-size: 12px;
}
div.sf-toolbar .sf-toolbar-block .sf-toolbar-info-piece.sf-toolbar-info-php-ext a {
text-decoration: none;
}
.sf-toolbar-block .sf-toolbar-info {
background-color: var(--sf-toolbar-gray-700);
border-radius: 4px;
border-bottom-left-radius: 0;
bottom: 36px;
color: var(--sf-toolbar-gray-100);
display: none;
padding: 9px 0;
position: absolute;
}
.sf-toolbar-block.sf-toolbar-block-right .sf-toolbar-info {
border-bottom-left-radius: 4px;
border-bottom-right-radius: 0;
}
.sf-toolbar-block .sf-toolbar-info:empty {
visibility: hidden;
}
.sf-toolbar-block .sf-toolbar-status {
display: inline-block;
color: var(--sf-toolbar-white);
background-color: var(--sf-toolbar-gray-600);
padding: 3px 6px;
margin: 0 4px;
min-width: 15px;
min-height: 13px;
text-align: center;
}
.sf-toolbar-block .sf-toolbar-status.sf-toolbar-status-green,
.sf-toolbar-block .sf-toolbar-info .sf-toolbar-status.sf-toolbar-status-green {
background-color: #059669;
color: var(--white);
}
.sf-toolbar-block .sf-toolbar-status.sf-toolbar-status-red,
.sf-toolbar-block .sf-toolbar-info .sf-toolbar-status.sf-toolbar-status-red {
background-color: var(--sf-toolbar-red-500);
color: var(--sf-toolbar-red-50);
}
.sf-toolbar-block .sf-toolbar-status.sf-toolbar-status-yellow,
.sf-toolbar-block .sf-toolbar-info .sf-toolbar-status.sf-toolbar-status-yellow {
background-color: var(--sf-toolbar-yellow-300);
color: var(--sf-toolbar-yellow-800);
}
.sf-toolbar-block.sf-toolbar-status-green::before,
.sf-toolbar-block.sf-toolbar-status-red::before,
.sf-toolbar-block.sf-toolbar-status-yellow::before {
background: var(--sf-toolbar-yellow-400);
border-radius: 6px;
content: '';
position: absolute;
bottom: 1px;
left: 0;
width: 98%;
height: 3px;
z-index: 10005;
}
.sf-toolbar-block.sf-toolbar-status-red::before {
background: var(--sf-toolbar-red-400);
}
.sf-toolbar-block.sf-toolbar-status-green::before {
background: var(--sf-toolbar-green-400);
}
.sf-toolbar-block-request.sf-toolbar-block.sf-toolbar-status-green::before,
.sf-toolbar-block-request.sf-toolbar-block.sf-toolbar-status-red::before,
.sf-toolbar-block-request.sf-toolbar-block.sf-toolbar-status-yellow::before {
display: none;
}
.sf-toolbar-block-request .sf-toolbar-status {
border-radius: 6px;
color: #fff;
display: inline-block;
flex-shrink: 0;
font-size: 13px;
font-weight: 500;
padding: 4px 8px;
}
.sf-toolbar-block-request .sf-toolbar-info-piece a {
background-color: transparent;
text-decoration: none;
}
.sf-toolbar-block-request .sf-toolbar-info-piece a:hover {
text-decoration: underline;
}
.sf-toolbar-block-request .sf-toolbar-redirection-status {
font-weight: normal;
padding: 2px 4px;
line-height: 18px;
}
.sf-toolbar-block.sf-toolbar-block-request .sf-toolbar-redirection-status.sf-toolbar-status-yellow {
background-color: var(--sf-toolbar-yellow-300);
border-radius: 4px;
color: var(--sf-toolbar-yellow-800);
padding: 1px 4px;
}
.sf-toolbar-block.sf-toolbar-block-request .sf-toolbar-info-piece .sf-toolbar-redirection-method {
background: transparent;
color: var(--sf-toolbar-gray-300);
border: 1px solid var(--sf-toolbar-gray-400);
padding: 1px 4px;
}
.sf-toolbar-block-request .sf-toolbar-info-piece span.sf-toolbar-redirection-method {
font-size: 12px;
height: 17px;
line-height: 17px;
margin-right: 5px;
}
.sf-toolbar-block-request .sf-toolbar-request-icon svg {
stroke-width: 3px;
}
.sf-toolbar-block-ajax .sf-toolbar-icon {
cursor: pointer;
}
.sf-toolbar-status-green .sf-toolbar-label,
.sf-toolbar-status-yellow .sf-toolbar-label,
.sf-toolbar-status-red .sf-toolbar-label {
color: var(--sf-toolbar-white);
}
.sf-toolbar-block-config svg path,
.sf-toolbar-block-config svg .sf-svg-path {
fill: var(--sf-toolbar-white);
}
.sf-toolbar-block .sf-toolbar-icon {
color: var(--sf-toolbar-gray-300);
align-items: center;
display: flex;
height: 36px;
padding: 0 7px;
overflow: hidden;
text-overflow: ellipsis;
}
.sf-toolbar-block:hover .sf-toolbar-icon {
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
box-shadow: 1px 0 0 var(--sf-toolbar-black), inset 0 -1px 0 var(--sf-toolbar-black);
}
.sf-toolbar-block.sf-toolbar-block-right:hover .sf-toolbar-icon {
box-shadow: -1px 0 0 var(--sf-toolbar-black), inset 0 -1px 0 var(--sf-toolbar-black);
}
.sf-toolbar-block-request .sf-toolbar-icon {
padding-left: 0;
padding-right: 0;
}
.sf-toolbar-block .sf-toolbar-icon img,
.sf-toolbar-block .sf-toolbar-icon svg {
border-width: 0;
}
.sf-toolbar-block .sf-toolbar-icon img + span,
.sf-toolbar-block .sf-toolbar-icon svg + span {
margin-left: 4px;
}
.sf-toolbar-block-config .sf-toolbar-icon .sf-toolbar-value,
.sf-toolbar-block.sf-toolbar-block-sf-cli .sf-toolbar-value {
margin-left: 5px;
}
.sf-toolbar-block-config .sf-toolbar-icon .sf-toolbar-label,
.sf-toolbar-block.sf-toolbar-block-sf-cli .sf-toolbar-label {
margin-left: 0;
}
.sf-toolbar-block:hover,
.sf-toolbar-block.hover {
position: relative;
}
.sf-toolbar-block:hover .sf-toolbar-icon,
.sf-toolbar-block.hover .sf-toolbar-icon {
background-color: var(--sf-toolbar-gray-700);
position: relative;
z-index: 10002;
}
.sf-toolbar-block-ajax.hover .sf-toolbar-info {
z-index: 10001;
}
.sf-toolbar-block:hover .sf-toolbar-info,
.sf-toolbar-block.hover .sf-toolbar-info {
display: block;
padding: 10px;
max-width: 525px;
max-height: 480px;
word-wrap: break-word;
overflow: hidden;
overflow-y: auto;
}
.sf-toolbar-info-piece b.sf-toolbar-ajax-info {
color: var(--sf-toolbar-gray-100);
}
.sf-toolbar-ajax-requests {
border: 1px solid var(--sf-toolbar-gray-500);
font-variant: tabular-nums;
margin: 5px 0 0;
width: 100%;
}
.sf-toolbar-ajax-requests td {
background-color: var(--sf-toolbar-gray-700);
border: 1px solid var(--sf-toolbar-gray-500);
color: var(--sf-toolbar-gray-100);
font-size: 12px;
padding: 4px;
vertical-align: middle;
}
.sf-toolbar-ajax-requests thead {
border: 0;
}
.sf-toolbar-ajax-requests th {
background-color: var(--sf-toolbar-gray-800);
border: 1px solid var(--sf-toolbar-gray-500);
color: var(--sf-toolbar-gray-200);
font-size: 11px;
padding: 4px;
}
.sf-ajax-request-url {
max-width: 250px;
line-height: 9px;
overflow: hidden;
text-overflow: ellipsis;
}
.sf-toolbar-ajax-requests .sf-ajax-request-url a {
text-decoration: none;
}
.sf-toolbar-ajax-requests .sf-ajax-request-url a:hover {
text-decoration: underline;
}
.sf-ajax-request-duration {
text-align: right;
}
.sf-toolbar-block .sf-toolbar-info-piece .sf-toolbar-ajax-requests .sf-toolbar-status {
font-size: 11px;
padding: 1px 3px;
}
.sf-ajax-request-loading {
animation: sf-blink .5s ease-in-out infinite;
}
@keyframes sf-blink {
0% { background: var(--sf-toolbar-gray-800); }
50% { background: var(--sf-toolbar-gray-700); }
100% { background: var(--sf-toolbar-gray-800); }
}
.sf-toolbar-block.sf-toolbar-block-dump .sf-toolbar-info {
max-width: none;
width: 100%;
position: fixed;
box-sizing: border-box;
left: 0;
}
.sf-toolbar-block-dump pre.sf-dump {
background-color: var(--sf-toolbar-gray-800);
border-color: var(--sf-toolbar-gray-500);
border-radius: 0;
margin: 6px 0 12px 0;
}
.sf-toolbar-block-dump pre.sf-dump:last-child {
margin-bottom: 0;
}
.sf-toolbar-block-dump pre.sf-dump .sf-dump-search-wrapper {
margin-bottom: 5px;
}
.sf-toolbar-block-dump pre.sf-dump span.sf-dump-search-count {
color: #333;
font-size: 12px;
}
.sf-toolbar-block-dump .sf-toolbar-info-piece {
display: block;
}
.sf-toolbar-block-dump .sf-toolbar-info-piece .sf-toolbar-file-line {
color: var(--sf-toolbar-gray-400);
margin-left: 4px;
}
.sf-toolbar-block-dump .sf-toolbar-info img {
display: none;
}
.sf-toolbar-block-serializer .detailed-metrics {
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-gap: 15px;
margin-top: 15px;
}
/* Responsive Design */
.sf-toolbar-icon .sf-toolbar-label,
.sf-toolbar-icon .sf-toolbar-value {
display: none;
}
.sf-toolbar-block-config .sf-toolbar-icon .sf-toolbar-label,
.sf-cli .sf-toolbar-icon .sf-toolbar-label {
display: inline-block;
}
/* Legacy Design - these styles are maintained to make old panels look
a bit better on the new toolbar */
.sf-toolbar-block .sf-toolbar-info-piece-additional-detail {
color: var(--sf-toolbar-gray-400);
font-size: 12px;
}
.sf-toolbar-status-green .sf-toolbar-info-piece-additional-detail,
.sf-toolbar-status-yellow .sf-toolbar-info-piece-additional-detail,
.sf-toolbar-status-red .sf-toolbar-info-piece-additional-detail {
color: var(--sf-toolbar-white);
}
@media (min-width: 768px) {
.sf-toolbar-icon .sf-toolbar-label,
.sf-toolbar-icon .sf-toolbar-value {
display: inline;
}
.sf-toolbar-block-time .sf-toolbar-icon svg,
.sf-toolbar-block-memory .sf-toolbar-icon svg {
display: none;
}
.sf-toolbar-block-time .sf-toolbar-icon svg + span,
.sf-toolbar-block-memory .sf-toolbar-icon svg + span {
margin-left: 0;
}
.sf-toolbar-block .sf-toolbar-icon {
padding: 0 10px;
}
.sf-toolbar-block-time .sf-toolbar-icon {
padding-right: 5px;
}
.sf-toolbar-block-memory .sf-toolbar-icon {
padding-left: 5px;
}
.sf-toolbar-block-request .sf-toolbar-icon {
display: flex;
align-items: center;
padding-left: 0;
padding-right: 0;
}
.sf-toolbar-block-request .sf-toolbar-label {
margin-left: 4px;
margin-right: 1px;
}
.sf-toolbar-block-request .sf-toolbar-status + .sf-toolbar-request-icon {
display: inline-flex;
margin-left: 5px;
}
.sf-toolbar-block-request .sf-toolbar-icon .sf-toolbar-request-icon + .sf-toolbar-label {
margin-left: 0;
}
.sf-toolbar-block-request .sf-toolbar-label + .sf-toolbar-value {
margin-right: 5px;
}
.sf-toolbar-block-request:hover .sf-toolbar-info {
max-width: none;
}
.sf-toolbar-block .sf-toolbar-info-piece b {
font-size: 12px;
}
.sf-toolbar-block .sf-toolbar-info-piece span {
font-size: 13px;
}
.sf-toolbar-block-right {
float: right;
margin-left: 0;
margin-right: 0;
}
.sf-toolbarreset .sf-toolbar-block.sf-toolbar-block-right:not(.sf-toolbar-block-sf-cli) .sf-toolbar-info {
border-bottom-left-radius: 4px;
border-bottom-right-radius: 0;
}
}
@media (min-width: 1024px) {
.sf-toolbar-block .sf-toolbar-info-piece-additional,
.sf-toolbar-block .sf-toolbar-info-piece-additional-detail {
display: inline;
}
.sf-toolbar-block .sf-toolbar-info-piece-additional:empty,
.sf-toolbar-block .sf-toolbar-info-piece-additional-detail:empty {
display: none;
}
}
/***** Error Toolbar *****/
.sf-error-toolbar .sf-toolbarreset {
background: var(--sf-toolbar-gray-800);
color: var(--sf-toolbar-gray-100);
font: 13px/36px var(--sf-toolbar-font-family-system);
height: 36px;
padding: 0 15px;
text-align: left;
}
.sf-error-toolbar .sf-toolbarreset svg {
height: auto;
}
.sf-error-toolbar .sf-toolbarreset a {
color: #99cdd8;
margin-left: 5px;
text-decoration: underline;
}
.sf-error-toolbar .sf-toolbarreset a:hover {
text-decoration: none;
}
.sf-error-toolbar .sf-toolbarreset .sf-toolbar-icon {
float: left;
padding: 5px 0;
margin-right: 10px;
}
.sf-full-stack {
left: 0px;
font-size: 12px;
}
/***** Media query print: Do not print the Toolbar. *****/
@media print {
.sf-toolbar {
display: none !important;
}
}

View File

@@ -0,0 +1,39 @@
<div id="sfToolbarClearer-{{ token }}" class="sf-toolbar-clearer"></div>
<div id="sfToolbarMainContent-{{ token }}" class="sf-toolbarreset notranslate clear-fix" data-no-turbolink data-turbo="false">
{% for name, template in templates %}
{% if block('toolbar', template) is defined %}
{% with {
collector: profile ? profile.getcollector(name) : null,
profiler_url: profiler_url,
token: token ?? (profile ? profile.token : null),
name: name,
profiler_markup_version: profiler_markup_version,
csp_script_nonce: csp_script_nonce,
csp_style_nonce: csp_style_nonce
} %}
{{ block('toolbar', template) }}
{% endwith %}
{% endif %}
{% endfor %}
{% if full_stack %}
<div class="sf-full-stack sf-toolbar-block sf-toolbar-block-full-stack sf-toolbar-status-red sf-toolbar-block-right">
<div class="sf-toolbar-icon">
<span class="sf-toolbar-value">Using symfony/symfony is NOT supported</span>
</div>
<div class="sf-toolbar-info sf-toolbar-status-red">
<p>This project is using Symfony via the "symfony/symfony" package.</p>
<p>This is NOT supported anymore since Symfony 4.0.</p>
<p>Even if it seems to work well, it has some important limitations with no workarounds.</p>
<p>Using this package also makes your project slower.</p>
<strong>Please, stop using this package and replace it with individual packages instead.</strong>
</div>
<div></div>
</div>
{% endif %}
<button class="sf-toolbar-toggle-button" type="button" id="sfToolbarToggleButton-{{ token }}" accesskey="D" aria-expanded="true" aria-controls="sfToolbarMainContent-{{ token }}">
<i class="sf-toolbar-icon-opened" title="Close Toolbar">{{ source('@WebProfiler/Icon/close.svg') }}</i>
<i class="sf-toolbar-icon-closed" title="Open Toolbar">{{ source('@WebProfiler/Icon/symfony.svg') }}</i>
</button>
</div>

View File

@@ -0,0 +1,6 @@
<div class="sf-toolbar-block sf-toolbar-block-{{ name }} sf-toolbar-status-{{ status|default('normal') }} {{ additional_classes|default('') }}" {{ block_attrs|default('')|raw }}>
{% if link is not defined or link %}<a href="{{ url('_profiler', { token: token, panel: name }) }}">{% endif %}
<div class="sf-toolbar-icon">{{ icon|default('') }}</div>
{% if link|default(false) %}</a>{% endif %}
<div class="sf-toolbar-info">{{ text|default('') }}</div>
</div>

View File

@@ -0,0 +1,632 @@
<!-- START of Symfony Web Debug Toolbar -->
<div id="sfwdt{{ token }}" class="sf-toolbar sf-toolbar-opened" role="region" aria-label="Symfony Web Debug Toolbar">
{{ include('@WebProfiler/Profiler/toolbar.html.twig', {
templates: {
'request': '@WebProfiler/Profiler/cancel.html.twig'
},
profile: null,
profiler_url: url('_profiler', {token: token}),
profiler_markup_version: 3,
}) }}
</div>
<link rel="stylesheet"{% if csp_style_nonce %} nonce="{{ csp_style_nonce }}"{% endif %} href="{{ url('_wdt_stylesheet') }}" />
{# CAUTION: the contents of this file are processed by Twig before loading
them as JavaScript source code. Always use '/*' comments instead
of '//' comments to avoid impossible-to-debug side-effects #}
<script{% if csp_script_nonce is defined and csp_script_nonce %} nonce="{{ csp_script_nonce }}"{% endif %}>/*<![CDATA[*/
if (typeof Sfjs === 'undefined' || typeof Sfjs.loadToolbar === 'undefined') {
Sfjs = (function() {
"use strict";
if ('classList' in document.documentElement) {
var hasClass = function (el, cssClass) { return el.classList.contains(cssClass); };
var removeClass = function(el, cssClass) { el.classList.remove(cssClass); };
var addClass = function(el, cssClass) { el.classList.add(cssClass); };
var toggleClass = function(el, cssClass) { el.classList.toggle(cssClass); };
} else {
var hasClass = function (el, cssClass) { return el.className.match(new RegExp('\\b' + cssClass + '\\b')); };
var removeClass = function(el, cssClass) { el.className = el.className.replace(new RegExp('\\b' + cssClass + '\\b'), ' '); };
var addClass = function(el, cssClass) { if (!hasClass(el, cssClass)) { el.className += " " + cssClass; } };
var toggleClass = function(el, cssClass) { hasClass(el, cssClass) ? removeClass(el, cssClass) : addClass(el, cssClass); };
}
var noop = function() {};
var profilerStorageKey = 'symfony/profiler/';
var addEventListener;
var el = document.createElement('div');
if (!('addEventListener' in el)) {
addEventListener = function (element, eventName, callback) {
element.attachEvent('on' + eventName, callback);
};
} else {
addEventListener = function (element, eventName, callback) {
element.addEventListener(eventName, callback, false);
};
}
var request = function(url, onSuccess, onError, payload, options, tries) {
url = new URL(url);
url.searchParams.set('XDEBUG_IGNORE', '1');
url = url.toString();
var xhr = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP');
options = options || {};
options.retry = options.retry || false;
tries = tries || 1;
/* this delays for 125, 375, 625, 875, and 1000, ... */
var delay = tries < 5 ? (tries - 0.5) * 250 : 1000;
xhr.open(options.method || 'GET', url, true);
xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
xhr.onreadystatechange = function(state) {
if (4 !== xhr.readyState) {
return null;
}
if (xhr.status == 404 && options.retry && !options.stop) {
setTimeout(function() {
if (options.stop) {
return;
}
request(url, onSuccess, onError, payload, options, tries + 1);
}, delay);
return null;
}
if (200 === xhr.status) {
(onSuccess || noop)(xhr);
} else {
(onError || noop)(xhr);
}
};
if (options.onSend) {
options.onSend(tries);
}
xhr.send(payload || '');
};
var getPreference = function(name) {
if (!window.localStorage) {
return null;
}
return localStorage.getItem(profilerStorageKey + name);
};
var setPreference = function(name, value) {
if (!window.localStorage) {
return null;
}
localStorage.setItem(profilerStorageKey + name, value);
};
var requestStack = [];
var extractHeaders = function(xhr, stackElement) {
/* Here we avoid to call xhr.getResponseHeader in order to */
/* prevent polluting the console with CORS security errors */
var allHeaders = xhr.getAllResponseHeaders();
var ret;
if (ret = allHeaders.match(/^x-debug-token:\s+(.*)$/im)) {
stackElement.profile = ret[1];
}
if (ret = allHeaders.match(/^x-debug-token-link:\s+(.*)$/im)) {
stackElement.profilerUrl = ret[1];
}
if (ret = allHeaders.match(/^Symfony-Debug-Toolbar-Replace:\s+(.*)$/im)) {
stackElement.toolbarReplaceFinished = false;
stackElement.toolbarReplace = '1' === ret[1];
}
};
var successStreak = 4;
var pendingRequests = 0;
var renderAjaxRequests = function() {
var requestCounter = document.querySelector('.sf-toolbar-ajax-request-counter');
if (!requestCounter) {
return;
}
requestCounter.textContent = requestStack.length;
var infoSpan = document.querySelector(".sf-toolbar-ajax-info");
if (infoSpan) {
infoSpan.textContent = requestStack.length + ' AJAX request' + (requestStack.length !== 1 ? 's' : '');
}
var ajaxToolbarPanel = document.querySelector('.sf-toolbar-block-ajax');
if (requestStack.length) {
ajaxToolbarPanel.style.display = '';
} else {
ajaxToolbarPanel.style.display = 'none';
}
if (pendingRequests > 0) {
addClass(ajaxToolbarPanel, 'sf-ajax-request-loading');
} else if (successStreak < 4) {
addClass(ajaxToolbarPanel, 'sf-toolbar-status-red');
removeClass(ajaxToolbarPanel, 'sf-ajax-request-loading');
} else {
removeClass(ajaxToolbarPanel, 'sf-ajax-request-loading');
removeClass(ajaxToolbarPanel, 'sf-toolbar-status-red');
}
};
var startAjaxRequest = function(index) {
var tbody = document.querySelector('.sf-toolbar-ajax-request-list');
if (!tbody) {
return;
}
var nbOfAjaxRequest = tbody.rows.length;
if (nbOfAjaxRequest >= 100) {
tbody.deleteRow(0);
}
var request = requestStack[index];
pendingRequests++;
var row = document.createElement('tr');
request.DOMNode = row;
var requestNumberCell = document.createElement('td');
requestNumberCell.textContent = index + 1;
row.appendChild(requestNumberCell);
var profilerCell = document.createElement('td');
profilerCell.textContent = 'n/a';
row.appendChild(profilerCell);
var methodCell = document.createElement('td');
methodCell.textContent = request.method;
row.appendChild(methodCell);
var typeCell = document.createElement('td');
typeCell.textContent = request.type;
row.appendChild(typeCell);
var statusCodeCell = document.createElement('td');
var statusCode = document.createElement('span');
statusCode.textContent = 'n/a';
statusCodeCell.appendChild(statusCode);
row.appendChild(statusCodeCell);
var pathCell = document.createElement('td');
pathCell.className = 'sf-ajax-request-url';
if ('GET' === request.method) {
var pathLink = document.createElement('a');
pathLink.setAttribute('href', request.url);
pathLink.textContent = request.url;
pathCell.appendChild(pathLink);
} else {
pathCell.textContent = request.url;
}
pathCell.setAttribute('title', request.url);
row.appendChild(pathCell);
var durationCell = document.createElement('td');
durationCell.className = 'sf-ajax-request-duration';
durationCell.textContent = 'n/a';
row.appendChild(durationCell);
request.liveDurationHandle = setInterval(function() {
durationCell.textContent = (new Date() - request.start) + ' ms';
}, 100);
row.className = 'sf-ajax-request sf-ajax-request-loading';
tbody.insertBefore(row, null);
var toolbarInfo = document.querySelector('.sf-toolbar-block-ajax .sf-toolbar-info');
toolbarInfo.scrollTop = toolbarInfo.scrollHeight;
renderAjaxRequests();
};
var finishAjaxRequest = function(index) {
var request = requestStack[index];
clearInterval(request.liveDurationHandle);
if (!request.DOMNode) {
return;
}
if (request.toolbarReplace && !request.toolbarReplaceFinished && request.profile) {
/* Flag as complete because finishAjaxRequest can be called multiple times. */
request.toolbarReplaceFinished = true;
/* Search up through the DOM to find the toolbar's container ID. */
for (var elem = request.DOMNode; elem && elem !== document; elem = elem.parentNode) {
if (elem.id.match(/^sfwdt/)) {
Sfjs.loadToolbar(elem.id.replace(/^sfwdt/, ''), request.profile);
break;
}
}
}
pendingRequests--;
var row = request.DOMNode;
/* Unpack the children from the row */
var profilerCell = row.children[1];
var methodCell = row.children[2];
var statusCodeCell = row.children[4];
var statusCodeElem = statusCodeCell.children[0];
var durationCell = row.children[6];
if (request.error) {
row.className = 'sf-ajax-request sf-ajax-request-error';
methodCell.className = 'sf-ajax-request-error';
successStreak = 0;
} else {
row.className = 'sf-ajax-request sf-ajax-request-ok';
successStreak++;
}
if (request.statusCode) {
if (request.statusCode < 300) {
statusCodeElem.setAttribute('class', 'sf-toolbar-status');
} else if (request.statusCode < 400) {
statusCodeElem.setAttribute('class', 'sf-toolbar-status sf-toolbar-status-yellow');
} else {
statusCodeElem.setAttribute('class', 'sf-toolbar-status sf-toolbar-status-red');
}
statusCodeElem.textContent = request.statusCode;
} else {
statusCodeElem.setAttribute('class', 'sf-toolbar-status sf-toolbar-status-red');
}
if (request.duration) {
durationCell.textContent = request.duration + ' ms';
}
if (request.profilerUrl) {
profilerCell.textContent = '';
var profilerLink = document.createElement('a');
profilerLink.setAttribute('href', request.profilerUrl);
profilerLink.textContent = request.profile;
profilerCell.appendChild(profilerLink);
}
renderAjaxRequests();
};
{% if excluded_ajax_paths is defined %}
if (window.fetch && window.fetch.polyfill === undefined) {
var oldFetch = window.fetch;
window.fetch = function () {
var promise = oldFetch.apply(this, arguments);
var url = arguments[0];
var params = arguments[1];
var paramType = Object.prototype.toString.call(arguments[0]);
if (paramType === '[object Request]') {
url = arguments[0].url;
params = {
method: arguments[0].method,
credentials: arguments[0].credentials,
headers: arguments[0].headers,
mode: arguments[0].mode,
redirect: arguments[0].redirect
};
} else {
url = String(url);
}
if (!url.match(new RegExp({{ excluded_ajax_paths|json_encode|raw }}))) {
var method = 'GET';
if (params && params.method !== undefined) {
method = params.method;
}
var stackElement = {
error: false,
url: url,
method: method,
type: 'fetch',
start: new Date()
};
var idx = requestStack.push(stackElement) - 1;
promise.then(function (r) {
stackElement.duration = new Date() - stackElement.start;
stackElement.error = r.status < 200 || r.status >= 400;
stackElement.statusCode = r.status;
stackElement.profile = r.headers.get('x-debug-token');
stackElement.profilerUrl = r.headers.get('x-debug-token-link');
stackElement.toolbarReplaceFinished = false;
stackElement.toolbarReplace = '1' === r.headers.get('Symfony-Debug-Toolbar-Replace');
finishAjaxRequest(idx);
}, function (e){
stackElement.error = true;
finishAjaxRequest(idx);
});
startAjaxRequest(idx);
}
return promise;
};
}
if (window.XMLHttpRequest && XMLHttpRequest.prototype.addEventListener) {
var proxied = XMLHttpRequest.prototype.open;
XMLHttpRequest.prototype.open = function(method, url, async, user, pass) {
var self = this;
/* prevent logging AJAX calls to static and inline files, like templates */
var path = url;
if (url.slice(0, 1) === '/') {
if (0 === url.indexOf('{{ request.basePath|e('js') }}')) {
path = url.slice({{ request.basePath|length }});
}
}
else if (0 === url.indexOf('{{ (request.schemeAndHttpHost ~ request.basePath)|e('js') }}')) {
path = url.slice({{ (request.schemeAndHttpHost ~ request.basePath)|length }});
}
if (!path.match(new RegExp({{ excluded_ajax_paths|json_encode|raw }}))) {
var stackElement = {
error: false,
url: url,
method: method,
type: 'xhr',
start: new Date()
};
var idx = requestStack.push(stackElement) - 1;
this.addEventListener('readystatechange', function() {
if (self.readyState == 4) {
stackElement.duration = new Date() - stackElement.start;
stackElement.error = self.status < 200 || self.status >= 400;
stackElement.statusCode = self.status;
extractHeaders(self, stackElement);
finishAjaxRequest(idx);
}
}, false);
startAjaxRequest(idx);
}
proxied.apply(this, Array.prototype.slice.call(arguments));
};
}
{% endif %}
return {
hasClass: hasClass,
removeClass: removeClass,
addClass: addClass,
toggleClass: toggleClass,
getPreference: getPreference,
setPreference: setPreference,
addEventListener: addEventListener,
request: request,
renderAjaxRequests: renderAjaxRequests,
getSfwdt: function(token) {
return document.getElementById('sfwdt' + token);
},
load: function(selector, url, onSuccess, onError, options) {
var el = document.getElementById(selector);
if (el && el.getAttribute('data-sfurl') !== url) {
request(
url,
function(xhr) {
el.innerHTML = xhr.responseText;
el.setAttribute('data-sfurl', url);
removeClass(el, 'loading');
var pending = pendingRequests;
for (var i = 0; i < requestStack.length; i++) {
startAjaxRequest(i);
if (requestStack[i].duration) {
finishAjaxRequest(i);
}
}
/* Revert the pending state in case there was a start called without a finish above. */
pendingRequests = pending;
(onSuccess || noop)(xhr, el);
},
function(xhr) { (onError || noop)(xhr, el); },
'',
options
);
}
return this;
},
showToolbar: function(token) {
var sfwdt = this.getSfwdt(token);
if ('closed' === getPreference('toolbar/displayState')) {
addClass(sfwdt, 'sf-toolbar-closed');
removeClass(sfwdt, 'sf-toolbar-opened');
} else {
addClass(sfwdt, 'sf-toolbar-opened');
removeClass(sfwdt, 'sf-toolbar-closed');
}
},
hideToolbar: function(token) {
var sfwdt = this.getSfwdt(token);
addClass(sfwdt, 'sf-toolbar-closed');
removeClass(sfwdt, 'sf-toolbar-opened');
},
initToolbar: function(token) {
this.showToolbar(token);
var toggleButton = document.querySelector(`#sfToolbarToggleButton-${token}`);
addEventListener(toggleButton, 'click', function (event) {
event.preventDefault();
const newState = 'opened' === getPreference('toolbar/displayState') ? 'closed' : 'opened';
setPreference('toolbar/displayState', newState);
'opened' === newState ? Sfjs.showToolbar(token) : Sfjs.hideToolbar(token);
});
},
loadToolbar: function(token, newToken) {
var that = this;
var triesCounter = document.getElementById('sfLoadCounter-' + token);
var options = {
retry: true,
onSend: function (count) {
if (count === 3) {
that.initToolbar(token);
}
if (triesCounter) {
triesCounter.textContent = count;
}
},
};
var cancelButton = document.getElementById('sfLoadCancel-' + token);
if (cancelButton) {
addEventListener(cancelButton, 'click', function (event) {
event.preventDefault();
options.stop = true;
that.hideToolbar(token);
});
}
newToken = (newToken || token);
this.load(
'sfwdt' + token,
'{{ url("_wdt", { "token": "xxxxxx" })|escape('js') }}'.replace(/xxxxxx/, newToken),
function(xhr, el) {
var toolbarContent = document.getElementById('sfToolbarMainContent-' + newToken);
/* Do nothing in the edge case where the toolbar has already been replaced with a new one */
if (!toolbarContent) {
return;
}
/* Replace the ID, it has to match the new token */
toolbarContent.parentElement.id = 'sfwdt' + newToken;
/* Evaluate in global scope scripts embedded inside the toolbar */
var i, scripts = [].slice.call(el.querySelectorAll('script'));
for (i = 0; i < scripts.length; ++i) {
if (scripts[i].firstChild) {
eval.call({}, scripts[i].firstChild.nodeValue);
}
}
el.style.display = -1 !== xhr.responseText.indexOf('sf-toolbarreset') ? 'block' : 'none';
if (el.style.display == 'none') {
return;
}
that.initToolbar(newToken);
/* Handle toolbar-info position */
var toolbarBlocks = [].slice.call(el.querySelectorAll('.sf-toolbar-block'));
for (i = 0; i < toolbarBlocks.length; ++i) {
toolbarBlocks[i].onmouseover = function () {
var toolbarInfo = this.querySelectorAll('.sf-toolbar-info')[0];
var pageWidth = document.body.clientWidth;
var elementWidth = toolbarInfo.offsetWidth;
var leftValue = (elementWidth + this.offsetLeft) - pageWidth;
var rightValue = (elementWidth + (pageWidth - this.offsetLeft)) - pageWidth;
/* Reset right and left value, useful on window resize */
toolbarInfo.style.right = '';
toolbarInfo.style.left = '';
if (elementWidth > pageWidth) {
toolbarInfo.style.left = 0;
}
else if (leftValue > 0 && rightValue > 0) {
toolbarInfo.style.right = (rightValue * -1) + 'px';
} else if (leftValue < 0) {
toolbarInfo.style.left = 0;
} else {
toolbarInfo.style.right = '0px';
}
};
}
renderAjaxRequests();
addEventListener(document.querySelector('.sf-toolbar-ajax-clear'), 'click', function() {
requestStack = [];
renderAjaxRequests();
successStreak = 4;
document.querySelector('.sf-toolbar-ajax-request-list').innerHTML = '';
});
addEventListener(document.querySelector('.sf-toolbar-block-ajax'), 'mouseenter', function (event) {
var elem = document.querySelector('.sf-toolbar-block-ajax .sf-toolbar-info');
elem.scrollTop = elem.scrollHeight;
});
addEventListener(document.querySelector('.sf-toolbar-block-ajax > .sf-toolbar-icon'), 'click', function (event) {
event.preventDefault();
toggleClass(this.parentNode, 'hover');
});
var dumpInfo = document.querySelector('.sf-toolbar-block-dump .sf-toolbar-info');
if (null !== dumpInfo) {
addEventListener(dumpInfo, 'sfbeforedumpcollapse', function () {
dumpInfo.style.minHeight = dumpInfo.getBoundingClientRect().height+'px';
});
addEventListener(dumpInfo, 'mouseleave', function () {
dumpInfo.style.minHeight = '';
});
}
},
function(xhr) {
if (xhr.status !== 0 && !options.stop) {
var sfwdt = that.getSfwdt(token);
sfwdt.innerHTML = '\
<div class="sf-toolbarreset notranslate">\
<div class="sf-toolbar-icon"><svg width="26" height="28" xmlns="http://www.w3.org/2000/svg" version="1.1" x="0px" y="0px" viewBox="0 0 26 28" enable-background="new 0 0 26 28" xml:space="preserve"><path fill="#FFFFFF" d="M13 0C5.8 0 0 5.8 0 13c0 7.2 5.8 13 13 13c7.2 0 13-5.8 13-13C26 5.8 20.2 0 13 0z M20 7.5 c-0.6 0-1-0.3-1-0.9c0-0.2 0-0.4 0.2-0.6c0.1-0.3 0.2-0.3 0.2-0.4c0-0.3-0.5-0.4-0.7-0.4c-2 0.1-2.5 2.7-2.9 4.8l-0.2 1.1 c1.1 0.2 1.9 0 2.4-0.3c0.6-0.4-0.2-0.8-0.1-1.3C18 9.2 18.4 9 18.7 8.9c0.5 0 0.8 0.5 0.8 1c0 0.8-1.1 2-3.3 1.9 c-0.3 0-0.5 0-0.7-0.1L15 14.1c-0.4 1.7-0.9 4.1-2.6 6.2c-1.5 1.8-3.1 2.1-3.8 2.1c-1.3 0-2.1-0.6-2.2-1.6c0-0.9 0.8-1.4 1.3-1.4 c0.7 0 1.2 0.5 1.2 1.1c0 0.5-0.2 0.6-0.4 0.7c-0.1 0.1-0.3 0.2-0.3 0.4c0 0.1 0.1 0.3 0.4 0.3c0.5 0 0.9-0.3 1.2-0.5 c1.3-1 1.7-2.9 2.4-6.2l0.1-0.8c0.2-1.1 0.5-2.3 0.8-3.5c-0.9-0.7-1.4-1.5-2.6-1.8c-0.8-0.2-1.3 0-1.7 0.4C8.4 10 8.6 10.7 9 11.1 l0.7 0.7c0.8 0.9 1.3 1.7 1.1 2.7c-0.3 1.6-2.1 2.8-4.3 2.1c-1.9-0.6-2.2-1.9-2-2.7c0.2-0.6 0.7-0.8 1.2-0.6 c0.5 0.2 0.7 0.8 0.6 1.3c0 0.1 0 0.1-0.1 0.3C6 15 5.9 15.2 5.9 15.3c-0.1 0.4 0.4 0.7 0.8 0.8c0.8 0.3 1.7-0.2 1.9-0.9 c0.2-0.6-0.2-1.1-0.4-1.2l-0.8-0.9c-0.4-0.4-1.2-1.5-0.8-2.8c0.2-0.5 0.5-1 0.9-1.4c1-0.7 2-0.8 3-0.6c1.3 0.4 1.9 1.2 2.8 1.9 c0.5-1.3 1.1-2.6 2-3.8c0.9-1 2-1.7 3.3-1.8C20 4.8 21 5.4 21 6.3C21 6.7 20.8 7.5 20 7.5z"/></svg></div>\
An error occurred while loading the web debug toolbar. <a href="{{ url("_profiler_home")|escape('js') }}' + newToken + '">Open the web profiler.</a>\
</div>\
';
sfwdt.setAttribute('class', 'sf-toolbar sf-error-toolbar');
}
},
options
);
return this;
},
toggle: function(selector, elOn, elOff) {
var tmp = elOn.style.display,
el = document.getElementById(selector);
elOn.style.display = elOff.style.display;
elOff.style.display = tmp;
if (el) {
el.style.display = 'none' === tmp ? 'none' : 'block';
}
return this;
},
};
})();
}
Sfjs.loadToolbar('{{ token }}');
/*]]>*/</script>
<!-- END of Symfony Web Debug Toolbar -->

View File

@@ -0,0 +1,54 @@
{% extends '@WebProfiler/Profiler/base.html.twig' %}
{% block title 'Redirection Intercepted' %}
{% block head %}
{{ parent() }}
<style>
.sf-redirection-details {
background: var(--page-background);
box-shadow: inset 0 0 0 1px var(--menu-border-color), 0 0 0 5px var(--page-background);
border-radius: 6px;
margin: 45px auto 30px;
max-width: 800px;
padding: 30px 45px;
}
.sf-redirection-details h1 {
font-size: 21px;
font-weight: bold;
margin: 0 0 10px;
}
.sf-redirection-details p {
margin-top: 0;
}
.sf-redirection-details .sf-redirection-help {
color: var(--color-muted);
font-size: 14px;
margin: 45px 0 0;
}
</style>
{% endblock %}
{% block body %}
<div class="container">
{{ include('@WebProfiler/Profiler/header.html.twig', with_context = false) }}
<div class="sf-reset sf-redirection-details">
<div class="block-exception">
<h1>Redirection Intercepted</h1>
{% set absolute_url = absolute_url(location) %}
<p>This request redirects to <strong>{{ absolute_url }}</strong></p>
<p><a class="btn" href="{{ absolute_url }}">Follow redirect</a></p>
<p class="sf-redirection-help">
The redirect was intercepted by the Symfony Web Debug toolbar to help debugging.
For more information, see the "intercept-redirects" option of the Profiler.
</p>
</div>
</div>
</div>
{% endblock %}