|
41 | 41 | height: 20px; |
42 | 42 | } |
43 | 43 |
|
44 | | - tr.data-row:hover { |
| 44 | + tr.data-row:hover, tr.data-row.highlight { |
45 | 45 | background-color: rgb(51, 51, 68); |
46 | 46 | color: white; |
47 | 47 | cursor: pointer; |
|
109 | 109 | <th class="left-aligned">Tables</th> |
110 | 110 | <th class="right-aligned">Num. Joins</th> |
111 | 111 | <th class="right-aligned">Execution Time (ms)</th> |
| 112 | + <th class="right-aligned">Num. Duplicates</th> |
112 | 113 | </tr> |
113 | 114 | {% for sql_query in items %} |
114 | 115 | <!-- TODO: Pretty grimy... --> |
115 | | - <tr class="data-row" onclick="window.location=' \ |
| 116 | + <tr |
| 117 | + class="data-row" |
| 118 | + data-duplicate-id="{{ sql_query.duplicate_id }}" |
| 119 | + onclick="window.location=' \ |
116 | 120 | {% if profile and silk_request %}\ |
117 | 121 | {% url "silk:request_and_profile_sql_detail" silk_request.id profile.id sql_query.id %}\ |
118 | 122 | {% elif profile %}\ |
|
126 | 130 | <td class="left-aligned">{{ sql_query.tables_involved|join:", " }}</td> |
127 | 131 | <td class="right-aligned">{{ sql_query.num_joins }}</td> |
128 | 132 | <td class="right-aligned">{{ sql_query.time_taken | floatformat:6 }}</td> |
| 133 | + <td class="right-aligned">{{ sql_query.num_duplicates }}</td> |
129 | 134 | </tr> |
130 | 135 | {% endfor %} |
131 | 136 |
|
|
153 | 158 | </div> |
154 | 159 | </div> |
155 | 160 |
|
156 | | - |
157 | | - |
| 161 | +<script> |
| 162 | + const rows = document.querySelectorAll('tr.data-row').forEach(function (row) { |
| 163 | + row.addEventListener('mouseenter', function () { |
| 164 | + document.querySelectorAll('tr[data-duplicate-id="' + row.dataset.duplicateId + '"]').forEach(function (e) { |
| 165 | + e.classList.add('highlight'); |
| 166 | + }); |
| 167 | + }); |
| 168 | + row.addEventListener('mouseleave', function () { |
| 169 | + document.querySelectorAll('tr[data-duplicate-id="' + row.dataset.duplicateId + '"]').forEach(function (e) { |
| 170 | + e.classList.remove('highlight'); |
| 171 | + }); |
| 172 | + }); |
| 173 | + }); |
| 174 | +</script> |
158 | 175 |
|
159 | 176 |
|
160 | 177 | {% endblock %} |
0 commit comments