mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-26 03:58:45 +02:00
N°6934 - Symfony 6.4 - upgrade Symfony bundles to 6.4 (#580)
* Update Symfony lib to version ~6.4.0 * Update code missing return type * Add an iTop general configuration entry to store application secret (Symfony mandatory parameter) * Use dependency injection in ExceptionListener & UserProvider classes
This commit is contained in:
@@ -1,6 +1,42 @@
|
||||
{% extends '@WebProfiler/Profiler/layout.html.twig' %}
|
||||
|
||||
{% import _self as helper %}
|
||||
{% block head %}
|
||||
{{ parent() }}
|
||||
|
||||
<style>
|
||||
#timeline-control {
|
||||
background: var(--table-background);
|
||||
box-shadow: var(--shadow);
|
||||
margin: 1em 0;
|
||||
padding: 10px;
|
||||
}
|
||||
#timeline-control label {
|
||||
font-weight: bold;
|
||||
margin-right: 1em;
|
||||
}
|
||||
#timeline-control input {
|
||||
background: var(--metric-value-background);
|
||||
font-size: 16px;
|
||||
padding: 4px;
|
||||
text-align: right;
|
||||
width: 5em;
|
||||
}
|
||||
#timeline-control .help {
|
||||
margin-left: 1em;
|
||||
}
|
||||
|
||||
.sf-profiler-timeline .legends {
|
||||
font-size: 12px;
|
||||
line-height: 1.5em;
|
||||
}
|
||||
.sf-profiler-timeline .legends button {
|
||||
color: var(--color-text);
|
||||
}
|
||||
.sf-profiler-timeline + p.help {
|
||||
margin-top: 0;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
{% block toolbar %}
|
||||
{% set has_time_events = collector.events|length > 0 %}
|
||||
@@ -9,7 +45,7 @@
|
||||
{% set status_color = has_time_events and collector.duration > 1000 ? 'yellow' %}
|
||||
|
||||
{% set icon %}
|
||||
{{ include('@WebProfiler/Icon/time.svg') }}
|
||||
{{ source('@WebProfiler/Icon/time.svg') }}
|
||||
<span class="sf-toolbar-value">{{ total_time }}</span>
|
||||
<span class="sf-toolbar-label">ms</span>
|
||||
{% endset %}
|
||||
@@ -30,7 +66,7 @@
|
||||
|
||||
{% block menu %}
|
||||
<span class="label">
|
||||
<span class="icon">{{ include('@WebProfiler/Icon/time.svg') }}</span>
|
||||
<span class="icon">{{ source('@WebProfiler/Icon/time.svg') }}</span>
|
||||
<strong>Performance</strong>
|
||||
</span>
|
||||
{% endblock %}
|
||||
@@ -40,17 +76,21 @@
|
||||
<h2>Performance metrics</h2>
|
||||
|
||||
<div class="metrics">
|
||||
<div class="metric">
|
||||
<span class="value">{{ '%.0f'|format(collector.duration) }} <span class="unit">ms</span></span>
|
||||
<span class="label">Total execution time</span>
|
||||
</div>
|
||||
<div class="metric-group">
|
||||
<div class="metric">
|
||||
<span class="value">{{ '%.0f'|format(collector.duration) }} <span class="unit">ms</span></span>
|
||||
<span class="label">Total execution time</span>
|
||||
</div>
|
||||
|
||||
<div class="metric">
|
||||
<span class="value">{{ '%.0f'|format(collector.inittime) }} <span class="unit">ms</span></span>
|
||||
<span class="label">Symfony initialization</span>
|
||||
<div class="metric">
|
||||
<span class="value">{{ '%.0f'|format(collector.inittime) }} <span class="unit">ms</span></span>
|
||||
<span class="label">Symfony initialization</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if profile.collectors.memory %}
|
||||
<div class="metric-divider"></div>
|
||||
|
||||
<div class="metric">
|
||||
<span class="value">{{ '%.2f'|format(profile.collectors.memory.memory / 1024 / 1024) }} <span class="unit">MiB</span></span>
|
||||
<span class="label">Peak memory usage</span>
|
||||
@@ -60,23 +100,20 @@
|
||||
{% if profile.children|length > 0 %}
|
||||
<div class="metric-divider"></div>
|
||||
|
||||
<div class="metric">
|
||||
<span class="value">{{ profile.children|length }}</span>
|
||||
<span class="label">Sub-Request{{ profile.children|length > 1 ? 's' }}</span>
|
||||
</div>
|
||||
<div class="metric-group">
|
||||
<div class="metric">
|
||||
<span class="value">{{ profile.children|length }}</span>
|
||||
<span class="label">Sub-{{ profile_type|title }}{{ profile.children|length > 1 ? 's' }}</span>
|
||||
</div>
|
||||
|
||||
{% if has_time_events %}
|
||||
{% set subrequests_time = 0 %}
|
||||
{% for child in profile.children %}
|
||||
{% set subrequests_time = subrequests_time + child.getcollector('time').events.__section__.duration %}
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
{% set subrequests_time = 'n/a' %}
|
||||
{% endif %}
|
||||
{% set subrequests_time = has_time_events
|
||||
? profile.children|reduce((total, child) => total + child.getcollector('time').events.__section__.duration, 0)
|
||||
: 'n/a' %}
|
||||
|
||||
<div class="metric">
|
||||
<span class="value">{{ subrequests_time }} <span class="unit">ms</span></span>
|
||||
<span class="label">Sub-Request{{ profile.children|length > 1 ? 's' }} time</span>
|
||||
<div class="metric">
|
||||
<span class="value">{{ subrequests_time }} <span class="unit">ms</span></span>
|
||||
<span class="label">Sub-{{ profile_type|title }}{{ profile.children|length > 1 ? 's' }} time</span>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
@@ -84,7 +121,7 @@
|
||||
<h2>Execution timeline</h2>
|
||||
|
||||
{% if not collector.isStopwatchInstalled() %}
|
||||
<div class="empty">
|
||||
<div class="empty empty-panel">
|
||||
<p>The Stopwatch component is not installed. If you want to see timing events, run: <code>composer require symfony/stopwatch</code>.</p>
|
||||
</div>
|
||||
{% elseif collector.events is empty %}
|
||||
@@ -106,24 +143,24 @@
|
||||
|
||||
{% if profile.parent %}
|
||||
<h3 class="dump-inline">
|
||||
Sub-Request {{ profiler_dump(profile.getcollector('request').requestattributes.get('_controller')) }}
|
||||
Sub-{{ profile_type|title }} {{ profiler_dump(profile.getcollector('request').requestattributes.get('_controller')) }}
|
||||
<small>
|
||||
{{ collector.events.__section__.duration }} ms
|
||||
<a class="newline" href="{{ path('_profiler', { token: profile.parent.token, panel: 'time' }) }}">Return to parent request</a>
|
||||
<a class="newline" href="{{ path('_profiler', { token: profile.parent.token, panel: 'time' }) }}">Return to parent {{ profile_type }}</a>
|
||||
</small>
|
||||
</h3>
|
||||
{% elseif profile.children|length > 0 %}
|
||||
<h3>
|
||||
Main Request <small>{{ collector.events.__section__.duration }} ms</small>
|
||||
Main {{ profile_type|title }} <small>{{ collector.events.__section__.duration }} ms</small>
|
||||
</h3>
|
||||
{% endif %}
|
||||
|
||||
{{ helper.display_timeline(token, collector.events, collector.events.__section__.origin) }}
|
||||
{{ _self.display_timeline(token, collector.events, collector.events.__section__.origin) }}
|
||||
|
||||
{% if profile.children|length %}
|
||||
<p class="help">Note: sections with a striped background correspond to sub-requests.</p>
|
||||
<p class="help">Note: sections with a striped background correspond to sub-{{ profile_type }}s.</p>
|
||||
|
||||
<h3>Sub-requests <small>({{ profile.children|length }})</small></h3>
|
||||
<h3>Sub-{{ profile_type }}s <small>({{ profile.children|length }})</small></h3>
|
||||
|
||||
{% for child in profile.children %}
|
||||
{% set events = child.getcollector('time').events %}
|
||||
@@ -132,7 +169,7 @@
|
||||
<small>{{ events.__section__.duration }} ms</small>
|
||||
</h4>
|
||||
|
||||
{{ helper.display_timeline(child.token, events, collector.events.__section__.origin) }}
|
||||
{{ _self.display_timeline(child.token, events, collector.events.__section__.origin) }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
@@ -143,22 +180,21 @@
|
||||
</pattern>
|
||||
</defs>
|
||||
</svg>
|
||||
<style type="text/css">
|
||||
{% include '@WebProfiler/Collector/time.css.twig' %}
|
||||
<style>
|
||||
{{ include('@WebProfiler/Collector/time.css.twig') }}
|
||||
</style>
|
||||
<script>
|
||||
{% include '@WebProfiler/Collector/time.js' %}
|
||||
{{ source('@WebProfiler/Collector/time.js') }}
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
{% macro dump_request_data(token, events, origin) %}
|
||||
{% autoescape 'js' %}
|
||||
{% from _self import dump_events %}
|
||||
{
|
||||
id: "{{ token }}",
|
||||
left: {{ "%F"|format(events.__section__.origin - origin) }},
|
||||
end: "{{ '%F'|format(events.__section__.endtime) }}",
|
||||
events: [ {{ dump_events(events) }} ],
|
||||
events: [ {{ _self.dump_events(events) }} ],
|
||||
}
|
||||
{% endautoescape %}
|
||||
{% endmacro %}
|
||||
@@ -193,7 +229,6 @@
|
||||
{% endmacro %}
|
||||
|
||||
{% macro display_timeline(token, events, origin) %}
|
||||
{% import _self as helper %}
|
||||
<div class="sf-profiler-timeline">
|
||||
<div id="legend-{{ token }}" class="legends"></div>
|
||||
<svg id="timeline-{{ token }}" class="timeline-graph"></svg>
|
||||
@@ -206,7 +241,7 @@
|
||||
new SvgRenderer(document.getElementById('timeline-{{ token }}')),
|
||||
new Legend(document.getElementById('legend-{{ token }}'), theme),
|
||||
document.getElementById('threshold'),
|
||||
{{ helper.dump_request_data(token, events, origin) }}
|
||||
{{ _self.dump_request_data(token, events, origin) }}
|
||||
);
|
||||
});
|
||||
{% endautoescape %}</script>
|
||||
|
||||
Reference in New Issue
Block a user