|
2 | 2 |
|
3 | 3 | {% import _self as helper %}
|
4 | 4 |
|
| 5 | +{% block head %} |
| 6 | + {{ parent() }} |
| 7 | + |
| 8 | + <style> |
| 9 | +
|
| 10 | + #collector-content .sf-toggle { cursor: pointer; position: relative; } |
| 11 | + #collector-content .sf-toggle-off .icon-close, .sf-toggle-on .icon-open { display: none; } |
| 12 | + #collector-content .sf-toggle-off .icon-open, .sf-toggle-on .icon-close { display: block; } |
| 13 | +
|
| 14 | + #collector-content .trace-details { background: var(--base-0); border: var(--border); box-shadow: 0px 0px 1px rgba(128, 128, 128, .2); margin: 0 0 1em; table-layout: fixed; } |
| 15 | +
|
| 16 | + #collector-content .trace-line .icon { opacity: .4; position: absolute; left: 10px; } |
| 17 | + #collector-content .trace-line .icon svg { fill: var(--base-5); height: 16px; width: 16px; } |
| 18 | + #collector-content .trace { background: var(--base-0); padding: 10px; margin: 0.5em 0; overflow: auto; font-size: 12px; } |
| 19 | + #collector-content .trace-method { color: var(--highlight-keyword); font-weight: bold; } |
| 20 | + #collector-content .trace li { margin-bottom: 0; padding: 0; } |
| 21 | + #collector-content .trace li.selected { background: var(--trace-selected-background); margin-top: 2px; } |
| 22 | + #collector-content .trace + .trace { margin-top: 30px; } |
| 23 | + #collector-content .trace-line { position: relative; margin: 0; padding-top: 8px; padding-bottom: 8px; } |
| 24 | + #collector-content .trace-line + .trace-line { border-top: var(--border); } |
| 25 | + #collector-content .trace-line:hover { background: var(--base-1); } |
| 26 | + #collector-content .trace-line a { color: var(--base-6); } |
| 27 | + #collector-content .trace-line .icon { opacity: .4; position: absolute; left: 10px; } |
| 28 | + #collector-content .trace-line .icon svg { fill: var(--base-5); height: 16px; width: 16px; } |
| 29 | + #collector-content .trace-line .icon.icon-copy { left: auto; top: auto; padding-left: 5px; display: none } |
| 30 | + #collector-content .trace-line-header { padding-left: 36px; padding-right: 10px; } |
| 31 | + </style> |
| 32 | +{% endblock %} |
| 33 | + |
5 | 34 | {% block toolbar %}
|
6 | 35 | {% if collector.requestCount > 0 %}
|
7 | 36 |
|
|
112 | 141 | <div class="text-small font-normal">
|
113 | 142 | <a href="#" class="sf-toggle link-inverse" data-toggle-selector="#formatted-request-{{ i }}-{{ loop.parent.loop.index }}" data-toggle-alt-content="Hide formatted request">View formatted request</a>
|
114 | 143 |
|
115 |
| - {# |
116 |
| - {% if request.runnable %} |
117 |
| - |
118 |
| - <a href="#" class="sf-toggle link-inverse" data-toggle-selector="#original-request-{{ i }}-{{ loop.parent.loop.index }}" data-toggle-alt-content="Hide runnable request">View runnable request</a> |
119 |
| - {% endif %} |
120 |
| -
|
121 |
| - {% if request.explainable %} |
122 |
| - |
123 |
| - <a class="link-inverse" href="{{ path('_profiler', { panel: 'db', token: token, page: 'explain', connection: connection, request: i }) }}" onclick="return explain(this);" data-target-id="explain-{{ i }}-{{ loop.parent.loop.index }}">Explain request</a> |
124 |
| - {% endif %} |
125 |
| - #} |
126 |
| - |
127 | 144 | {% if request.backtrace is defined %}
|
| 145 | + |
128 | 146 | <a href="#" class="sf-toggle link-inverse" data-toggle-selector="#backtrace-{{ i }}-{{ loop.parent.loop.index }}" data-toggle-alt-content="Hide request backtrace">View request backtrace</a>
|
129 | 147 | {% endif %}
|
130 | 148 | </div>
|
|
134 | 152 | <button class="btn btn-sm label hidden" data-clipboard-text="{{ request.command|json_encode|e('html_attr') }}">Copy</button>
|
135 | 153 | </div>
|
136 | 154 |
|
137 |
| - {# |
138 |
| - {% if request.runnable %} |
139 |
| - <div id="original-request-{{ i }}-{{ loop.parent.loop.index }}" class="sql-runnable hidden"> |
140 |
| - {% set runnable_sql = (request.sql ~ ';')|doctrine_replace_request_parameters(request.params) %} |
141 |
| - {{ runnable_sql|doctrine_prettify_sql }} |
142 |
| - <button class="btn btn-sm hidden" data-clipboard-text="{{ runnable_sql|e('html_attr') }}">Copy</button> |
143 |
| - </div> |
144 |
| - {% endif %} |
145 |
| -
|
146 |
| - {% if request.explainable %} |
147 |
| - <div id="explain-{{ i }}-{{ loop.parent.loop.index }}" class="sql-explain"></div> |
148 |
| - {% endif %} |
149 |
| - #} |
150 |
| - |
151 | 155 | {% if request.backtrace is defined %}
|
152 |
| - <div id="backtrace-{{ i }}-{{ loop.parent.loop.index }}" class="0hidden"> |
153 |
| - <table> |
154 |
| - <thead> |
155 |
| - <tr> |
156 |
| - <th scope="col">#</th> |
157 |
| - <th scope="col">File/Call</th> |
158 |
| - </tr> |
159 |
| - </thead> |
160 |
| - <tbody> |
161 |
| - {% for trace in request.backtrace %} |
162 |
| - <tr> |
163 |
| - <td>{{ loop.index }}</td> |
164 |
| - <td> |
165 |
| - <span class="text-small"> |
166 |
| - {% set line_number = trace.line|default(1) %} |
167 |
| - {% if trace.file is defined %} |
168 |
| - <a href="{{ trace.file|file_link(line_number) }}"> |
169 |
| - {% endif %} |
170 |
| - {{- trace.class|default ~ (trace.class is defined ? trace.type|default('::')) -}} |
171 |
| - <span class="status-warning">{{ trace.function }}</span> |
| 156 | + <div id="backtrace-{{ i }}-{{ loop.parent.loop.index }}" class="trace-details hidden"> |
| 157 | + {% set firstUserCode = true %} |
| 158 | + {% for trace in request.backtrace %} |
| 159 | + <div class="trace-line"> |
| 160 | + {% set display = false %} |
| 161 | + {% if firstUserCode and trace.file is not empty and '/vendor/' not in trace.file and '/var/cache/' not in trace.file %} |
| 162 | + {% set firstUserCode = false %} |
| 163 | + {% set display = true %} |
| 164 | + {% endif %} |
| 165 | + <div class="trace-line-header break-long-words sf-toggle" data-toggle-selector="#trace-html-{{ i }}-{{ loop.index }}" data-toggle-initial="{{ display ? 'display' : 'hidden' }}"> |
| 166 | + <span class="icon icon-close">{{ include('@WebProfiler/images/icon-minus-square.svg') }}</span> |
| 167 | + <span class="icon icon-open">{{ include('@WebProfiler/images/icon-plus-square.svg') }}</span> |
| 168 | + <span class="block trace-file-path"> |
| 169 | + {% set line_number = trace.line|default(1) %} |
172 | 170 | {% if trace.file is defined %}
|
173 |
| - </a> |
174 |
| - {% endif %} |
175 |
| - (line {{ line_number }}) |
176 |
| - </span> |
177 |
| - </td> |
178 |
| - </tr> |
179 |
| - {% endfor %} |
180 |
| - </tbody> |
181 |
| - </table> |
| 171 | + <a href="{{ trace.file|file_link(line_number) }}"> |
| 172 | + {% endif %} |
| 173 | + {{- trace.file|file_relative|default('n/a') -}} |
| 174 | + {% if trace.file is defined %} |
| 175 | + </a> |
| 176 | + {% endif %} |
| 177 | + -> <span class="trace-method">{{ trace.function }}</span> |
| 178 | + (line {{ line_number }}) |
| 179 | + </span> |
| 180 | + </div> |
| 181 | + <div id="trace-html-{{ i }}-{{ loop.index }}" class="trace sf-toggle-content"> |
| 182 | + {{ trace.file|file_excerpt(trace.line)|replace({ |
| 183 | + '#DD0000': 'var(--highlight-string)', |
| 184 | + '#007700': 'var(--highlight-keyword)', |
| 185 | + '#0000BB': 'var(--highlight-default)', |
| 186 | + '#FF8000': 'var(--highlight-comment)' |
| 187 | + })|raw }} |
| 188 | + </div> |
| 189 | + </div> |
| 190 | + {% endfor %} |
182 | 191 | </div>
|
183 | 192 | {% endif %}
|
184 | 193 | </td>
|
|
0 commit comments