fix: dhcp auto-sync UI refresh, users.js null guard, and login toast escaping

This commit is contained in:
2026-07-30 23:30:56 +00:00
parent b69ca330f4
commit c64f988ba2
3 changed files with 6 additions and 5 deletions
+1
View File
@@ -213,6 +213,7 @@ export default definePage({
let msg = 'dnsmasq applied'; let msg = 'dnsmasq applied';
if (synced && synced.length) { if (synced && synced.length) {
msg += ' (auto-synced: ' + synced.join(', ') + ')'; msg += ' (auto-synced: ' + synced.join(', ') + ')';
synced.forEach(s => modelFetch(s));
} }
toast(msg, 'success'); toast(msg, 'success');
modelFetch('dnsmasq'); modelFetch('dnsmasq');
+3 -2
View File
@@ -16,6 +16,7 @@ import {
handleLoginSuccess, handleLoginSuccess,
webauthnSupported, webauthnSupported,
startAuthentication, startAuthentication,
esc,
} from '/static/hoover/index.js'; } from '/static/hoover/index.js';
function LoginPage() { function LoginPage() {
@@ -89,7 +90,7 @@ async function doPasswordLogin() {
if (res.ok) { if (res.ok) {
handleLoginSuccess(res.data); handleLoginSuccess(res.data);
toast('Welcome, ' + username, 'success'); toast('Welcome, ' + esc(username), 'success');
} else { } else {
errEl.textContent = res.error || 'Login failed'; errEl.textContent = res.error || 'Login failed';
} }
@@ -173,7 +174,7 @@ const passkeyClickHandler = async () => {
if (finishRes.ok) { if (finishRes.ok) {
handleLoginSuccess(finishRes.data); handleLoginSuccess(finishRes.data);
toast('Welcome, ' + username, 'success'); toast('Welcome, ' + esc(username), 'success');
} else { } else {
errEl.textContent = finishRes.error || 'Passkey authentication failed'; errEl.textContent = finishRes.error || 'Passkey authentication failed';
} }
+2 -3
View File
@@ -5,8 +5,7 @@
* Requires auth: rw permission. * Requires auth: rw permission.
*/ */
import { h, definePage, reactive } from '/static/hoover/index.js'; import { h, definePage, reactive, html, PageHeader, Table, Badge, ConfirmDelete, openModal, closeModal, formModal, apiFetch, toast, esc } from '/static/hoover/index.js';
import { html, PageHeader, Table, Badge, ConfirmDelete, Empty, Card, openModal, closeModal, formModal, apiFetch, toast, esc } from '/static/hoover/index.js';
const BUILTIN_ADMIN = 'admin'; const BUILTIN_ADMIN = 'admin';
@@ -69,7 +68,7 @@ async function loadUsers(abortController) {
} }
function permissionLevel(perms, subsystem) { function permissionLevel(perms, subsystem) {
return perms[subsystem] || '—'; return perms?.[subsystem] || '—';
} }
function openCreateUserModal() { function openCreateUserModal() {