Skip to content

Commit

Permalink
Opening sql queries in new tab is very useful
Browse files Browse the repository at this point in the history
  • Loading branch information
lokeshatbigbasket authored and avelis committed Jan 8, 2018
1 parent 3d41c48 commit 6b0b22e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions silk/templates/silk/sql.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,13 @@
{% block js %}
<script type="text/javascript" src="{% static 'silk/lib/sortable.js' %}"></script>
{{ block.super }}
function openInNewTab(url) {
var win = window.open(url, '_blank');
win.focus();
}
{% endblock %}


{% block style %}
<style>
.right-aligned {
Expand Down Expand Up @@ -111,15 +116,15 @@
</tr>
{% for sql_query in items %}
<!-- TODO: Pretty grimy... -->
<tr class="data-row" onclick="window.location=' \
<tr class="data-row" onclick="openInNewTab(' \
{% if profile and silk_request %}\
{% url "silk:request_and_profile_sql_detail" silk_request.id profile.id sql_query.id %}\
{% elif profile %}\
{% url "silk:profile_sql_detail" profile.id sql_query.id %}\
{% elif silk_request %}\
{% url "silk:request_sql_detail" silk_request.id sql_query.id %}\
{% endif %}\
';">
');">
<td class="left-aligned">+{{ sql_query.start_time_relative }}</td>
<td class="left-aligned">{{ sql_query.tables_involved|join:", " }}</td>
<td class="right-aligned">{{ sql_query.num_joins }}</td>
Expand Down

0 comments on commit 6b0b22e

Please sign in to comment.