Update public/app.js
Browse files- public/app.js +3 -0
public/app.js
CHANGED
|
@@ -164,6 +164,7 @@
|
|
| 164 |
|
| 165 |
// ---------- RENDER ----------
|
| 166 |
function render() {
|
|
|
|
| 167 |
document.querySelectorAll('.nav-item[data-view]').forEach((n) =>
|
| 168 |
n.classList.toggle('active', n.dataset.view === state.view)
|
| 169 |
);
|
|
@@ -494,6 +495,7 @@
|
|
| 494 |
|
| 495 |
// ---------- EDIT ----------
|
| 496 |
$('newBtn').addEventListener('click', () => openEdit(null));
|
|
|
|
| 497 |
|
| 498 |
function openEdit(id) {
|
| 499 |
state.editingId = id;
|
|
@@ -622,6 +624,7 @@
|
|
| 622 |
await loadSettings();
|
| 623 |
// 间隔可能变了,重启 polling
|
| 624 |
if (pollTimer) { stopPolling(); ensurePolling(); }
|
|
|
|
| 625 |
toast('配置已保存');
|
| 626 |
} catch (err) {
|
| 627 |
toast(err.message || String(err), 'error');
|
|
|
|
| 164 |
|
| 165 |
// ---------- RENDER ----------
|
| 166 |
function render() {
|
| 167 |
+
$('passwordBanner').classList.toggle('hidden', !!state.settings.accessPasswordSet);
|
| 168 |
document.querySelectorAll('.nav-item[data-view]').forEach((n) =>
|
| 169 |
n.classList.toggle('active', n.dataset.view === state.view)
|
| 170 |
);
|
|
|
|
| 495 |
|
| 496 |
// ---------- EDIT ----------
|
| 497 |
$('newBtn').addEventListener('click', () => openEdit(null));
|
| 498 |
+
$('passwordBannerBtn').addEventListener('click', () => openSettings());
|
| 499 |
|
| 500 |
function openEdit(id) {
|
| 501 |
state.editingId = id;
|
|
|
|
| 624 |
await loadSettings();
|
| 625 |
// 间隔可能变了,重启 polling
|
| 626 |
if (pollTimer) { stopPolling(); ensurePolling(); }
|
| 627 |
+
render();
|
| 628 |
toast('配置已保存');
|
| 629 |
} catch (err) {
|
| 630 |
toast(err.message || String(err), 'error');
|