mirror of
https://github.com/pallets-eco/flask-debugtoolbar.git
synced 2026-05-04 15:29:12 -05:00
69 lines
2.5 KiB
HTML
69 lines
2.5 KiB
HTML
<table>
|
|
<thead>
|
|
<tr>
|
|
<th> (ms)</th>
|
|
<th>Action</th>
|
|
<th>Context</th>
|
|
<th>Query</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for query in queries %}
|
|
<tr class="{{ loop.cycle('flDebugOdd', 'flDebugEven') }}">
|
|
<td>{{ '%.4f'|format(query.duration) }}</td>
|
|
<td>
|
|
{% if query.params %}
|
|
{% if query.is_select %}
|
|
<a class="remoteCall" href="/_debug_toolbar/views/sqlalchemy/sql_select?sql={{ query.raw_sql|urlencode }}&params={{ query.params|urlencode }}&duration={{ query.duration|urlencode }}&hash={{ query.hash }}">SELECT</a><br />
|
|
<a class="remoteCall" href="/_debug_toolbar/views/sqlalchemy/sql_explain?sql={{ query.raw_sql|urlencode }}&params={{ query.params|urlencode }}&duration={{ query.duration|urlencode }}&hash={{ query.hash }}">EXPLAIN</a><br />
|
|
{% if is_mysql %}
|
|
<a class="remoteCall" href="/__debug__/sql_profile/?sql={{ query.raw_sql|urlencode }}&params={{ query.params|urlencode }}&duration={{ query.duration|urlencode }}&hash={{ query.hash }}">PROFILE</a><br />
|
|
{% endif %}
|
|
{% endif %}
|
|
{% endif %}
|
|
</td>
|
|
<td title="{{ query.context_long }}">
|
|
{{ query.context }}
|
|
</td>
|
|
<td class="syntax">
|
|
<div class="flDebugSqlWrap">
|
|
<div class="flDebugSql">{{ query.sql|safe }}</div>
|
|
{#
|
|
{% if query.stacktrace %}
|
|
<div class="djSQLHideStacktraceDiv" style="display:none;">
|
|
<table>
|
|
<tr>
|
|
<th>{% trans "Line" %}</th>
|
|
<th>{% trans "Method" %}</th>
|
|
<th>{% trans "File" %}</th>
|
|
</tr>
|
|
{% for file, line, method in query.stacktrace %}
|
|
<tr>
|
|
<td>{{ line }}</td>
|
|
<td><code>{{ method|escape }}</code></td>
|
|
<td><code>{{ file|escape }}</code></td>
|
|
</tr>
|
|
{% endfor %}
|
|
</table>
|
|
{% if query.template_info %}
|
|
<table>
|
|
{% for line in query.template_info.context %}
|
|
<tr>
|
|
<td>{{ line.num }}</td>
|
|
<td><code style="font-family: monospace;{% if line.highlight %}background-color: lightgrey{% endif %}">{{ line.content }}</code></td>
|
|
</tr>
|
|
{% endfor %}
|
|
</table>
|
|
<p><strong>{{ query.template_info.name|default:"(unknown)" }}</strong></p>
|
|
{% endif %}
|
|
</div>
|
|
{% endif %}
|
|
<span class="djDebugLineChart{% if query.is_slow %} djDebugLineChartWarning{% endif %}" style="width:{{ query.width_ratio }}%; left:{{ query.start_offset }}%;"></span>
|
|
#}
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|