summaryrefslogtreecommitdiffstats
path: root/modules-available/passthrough
diff options
context:
space:
mode:
authorSimon Rettberg2021-11-24 15:30:23 +0100
committerSimon Rettberg2022-03-09 15:06:54 +0100
commit88a49692688114d8fc16896f501d0cc9caa32a1c (patch)
tree59bc58d133ca3b31e71712912ec723781c12a025 /modules-available/passthrough
parent[statistics] Adapt hw-data parsing to new json format for display (diff)
downloadslx-admin-88a49692688114d8fc16896f501d0cc9caa32a1c.tar.gz
slx-admin-88a49692688114d8fc16896f501d0cc9caa32a1c.tar.xz
slx-admin-88a49692688114d8fc16896f501d0cc9caa32a1c.zip
[passthrough] Show+Highlight device from URL hash (link in statistics)
Diffstat (limited to 'modules-available/passthrough')
-rw-r--r--modules-available/passthrough/templates/hardware-list.html14
1 files changed, 13 insertions, 1 deletions
diff --git a/modules-available/passthrough/templates/hardware-list.html b/modules-available/passthrough/templates/hardware-list.html
index 4bff0a39..4468645c 100644
--- a/modules-available/passthrough/templates/hardware-list.html
+++ b/modules-available/passthrough/templates/hardware-list.html
@@ -11,7 +11,7 @@
</thead>
<tbody>
{{#list}}
- <tr>
+ <tr class="c-{{vendor}}-{{device}} tr">
{{#class_name}}
<td colspan="4">
<span>{{class}}</span> – <strong>{{class_name}}</strong>
@@ -101,5 +101,17 @@
$(this).append($('<option>').attr('value', gid).text(gid + ' (' + title + ')'));
});
});
+ hashChanged();
+ });
+ window.addEventListener('hashchange', function() {
+ hashChanged();
});
+ function hashChanged() {
+ var c = window.location.hash;
+ $('tr.tr').removeClass('bg-success');
+ if (c && c.length > 1) {
+ var d = $('.c-' + c.substr(1)).addClass('bg-success');
+ if (d.length > 0) d[0].scrollIntoView();
+ }
+ }
</script> \ No newline at end of file