8000 [WebProfilerBundle] Improve performance by javiereguiluz · Pull Request #54421 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[WebProfilerBundle] Improve performance #54421

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<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 %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,32 +11,13 @@

class SymfonyProfiler {
constructor() {
this.#reorderMainMenuItems();
this.#createTabs();
this.#createTableSearchFields();
this.#createToggles();
this.#createCopyToClipboard();
this.#convertDateTimesToUserTimezone();
}

#reorderMainMenuItems() {
/* reorder the main menu items to always display first the non-disabled items */
const mainMenuElement = document.querySelector('#menu-profiler');
const firstDisabledMenuItem = mainMenuElement.querySelector('li a > span.disabled')?.parentNode?.parentNode;

if (!firstDisabledMenuItem) {
return;
}

const mainMenuItems = mainMenuElement.querySelectorAll('li');
mainMenuItems.forEach(menuItem => {
const isDisabled = null !== menuItem.querySelector('a > span.disabled');
if (!isDisabled) {
mainMenuElement.insertBefore(menuItem, firstDisabledMenuItem);
}
});
}

#createTabs() {
/* the accessibility options of this component have been defined according to: */
/* www.w3.org/WAI/ARIA/apg/example-index/tabs/tabs-manual.html */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1499,11 +1499,16 @@ tr.status-warning td {
list-style-type: none;
margin: 0;
padding: 7px;
display: flex;
flex-direction: column;
}
#menu-profiler li {
margin-bottom: 0;
position: relative;
}
#menu-profiler li:has(span.disabled) {
order: 1;
}
#menu-profiler li + li {
margin-top: 4px;
}
Expand Down
0