mirror of
https://github.com/Kpa-clawbot/meshcore-analyzer.git
synced 2026-10-23 16:52:42 +00:00
feat: deep-linkable analytics tabs — #/analytics?tab=collisions
Parses ?tab= from hash URL and activates that tab on load. e.g. #/analytics?tab=collisions → Hash Issues tab
This commit is contained in:
1 parent
470ea92e93
commit
a1f510f7de
1 file changed
+12
@@ -104,6 +104,18 @@
|
||||
renderTab(_currentTab);
|
||||
});
|
||||
|
||||
// Deep-link: #/analytics?tab=collisions
|
||||
const hashParams = location.hash.split('?')[1] || '';
|
||||
const urlTab = new URLSearchParams(hashParams).get('tab');
|
||||
if (urlTab) {
|
||||
const tabBtn = analyticsTabs.querySelector(`[data-tab="${urlTab}"]`);
|
||||
if (tabBtn) {
|
||||
analyticsTabs.querySelectorAll('.tab-btn').forEach(b => b.classList.remove('active'));
|
||||
tabBtn.classList.add('active');
|
||||
_currentTab = urlTab;
|
||||
}
|
||||
}
|
||||
|
||||
RegionFilter.init(document.getElementById('analyticsRegionFilter'));
|
||||
RegionFilter.onChange(function () { loadAnalytics(); });
|
||||
|
||||
|
||||
Reference in new issue
Block a user