修复bug

This commit is contained in:
dekun
2026-05-23 16:39:35 +08:00
parent c66c9f01c5
commit 952d57ab6d
7 changed files with 77 additions and 13 deletions
+14 -3
View File
@@ -270,8 +270,11 @@
else parts.push("中控未设 HUB_BRIDGE_TOKEN(实例需 APP_AUTH_DISABLED 或同令牌)");
if (m.public_origin) parts.push("浏览器外链基址: " + m.public_origin);
else parts.push("未设 HUB_PUBLIC_ORIGIN(复盘链接仅本机可开)");
if ((m.env_disabled_ids || []).length)
parts.push("环境强制关闭 id: " + m.env_disabled_ids.join(", "));
if ((m.env_disabled_ids || []).length) {
parts.push("环境强制关闭 id: " + m.env_disabled_ids.join(", ") + "(改 .env 后须重启 hub");
} else {
parts.push("HUB_DISABLED_IDS 未强制关闭任何账户");
}
el.textContent = parts.join(" · ");
} catch (_) {}
}
@@ -361,7 +364,13 @@
const j = await r.json();
if (j.ok) {
showToast("设置已保存(已写入 hub_settings.json");
await loadSettingsUI();
if (j.settings) {
settingsCache = j.settings;
renderSettingsList(j.settings);
loadSettingsMetaLine();
} else {
await loadSettingsUI();
}
} else showToast("保存失败", true);
} catch (e) {
showToast(String(e), true);
@@ -395,10 +404,12 @@
});
settingsCache = data;
renderSettingsList(data);
showToast("已添加一行,请填写 URL 后点「保存设置」");
};
initAuth().then((ok) => {
if (!ok) return;
loadSettings().catch(() => {});
setActiveNav();
window.addEventListener("popstate", setActiveNav);
});
+2 -2
View File
@@ -7,7 +7,7 @@
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&family=Orbitron:wght@500;600;700&display=swap" rel="stylesheet" />
<link rel="stylesheet" href="/assets/app.css" />
<link rel="stylesheet" href="/assets/app.css?v=20260522-settings-fix" />
</head>
<body>
<div class="app-bg" aria-hidden="true"></div>
@@ -80,6 +80,6 @@
</div>
<div id="toast"></div>
<script src="/assets/app.js"></script>
<script src="/assets/app.js?v=20260522-settings-fix"></script>
</body>
</html>