mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-26 03:58:45 +02:00
migration symfony 5 4 (#300)
* symfony 5.4 (diff dev) * symfony 5.4 (working) * symfony 5.4 (update autoload) * symfony 5.4 (remove swiftmailer mailer implementation) * symfony 5.4 (php doc and split Global accessor class) ### Impacted packages: composer require php:">=7.2.5 <8.0.0" symfony/console:5.4.* symfony/dotenv:5.4.* symfony/framework-bundle:5.4.* symfony/twig-bundle:5.4.* symfony/yaml:5.4.* --update-with-dependencies composer require symfony/stopwatch:5.4.* symfony/web-profiler-bundle:5.4.* --dev --update-with-dependencies
This commit is contained in:
@@ -4,16 +4,31 @@
|
||||
<meta charset="{{ _charset }}" />
|
||||
<meta name="robots" content="noindex,nofollow" />
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
||||
<title>Symfony Profiler</title>
|
||||
<title>{% block title %}Symfony Profiler{% endblock %}</title>
|
||||
<link rel="icon" type="image/x-icon" sizes="16x16" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAFEUlEQVR4AZVXA4wm2RMf27bXDM/+3/+sYBGfrbVtezc6BWtzfPbYXtvDL9906t6v0vWl05me7q1JzXuvvu4yXnvZgJ9hH6bwZYXLFR739vauUGuDwhq1L1N4Uv/tRYUhFjwcg49hn6aYr1V4TiGp86CoP9Oh1tV414KnM6t9fHymKUZ3DAI0hW4b1AyK3lE8phh5OxWeoJgUGhi5mLm95YzBwcHuhIQEV1JSEoWGhoKWHxYWFmenhJ/B5W0GwZpDt5Ovry9lZWWRyWOu5ORk7JsUpogsq5gnmISTU+HKQoLFQv/qq6/os88+I+EVFRUlSsRZ5oRiVmwlXMWShQkahUdERJCfnx/vd+3aRTU1NXTixAmqrq6mK1eu0PTp05mnrmD+QK6XhLO0XP2O2FJAQICRjjMU4P1PP/1EfX19NGfOHM8Z0N7ezueQkBBXYGAgSWIaQ5Em2T5QzFNSUig9PV3OHOe4uDjZ87p//34C7Nm7x/NcRUUFAX799Vec8Y7m7+8Pz92SfBDXr7VwPYRbxn/MmDG8Tps2jQBd3V30/PPPe35/6qmnaPXq1TR69Gg+h4eHiwwosdLT4dBkQDSXWmJiIq/vv/8+/fvvv3ThwgWqr6+n/Px8oyCmAerq6jy03Nxc2Yv7ySSjQzrmi4i92fVpaWlYOZ79/f2MW7dtpSlTptDp06epo6ODPvroI850ASiGdyZOnEjXrl2jyspKT4XA9cgjkaPL/D8UWG62HokieyQQoKSkRGiMs2bNotraWmprayOBNWvWyO+scGdnp5zF/WYvLEb8TwpRykp1MV7feust6uzqJMD169fpueeeY/rDDz/MKzzgdrsJoGkaffvtt/TFF19wQsIDmzZtssojt+6Fo1CgzKiAvAB3DRs2jAULtLS0eErPGB5Ad3c3lZaWUnFxMfeAd955h5+JjY3FaqXAPwhBnRCNySK4b98+Aoilv/z6i/zGggSk1g0opWupAMvGP91yt96zadWqVdTc3Ezz58/31LOAy+US6zgHBP766y+mDR8+HBUgFWSnQI2EAFnqlpcaGxsJIFkMN8L9AnPnzmX6jRs3SACeAi0vL888JwYPgTEJpauhnADo6/LSgQMHCHD37l2Cp15//XXq7eslgKb+Fi1exM9lZmbaCDclIcpQQhATE4OVsrOzuamg+cyePZuzG64Hrlu3jp9ZuWolCdy+fZueeOIJpkdHR1sLHqgM0Yh0bTRz1m7fvp2KiopYkYKCApo8ebLZIwzlFeXSOXEnsLPe2Ij+p5DbYYdOdOtDQ0rNjFya5sTcsGGDcTDZoXTcNoVBMoxWyzDS2yXmOyeUtGSskmDjx4/nRgPAfBDmMpZtUIbRcsi2GsfSD2QYyd2OcdmyZSSwdu1apuXk5GB16v4bak0yX0imyIUEgwNovFTglhMZGcm0srIy43zAVUxuTLbW4xn17Fci23wly9dngUummrTaixcvMpOtW7fiiBwQpqKYU9efHuxDJE5hC9wvL9TW1RLg+PHjPGTQ8wsLC4WpDC5Y5UR4k5qKMSLT6lqeAiX0nuAaMmSI9sMPP9CZM2foyJEj9O677wpTVIuTjidNp0HibvttoH9E5OMqbWKkSaNSlojldoLF7TEP+nUEmKI62y1kOBINbVaNarcI0PuGGUlHyfYvLHg7/jhFSFYqZh0P8KHSptd5ksOPU3tvqAEUot/hFmOIYJLp87wGe9Dwm95eg5xa/R8G6d8U5EcFhwAAAABJRU5ErkJggg==">
|
||||
|
||||
{% block head %}
|
||||
<style>
|
||||
<style{% if csp_style_nonce is defined and csp_style_nonce %} nonce="{{ csp_style_nonce }}"{% endif %}>
|
||||
{{ include('@WebProfiler/Profiler/profiler.css.twig') }}
|
||||
</style>
|
||||
{% 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');
|
||||
</script>
|
||||
|
||||
{% block body '' %}
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
{# This file is partially duplicated in TwigBundle/Resources/views/base_js.html.twig. If you
|
||||
make any change in this file, verify the same change is needed in the other file. #}
|
||||
{# 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. #}
|
||||
<script{% if csp_script_nonce is defined and csp_script_nonce %} nonce="{{ csp_script_nonce }}"{% endif %}>/*<![CDATA[*/
|
||||
{# 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 #}
|
||||
|
||||
if (typeof Sfjs === 'undefined' || typeof Sfjs.loadToolbar === 'undefined') {
|
||||
Sfjs = (function() {
|
||||
"use strict";
|
||||
|
||||
@@ -24,10 +25,36 @@
|
||||
|
||||
var profilerStorageKey = 'symfony/profiler/';
|
||||
|
||||
var request = function(url, onSuccess, onError, payload, options) {
|
||||
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);
|
||||
};
|
||||
}
|
||||
|
||||
if (navigator.clipboard) {
|
||||
document.querySelectorAll('[data-clipboard-text]').forEach(function(element) {
|
||||
removeClass(element, 'hidden');
|
||||
element.addEventListener('click', function() {
|
||||
navigator.clipboard.writeText(element.getAttribute('data-clipboard-text'));
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
var request = function(url, onSuccess, onError, payload, options, tries) {
|
||||
var xhr = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP');
|
||||
options = options || {};
|
||||
options.maxTries = options.maxTries || 0;
|
||||
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) {
|
||||
@@ -35,11 +62,13 @@
|
||||
return null;
|
||||
}
|
||||
|
||||
if (xhr.status == 404 && options.maxTries > 1) {
|
||||
setTimeout(function(){
|
||||
options.maxTries--;
|
||||
request(url, onSuccess, onError, payload, options);
|
||||
}, 1000);
|
||||
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;
|
||||
}
|
||||
@@ -50,6 +79,11 @@
|
||||
(onError || noop)(xhr);
|
||||
}
|
||||
};
|
||||
|
||||
if (options.onSend) {
|
||||
options.onSend(tries);
|
||||
}
|
||||
|
||||
xhr.send(payload || '');
|
||||
};
|
||||
|
||||
@@ -83,6 +117,10 @@
|
||||
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;
|
||||
@@ -124,7 +162,7 @@
|
||||
|
||||
var nbOfAjaxRequest = tbody.rows.length;
|
||||
if (nbOfAjaxRequest >= 100) {
|
||||
tbody.deleteRow(nbOfAjaxRequest - 1);
|
||||
tbody.deleteRow(0);
|
||||
}
|
||||
|
||||
var request = requestStack[index];
|
||||
@@ -132,6 +170,14 @@
|
||||
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);
|
||||
@@ -164,29 +210,47 @@
|
||||
durationCell.textContent = 'n/a';
|
||||
row.appendChild(durationCell);
|
||||
|
||||
var profilerCell = document.createElement('td');
|
||||
profilerCell.textContent = 'n/a';
|
||||
row.appendChild(profilerCell);
|
||||
request.liveDurationHandle = setInterval(function() {
|
||||
durationCell.textContent = (new Date() - request.start) + ' ms';
|
||||
}, 100);
|
||||
|
||||
row.className = 'sf-ajax-request sf-ajax-request-loading';
|
||||
tbody.insertBefore(row, tbody.firstChild);
|
||||
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 methodCell = row.children[0];
|
||||
var statusCodeCell = row.children[2];
|
||||
var profilerCell = row.children[1];
|
||||
var methodCell = row.children[2];
|
||||
var statusCodeCell = row.children[4];
|
||||
var statusCodeElem = statusCodeCell.children[0];
|
||||
var durationCell = row.children[4];
|
||||
var profilerCell = row.children[5];
|
||||
var durationCell = row.children[6];
|
||||
|
||||
if (request.error) {
|
||||
row.className = 'sf-ajax-request sf-ajax-request-error';
|
||||
@@ -211,7 +275,7 @@
|
||||
}
|
||||
|
||||
if (request.duration) {
|
||||
durationCell.textContent = request.duration + 'ms';
|
||||
durationCell.textContent = request.duration + ' ms';
|
||||
}
|
||||
|
||||
if (request.profilerUrl) {
|
||||
@@ -225,19 +289,6 @@
|
||||
renderAjaxRequests();
|
||||
};
|
||||
|
||||
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);
|
||||
};
|
||||
}
|
||||
|
||||
{% if excluded_ajax_paths is defined %}
|
||||
if (window.fetch && window.fetch.polyfill === undefined) {
|
||||
var oldFetch = window.fetch;
|
||||
@@ -279,6 +330,8 @@
|
||||
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;
|
||||
@@ -298,13 +351,13 @@
|
||||
|
||||
/* prevent logging AJAX calls to static and inline files, like templates */
|
||||
var path = url;
|
||||
if (url.substr(0, 1) === '/') {
|
||||
if (url.slice(0, 1) === '/') {
|
||||
if (0 === url.indexOf('{{ request.basePath|e('js') }}')) {
|
||||
path = url.substr({{ request.basePath|length }});
|
||||
path = url.slice({{ request.basePath|length }});
|
||||
}
|
||||
}
|
||||
else if (0 === url.indexOf('{{ (request.schemeAndHttpHost ~ request.basePath)|e('js') }}')) {
|
||||
path = url.substr({{ (request.schemeAndHttpHost ~ request.basePath)|length }});
|
||||
path = url.slice({{ (request.schemeAndHttpHost ~ request.basePath)|length }});
|
||||
}
|
||||
|
||||
if (!path.match(new RegExp({{ excluded_ajax_paths|json_encode|raw }}))) {
|
||||
@@ -356,6 +409,14 @@
|
||||
|
||||
renderAjaxRequests: renderAjaxRequests,
|
||||
|
||||
getSfwdt: function(token) {
|
||||
if (!this.sfwdt) {
|
||||
this.sfwdt = document.getElementById('sfwdt' + token);
|
||||
}
|
||||
|
||||
return this.sfwdt;
|
||||
},
|
||||
|
||||
load: function(selector, url, onSuccess, onError, options) {
|
||||
var el = document.getElementById(selector);
|
||||
|
||||
@@ -366,12 +427,15 @@
|
||||
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); },
|
||||
@@ -383,6 +447,189 @@
|
||||
return this;
|
||||
},
|
||||
|
||||
showToolbar: function(token) {
|
||||
var sfwdt = this.getSfwdt(token);
|
||||
removeClass(sfwdt, 'sf-display-none');
|
||||
|
||||
if (getPreference('toolbar/displayState') == 'none') {
|
||||
document.getElementById('sfToolbarMainContent-' + token).style.display = 'none';
|
||||
document.getElementById('sfToolbarClearer-' + token).style.display = 'none';
|
||||
document.getElementById('sfMiniToolbar-' + token).style.display = 'block';
|
||||
} else {
|
||||
document.getElementById('sfToolbarMainContent-' + token).style.display = 'block';
|
||||
document.getElementById('sfToolbarClearer-' + token).style.display = 'block';
|
||||
document.getElementById('sfMiniToolbar-' + token).style.display = 'none';
|
||||
}
|
||||
},
|
||||
|
||||
hideToolbar: function(token) {
|
||||
var sfwdt = this.getSfwdt(token);
|
||||
addClass(sfwdt, 'sf-display-none');
|
||||
},
|
||||
|
||||
initToolbar: function(token) {
|
||||
this.showToolbar(token);
|
||||
|
||||
var hideButton = document.getElementById('sfToolbarHideButton-' + token);
|
||||
var hideButtonSvg = hideButton.querySelector('svg');
|
||||
hideButtonSvg.setAttribute('aria-hidden', 'true');
|
||||
hideButtonSvg.setAttribute('focusable', 'false');
|
||||
addEventListener(hideButton, 'click', function (event) {
|
||||
event.preventDefault();
|
||||
|
||||
var p = this.parentNode;
|
||||
p.style.display = 'none';
|
||||
(p.previousElementSibling || p.previousSibling).style.display = 'none';
|
||||
document.getElementById('sfMiniToolbar-' + token).style.display = 'block';
|
||||
setPreference('toolbar/displayState', 'none');
|
||||
});
|
||||
|
||||
var showButton = document.getElementById('sfToolbarMiniToggler-' + token);
|
||||
var showButtonSvg = showButton.querySelector('svg');
|
||||
showButtonSvg.setAttribute('aria-hidden', 'true');
|
||||
showButtonSvg.setAttribute('focusable', 'false');
|
||||
addEventListener(showButton, 'click', function (event) {
|
||||
event.preventDefault();
|
||||
|
||||
var elem = this.parentNode;
|
||||
if (elem.style.display == 'none') {
|
||||
document.getElementById('sfToolbarMainContent-' + token).style.display = 'none';
|
||||
document.getElementById('sfToolbarClearer-' + token).style.display = 'none';
|
||||
elem.style.display = 'block';
|
||||
} else {
|
||||
document.getElementById('sfToolbarMainContent-' + token).style.display = 'block';
|
||||
document.getElementById('sfToolbarClearer-' + token).style.display = 'block';
|
||||
elem.style.display = 'none'
|
||||
}
|
||||
|
||||
setPreference('toolbar/displayState', 'block');
|
||||
});
|
||||
},
|
||||
|
||||
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) {
|
||||
/* Do nothing in the edge case where the toolbar has already been replaced with a new one */
|
||||
if (!document.getElementById('sfToolbarMainContent-' + newToken)) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Evaluate in global scope scripts embedded inside the toolbar */
|
||||
var i, scripts = [].slice.call(el.querySelectorAll('script'));
|
||||
for (i = 0; i < scripts.length; ++i) {
|
||||
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">\
|
||||
<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);
|
||||
@@ -402,17 +649,18 @@
|
||||
|
||||
/* create the tab navigation for each group of tabs */
|
||||
for (var i = 0; i < tabGroups.length; i++) {
|
||||
var tabs = tabGroups[i].querySelectorAll('.tab');
|
||||
var tabs = tabGroups[i].querySelectorAll(':scope > .tab');
|
||||
var tabNavigation = document.createElement('ul');
|
||||
tabNavigation.className = 'tab-navigation';
|
||||
|
||||
var selectedTabId = 'tab-' + i + '-0'; /* select the first tab by default */
|
||||
for (var j = 0; j < tabs.length; j++) {
|
||||
var tabId = 'tab-' + i + '-' + j;
|
||||
var tabTitle = tabs[j].querySelector('.tab-title').innerHTML;
|
||||
|
||||
var tabNavigationItem = document.createElement('li');
|
||||
tabNavigationItem.setAttribute('data-tab-id', tabId);
|
||||
if (j == 0) { addClass(tabNavigationItem, 'active'); }
|
||||
if (hasClass(tabs[j], 'active')) { selectedTabId = tabId; }
|
||||
if (hasClass(tabs[j], 'disabled')) { addClass(tabNavigationItem, 'disabled'); }
|
||||
tabNavigationItem.innerHTML = tabTitle;
|
||||
tabNavigation.appendChild(tabNavigationItem);
|
||||
@@ -422,11 +670,12 @@
|
||||
}
|
||||
|
||||
tabGroups[i].insertBefore(tabNavigation, tabGroups[i].firstChild);
|
||||
addClass(document.querySelector('[data-tab-id="' + selectedTabId + '"]'), 'active');
|
||||
}
|
||||
|
||||
/* display the active tab and add the 'click' event listeners */
|
||||
for (i = 0; i < tabGroups.length; i++) {
|
||||
tabNavigation = tabGroups[i].querySelectorAll('.tab-navigation li');
|
||||
tabNavigation = tabGroups[i].querySelectorAll(':scope > .tab-navigation li');
|
||||
|
||||
for (j = 0; j < tabNavigation.length; j++) {
|
||||
tabId = tabNavigation[j].getAttribute('data-tab-id');
|
||||
@@ -528,9 +777,92 @@
|
||||
});
|
||||
}
|
||||
|
||||
/* Prevents from disallowing clicks on "copy to clipboard" elements inside toggles */
|
||||
var copyToClipboardElements = toggles[i].querySelectorAll('span[data-clipboard-text]');
|
||||
for (var k = 0; k < copyToClipboardElements.length; k++) {
|
||||
addEventListener(copyToClipboardElements[k], 'click', function(e) {
|
||||
e.stopPropagation();
|
||||
});
|
||||
}
|
||||
|
||||
toggles[i].setAttribute('data-processed', 'true');
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
initializeLogsTable: function() {
|
||||
Sfjs.updateLogsTable();
|
||||
|
||||
document.querySelectorAll('.log-filter input').forEach((input) => {
|
||||
input.addEventListener('change', () => { Sfjs.updateLogsTable(); });
|
||||
});
|
||||
|
||||
document.querySelectorAll('.filter-select-all-or-none button').forEach((link) => {
|
||||
link.addEventListener('click', () => {
|
||||
const selectAll = link.classList.contains('select-all');
|
||||
link.closest('.log-filter-content').querySelectorAll('input').forEach((input) => {
|
||||
input.checked = selectAll;
|
||||
});
|
||||
|
||||
Sfjs.updateLogsTable();
|
||||
});
|
||||
});
|
||||
|
||||
document.body.addEventListener('click', (event) => {
|
||||
document.querySelectorAll('details.log-filter').forEach((filterElement) => {
|
||||
if (!filterElement.contains(event.target) && filterElement.open) {
|
||||
filterElement.open = false;
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
updateLogsTable: function() {
|
||||
const selectedType = document.querySelector('#log-filter-type input:checked').value;
|
||||
const priorities = document.querySelectorAll('#log-filter-priority input');
|
||||
const allPriorities = Array.from(priorities).map((input) => input.value);
|
||||
const selectedPriorities = Array.from(priorities).filter((input) => input.checked).map((input) => input.value);
|
||||
const channels = document.querySelectorAll('#log-filter-channel input');
|
||||
const selectedChannels = Array.from(channels).filter((input) => input.checked).map((input) => input.value);
|
||||
|
||||
const logs = document.querySelector('table.logs');
|
||||
if (null === logs) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* hide rows that don't match the current filters */
|
||||
let numVisibleRows = 0;
|
||||
logs.querySelectorAll('tbody tr').forEach((row) => {
|
||||
if ('all' !== selectedType && selectedType !== row.getAttribute('data-type')) {
|
||||
row.style.display = 'none';
|
||||
return;
|
||||
}
|
||||
|
||||
const priority = row.getAttribute('data-priority');
|
||||
if (false === selectedPriorities.includes(priority) && true === allPriorities.includes(priority)) {
|
||||
row.style.display = 'none';
|
||||
return;
|
||||
}
|
||||
|
||||
if ('' !== row.getAttribute('data-channel') && false === selectedChannels.includes(row.getAttribute('data-channel'))) {
|
||||
row.style.display = 'none';
|
||||
return;
|
||||
}
|
||||
|
||||
row.style.display = 'table-row';
|
||||
numVisibleRows++;
|
||||
});
|
||||
|
||||
document.querySelector('table.logs').style.display = 0 === numVisibleRows ? 'none' : 'table';
|
||||
document.querySelector('.no-logs-message').style.display = 0 === numVisibleRows ? 'block' : 'none';
|
||||
|
||||
/* update the selected totals of all filters */
|
||||
document.querySelector('#log-filter-priority .filter-active-num').innerText = (priorities.length === selectedPriorities.length) ? 'All' : selectedPriorities.length;
|
||||
document.querySelector('#log-filter-channel .filter-active-num').innerText = (channels.length === selectedChannels.length) ? 'All' : selectedChannels.length;
|
||||
|
||||
/* update the currently selected "log type" tab */
|
||||
document.querySelectorAll('#log-filter-type li').forEach((tab) => tab.classList.remove('active'));
|
||||
document.querySelector(`#log-filter-type input[value="${selectedType}"]`).parentElement.classList.add('active');
|
||||
},
|
||||
};
|
||||
})();
|
||||
|
||||
@@ -538,5 +870,5 @@
|
||||
Sfjs.createTabs();
|
||||
Sfjs.createToggles();
|
||||
});
|
||||
|
||||
}
|
||||
/*]]>*/</script>
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
{% block toolbar %}
|
||||
{% set icon %}
|
||||
{{ include('@WebProfiler/Icon/symfony.svg') }}
|
||||
|
||||
<span class="sf-toolbar-value sf-toolbar-ajax-request-counter">
|
||||
Loading…
|
||||
</span>
|
||||
{% endset %}
|
||||
|
||||
{% set text %}
|
||||
<div class="sf-toolbar-info-piece">
|
||||
<b>Loading the web debug toolbar…</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 %}
|
||||
@@ -6,7 +6,8 @@
|
||||
<div id="summary">
|
||||
{% block summary %}
|
||||
{% if profile is defined %}
|
||||
{% set status_code = ('request' in profile.collectors|keys) ? profile.getcollector('request').statuscode|default(0) : 0 %}
|
||||
{% set request_collector = profile.collectors.request|default(false) %}
|
||||
{% 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' %}
|
||||
|
||||
<div class="status {{ css_class }}">
|
||||
@@ -16,10 +17,13 @@
|
||||
<a href="{{ profile.url }}">{{ profile.url }}</a>
|
||||
{% else %}
|
||||
{{ profile.url }}
|
||||
{% set referer = request_collector ? request_collector.requestheaders.get('referer') : null %}
|
||||
{% if referer %}
|
||||
<a href="{{ referer }}" class="referer">Return to referer URL</a>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</h2>
|
||||
|
||||
{% set request_collector = profile.collectors.request|default(false) %}
|
||||
{% if request_collector and request_collector.redirect -%}
|
||||
{%- set redirect = request_collector.redirect -%}
|
||||
{%- set controller = redirect.controller -%}
|
||||
@@ -44,18 +48,22 @@
|
||||
</dl>
|
||||
{%- endif %}
|
||||
|
||||
{% if request_collector and request_collector.forward|default(false) and request_collector.forward.controller.class is defined -%}
|
||||
{%- set forward = request_collector.forward -%}
|
||||
{%- set controller = forward.controller -%}
|
||||
{% 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' %}
|
||||
<dl class="metadata">
|
||||
<dt>Forwarded to</dt>
|
||||
<dd>
|
||||
{% set link = controller.file|file_link(controller.line) -%}
|
||||
{% set link = controller.file is defined ? controller.file|file_link(controller.line) : null -%}
|
||||
{%- if link %}<a href="{{ link }}" title="{{ controller.file }}">{% endif -%}
|
||||
{{- controller.class|abbr_class|striptags -}}
|
||||
{{- controller.method ? ' :: ' ~ controller.method }}
|
||||
{% 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: forward.token }) }}">{{ forward.token }}</a>)
|
||||
(<a href="{{ path('_profiler', { token: request_collector.forwardtoken }) }}">{{ request_collector.forwardtoken }}</a>)
|
||||
</dd>
|
||||
</dl>
|
||||
{%- endif %}
|
||||
@@ -73,7 +81,7 @@
|
||||
</dd>
|
||||
|
||||
<dt>Profiled on</dt>
|
||||
<dd>{{ profile.time|date('r') }}</dd>
|
||||
<dd><time datetime="{{ profile.time|date('c') }}">{{ profile.time|date('r') }}</time></dd>
|
||||
|
||||
<dt>Token</dt>
|
||||
<dd>{{ profile.token }}</dd>
|
||||
@@ -100,7 +108,7 @@
|
||||
{{ include('@WebProfiler/Icon/search.svg') }} <span class="hidden-small">Search</span>
|
||||
</a>
|
||||
|
||||
{{ render(path('_profiler_search_bar', request.query.all)) }}
|
||||
{{ render(controller('web_profiler.controller.profiler::searchBarAction', request.query.all)) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -115,13 +123,15 @@
|
||||
{%- endif -%}
|
||||
{%- endset %}
|
||||
{% if menu is not empty %}
|
||||
<li class="{{ name }} {{ name == panel ? 'selected' : '' }}">
|
||||
<li class="{{ name }} {{ name == panel ? 'selected' }}">
|
||||
<a href="{{ path('_profiler', { token: token, panel: name }) }}">{{ menu|raw }}</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
|
||||
{{ include('@WebProfiler/Profiler/settings.html.twig') }}
|
||||
</div>
|
||||
|
||||
<div id="collector-wrapper">
|
||||
@@ -138,6 +148,6 @@
|
||||
event.preventDefault();
|
||||
Sfjs.toggleClass(document.getElementById('sidebar'), 'expanded');
|
||||
})
|
||||
}())
|
||||
}());
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,13 @@
|
||||
{% 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">{{ include('@WebProfiler/Icon/search.svg') }}</span></a>
|
||||
{%- endif -%}
|
||||
{% endmacro %}
|
||||
|
||||
{% import _self as helper %}
|
||||
|
||||
{% block summary %}
|
||||
<div class="status">
|
||||
<div class="container">
|
||||
@@ -32,28 +40,14 @@
|
||||
<span class="label {{ css_class }}">{{ result.status_code|default('n/a') }}</span>
|
||||
</td>
|
||||
<td>
|
||||
<span class="nowrap">{{ result.ip }}</span>
|
||||
{% 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 %}
|
||||
<span class="nowrap">{{ result.ip }} {{ helper.profile_search_filter(request, result, 'ip') }}</span>
|
||||
</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 %}
|
||||
<span class="nowrap">{{ result.method }} {{ helper.profile_search_filter(request, result, 'method') }}</span>
|
||||
</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 %}
|
||||
{{ helper.profile_search_filter(request, result, 'url') }}
|
||||
</td>
|
||||
<td class="text-small">
|
||||
<span class="nowrap">{{ result.time|date('d-M-Y') }}</span>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
<div class="form-group">
|
||||
<label for="status_code">Status</label>
|
||||
<input type="number" name="status_code" id="status_code" value="{{ status_code }}">
|
||||
<input type="number" name="status_code" id="status_code" min="100" max="599" value="{{ status_code }}">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
|
||||
@@ -0,0 +1,193 @@
|
||||
<style>
|
||||
#open-settings {
|
||||
color: var(--color-muted);
|
||||
display: block;
|
||||
margin: 15px 15px 5px;
|
||||
}
|
||||
|
||||
.modal-wrap {
|
||||
-webkit-transition: all 0.3s ease-in-out;
|
||||
align-items: center;
|
||||
background: rgba(0, 0, 0, 0.8);
|
||||
display: flex;
|
||||
height: 100%;
|
||||
justify-content: center;
|
||||
left: 0;
|
||||
opacity: 1;
|
||||
overflow: auto;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
transition: all 0.3s ease-in-out;
|
||||
visibility: hidden;
|
||||
width: 100%;
|
||||
z-index: 100000;
|
||||
}
|
||||
.modal-wrap.visible {
|
||||
opacity: 1;
|
||||
visibility: visible;
|
||||
}
|
||||
.modal-wrap .modal-container {
|
||||
box-shadow: 5px 5px 10px 0px rgba(0, 0, 0, 0.5);
|
||||
color: var(--base-6);
|
||||
margin: 1em;
|
||||
max-width: 94%;
|
||||
width: 600px;
|
||||
}
|
||||
|
||||
.modal-wrap .modal-header {
|
||||
align-items: center;
|
||||
background: var(--table-header);
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 15px 30px;
|
||||
}
|
||||
.modal-wrap .modal-header h3 {
|
||||
color: var(--base-6);
|
||||
margin: 0;
|
||||
}
|
||||
.modal-wrap .modal-header .close-modal {
|
||||
background: transparent;
|
||||
border: 0;
|
||||
color: var(--base-4);
|
||||
cursor: pointer;
|
||||
font-size: 28px;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.modal-wrap .modal-header .close-modal:hover { opacity: 1; }
|
||||
|
||||
.modal-wrap .modal-content {
|
||||
background: var(--base-1);
|
||||
margin: 0;
|
||||
padding: 15px 30px;
|
||||
width: 100%;
|
||||
z-index: 100000;
|
||||
}
|
||||
.modal-content h4 {
|
||||
border-bottom: var(--border);
|
||||
margin: 0 0 15px;
|
||||
padding: 0 0 5px;
|
||||
}
|
||||
.modal-content input, .modal-content .form-help {
|
||||
margin-left: 15px;
|
||||
}
|
||||
.modal-content label {
|
||||
cursor: pointer;
|
||||
font-size: 16px;
|
||||
margin-left: 3px;
|
||||
}
|
||||
.modal-content .form-help {
|
||||
color: var(--color-muted);
|
||||
font-size: 14px;
|
||||
margin: 5px 0 15px 33px;
|
||||
}
|
||||
.modal-content .form-help + h4 {
|
||||
margin-top: 45px;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
#open-settings {
|
||||
color: transparent;
|
||||
}
|
||||
#sidebar:hover #open-settings, #sidebar.expanded #open-settings {
|
||||
color: var(--color-muted);
|
||||
}
|
||||
#open-settings:before {
|
||||
content: '\2699';
|
||||
font-weight: bold;
|
||||
font-size: 25px;
|
||||
color: var(--color-muted);
|
||||
}
|
||||
#sidebar:hover #open-settings:before, #sidebar.expanded #open-settings:before {
|
||||
content: '';
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<a href="#" id="open-settings">Settings</a>
|
||||
|
||||
<div class="modal-wrap" id="profiler-settings">
|
||||
<div class="modal-container">
|
||||
<div class="modal-header">
|
||||
<h3>Configuration Settings</h3>
|
||||
<button class="close-modal">×</button>
|
||||
</div>
|
||||
|
||||
<div class="modal-content">
|
||||
<h4>Theme</h4>
|
||||
|
||||
<input class="config-option" type="radio" name="theme" value="auto" id="settings-theme-auto">
|
||||
<label for="settings-theme-auto">Auto</label>
|
||||
<p class="form-help"><strong>Default theme</strong>. It switches between Light and Dark automatically to match the operating system theme.</p>
|
||||
|
||||
<input class="config-option" type="radio" name="theme" value="light" id="settings-theme-light">
|
||||
<label for="settings-theme-light">Light</label>
|
||||
<p class="form-help">Provides greatest readability, but requires a well-lit environment.</p>
|
||||
|
||||
<input class="config-option" type="radio" name="theme" value="dark" id="settings-theme-dark">
|
||||
<label for="settings-theme-dark">Dark</label>
|
||||
<p class="form-help">Reduces eye fatigue. Ideal for low light environments.</p>
|
||||
|
||||
<h4>Page Width</h4>
|
||||
|
||||
<input class="config-option" type="radio" name="width" value="normal" id="settings-width-normal">
|
||||
<label for="settings-width-normal">Normal</label>
|
||||
<p class="form-help">Fixed page width. Improves readability.</p>
|
||||
|
||||
<input class="config-option" type="radio" name="width" value="full" id="settings-width-full">
|
||||
<label for="settings-width-full">Full-page</label>
|
||||
<p class="form-help">Dynamic page width. As wide as the browser window.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
const configOptions = document.querySelectorAll('.config-option');
|
||||
const allSettingValues = ['theme-auto', 'theme-ligh', 'theme-dark', 'width-normal', 'width-full'];
|
||||
[...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);
|
||||
}
|
||||
});
|
||||
|
||||
if ('theme-auto' === settingValue) {
|
||||
document.body.classList.add((matchMedia('(prefers-color-scheme: dark)').matches ? 'theme-dark' : 'theme-light'));
|
||||
} else {
|
||||
document.body.classList.add(settingValue);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
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]
|
||||
|
||||
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');
|
||||
event.preventDefault();
|
||||
});
|
||||
|
||||
closeModalButton.addEventListener('click', function() {
|
||||
modalWindow.classList.remove('visible');
|
||||
});
|
||||
modalWrapper.addEventListener('click', function(event) {
|
||||
if (event.target == event.currentTarget) {
|
||||
modalWindow.classList.remove('visible');
|
||||
}
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
@@ -14,8 +14,10 @@
|
||||
z-index: 99999;
|
||||
}
|
||||
|
||||
.sf-minitoolbar a {
|
||||
display: block;
|
||||
.sf-minitoolbar button {
|
||||
background-color: transparent;
|
||||
padding: 0;
|
||||
border: none;
|
||||
}
|
||||
.sf-minitoolbar svg,
|
||||
.sf-minitoolbar img {
|
||||
@@ -71,6 +73,10 @@
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.sf-toolbarreset .sf-cancel-button {
|
||||
color: #444;
|
||||
}
|
||||
|
||||
.sf-toolbarreset .hide-button {
|
||||
background: #444;
|
||||
display: block;
|
||||
@@ -81,10 +87,13 @@
|
||||
height: 36px;
|
||||
cursor: pointer;
|
||||
text-align: center;
|
||||
border: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
.sf-toolbarreset .hide-button svg {
|
||||
max-height: 18px;
|
||||
margin-top: 10px;
|
||||
margin-top: 1px;
|
||||
}
|
||||
|
||||
.sf-toolbar-block {
|
||||
@@ -94,11 +103,14 @@
|
||||
height: 36px;
|
||||
margin-right: 0;
|
||||
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 {
|
||||
@@ -236,6 +248,7 @@ div.sf-toolbar .sf-toolbar-block a:hover {
|
||||
padding: 0 10px;
|
||||
}
|
||||
.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 {
|
||||
@@ -279,6 +292,8 @@ div.sf-toolbar .sf-toolbar-block a:hover {
|
||||
display: block;
|
||||
height: 36px;
|
||||
padding: 0 7px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.sf-toolbar-block-request .sf-toolbar-icon {
|
||||
padding-left: 0;
|
||||
@@ -407,34 +422,6 @@ div.sf-toolbar .sf-toolbar-block a:hover {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* Override the setting when the toolbar is on the top */
|
||||
{% if position == 'top' %}
|
||||
.sf-minitoolbar {
|
||||
border-bottom-left-radius: 4px;
|
||||
border-top-left-radius: 0;
|
||||
bottom: auto;
|
||||
right: 0;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.sf-toolbarreset {
|
||||
bottom: auto;
|
||||
box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.sf-toolbar-block .sf-toolbar-info {
|
||||
bottom: auto;
|
||||
top: 36px;
|
||||
}
|
||||
{% endif %}
|
||||
|
||||
{% if not floatable %}
|
||||
.sf-toolbarreset {
|
||||
position: static;
|
||||
}
|
||||
{% endif %}
|
||||
|
||||
/* Responsive Design */
|
||||
.sf-toolbar-icon .sf-toolbar-label,
|
||||
.sf-toolbar-icon .sf-toolbar-value {
|
||||
@@ -523,7 +510,7 @@ div.sf-toolbar .sf-toolbar-block a:hover {
|
||||
@media (min-width: 1024px) {
|
||||
.sf-toolbar-block .sf-toolbar-info-piece-additional,
|
||||
.sf-toolbar-block .sf-toolbar-info-piece-additional-detail {
|
||||
display: inline-block;
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.sf-toolbar-block .sf-toolbar-info-piece-additional:empty,
|
||||
@@ -562,6 +549,11 @@ div.sf-toolbar .sf-toolbar-block a:hover {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.sf-full-stack {
|
||||
left: 0px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
/***** Media query print: Do not print the Toolbar. *****/
|
||||
@media print {
|
||||
.sf-toolbar {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<!-- START of Symfony Web Debug Toolbar -->
|
||||
<div id="sfMiniToolbar-{{ token }}" class="sf-minitoolbar" data-no-turbolink>
|
||||
<a href="#" title="Show Symfony toolbar" tabindex="-1" id="sfToolbarMiniToggler-{{ token }}" accesskey="D">
|
||||
<button type="button" title="Show Symfony toolbar" id="sfToolbarMiniToggler-{{ token }}" accesskey="D" aria-expanded="false" aria-controls="sfToolbarMainContent-{{ token }}">
|
||||
{{ include('@WebProfiler/Icon/symfony.svg') }}
|
||||
</a>
|
||||
</button>
|
||||
</div>
|
||||
<div id="sfToolbarClearer-{{ token }}" class="sf-toolbar-clearer"></div>
|
||||
|
||||
@@ -10,9 +10,9 @@
|
||||
{% for name, template in templates %}
|
||||
{% if block('toolbar', template) is defined %}
|
||||
{% with {
|
||||
collector: profile.getcollector(name),
|
||||
collector: profile ? profile.getcollector(name) : null,
|
||||
profiler_url: profiler_url,
|
||||
token: profile.token,
|
||||
token: token ?? (profile ? profile.token : null),
|
||||
name: name,
|
||||
profiler_markup_version: profiler_markup_version,
|
||||
csp_script_nonce: csp_script_nonce,
|
||||
@@ -22,9 +22,25 @@
|
||||
{% 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>
|
||||
|
||||
<a class="hide-button" id="sfToolbarHideButton-{{ token }}" title="Close Toolbar" tabindex="-1" accesskey="D">
|
||||
<strong>Please, stop using this package and replace it with individual packages instead.</strong>
|
||||
</div>
|
||||
<div></div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<button class="hide-button" type="button" id="sfToolbarHideButton-{{ token }}" title="Close Toolbar" accesskey="D" aria-expanded="true" aria-controls="sfToolbarMainContent-{{ token }}">
|
||||
{{ include('@WebProfiler/Icon/close.svg') }}
|
||||
</a>
|
||||
</button>
|
||||
</div>
|
||||
<!-- END of Symfony Web Debug Toolbar -->
|
||||
|
||||
@@ -1,127 +1,21 @@
|
||||
<div id="sfwdt{{ token }}" class="sf-toolbar sf-display-none" role="region" aria-label="Symfony Web Debug Toolbar"></div>
|
||||
<div id="sfwdt{{ token }}" class="sf-toolbar sf-display-none" role="region" aria-label="Symfony Web Debug Toolbar">
|
||||
{% include('@WebProfiler/Profiler/toolbar.html.twig') with {
|
||||
templates: {
|
||||
'request': '@WebProfiler/Profiler/cancel.html.twig'
|
||||
},
|
||||
profile: null,
|
||||
profiler_url: url('_profiler', {token: token}),
|
||||
profiler_markup_version: 2,
|
||||
} %}
|
||||
</div>
|
||||
|
||||
{{ include('@WebProfiler/Profiler/base_js.html.twig') }}
|
||||
|
||||
<style{% if csp_style_nonce %} nonce="{{ csp_style_nonce }}"{% endif %}>
|
||||
{{ include('@WebProfiler/Profiler/toolbar.css.twig', { 'position': position, 'floatable': true }) }}
|
||||
{{ include('@WebProfiler/Profiler/toolbar.css.twig') }}
|
||||
</style>
|
||||
<script{% if csp_script_nonce %} nonce="{{ csp_script_nonce }}"{% endif %}>/*<![CDATA[*/
|
||||
(function () {
|
||||
{% if 'top' == position %}
|
||||
var sfwdt = document.getElementById('sfwdt{{ token }}');
|
||||
document.body.insertBefore(
|
||||
document.body.removeChild(sfwdt),
|
||||
document.body.firstChild
|
||||
);
|
||||
{% endif %}
|
||||
|
||||
Sfjs.load(
|
||||
'sfwdt{{ token }}',
|
||||
'{{ path("_wdt", { "token": token })|escape('js') }}',
|
||||
function(xhr, el) {
|
||||
|
||||
/* Evaluate embedded scripts inside the toolbar */
|
||||
var i, scripts = [].slice.call(el.querySelectorAll('script'));
|
||||
|
||||
for (i = 0; i < scripts.length; ++i) {
|
||||
eval(scripts[i].firstChild.nodeValue);
|
||||
}
|
||||
|
||||
el.style.display = -1 !== xhr.responseText.indexOf('sf-toolbarreset') ? 'block' : 'none';
|
||||
|
||||
if (el.style.display == 'none') {
|
||||
return;
|
||||
}
|
||||
|
||||
if (Sfjs.getPreference('toolbar/displayState') == 'none') {
|
||||
document.getElementById('sfToolbarMainContent-{{ token }}').style.display = 'none';
|
||||
document.getElementById('sfToolbarClearer-{{ token }}').style.display = 'none';
|
||||
document.getElementById('sfMiniToolbar-{{ token }}').style.display = 'block';
|
||||
} else {
|
||||
document.getElementById('sfToolbarMainContent-{{ token }}').style.display = 'block';
|
||||
document.getElementById('sfToolbarClearer-{{ token }}').style.display = 'block';
|
||||
document.getElementById('sfMiniToolbar-{{ token }}').style.display = 'none';
|
||||
}
|
||||
|
||||
/* 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';
|
||||
}
|
||||
};
|
||||
}
|
||||
Sfjs.addEventListener(document.getElementById('sfToolbarHideButton-{{ token }}'), 'click', function (event) {
|
||||
event.preventDefault();
|
||||
|
||||
var p = this.parentNode;
|
||||
p.style.display = 'none';
|
||||
(p.previousElementSibling || p.previousSibling).style.display = 'none';
|
||||
document.getElementById('sfMiniToolbar-{{ token }}').style.display = 'block';
|
||||
Sfjs.setPreference('toolbar/displayState', 'none');
|
||||
});
|
||||
Sfjs.addEventListener(document.getElementById('sfToolbarMiniToggler-{{ token }}'), 'click', function (event) {
|
||||
event.preventDefault();
|
||||
|
||||
var elem = this.parentNode;
|
||||
if (elem.style.display == 'none') {
|
||||
document.getElementById('sfToolbarMainContent-{{ token }}').style.display = 'none';
|
||||
document.getElementById('sfToolbarClearer-{{ token }}').style.display = 'none';
|
||||
elem.style.display = 'block';
|
||||
} else {
|
||||
document.getElementById('sfToolbarMainContent-{{ token }}').style.display = 'block';
|
||||
document.getElementById('sfToolbarClearer-{{ token }}').style.display = 'block';
|
||||
elem.style.display = 'none'
|
||||
}
|
||||
|
||||
Sfjs.setPreference('toolbar/displayState', 'block');
|
||||
});
|
||||
Sfjs.renderAjaxRequests();
|
||||
Sfjs.addEventListener(document.querySelector('.sf-toolbar-block-ajax > .sf-toolbar-icon'), 'click', function (event) {
|
||||
event.preventDefault();
|
||||
|
||||
Sfjs.toggleClass(this.parentNode, 'hover');
|
||||
});
|
||||
|
||||
var dumpInfo = document.querySelector('.sf-toolbar-block-dump .sf-toolbar-info');
|
||||
if (null !== dumpInfo) {
|
||||
Sfjs.addEventListener(dumpInfo, 'sfbeforedumpcollapse', function () {
|
||||
dumpInfo.style.minHeight = dumpInfo.getBoundingClientRect().height+'px';
|
||||
});
|
||||
Sfjs.addEventListener(dumpInfo, 'mouseleave', function () {
|
||||
dumpInfo.style.minHeight = '';
|
||||
});
|
||||
}
|
||||
},
|
||||
function(xhr) {
|
||||
if (xhr.status !== 0) {
|
||||
var sfwdt = document.getElementById('sfwdt{{ token }}');
|
||||
sfwdt.innerHTML = '\
|
||||
<div class="sf-toolbarreset">\
|
||||
<div class="sf-toolbar-icon"><svg width="26" height="28" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 26 28"><path fill="#FFF" d="M13 0a13 13 0 1 0 0 26 13 13 0 1 0 0-26zm7 7.5c-.6 0-1-.3-1-.9 0-.2 0-.4.2-.6l.2-.4c0-.3-.5-.4-.7-.4-2 .1-2.5 2.7-2.9 4.8l-.2 1.1c1.1.2 1.9 0 2.4-.3.6-.4-.2-.8-.1-1.3.1-.3.5-.5.8-.6.5 0 .8.5.8 1 0 .8-1.1 2-3.3 1.9l-.7-.1-.5 2.4c-.4 1.7-.9 4.1-2.6 6.2-1.5 1.8-3.1 2.1-3.8 2.1-1.3 0-2.1-.6-2.2-1.6 0-.9.8-1.4 1.3-1.4.7 0 1.2.5 1.2 1.1 0 .5-.2.6-.4.7-.1.1-.3.2-.3.4 0 .1.1.3.4.3.5 0 .9-.3 1.2-.5 1.3-1 1.7-2.9 2.4-6.2l.1-.8.8-3.5c-.9-.7-1.4-1.5-2.6-1.8-.8-.2-1.3 0-1.7.4-.4.5-.2 1.2.2 1.6l.7.7c.8.9 1.3 1.7 1.1 2.7-.3 1.6-2.1 2.8-4.3 2.1-1.9-.6-2.2-1.9-2-2.7.2-.6.7-.8 1.2-.6.5.2.7.8.6 1.3l-.1.3c-.2.1-.3.3-.3.4-.1.4.4.7.8.8.8.3 1.7-.2 1.9-.9.2-.6-.2-1.1-.4-1.2l-.8-.9c-.4-.4-1.2-1.5-.8-2.8.2-.5.5-1 .9-1.4 1-.7 2-.8 3-.6 1.3.4 1.9 1.2 2.8 1.9.5-1.3 1.1-2.6 2-3.8a5 5 0 0 1 3.3-1.8c1.4.2 2.4.8 2.4 1.7 0 .4-.2 1.2-1 1.2z"/></svg></div>\
|
||||
An error occurred while loading the web debug toolbar. <a href="{{ path("_profiler", { "token": token }) }}">Open the web profiler.</a>\
|
||||
</div>\
|
||||
';
|
||||
sfwdt.setAttribute('class', 'sf-toolbar sf-error-toolbar');
|
||||
}
|
||||
},
|
||||
{ maxTries: 5 }
|
||||
);
|
||||
Sfjs.loadToolbar('{{ token }}');
|
||||
})();
|
||||
/*]]>*/</script>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{% extends '@Twig/layout.html.twig' %}
|
||||
{% extends '@WebProfiler/Profiler/base.html.twig' %}
|
||||
|
||||
{% block title 'Redirection Intercepted' %}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user