mirror of
https://github.com/Kpa-clawbot/meshcore-analyzer.git
synced 2026-03-30 21:45:40 +00:00
Fix region filter resetting analytics tab to overview
Track current active tab in _currentTab variable so that loadAnalytics() re-renders the current tab instead of always resetting to 'overview' when region filter changes.
This commit is contained in:
@@ -90,7 +90,8 @@
|
||||
if (!btn) return;
|
||||
document.querySelectorAll('.tab-btn').forEach(b => b.classList.remove('active'));
|
||||
btn.classList.add('active');
|
||||
renderTab(btn.dataset.tab);
|
||||
_currentTab = btn.dataset.tab;
|
||||
renderTab(_currentTab);
|
||||
});
|
||||
|
||||
RegionFilter.init(document.getElementById('analyticsRegionFilter'));
|
||||
@@ -113,6 +114,8 @@
|
||||
loadAnalytics();
|
||||
}
|
||||
|
||||
let _currentTab = 'overview';
|
||||
|
||||
async function loadAnalytics() {
|
||||
try {
|
||||
_analyticsData = {};
|
||||
@@ -125,7 +128,7 @@
|
||||
api('/analytics/channels' + sep, { ttl: CLIENT_TTL.analyticsRF }),
|
||||
]);
|
||||
_analyticsData = { hashData, rfData, topoData, chanData };
|
||||
renderTab('overview');
|
||||
renderTab(_currentTab);
|
||||
} catch (e) {
|
||||
document.getElementById('analyticsContent').innerHTML =
|
||||
`<div class="text-muted" role="alert" aria-live="polite" style="padding:40px">Failed to load: ${e.message}</div>`;
|
||||
|
||||
@@ -88,7 +88,7 @@
|
||||
<script src="channels.js?v=1774075538" onerror="console.error('Failed to load:', this.src)"></script>
|
||||
<script src="nodes.js?v=1774290000" onerror="console.error('Failed to load:', this.src)"></script>
|
||||
<script src="traces.js?v=1774290000" onerror="console.error('Failed to load:', this.src)"></script>
|
||||
<script src="analytics.js?v=1774290000" onerror="console.error('Failed to load:', this.src)"></script>
|
||||
<script src="analytics.js?v=1774335600" onerror="console.error('Failed to load:', this.src)"></script>
|
||||
<script src="live.js?v=1774072222" onerror="console.error('Failed to load:', this.src)"></script>
|
||||
<script src="observers.js?v=1774290000" onerror="console.error('Failed to load:', this.src)"></script>
|
||||
<script src="observer-detail.js?v=1774028201" onerror="console.error('Failed to load:', this.src)"></script>
|
||||
|
||||
Reference in New Issue
Block a user