修复数据统计错误的问题

This commit is contained in:
CN-JS-HuiBai
2026-04-10 14:56:06 +08:00
parent e65de2c30b
commit 5afcd3d86a
2 changed files with 42 additions and 2 deletions

View File

@@ -2070,6 +2070,18 @@
const savedTheme = localStorage.getItem('theme');
const themeToApply = savedTheme || settings.default_theme || 'dark';
applyTheme(themeToApply);
// Apply settings to UI (logo, name, etc.)
applySiteSettings(window.SITE_SETTINGS);
// Refresh overview and historical charts to reflect new source selections
fetchNetworkHistory(true);
// We can't force the WS broadcast easily from client,
// but we can fetch the overview via REST API once to update UI
fetch('/api/metrics/overview?force=true')
.then(res => res.json())
.then(data => updateDashboard(data))
.catch(() => {});
} else {
const err = await response.json();
showSiteMessage(`保存失败: ${err.error || '未知错误'}`, 'error');