Update status checks and add optgroup support to form modals

- modal.js: add optgroup support for select options in formModal
- dhcp.js: use zone-based interface selector for DHCP ranges
- dashboard.js, wireguard.js: use status.up for state checks
- proxy.js: use inner.querySelector for modal field lookup
This commit is contained in:
2026-06-28 12:47:59 +00:00
parent d8d8425340
commit 391466664e
5 changed files with 72 additions and 38 deletions
+3 -3
View File
@@ -61,7 +61,7 @@ export default definePage({
if (guard) return guard;
const st = state.wireguard.data?.status || {};
const isUp = st.state === 'up';
const isUp = st.up || false;
const listenPort = (state.wireguard.data?.config?.interface || {}).listen_port || '-';
const peerRows = (state.wireguard.data?.peers || []).map(p => {
@@ -107,10 +107,10 @@ export default definePage({
return [
PageHeader({
title: 'WireGuard',
subtitle: 'Tunnel: ' + (st.state || 'unknown') + ', Listen: ' + listenPort,
subtitle: 'Tunnel: ' + (st.up ? 'up' : 'down') + ', Listen: ' + listenPort,
actions,
}),
ServiceStatus({ state: st.state || 'down' }),
ServiceStatus({ state: st.up ? 'up' : 'down' }),
peerRows.length
? Table({
columns: ['Peer', 'Public Key', 'Allowed IPs', 'Endpoint', 'Handshake', 'Transfer', 'Actions'],