Add FPS sparkline charts, configurable poll interval, and uptime interpolation
Replace text FPS labels with Chart.js sparklines on running targets, use emoji icons for metrics, add in-place DOM updates to preserve chart animations, and add a 1-10s poll interval slider that controls all dashboard timers. Uptime now ticks every second via client-side interpolation regardless of poll interval. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
* Tab switching — switchTab, initTabs, startAutoRefresh.
|
||||
*/
|
||||
|
||||
import { apiKey, refreshInterval, setRefreshInterval } from '../core/state.js';
|
||||
import { apiKey, refreshInterval, setRefreshInterval, dashboardPollInterval } from '../core/state.js';
|
||||
|
||||
export function switchTab(name) {
|
||||
document.querySelectorAll('.tab-btn').forEach(btn => btn.classList.toggle('active', btn.dataset.tab === name));
|
||||
@@ -15,6 +15,7 @@ export function switchTab(name) {
|
||||
} else {
|
||||
if (typeof window.stopDashboardWS === 'function') window.stopDashboardWS();
|
||||
if (typeof window.stopPerfPolling === 'function') window.stopPerfPolling();
|
||||
if (typeof window.stopUptimeTimer === 'function') window.stopUptimeTimer();
|
||||
if (name === 'streams') {
|
||||
if (typeof window.loadPictureSources === 'function') window.loadPictureSources();
|
||||
} else if (name === 'targets') {
|
||||
@@ -50,5 +51,5 @@ export function startAutoRefresh() {
|
||||
if (typeof window.loadDashboard === 'function') window.loadDashboard();
|
||||
}
|
||||
}
|
||||
}, 2000));
|
||||
}, dashboardPollInterval));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user