diff options
| author | David Cramer | 2011-03-24 16:13:15 -0700 |
|---|---|---|
| committer | David Cramer | 2011-03-24 16:13:15 -0700 |
| commit | d29f055713636c5629ddb7f48805536d39e550cb (patch) | |
| tree | bb028f85aa3daf3428c9d9d0700e541211f40a5e /debug_toolbar/templates | |
| parent | a7253cb3600e680f3cee7079926df1eccfced5dd (diff) | |
| download | django-debug-toolbar-d29f055713636c5629ddb7f48805536d39e550cb.tar.bz2 | |
Add multi db support and summaries to SQL panel
Diffstat (limited to 'debug_toolbar/templates')
| -rw-r--r-- | debug_toolbar/templates/debug_toolbar/panels/sql.html | 56 |
1 files changed, 34 insertions, 22 deletions
diff --git a/debug_toolbar/templates/debug_toolbar/panels/sql.html b/debug_toolbar/templates/debug_toolbar/panels/sql.html index 8309c06..4d3392f 100644 --- a/debug_toolbar/templates/debug_toolbar/panels/sql.html +++ b/debug_toolbar/templates/debug_toolbar/panels/sql.html @@ -1,35 +1,36 @@ {% load i18n %} +<div class="clearfix"> + <ul class="stats"> + {% for alias, info in databases %} + <li> + <strong>{{ alias }}</strong> + <span>{{ info.time_spent|floatformat:"2" }} ms ({% blocktrans count info.queries as num %}{{ num }} query{% plural %}{{ num }} queries{% endblocktrans %})</span> + </li> + {% endfor %} + </ul> +</div> + <table> <thead> <tr> - <th>{% trans "Action" %}</th> - <th>{% trans 'Query' %}</th> - <th style="width:30%">{% trans 'Timeline' %}</th> - <th>{% trans 'Time (ms)' %}</th> + <th class="query" colspan="2">{% trans 'Query' %}</th> + <th class="timeline">{% trans 'Timeline' %}</th> + <th class="time">{% trans 'Time (ms)' %}</th> + <th class="actions">{% trans "Action" %}</th> </tr> </thead> <tbody> {% for query in queries %} <tr class="djDebugHoverable {% cycle 'djDebugOdd' 'djDebugEven' %}{% if query.is_slow %} djDebugRowWarning{% endif %}"> - <td> - {% if query.params %} - {% if query.is_select %} - <a class="remoteCall" href="/__debug__/sql_select/?sql={{ query.raw_sql|urlencode }}&params={{ query.params|urlencode }}&duration={{ query.duration|floatformat:"2"|urlencode }}&hash={{ query.hash }}">S</a> - <a class="remoteCall" href="/__debug__/sql_explain/?sql={{ query.raw_sql|urlencode }}&params={{ query.params|urlencode }}&duration={{ query.duration|floatformat:"2"|urlencode }}&hash={{ query.hash }}">E</a> - {% if is_mysql %} - <a class="remoteCall" href="/__debug__/sql_profile/?sql={{ query.raw_sql|urlencode }}&params={{ query.params|urlencode }}&duration={{ query.duration|floatformat:"2"|urlencode }}&hash={{ query.hash }}">P</a> - {% endif %} - {% endif %} - {% endif %} - {% if query.stacktrace %} - <a class="djSQLShowStacktrace" href="#">T</a> - {% endif %} + <td class="toggle"> + <a class="djSQLToggleDetails" href="javascript:void(0)">+</a> </td> - <td class="syntax"> + <td class="query"> <div class="djDebugSqlWrap"> <div class="djDebugSql">{{ query.sql|safe }}</div> {% if query.stacktrace %} - <div class="djSQLHideStacktraceDiv" style="display:none;"> + <div class="djSQLDetailsDiv" style="display:none;"> + <p><strong>Connection:</strong> {{ query.alias }}</p> <pre>{{ query.stacktrace }}</pre> {% if query.template_info %} <table> @@ -47,10 +48,21 @@ </div> </td> <td class="timeline"> - <div class="djDebugTimeline"><div class="djDebugLineChart{% if query.is_slow %} djDebugLineChartWarning{% endif %}" style="left:{{ query.start_offset }}%;"><strong style="width:{{ query.width_ratio }}%;">{{ query.width_ratio }}%</strong></div></div> + <div class="djDebugTimeline"><div class="djDebugLineChart{% if query.is_slow %} djDebugLineChartWarning{% endif %}" style="left:{{ query.start_offset }}%;"><strong style="width:{{ query.width_ratio }}%;">{{ query.width_ratio }}%</strong></div></div> </td> - <td class="duration"> - {{ query.duration|floatformat:"2" }} + <td class="time"> + {{ query.duration|floatformat:"2" }} + </td> + <td class="actions"> + {% if query.params %} + {% if query.is_select %} + <a class="remoteCall" href="/__debug__/sql_select/?sql={{ query.raw_sql|urlencode }}&params={{ query.params|urlencode }}&duration={{ query.duration|floatformat:"2"|urlencode }}&hash={{ query.hash }}">Sel</a> + <a class="remoteCall" href="/__debug__/sql_explain/?sql={{ query.raw_sql|urlencode }}&params={{ query.params|urlencode }}&duration={{ query.duration|floatformat:"2"|urlencode }}&hash={{ query.hash }}">Expl</a> + {% if is_mysql %} + <a class="remoteCall" href="/__debug__/sql_profile/?sql={{ query.raw_sql|urlencode }}&params={{ query.params|urlencode }}&duration={{ query.duration|floatformat:"2"|urlencode }}&hash={{ query.hash }}">Prof</a> + {% endif %} + {% endif %} + {% endif %} </td> </tr> {% endfor %} |
