Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

Split network settings section owners

rcourtman808b6904c7ce
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
index 6b6977efc2..6df985bede 100644
--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md
+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
@@ -74,6 +74,9 @@ work extends shared components instead of creating new local variants.
52. `frontend-modern/src/features/operations/operationsPageModel.ts`
53. `frontend-modern/src/pages/Operations.tsx`
54. `frontend-modern/src/pages/__tests__/Operations.helpers.test.ts`
+55. `frontend-modern/src/components/Settings/NetworkDiscoverySection.tsx`
+56. `frontend-modern/src/components/Settings/NetworkBoundarySettingsSection.tsx`
+57. `frontend-modern/src/components/Settings/networkSettingsModel.ts`
## Shared Boundaries
@@ -364,8 +367,11 @@ being re-inlined into the shell.
`frontend-modern/src/components/Settings/AuditLogPanel.tsx`,
`frontend-modern/src/components/Settings/AuditWebhookPanel.tsx`,
`frontend-modern/src/components/Settings/GeneralSettingsPanel.tsx`,
-`frontend-modern/src/components/Settings/NetworkSettingsPanel.tsx` must keep
-`frontend-modern/src/components/Settings/SecurityAuthPanel.tsx` must keep
+`frontend-modern/src/components/Settings/NetworkSettingsPanel.tsx`,
+`frontend-modern/src/components/Settings/NetworkDiscoverySection.tsx`,
+`frontend-modern/src/components/Settings/NetworkBoundarySettingsSection.tsx`,
+`frontend-modern/src/components/Settings/networkSettingsModel.ts`,
+`frontend-modern/src/components/Settings/SecurityAuthPanel.tsx`,
`frontend-modern/src/components/Settings/SecurityOverviewPanel.tsx`,
`frontend-modern/src/components/Settings/RecoverySettingsPanel.tsx`,
`frontend-modern/src/components/Settings/SSOProvidersPanel.tsx`,
@@ -377,6 +383,14 @@ is the shell, `useSSOProvidersState.ts` owns the reactive/API lifecycle, and
`frontend-modern/src/components/Settings/UpdatesSettingsPanel.tsx` must keep
page-shell titles, descriptions, and lead panel framing aligned instead of
letting navigation/header labels drift away from the actual settings surface.
+`frontend-modern/src/components/Settings/NetworkSettingsPanel.tsx` is now a
+shell only. `frontend-modern/src/components/Settings/NetworkDiscoverySection.tsx`
+owns discovery controls and shared subnet presets, while
+`frontend-modern/src/components/Settings/NetworkBoundarySettingsSection.tsx`
+owns the public URL, CORS, embedding, and webhook-boundary UI. Shared prop
+contracts for that surface must extend
+`frontend-modern/src/components/Settings/networkSettingsModel.ts` instead of
+re-expanding the shell or reintroducing page-local section types.
First-session runtime framing is now part of that same owned primitive story.
`frontend-modern/src/components/SetupWizard/SetupWizard.tsx` must stay on the
real two-step runtime shape (`Welcome`, then `Security`) and hand successful
diff --git a/docs/release-control/v6/internal/subsystems/registry.json b/docs/release-control/v6/internal/subsystems/registry.json
index cce2e7b024..b0aec49b78 100644
--- a/docs/release-control/v6/internal/subsystems/registry.json
+++ b/docs/release-control/v6/internal/subsystems/registry.json
@@ -1747,6 +1747,9 @@
"frontend-modern/src/components/Settings/DiagnosticsPanel.tsx",
"frontend-modern/src/components/Settings/DiagnosticsResultsPanel.tsx",
"frontend-modern/src/components/Settings/GeneralSettingsPanel.tsx",
+ "frontend-modern/src/components/Settings/NetworkBoundarySettingsSection.tsx",
+ "frontend-modern/src/components/Settings/NetworkDiscoverySection.tsx",
+ "frontend-modern/src/components/Settings/networkSettingsModel.ts",
"frontend-modern/src/components/Settings/NetworkSettingsPanel.tsx",
"frontend-modern/src/components/Settings/RecoverySettingsPanel.tsx",
"frontend-modern/src/components/Settings/ReportingPanel.tsx",
@@ -1823,6 +1826,9 @@
"frontend-modern/src/components/Settings/DiagnosticsPanel.tsx",
"frontend-modern/src/components/Settings/DiagnosticsResultsPanel.tsx",
"frontend-modern/src/components/Settings/GeneralSettingsPanel.tsx",
+ "frontend-modern/src/components/Settings/NetworkBoundarySettingsSection.tsx",
+ "frontend-modern/src/components/Settings/NetworkDiscoverySection.tsx",
+ "frontend-modern/src/components/Settings/networkSettingsModel.ts",
"frontend-modern/src/components/Settings/NetworkSettingsPanel.tsx",
"frontend-modern/src/components/Settings/RecoverySettingsPanel.tsx",
"frontend-modern/src/components/Settings/SecurityAuthPanel.tsx",
diff --git a/frontend-modern/src/components/Settings/NetworkBoundarySettingsSection.tsx b/frontend-modern/src/components/Settings/NetworkBoundarySettingsSection.tsx
new file mode 100644
index 0000000000..d811681c76
--- /dev/null
+++ b/frontend-modern/src/components/Settings/NetworkBoundarySettingsSection.tsx
@@ -0,0 +1,270 @@
+import { Component, Show } from 'solid-js';
+import { Card } from '@/components/shared/Card';
+import type { NetworkBoundarySettingsSectionProps } from './networkSettingsModel';
+
+interface EnvironmentOverrideAlertProps {
+ description: string;
+ title: string;
+}
+
+function EnvironmentOverrideAlert(props: EnvironmentOverrideAlertProps) {
+ return (
+ <div class="mt-2 p-2 bg-amber-100 dark:bg-amber-900 border border-amber-300 dark:border-amber-700 rounded text-xs text-amber-800 dark:text-amber-200">
+ <div class="flex items-center gap-1">
+ <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
+ <path
+ stroke-linecap="round"
+ stroke-linejoin="round"
+ stroke-width="2"
+ d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"
+ />
+ </svg>
+ <span>{props.title}</span>
+ </div>
+ <div class="mt-1 text-amber-700 dark:text-amber-300">{props.description}</div>
+ </div>
+ );
+}
+
+export const NetworkBoundarySettingsSection: Component<NetworkBoundarySettingsSectionProps> = (
+ props,
+) => {
+ return (
+ <>
+ <section class="p-4 sm:p-6 space-y-4">
+ <h4 class="flex items-center gap-2 text-sm font-medium text-base-content">
+ <svg
+ width="16"
+ height="16"
+ viewBox="0 0 24 24"
+ fill="none"
+ stroke="currentColor"
+ stroke-width="2"
+ >
+ <path d="M10 13a5 5 0 007.54.54l3-3a5 5 0 00-7.07-7.07l-1.72 1.71"></path>
+ <path d="M14 11a5 5 0 00-7.54-.54l-3 3a5 5 0 007.07 7.07l1.71-1.71"></path>
+ </svg>
+ Public URL
+ </h4>
+ <div class="space-y-2">
+ <label class="text-sm font-medium text-base-content">Dashboard URL for Notifications</label>
+ <p class="text-xs text-muted">
+ The URL included in email alerts to link back to Pulse. Required for Docker deployments
+ with custom ports.
+ </p>
+ <div class="relative">
+ <input
+ type="text"
+ value={props.publicURL()}
+ onInput={(e) => {
+ if (!props.envOverrides().publicURL) {
+ props.setPublicURL(e.currentTarget.value);
+ props.setHasUnsavedChanges(true);
+ }
+ }}
+ disabled={props.envOverrides().publicURL}
+ placeholder="http://192.168.1.100:8080"
+ class={`w-full min-h-10 sm:min-h-10 px-3 py-2.5 text-sm border rounded-md ${
+ props.envOverrides().publicURL
+ ? 'border-amber-300 dark:border-amber-600 bg-amber-50 dark:bg-amber-900 cursor-not-allowed opacity-75'
+ : 'border-border bg-surface'
+ }`}
+ />
+ <Show when={props.envOverrides().publicURL}>
+ <EnvironmentOverrideAlert
+ title="Overridden by PULSE_PUBLIC_URL environment variable"
+ description="Remove the env var and restart to enable UI configuration"
+ />
+ </Show>
+ </div>
+ <p class="text-xs text-muted mt-1">
+ Example: If you access Pulse at <code>http://myserver:8080</code>, enter that URL here.
+ Leave empty to auto-detect (may not work correctly with Docker port mappings).
+ </p>
+ </div>
+ </section>
+
+ <section class="p-4 sm:p-6 space-y-4">
+ <h4 class="flex items-center gap-2 text-sm font-medium text-base-content">
+ <svg
+ width="16"
+ height="16"
+ viewBox="0 0 24 24"
+ fill="none"
+ stroke="currentColor"
+ stroke-width="2"
+ >
+ <circle cx="12" cy="12" r="10"></circle>
+ <path d="M2 12h20M12 2a15.3 15.3 0 014 10 15.3 15.3 0 01-4 10 15.3 15.3 0 01-4-10 15.3 15.3 0 014-10z"></path>
+ </svg>
+ Network Settings
+ </h4>
+ <div class="space-y-2">
+ <label class="text-sm font-medium text-base-content">CORS Allowed Origins</label>
+ <p class="text-xs text-muted">
+ For reverse proxy setups (* = allow all, empty = same-origin only)
+ </p>
+ <div class="relative">
+ <input
+ type="text"
+ value={props.allowedOrigins()}
+ onInput={(e) => {
+ if (!props.envOverrides().allowedOrigins) {
+ props.setAllowedOrigins(e.currentTarget.value);
+ props.setHasUnsavedChanges(true);
+ }
+ }}
+ disabled={props.envOverrides().allowedOrigins}
+ placeholder="* or https://example.com"
+ class={`w-full min-h-10 sm:min-h-10 px-3 py-2.5 text-sm border rounded-md ${
+ props.envOverrides().allowedOrigins
+ ? 'border-amber-300 dark:border-amber-600 bg-amber-50 dark:bg-amber-900 cursor-not-allowed opacity-75'
+ : 'border-border bg-surface'
+ }`}
+ />
+ <Show when={props.envOverrides().allowedOrigins}>
+ <EnvironmentOverrideAlert
+ title="Overridden by ALLOWED_ORIGINS environment variable"
+ description="Remove the env var and restart to enable UI configuration"
+ />
+ </Show>
+ </div>
+ </div>
+ </section>
+
+ <section class="p-4 sm:p-6 space-y-4">
+ <h4 class="flex items-center gap-2 text-sm font-medium text-base-content">
+ <svg
+ width="16"
+ height="16"
+ viewBox="0 0 24 24"
+ fill="none"
+ stroke="currentColor"
+ stroke-width="2"
+ >
+ <rect x="3" y="4" width="18" height="14" rx="2"></rect>
+ <path d="M7 20h10"></path>
+ </svg>
+ Embedding
+ </h4>
+ <p class="text-xs text-muted">
+ Allow Pulse to be embedded in iframes (e.g., Homepage dashboard)
+ </p>
+ <div class="space-y-3">
+ <div class="flex items-center gap-2">
+ <input
+ type="checkbox"
+ id="allowEmbedding"
+ checked={props.allowEmbedding()}
+ onChange={(e) => {
+ props.setAllowEmbedding(e.currentTarget.checked);
+ props.setHasUnsavedChanges(true);
+ }}
+ class="h-5 w-5 sm:h-4 sm:w-4 rounded border-border text-blue-600 focus:ring-blue-500"
+ />
+ <label for="allowEmbedding" class="text-sm text-base-content">
+ Allow iframe embedding
+ </label>
+ </div>
+
+ <Show when={props.allowEmbedding()}>
+ <div class="space-y-2">
+ <label class="text-xs font-medium text-base-content">
+ Allowed Embed Origins (optional)
+ </label>
+ <p class="text-xs text-muted">
+ Comma-separated list of origins that can embed Pulse (leave empty for same-origin
+ only)
+ </p>
+ <input
+ type="text"
+ value={props.allowedEmbedOrigins()}
+ onChange={(e) => {
+ props.setAllowedEmbedOrigins(e.currentTarget.value);
+ props.setHasUnsavedChanges(true);
+ }}
+ placeholder="https://my.domain, https://dashboard.example.com"
+ class="w-full min-h-10 sm:min-h-10 px-3 py-2.5 text-sm border rounded-md border-border bg-surface"
+ />
+ <p class="text-xs text-muted">
+ Example: If Pulse is at <code>pulse.my.domain</code> and your dashboard is at{' '}
+ <code>my.domain</code>, add <code>https://my.domain</code> here.
+ </p>
+ </div>
+ </Show>
+ </div>
+ </section>
+
+ <section class="p-4 sm:p-6 space-y-4">
+ <h3 class="text-sm font-semibold text-base-content flex items-center gap-2">
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ class="h-5 w-5 sm:h-4 sm:w-4"
+ fill="none"
+ viewBox="0 0 24 24"
+ stroke="currentColor"
+ >
+ <path
+ stroke-linecap="round"
+ stroke-linejoin="round"
+ stroke-width={2}
+ d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"
+ />
+ </svg>
+ Webhook Security
+ </h3>
+ <div class="space-y-3">
+ <div>
+ <label class="text-sm font-medium text-base-content">
+ Allowed Private IP Ranges for Webhooks
+ </label>
+ <p class="text-xs text-muted mb-2">
+ By default, webhooks to private IP addresses are blocked for security. Enter trusted
+ CIDR ranges to allow webhooks to internal services (leave empty to block all private
+ IPs).
+ </p>
+ <input
+ type="text"
+ value={props.webhookAllowedPrivateCIDRs()}
+ onChange={(e) => {
+ props.setWebhookAllowedPrivateCIDRs(e.currentTarget.value);
+ props.setHasUnsavedChanges(true);
+ }}
+ placeholder="192.168.1.0/24, 10.0.0.0/8"
+ class="w-full min-h-10 sm:min-h-10 px-3 py-2.5 text-sm border rounded-md border-border bg-surface"
+ />
+ <p class="text-xs text-muted mt-1">
+ Example: <code>192.168.1.0/24,10.0.0.0/8</code> allows webhooks to these private
+ networks. Localhost and cloud metadata services remain blocked.
+ </p>
+ </div>
+ </div>
+ </section>
+
+ <div class="p-4 sm:p-6">
+ <Card
+ tone="warning"
+ padding="sm"
+ border={false}
+ class="border border-amber-200 dark:border-amber-800"
+ >
+ <p class="text-xs text-amber-800 dark:text-amber-200 mb-2">
+ <strong>Port Configuration:</strong> Use{' '}
+ <code class="font-mono bg-amber-100 dark:bg-amber-800 px-1 rounded">
+ systemctl edit pulse
+ </code>
+ </p>
+ <p class="text-xs text-amber-700 dark:text-amber-300 font-mono">
+ [Service]
+ <br />
+ Environment="FRONTEND_PORT=8080"
+ <br />
+ <span class="text-xs text-amber-600 dark:text-amber-400">
+ Then restart: sudo systemctl restart pulse
+ </span>
+ </p>
+ </Card>
+ </div>
+ </>
+ );
+};
diff --git a/frontend-modern/src/components/Settings/NetworkDiscoverySection.tsx b/frontend-modern/src/components/Settings/NetworkDiscoverySection.tsx
new file mode 100644
index 0000000000..4ccb638658
--- /dev/null
+++ b/frontend-modern/src/components/Settings/NetworkDiscoverySection.tsx
@@ -0,0 +1,317 @@
+import { Component, For, Show } from 'solid-js';
+import { SectionHeader } from '@/components/shared/SectionHeader';
+import { Toggle } from '@/components/shared/Toggle';
+import type { ToggleChangeEvent } from '@/components/shared/Toggle';
+import { COMMON_DISCOVERY_SUBNETS } from '@/utils/systemSettingsPresentation';
+import type { NetworkDiscoverySectionProps } from './networkSettingsModel';
+
+export const NetworkDiscoverySection: Component<NetworkDiscoverySectionProps> = (props) => {
+ return (
+ <>
+ <div class="p-4 sm:p-6">
+ <div class="rounded-md border border-blue-200 dark:border-blue-800 bg-blue-50/70 dark:bg-blue-950/40 p-4">
+ <div class="flex items-start gap-3">
+ <svg
+ class="w-5 h-5 text-blue-600 dark:text-blue-400 mt-0.5 flex-shrink-0"
+ fill="none"
+ stroke="currentColor"
+ viewBox="0 0 24 24"
+ >
+ <path
+ stroke-linecap="round"
+ stroke-linejoin="round"
+ stroke-width="2"
+ d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
+ />
+ </svg>
+ <div class="text-sm text-blue-800 dark:text-blue-200">
+ <p class="font-medium mb-1">Configuration priority</p>
+ <ul class="space-y-1">
+ <li>• Some environment variables still override these settings.</li>
+ <li>• Changes made here are written to `system.json` immediately.</li>
+ <li>• Settings persist until an environment override replaces them.</li>
+ </ul>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <section class="p-4 sm:p-6 space-y-5">
+ <SectionHeader
+ title="Network discovery"
+ description="Control how Pulse scans for Proxmox services on your network."
+ size="sm"
+ align="left"
+ />
+
+ <div class="flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between">
+ <div class="text-sm text-muted">
+ <p class="font-medium text-base-content">Automatic scanning</p>
+ <p class="text-xs text-muted">
+ Enable discovery to surface Proxmox VE, PBS, and PMG endpoints automatically.
+ </p>
+ </div>
+ <Toggle
+ checked={props.discoveryEnabled()}
+ onChange={async (e: ToggleChangeEvent) => {
+ if (props.envOverrides().discoveryEnabled || props.savingDiscoverySettings()) {
+ e.preventDefault();
+ return;
+ }
+ const success = await props.handleDiscoveryEnabledChange(e.currentTarget.checked);
+ if (!success) {
+ e.currentTarget.checked = props.discoveryEnabled();
+ }
+ }}
+ disabled={props.envOverrides().discoveryEnabled || props.savingDiscoverySettings()}
+ containerClass="gap-2"
+ label={
+ <span class="text-xs font-medium text-muted">
+ {props.discoveryEnabled() ? 'On' : 'Off'}
+ </span>
+ }
+ />
+ </div>
+
+ <Show when={props.discoveryEnabled()}>
+ <div class="space-y-4 rounded-md border border-border bg-surface p-3">
+ <fieldset class="space-y-2">
+ <legend class="text-xs font-medium text-base-content">Scan scope</legend>
+ <div class="space-y-2">
+ <label
+ class={`flex items-start gap-3 rounded-md border p-2 transition-colors ${
+ props.discoveryMode() === 'auto'
+ ? 'border-blue-200 bg-blue-50 dark:border-blue-700 dark:bg-blue-900'
+ : 'border-transparent hover:border-border'
+ }`}
+ >
+ <input
+ type="radio"
+ name="discoveryMode"
+ value="auto"
+ checked={props.discoveryMode() === 'auto'}
+ onChange={async () => {
+ if (props.discoveryMode() !== 'auto') {
+ await props.handleDiscoveryModeChange('auto');
+ }
+ }}
+ disabled={props.envOverrides().discoverySubnet || props.savingDiscoverySettings()}
+ class="mt-1 h-5 w-5 sm:h-4 sm:w-4 border-slate-300 text-blue-600 focus:ring-blue-500"
+ />
+ <div class="space-y-1">
+ <p class="text-sm font-medium text-base-content">Auto (slower, full scan)</p>
+ <p class="text-xs text-muted">
+ Scans all network interfaces on this host, including container bridges, local
+ subnets, and gateways. On large or shared networks, consider using a custom
+ subnet instead.
+ </p>
+ </div>
+ </label>
+
+ <label
+ class={`flex items-start gap-3 rounded-md border p-2 transition-colors ${
+ props.discoveryMode() === 'custom'
+ ? 'border-blue-200 bg-blue-50 dark:border-blue-700 dark:bg-blue-900'
+ : 'border-transparent hover:border-border'
+ }`}
+ >
+ <input
+ type="radio"
+ name="discoveryMode"
+ value="custom"
+ checked={props.discoveryMode() === 'custom'}
+ onChange={() => {
+ if (props.discoveryMode() !== 'custom') {
+ props.handleDiscoveryModeChange('custom');
+ }
+ }}
+ disabled={props.envOverrides().discoverySubnet || props.savingDiscoverySettings()}
+ class="mt-1 h-5 w-5 sm:h-4 sm:w-4 border-slate-300 text-blue-600 focus:ring-blue-500"
+ />
+ <div class="space-y-1">
+ <p class="text-sm font-medium text-base-content">Custom subnet (faster)</p>
+ <p class="text-xs text-muted">
+ Limit discovery to one or more CIDR ranges to finish faster on large
+ networks.
+ </p>
+ </div>
+ </label>
+
+ <Show when={props.discoveryMode() === 'custom'}>
+ <div class="flex flex-wrap items-center gap-2 pl-9 pr-2">
+ <span class="text-[0.68rem] uppercase tracking-wide text-muted">
+ Common networks:
+ </span>
+ <For each={COMMON_DISCOVERY_SUBNETS}>
+ {(preset) => {
+ const baseValue = props.currentDraftSubnetValue();
+ const currentSelections = props.parseSubnetList(baseValue);
+ const isActive = currentSelections.includes(preset);
+ return (
+ <button
+ type="button"
+ class={`rounded border px-2.5 py-1 text-[0.7rem] transition-colors ${isActive ? 'border-blue-500 bg-blue-600 text-white dark:border-blue-400 dark:bg-blue-500' : 'border-border text-base-content hover:border-blue-400 hover:bg-blue-50 dark:hover:border-blue-500 dark:hover:bg-blue-900'}`}
+ onClick={async () => {
+ if (props.envOverrides().discoverySubnet) {
+ return;
+ }
+ let selections = [...currentSelections];
+ if (isActive) {
+ selections = selections.filter((item) => item !== preset);
+ } else {
+ selections.push(preset);
+ }
+
+ if (selections.length === 0) {
+ props.setDiscoverySubnetDraft('');
+ props.setLastCustomSubnet('');
+ props.setDiscoverySubnetError(
+ 'Enter at least one subnet in CIDR format (e.g., 192.168.1.0/24)',
+ );
+ return;
+ }
+
+ const updatedValue = props.normalizeSubnetList(
+ selections.join(', '),
+ );
+ props.setDiscoveryMode('custom');
+ props.setDiscoverySubnetDraft(updatedValue);
+ props.setLastCustomSubnet(updatedValue);
+ props.setDiscoverySubnetError(undefined);
+ await props.commitDiscoverySubnet(updatedValue);
+ }}
+ disabled={props.envOverrides().discoverySubnet}
+ classList={{
+ 'cursor-not-allowed opacity-60':
+ props.envOverrides().discoverySubnet,
+ }}
+ >
+ {preset}
+ </button>
+ );
+ }}
+ </For>
+ </div>
+ </Show>
+ </div>
+ </fieldset>
+
+ <div class="space-y-2">
+ <div class="flex items-center justify-between gap-2">
+ <label for="discoverySubnetInput" class="text-xs font-medium text-base-content">
+ Discovery subnet
+ </label>
+ <span
+ class="text-slate-400 hover:text-muted"
+ title="Use CIDR notation (comma-separated for multiple), e.g. 192.168.1.0/24, 10.0.0.0/24. Smaller ranges keep scans quick."
+ >
+ <svg
+ class="h-5 w-5 sm:h-4 sm:w-4"
+ viewBox="0 0 24 24"
+ fill="none"
+ stroke="currentColor"
+ stroke-width="2"
+ >
+ <circle cx="12" cy="12" r="10"></circle>
+ <path d="M12 16v-4"></path>
+ <path d="M12 8h.01"></path>
+ </svg>
+ </span>
+ </div>
+ <input
+ id="discoverySubnetInput"
+ ref={props.discoverySubnetInputRef}
+ type="text"
+ value={props.discoverySubnetDraft()}
+ placeholder={
+ props.discoveryMode() === 'auto'
+ ? 'auto (scan every network phase)'
+ : '192.168.1.0/24, 10.0.0.0/24'
+ }
+ class={`w-full min-h-10 sm:min-h-10 rounded-md border px-3 py-2.5 text-sm transition-colors focus:outline-none focus:ring-2 focus:ring-blue-500 ${
+ props.envOverrides().discoverySubnet
+ ? 'border-amber-300 bg-amber-50 text-amber-800 dark:border-amber-600 dark:bg-amber-900 dark:text-amber-200 cursor-not-allowed opacity-60'
+ : 'border-border bg-surface'
+ }`}
+ disabled={props.envOverrides().discoverySubnet}
+ onInput={(e) => {
+ if (props.envOverrides().discoverySubnet) {
+ return;
+ }
+ const rawValue = e.currentTarget.value;
+ props.setDiscoverySubnetDraft(rawValue);
+ if (props.discoveryMode() !== 'custom') {
+ props.setDiscoveryMode('custom');
+ }
+ props.setLastCustomSubnet(rawValue);
+ const trimmed = rawValue.trim();
+ if (!trimmed) {
+ props.setDiscoverySubnetError(undefined);
+ return;
+ }
+ if (!props.isValidCIDR(trimmed)) {
+ props.setDiscoverySubnetError(
+ 'Use CIDR format such as 192.168.1.0/24 (comma-separated for multiple)',
+ );
+ } else {
+ props.setDiscoverySubnetError(undefined);
+ }
+ }}
+ onBlur={async (e) => {
+ if (props.envOverrides().discoverySubnet || props.discoveryMode() !== 'custom') {
+ return;
+ }
+ const rawValue = e.currentTarget.value;
+ props.setDiscoverySubnetDraft(rawValue);
+ const trimmed = rawValue.trim();
+ if (!trimmed) {
+ props.setDiscoverySubnetError(
+ 'Enter at least one subnet in CIDR format (e.g., 192.168.1.0/24)',
+ );
+ return;
+ }
+ if (!props.isValidCIDR(trimmed)) {
+ props.setDiscoverySubnetError(
+ 'Use CIDR format such as 192.168.1.0/24 (comma-separated for multiple)',
+ );
+ return;
+ }
+ props.setDiscoverySubnetError(undefined);
+ await props.commitDiscoverySubnet(rawValue);
+ }}
+ onKeyDown={(e) => {
+ if (e.key === 'Enter') {
+ e.preventDefault();
+ (e.currentTarget as HTMLInputElement).blur();
+ }
+ }}
+ />
+ <Show when={props.discoverySubnetError()}>
+ <p class="text-xs text-red-600 dark:text-red-400">{props.discoverySubnetError()}</p>
+ </Show>
+ <Show when={!props.discoverySubnetError() && props.discoveryMode() === 'auto'}>
+ <p class="text-xs text-muted">
+ Auto scans all host network interfaces, which may include corporate or shared
+ networks. Switch to a custom subnet for faster, more targeted scans.
+ </p>
+ </Show>
+ <Show when={!props.discoverySubnetError() && props.discoveryMode() === 'custom'}>
+ <p class="text-xs text-muted">
+ Example: 192.168.1.0/24, 10.0.0.0/24 (comma-separated). Smaller ranges finish
+ faster and avoid timeouts.
+ </p>
+ </Show>
+ </div>
+ </div>
+ </Show>
+
+ <Show when={props.envOverrides().discoveryEnabled || props.envOverrides().discoverySubnet}>
+ <div class="rounded-md border border-amber-200 bg-amber-100 p-3 text-xs text-amber-800 dark:border-amber-700 dark:bg-amber-900 dark:text-amber-200">
+ Discovery settings are locked by environment variables. Update the service
+ configuration and restart Pulse to change them here.
+ </div>
+ </Show>
+ </section>
+ </>
+ );
+};
diff --git a/frontend-modern/src/components/Settings/NetworkSettingsPanel.tsx b/frontend-modern/src/components/Settings/NetworkSettingsPanel.tsx
index 739c55ab00..8a56d584d6 100644
--- a/frontend-modern/src/components/Settings/NetworkSettingsPanel.tsx
+++ b/frontend-modern/src/components/Settings/NetworkSettingsPanel.tsx
@@ -1,52 +1,9 @@
-import { Component, Show, For, Accessor, Setter } from 'solid-js';
-import { Card } from '@/components/shared/Card';
+import { Component } from 'solid-js';
import SettingsPanel from '@/components/shared/SettingsPanel';
-import { SectionHeader } from '@/components/shared/SectionHeader';
-import { Toggle } from '@/components/shared/Toggle';
-import type { ToggleChangeEvent } from '@/components/shared/Toggle';
import Network from 'lucide-solid/icons/network';
-import { COMMON_DISCOVERY_SUBNETS } from '@/utils/systemSettingsPresentation';
-
-interface NetworkSettingsPanelProps {
- // Discovery settings
- discoveryEnabled: Accessor<boolean>;
- discoveryMode: Accessor<'auto' | 'custom'>;
- discoverySubnetDraft: Accessor<string>;
- discoverySubnetError: Accessor<string | undefined>;
- savingDiscoverySettings: Accessor<boolean>;
- envOverrides: Accessor<Record<string, boolean>>;
-
- // Network settings
- allowedOrigins: Accessor<string>;
- setAllowedOrigins: Setter<string>;
- allowEmbedding: Accessor<boolean>;
- setAllowEmbedding: Setter<boolean>;
- allowedEmbedOrigins: Accessor<string>;
- setAllowedEmbedOrigins: Setter<string>;
- webhookAllowedPrivateCIDRs: Accessor<string>;
- setWebhookAllowedPrivateCIDRs: Setter<string>;
- publicURL: Accessor<string>;
- setPublicURL: Setter<string>;
-
- // Handlers
- handleDiscoveryEnabledChange: (enabled: boolean) => Promise<boolean>;
- handleDiscoveryModeChange: (mode: 'auto' | 'custom') => Promise<void>;
- setDiscoveryMode: Setter<'auto' | 'custom'>;
- setDiscoverySubnetDraft: Setter<string>;
- setDiscoverySubnetError: Setter<string | undefined>;
- setLastCustomSubnet: Setter<string>;
- commitDiscoverySubnet: (value: string) => Promise<boolean>;
- setHasUnsavedChanges: Setter<boolean>;
-
- // Utility functions
- parseSubnetList: (value: string) => string[];
- normalizeSubnetList: (value: string) => string;
- isValidCIDR: (value: string) => boolean;
- currentDraftSubnetValue: () => string;
-
- // Ref for input
- discoverySubnetInputRef?: (el: HTMLInputElement) => void;
-}
+import { NetworkBoundarySettingsSection } from './NetworkBoundarySettingsSection';
+import { NetworkDiscoverySection } from './NetworkDiscoverySection';
+import type { NetworkSettingsPanelProps } from './networkSettingsModel';
export const NetworkSettingsPanel: Component<NetworkSettingsPanelProps> = (props) => {
return (
@@ -57,595 +14,8 @@ export const NetworkSettingsPanel: Component<NetworkSettingsPanelProps> = (props
noPadding
bodyClass="divide-y divide-border"
>
- <div class="p-4 sm:p-6">
- <div class="rounded-md border border-blue-200 dark:border-blue-800 bg-blue-50/70 dark:bg-blue-950/40 p-4">
- <div class="flex items-start gap-3">
- <svg
- class="w-5 h-5 text-blue-600 dark:text-blue-400 mt-0.5 flex-shrink-0"
- fill="none"
- stroke="currentColor"
- viewBox="0 0 24 24"
- >
- <path
- stroke-linecap="round"
- stroke-linejoin="round"
- stroke-width="2"
- d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
- />
- </svg>
- <div class="text-sm text-blue-800 dark:text-blue-200">
- <p class="font-medium mb-1">Configuration priority</p>
- <ul class="space-y-1">
- <li>• Some environment variables still override these settings.</li>
- <li>• Changes made here are written to `system.json` immediately.</li>
- <li>• Settings persist until an environment override replaces them.</li>
- </ul>
- </div>
- </div>
- </div>
- </div>
-
- {/* Network Discovery Section */}
- <section class="p-4 sm:p-6 space-y-5">
- <SectionHeader
- title="Network discovery"
- description="Control how Pulse scans for Proxmox services on your network."
- size="sm"
- align="left"
- />
-
- {/* Discovery Toggle */}
- <div class="flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between">
- <div class="text-sm text-muted">
- <p class="font-medium text-base-content">Automatic scanning</p>
- <p class="text-xs text-muted">
- Enable discovery to surface Proxmox VE, PBS, and PMG endpoints automatically.
- </p>
- </div>
- <Toggle
- checked={props.discoveryEnabled()}
- onChange={async (e: ToggleChangeEvent) => {
- if (props.envOverrides().discoveryEnabled || props.savingDiscoverySettings()) {
- e.preventDefault();
- return;
- }
- const success = await props.handleDiscoveryEnabledChange(e.currentTarget.checked);
- if (!success) {
- e.currentTarget.checked = props.discoveryEnabled();
- }
- }}
- disabled={props.envOverrides().discoveryEnabled || props.savingDiscoverySettings()}
- containerClass="gap-2"
- label={
- <span class="text-xs font-medium text-muted">
- {props.discoveryEnabled() ? 'On' : 'Off'}
- </span>
- }
- />
- </div>
-
- {/* Discovery Options (shown when enabled) */}
- <Show when={props.discoveryEnabled()}>
- <div class="space-y-4 rounded-md border border-border bg-surface p-3">
- <fieldset class="space-y-2">
- <legend class="text-xs font-medium text-base-content">Scan scope</legend>
- <div class="space-y-2">
- {/* Auto mode */}
- <label
- class={`flex items-start gap-3 rounded-md border p-2 transition-colors ${
- props.discoveryMode() === 'auto'
- ? 'border-blue-200 bg-blue-50 dark:border-blue-700 dark:bg-blue-900'
- : 'border-transparent hover:border-border'
- }`}
- >
- <input
- type="radio"
- name="discoveryMode"
- value="auto"
- checked={props.discoveryMode() === 'auto'}
- onChange={async () => {
- if (props.discoveryMode() !== 'auto') {
- await props.handleDiscoveryModeChange('auto');
- }
- }}
- disabled={
- props.envOverrides().discoverySubnet || props.savingDiscoverySettings()
- }
- class="mt-1 h-5 w-5 sm:h-4 sm:w-4 border-slate-300 text-blue-600 focus:ring-blue-500"
- />
- <div class="space-y-1">
- <p class="text-sm font-medium text-base-content">Auto (slower, full scan)</p>
- <p class="text-xs text-muted">
- Scans all network interfaces on this host, including container bridges,
- local subnets, and gateways. On large or shared networks, consider using a
- custom subnet instead.
- </p>
- </div>
- </label>
-
- {/* Custom mode */}
- <label
- class={`flex items-start gap-3 rounded-md border p-2 transition-colors ${
- props.discoveryMode() === 'custom'
- ? 'border-blue-200 bg-blue-50 dark:border-blue-700 dark:bg-blue-900'
- : 'border-transparent hover:border-border'
- }`}
- >
- <input
- type="radio"
- name="discoveryMode"
- value="custom"
- checked={props.discoveryMode() === 'custom'}
- onChange={() => {
- if (props.discoveryMode() !== 'custom') {
- props.handleDiscoveryModeChange('custom');
- }
- }}
- disabled={
- props.envOverrides().discoverySubnet || props.savingDiscoverySettings()
- }
- class="mt-1 h-5 w-5 sm:h-4 sm:w-4 border-slate-300 text-blue-600 focus:ring-blue-500"
- />
- <div class="space-y-1">
- <p class="text-sm font-medium text-base-content">Custom subnet (faster)</p>
- <p class="text-xs text-muted">
- Limit discovery to one or more CIDR ranges to finish faster on large
- networks.
- </p>
- </div>
- </label>
-
- {/* Common subnet presets */}
- <Show when={props.discoveryMode() === 'custom'}>
- <div class="flex flex-wrap items-center gap-2 pl-9 pr-2">
- <span class="text-[0.68rem] uppercase tracking-wide text-muted">
- Common networks:
- </span>
- <For each={COMMON_DISCOVERY_SUBNETS}>
- {(preset) => {
- const baseValue = props.currentDraftSubnetValue();
- const currentSelections = props.parseSubnetList(baseValue);
- const isActive = currentSelections.includes(preset);
- return (
- <button
- type="button"
- class={`rounded border px-2.5 py-1 text-[0.7rem] transition-colors ${isActive ? 'border-blue-500 bg-blue-600 text-white dark:border-blue-400 dark:bg-blue-500' : 'border-border text-base-content hover:border-blue-400 hover:bg-blue-50 dark:hover:border-blue-500 dark:hover:bg-blue-900'}`}
- onClick={async () => {
- if (props.envOverrides().discoverySubnet) {
- return;
- }
- let selections = [...currentSelections];
- if (isActive) {
- selections = selections.filter((item) => item !== preset);
- } else {
- selections.push(preset);
- }
-
- if (selections.length === 0) {
- props.setDiscoverySubnetDraft('');
- props.setLastCustomSubnet('');
- props.setDiscoverySubnetError(
- 'Enter at least one subnet in CIDR format (e.g., 192.168.1.0/24)',
- );
- return;
- }
-
- const updatedValue = props.normalizeSubnetList(
- selections.join(', '),
- );
- props.setDiscoveryMode('custom');
- props.setDiscoverySubnetDraft(updatedValue);
- props.setLastCustomSubnet(updatedValue);
- props.setDiscoverySubnetError(undefined);
- await props.commitDiscoverySubnet(updatedValue);
- }}
- disabled={props.envOverrides().discoverySubnet}
- classList={{
- 'cursor-not-allowed opacity-60':
- props.envOverrides().discoverySubnet,
- }}
- >
- {preset}
- </button>
- );
- }}
- </For>
- </div>
- </Show>
- </div>
- </fieldset>
-
- {/* Subnet Input */}
- <div class="space-y-2">
- <div class="flex items-center justify-between gap-2">
- <label for="discoverySubnetInput" class="text-xs font-medium text-base-content">
- Discovery subnet
- </label>
- <span
- class="text-slate-400 hover:text-muted"
- title="Use CIDR notation (comma-separated for multiple), e.g. 192.168.1.0/24, 10.0.0.0/24. Smaller ranges keep scans quick."
- >
- <svg
- class="h-5 w-5 sm:h-4 sm:w-4"
- viewBox="0 0 24 24"
- fill="none"
- stroke="currentColor"
- stroke-width="2"
- >
- <circle cx="12" cy="12" r="10"></circle>
- <path d="M12 16v-4"></path>
- <path d="M12 8h.01"></path>
- </svg>
- </span>
- </div>
- <input
- id="discoverySubnetInput"
- ref={props.discoverySubnetInputRef}
- type="text"
- value={props.discoverySubnetDraft()}
- placeholder={
- props.discoveryMode() === 'auto'
- ? 'auto (scan every network phase)'
- : '192.168.1.0/24, 10.0.0.0/24'
- }
- class={`w-full min-h-10 sm:min-h-10 rounded-md border px-3 py-2.5 text-sm transition-colors focus:outline-none focus:ring-2 focus:ring-blue-500 ${
- props.envOverrides().discoverySubnet
- ? 'border-amber-300 bg-amber-50 text-amber-800 dark:border-amber-600 dark:bg-amber-900 dark:text-amber-200 cursor-not-allowed opacity-60'
- : 'border-border bg-surface'
- }`}
- disabled={props.envOverrides().discoverySubnet}
- onInput={(e) => {
- if (props.envOverrides().discoverySubnet) {
- return;
- }
- const rawValue = e.currentTarget.value;
- props.setDiscoverySubnetDraft(rawValue);
- if (props.discoveryMode() !== 'custom') {
- props.setDiscoveryMode('custom');
- }
- props.setLastCustomSubnet(rawValue);
- const trimmed = rawValue.trim();
- if (!trimmed) {
- props.setDiscoverySubnetError(undefined);
- return;
- }
- if (!props.isValidCIDR(trimmed)) {
- props.setDiscoverySubnetError(
- 'Use CIDR format such as 192.168.1.0/24 (comma-separated for multiple)',
- );
- } else {
- props.setDiscoverySubnetError(undefined);
- }
- }}
- onBlur={async (e) => {
- if (
- props.envOverrides().discoverySubnet ||
- props.discoveryMode() !== 'custom'
- ) {
- return;
- }
- const rawValue = e.currentTarget.value;
- props.setDiscoverySubnetDraft(rawValue);
- const trimmed = rawValue.trim();
- if (!trimmed) {
- props.setDiscoverySubnetError(
- 'Enter at least one subnet in CIDR format (e.g., 192.168.1.0/24)',
- );
- return;
- }
- if (!props.isValidCIDR(trimmed)) {
- props.setDiscoverySubnetError(
- 'Use CIDR format such as 192.168.1.0/24 (comma-separated for multiple)',
- );
- return;
- }
- props.setDiscoverySubnetError(undefined);
- await props.commitDiscoverySubnet(rawValue);
- }}
- onKeyDown={(e) => {
- if (e.key === 'Enter') {
- e.preventDefault();
- (e.currentTarget as HTMLInputElement).blur();
- }
- }}
- />
- <Show when={props.discoverySubnetError()}>
- <p class="text-xs text-red-600 dark:text-red-400">
- {props.discoverySubnetError()}
- </p>
- </Show>
- <Show when={!props.discoverySubnetError() && props.discoveryMode() === 'auto'}>
- <p class="text-xs text-muted">
- Auto scans all host network interfaces, which may include corporate or shared
- networks. Switch to a custom subnet for faster, more targeted scans.
- </p>
- </Show>
- <Show when={!props.discoverySubnetError() && props.discoveryMode() === 'custom'}>
- <p class="text-xs text-muted">
- Example: 192.168.1.0/24, 10.0.0.0/24 (comma-separated). Smaller ranges finish
- faster and avoid timeouts.
- </p>
- </Show>
- </div>
- </div>
- </Show>
-
- {/* Env override warning */}
- <Show
- when={props.envOverrides().discoveryEnabled || props.envOverrides().discoverySubnet}
- >
- <div class="rounded-md border border-amber-200 bg-amber-100 p-3 text-xs text-amber-800 dark:border-amber-700 dark:bg-amber-900 dark:text-amber-200">
- Discovery settings are locked by environment variables. Update the service
- configuration and restart Pulse to change them here.
- </div>
- </Show>
- </section>
-
- {/* Public URL Setting */}
- <section class="p-4 sm:p-6 space-y-4">
- <h4 class="flex items-center gap-2 text-sm font-medium text-base-content">
- <svg
- width="16"
- height="16"
- viewBox="0 0 24 24"
- fill="none"
- stroke="currentColor"
- stroke-width="2"
- >
- <path d="M10 13a5 5 0 007.54.54l3-3a5 5 0 00-7.07-7.07l-1.72 1.71"></path>
- <path d="M14 11a5 5 0 00-7.54-.54l-3 3a5 5 0 007.07 7.07l1.71-1.71"></path>
- </svg>
- Public URL
- </h4>
- <div class="space-y-2">
- <label class="text-sm font-medium text-base-content">
- Dashboard URL for Notifications
- </label>
- <p class="text-xs text-muted">
- The URL included in email alerts to link back to Pulse. Required for Docker
- deployments with custom ports.
- </p>
- <div class="relative">
- <input
- type="text"
- value={props.publicURL()}
- onInput={(e) => {
- if (!props.envOverrides().publicURL) {
- props.setPublicURL(e.currentTarget.value);
- props.setHasUnsavedChanges(true);
- }
- }}
- disabled={props.envOverrides().publicURL}
- placeholder="http://192.168.1.100:8080"
- class={`w-full min-h-10 sm:min-h-10 px-3 py-2.5 text-sm border rounded-md ${
- props.envOverrides().publicURL
- ? 'border-amber-300 dark:border-amber-600 bg-amber-50 dark:bg-amber-900 cursor-not-allowed opacity-75'
- : 'border-border bg-surface'
- }`}
- />
- {props.envOverrides().publicURL && (
- <div class="mt-2 p-2 bg-amber-100 dark:bg-amber-900 border border-amber-300 dark:border-amber-700 rounded text-xs text-amber-800 dark:text-amber-200">
- <div class="flex items-center gap-1">
- <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path
- stroke-linecap="round"
- stroke-linejoin="round"
- stroke-width="2"
- d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"
- />
- </svg>
- <span>Overridden by PULSE_PUBLIC_URL environment variable</span>
- </div>
- <div class="mt-1 text-amber-700 dark:text-amber-300">
- Remove the env var and restart to enable UI configuration
- </div>
- </div>
- )}
- </div>
- <p class="text-xs text-muted mt-1">
- Example: If you access Pulse at <code>http://myserver:8080</code>, enter that URL
- here. Leave empty to auto-detect (may not work correctly with Docker port mappings).
- </p>
- </div>
- </section>
-
- {/* CORS Settings Section */}
- <section class="p-4 sm:p-6 space-y-4">
- <h4 class="flex items-center gap-2 text-sm font-medium text-base-content">
- <svg
- width="16"
- height="16"
- viewBox="0 0 24 24"
- fill="none"
- stroke="currentColor"
- stroke-width="2"
- >
- <circle cx="12" cy="12" r="10"></circle>
- <path d="M2 12h20M12 2a15.3 15.3 0 014 10 15.3 15.3 0 01-4 10 15.3 15.3 0 01-4-10 15.3 15.3 0 014-10z"></path>
- </svg>
- Network Settings
- </h4>
- <div class="space-y-2">
- <label class="text-sm font-medium text-base-content">CORS Allowed Origins</label>
- <p class="text-xs text-muted">
- For reverse proxy setups (* = allow all, empty = same-origin only)
- </p>
- <div class="relative">
- <input
- type="text"
- value={props.allowedOrigins()}
- onInput={(e) => {
- if (!props.envOverrides().allowedOrigins) {
- props.setAllowedOrigins(e.currentTarget.value);
- props.setHasUnsavedChanges(true);
- }
- }}
- disabled={props.envOverrides().allowedOrigins}
- placeholder="* or https://example.com"
- class={`w-full min-h-10 sm:min-h-10 px-3 py-2.5 text-sm border rounded-md ${
- props.envOverrides().allowedOrigins
- ? 'border-amber-300 dark:border-amber-600 bg-amber-50 dark:bg-amber-900 cursor-not-allowed opacity-75'
- : 'border-border bg-surface'
- }`}
- />
- {props.envOverrides().allowedOrigins && (
- <div class="mt-2 p-2 bg-amber-100 dark:bg-amber-900 border border-amber-300 dark:border-amber-700 rounded text-xs text-amber-800 dark:text-amber-200">
- <div class="flex items-center gap-1">
- <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path
- stroke-linecap="round"
- stroke-linejoin="round"
- stroke-width="2"
- d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"
- />
- </svg>
- <span>Overridden by ALLOWED_ORIGINS environment variable</span>
- </div>
- <div class="mt-1 text-amber-700 dark:text-amber-300">
- Remove the env var and restart to enable UI configuration
- </div>
- </div>
- )}
- </div>
- </div>
- </section>
-
- {/* Embedding Section */}
- <section class="p-4 sm:p-6 space-y-4">
- <h4 class="flex items-center gap-2 text-sm font-medium text-base-content">
- <svg
- width="16"
- height="16"
- viewBox="0 0 24 24"
- fill="none"
- stroke="currentColor"
- stroke-width="2"
- >
- <rect x="3" y="4" width="18" height="14" rx="2"></rect>
- <path d="M7 20h10"></path>
- </svg>
- Embedding
- </h4>
- <p class="text-xs text-muted">
- Allow Pulse to be embedded in iframes (e.g., Homepage dashboard)
- </p>
- <div class="space-y-3">
- <div class="flex items-center gap-2">
- <input
- type="checkbox"
- id="allowEmbedding"
- checked={props.allowEmbedding()}
- onChange={(e) => {
- props.setAllowEmbedding(e.currentTarget.checked);
- props.setHasUnsavedChanges(true);
- }}
- class="h-5 w-5 sm:h-4 sm:w-4 rounded border-border text-blue-600 focus:ring-blue-500"
- />
- <label for="allowEmbedding" class="text-sm text-base-content">
- Allow iframe embedding
- </label>
- </div>
-
- <Show when={props.allowEmbedding()}>
- <div class="space-y-2">
- <label class="text-xs font-medium text-base-content">
- Allowed Embed Origins (optional)
- </label>
- <p class="text-xs text-muted">
- Comma-separated list of origins that can embed Pulse (leave empty for same-origin
- only)
- </p>
- <input
- type="text"
- value={props.allowedEmbedOrigins()}
- onChange={(e) => {
- props.setAllowedEmbedOrigins(e.currentTarget.value);
- props.setHasUnsavedChanges(true);
- }}
- placeholder="https://my.domain, https://dashboard.example.com"
- class="w-full min-h-10 sm:min-h-10 px-3 py-2.5 text-sm border rounded-md border-border bg-surface"
- />
- <p class="text-xs text-muted">
- Example: If Pulse is at <code>pulse.my.domain</code> and your dashboard is at{' '}
- <code>my.domain</code>, add <code>https://my.domain</code> here.
- </p>
- </div>
- </Show>
- </div>
- </section>
-
- {/* Webhook Security Section */}
- <section class="p-4 sm:p-6 space-y-4">
- <h3 class="text-sm font-semibold text-base-content flex items-center gap-2">
- <svg
- xmlns="http://www.w3.org/2000/svg"
- class="h-5 w-5 sm:h-4 sm:w-4"
- fill="none"
- viewBox="0 0 24 24"
- stroke="currentColor"
- >
- <path
- stroke-linecap="round"
- stroke-linejoin="round"
- stroke-width={2}
- d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"
- />
- </svg>
- Webhook Security
- </h3>
- <div class="space-y-3">
- <div>
- <label class="text-sm font-medium text-base-content">
- Allowed Private IP Ranges for Webhooks
- </label>
- <p class="text-xs text-muted mb-2">
- By default, webhooks to private IP addresses are blocked for security. Enter trusted
- CIDR ranges to allow webhooks to internal services (leave empty to block all private
- IPs).
- </p>
- <input
- type="text"
- value={props.webhookAllowedPrivateCIDRs()}
- onChange={(e) => {
- props.setWebhookAllowedPrivateCIDRs(e.currentTarget.value);
- props.setHasUnsavedChanges(true);
- }}
- placeholder="192.168.1.0/24, 10.0.0.0/8"
- class="w-full min-h-10 sm:min-h-10 px-3 py-2.5 text-sm border rounded-md border-border bg-surface"
- />
- <p class="text-xs text-muted mt-1">
- Example: <code>192.168.1.0/24,10.0.0.0/8</code> allows webhooks to these private
- networks. Localhost and cloud metadata services remain blocked.
- </p>
- </div>
- </div>
- </section>
-
- {/* Port Configuration Notice */}
- <div class="p-4 sm:p-6">
- <Card
- tone="warning"
- padding="sm"
- border={false}
- class="border border-amber-200 dark:border-amber-800"
- >
- <p class="text-xs text-amber-800 dark:text-amber-200 mb-2">
- <strong>Port Configuration:</strong> Use{' '}
- <code class="font-mono bg-amber-100 dark:bg-amber-800 px-1 rounded">
- systemctl edit pulse
- </code>
- </p>
- <p class="text-xs text-amber-700 dark:text-amber-300 font-mono">
- [Service]
- <br />
- Environment="FRONTEND_PORT=8080"
- <br />
- <span class="text-xs text-amber-600 dark:text-amber-400">
- Then restart: sudo systemctl restart pulse
- </span>
- </p>
- </Card>
- </div>
+ <NetworkDiscoverySection {...props} />
+ <NetworkBoundarySettingsSection {...props} />
</SettingsPanel>
);
};
diff --git a/frontend-modern/src/components/Settings/__tests__/monitoredSystemModelGuardrails.test.ts b/frontend-modern/src/components/Settings/__tests__/monitoredSystemModelGuardrails.test.ts
index b158783338..42fc302b9c 100644
--- a/frontend-modern/src/components/Settings/__tests__/monitoredSystemModelGuardrails.test.ts
+++ b/frontend-modern/src/components/Settings/__tests__/monitoredSystemModelGuardrails.test.ts
@@ -149,6 +149,8 @@ import proxmoxSettingsPanelSource from '../ProxmoxSettingsPanel.tsx?raw';
import proxmoxSettingsPanelStateSource from '../useProxmoxSettingsPanelState.ts?raw';
import relayOnboardingCardSource from '@/components/Dashboard/RelayOnboardingCard.tsx?raw';
import generalSettingsPanelSource from '../GeneralSettingsPanel.tsx?raw';
+import networkBoundarySettingsSectionSource from '../NetworkBoundarySettingsSection.tsx?raw';
+import networkDiscoverySectionSource from '../NetworkDiscoverySection.tsx?raw';
import networkSettingsPanelSource from '../NetworkSettingsPanel.tsx?raw';
import recoverySettingsPanelSource from '../RecoverySettingsPanel.tsx?raw';
import rbacFeatureGateSectionSource from '../RBACFeatureGateSection.tsx?raw';
@@ -955,8 +957,11 @@ describe('monitored-system model guardrails', () => {
expect(generalSettingsPanelSource).not.toContain('const PVE_POLLING_PRESETS =');
expect(recoverySettingsPanelSource).toContain('@/utils/systemSettingsPresentation');
expect(recoverySettingsPanelSource).not.toContain('const BACKUP_INTERVAL_OPTIONS =');
- expect(networkSettingsPanelSource).toContain('@/utils/systemSettingsPresentation');
- expect(networkSettingsPanelSource).not.toContain('const COMMON_DISCOVERY_SUBNETS =');
+ expect(networkSettingsPanelSource).toContain('./NetworkDiscoverySection');
+ expect(networkSettingsPanelSource).toContain('./NetworkBoundarySettingsSection');
+ expect(networkDiscoverySectionSource).toContain('@/utils/systemSettingsPresentation');
+ expect(networkDiscoverySectionSource).not.toContain('const COMMON_DISCOVERY_SUBNETS =');
+ expect(networkBoundarySettingsSectionSource).not.toContain('const COMMON_DISCOVERY_SUBNETS =');
expect(systemSettingsPresentationSource).toContain('export const PVE_POLLING_PRESETS');
expect(systemSettingsPresentationSource).toContain('export const BACKUP_INTERVAL_OPTIONS');
expect(systemSettingsPresentationSource).toContain('export const COMMON_DISCOVERY_SUBNETS');
diff --git a/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts b/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts
index 26548c3d98..053f3dd513 100644
--- a/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts
+++ b/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts
@@ -37,7 +37,10 @@ import aiSettingsStateSource from '../useAISettingsState.ts?raw';
import diagnosticsModelSource from '../diagnosticsModel.ts?raw';
import diagnosticsPanelSource from '../DiagnosticsPanel.tsx?raw';
import diagnosticsResultsPanelSource from '../DiagnosticsResultsPanel.tsx?raw';
+import networkBoundarySettingsSectionSource from '../NetworkBoundarySettingsSection.tsx?raw';
+import networkDiscoverySectionSource from '../NetworkDiscoverySection.tsx?raw';
import networkSettingsPanelSource from '../NetworkSettingsPanel.tsx?raw';
+import networkSettingsModelSource from '../networkSettingsModel.ts?raw';
import copyCommandBlockSource from '../CopyCommandBlock.tsx?raw';
import updateInstallGuideSource from '../UpdateInstallGuide.tsx?raw';
import updatesSettingsModelSource from '../updatesSettingsModel.ts?raw';
@@ -135,6 +138,9 @@ const extractedModules = [
'../diagnosticsModel.ts',
'../DiagnosticsPanel.tsx',
'../DiagnosticsResultsPanel.tsx',
+ '../NetworkBoundarySettingsSection.tsx',
+ '../NetworkDiscoverySection.tsx',
+ '../networkSettingsModel.ts',
'../CopyCommandBlock.tsx',
'../UpdateInstallGuide.tsx',
'../ReportingPanel.tsx',
@@ -419,6 +425,26 @@ describe('Settings architecture guardrails', () => {
expect(systemLogsPanelStateSource).toContain('notificationStore.success');
});
+ it('keeps network settings split into shell, section, and model owners', () => {
+ expect(networkSettingsPanelSource).toContain('./NetworkDiscoverySection');
+ expect(networkSettingsPanelSource).toContain('./NetworkBoundarySettingsSection');
+ expect(networkSettingsPanelSource).toContain('./networkSettingsModel');
+ expect(networkSettingsPanelSource).not.toContain('COMMON_DISCOVERY_SUBNETS');
+ expect(networkSettingsPanelSource).not.toContain('Dashboard URL for Notifications');
+ expect(networkSettingsPanelSource).not.toContain('Allowed Private IP Ranges for Webhooks');
+ expect(networkDiscoverySectionSource).toContain('COMMON_DISCOVERY_SUBNETS');
+ expect(networkDiscoverySectionSource).toContain('title="Network discovery"');
+ expect(networkDiscoverySectionSource).toContain('Configuration priority');
+ expect(networkBoundarySettingsSectionSource).toContain('Dashboard URL for Notifications');
+ expect(networkBoundarySettingsSectionSource).toContain(
+ 'Allowed Private IP Ranges for Webhooks',
+ );
+ expect(networkBoundarySettingsSectionSource).toContain('EnvironmentOverrideAlert');
+ expect(networkSettingsModelSource).toContain('export interface NetworkSettingsPanelProps');
+ expect(networkSettingsModelSource).toContain('export type NetworkDiscoverySectionProps');
+ expect(networkSettingsModelSource).toContain('export type NetworkBoundarySettingsSectionProps');
+ });
+
it('does not re-inline extracted tab and header metadata definitions', () => {
expect(settingsSource).not.toMatch(/\b(?:const|let|var)\s+baseTabGroups\s*=/);
expect(settingsSource).not.toMatch(/\b(?:const|let|var)\s+SETTINGS_HEADER_META\s*=/);
diff --git a/frontend-modern/src/components/Settings/networkSettingsModel.ts b/frontend-modern/src/components/Settings/networkSettingsModel.ts
new file mode 100644
index 0000000000..64c646daa4
--- /dev/null
+++ b/frontend-modern/src/components/Settings/networkSettingsModel.ts
@@ -0,0 +1,71 @@
+import type { Accessor, Setter } from 'solid-js';
+
+export interface NetworkSettingsPanelProps {
+ discoveryEnabled: Accessor<boolean>;
+ discoveryMode: Accessor<'auto' | 'custom'>;
+ discoverySubnetDraft: Accessor<string>;
+ discoverySubnetError: Accessor<string | undefined>;
+ savingDiscoverySettings: Accessor<boolean>;
+ envOverrides: Accessor<Record<string, boolean>>;
+ allowedOrigins: Accessor<string>;
+ setAllowedOrigins: Setter<string>;
+ allowEmbedding: Accessor<boolean>;
+ setAllowEmbedding: Setter<boolean>;
+ allowedEmbedOrigins: Accessor<string>;
+ setAllowedEmbedOrigins: Setter<string>;
+ webhookAllowedPrivateCIDRs: Accessor<string>;
+ setWebhookAllowedPrivateCIDRs: Setter<string>;
+ publicURL: Accessor<string>;
+ setPublicURL: Setter<string>;
+ handleDiscoveryEnabledChange: (enabled: boolean) => Promise<boolean>;
+ handleDiscoveryModeChange: (mode: 'auto' | 'custom') => Promise<void>;
+ setDiscoveryMode: Setter<'auto' | 'custom'>;
+ setDiscoverySubnetDraft: Setter<string>;
+ setDiscoverySubnetError: Setter<string | undefined>;
+ setLastCustomSubnet: Setter<string>;
+ commitDiscoverySubnet: (value: string) => Promise<boolean>;
+ setHasUnsavedChanges: Setter<boolean>;
+ parseSubnetList: (value: string) => string[];
+ normalizeSubnetList: (value: string) => string;
+ isValidCIDR: (value: string) => boolean;
+ currentDraftSubnetValue: () => string;
+ discoverySubnetInputRef?: (el: HTMLInputElement) => void;
+}
+
+export type NetworkDiscoverySectionProps = Pick<
+ NetworkSettingsPanelProps,
+ | 'commitDiscoverySubnet'
+ | 'currentDraftSubnetValue'
+ | 'discoveryEnabled'
+ | 'discoveryMode'
+ | 'discoverySubnetDraft'
+ | 'discoverySubnetError'
+ | 'discoverySubnetInputRef'
+ | 'envOverrides'
+ | 'handleDiscoveryEnabledChange'
+ | 'handleDiscoveryModeChange'
+ | 'isValidCIDR'
+ | 'normalizeSubnetList'
+ | 'parseSubnetList'
+ | 'savingDiscoverySettings'
+ | 'setDiscoveryMode'
+ | 'setDiscoverySubnetDraft'
+ | 'setDiscoverySubnetError'
+ | 'setLastCustomSubnet'
+>;
+
+export type NetworkBoundarySettingsSectionProps = Pick<
+ NetworkSettingsPanelProps,
+ | 'allowEmbedding'
+ | 'allowedEmbedOrigins'
+ | 'allowedOrigins'
+ | 'envOverrides'
+ | 'publicURL'
+ | 'setAllowEmbedding'
+ | 'setAllowedEmbedOrigins'
+ | 'setAllowedOrigins'
+ | 'setHasUnsavedChanges'
+ | 'setPublicURL'
+ | 'setWebhookAllowedPrivateCIDRs'
+ | 'webhookAllowedPrivateCIDRs'
+>;
diff --git a/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts b/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts
index 11c2763c83..26f14602bb 100644
--- a/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts
+++ b/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts
@@ -27,6 +27,10 @@ import updatesSettingsModelSource from '@/components/Settings/updatesSettingsMod
import diagnosticsModelSource from '@/components/Settings/diagnosticsModel.ts?raw';
import diagnosticsResultsPanelSource from '@/components/Settings/DiagnosticsResultsPanel.tsx?raw';
import diagnosticsStateSource from '@/components/Settings/useDiagnosticsPanelState.ts?raw';
+import networkBoundarySettingsSectionSource from '@/components/Settings/NetworkBoundarySettingsSection.tsx?raw';
+import networkDiscoverySectionSource from '@/components/Settings/NetworkDiscoverySection.tsx?raw';
+import networkSettingsPanelSource from '@/components/Settings/NetworkSettingsPanel.tsx?raw';
+import networkSettingsModelSource from '@/components/Settings/networkSettingsModel.ts?raw';
import reportingPresentationSource from '@/utils/reportingPresentation.ts?raw';
import updatesPresentationSource from '@/utils/updatesPresentation.ts?raw';
import environmentLockBadgeSource from '@/components/shared/EnvironmentLockBadge.tsx?raw';
@@ -814,6 +818,14 @@ describe('frontend resource type boundaries', () => {
);
expect(systemSettingsPresentationSource).toContain('export function getBackupIntervalSummary');
expect(systemSettingsPresentationSource).toContain('export const COMMON_DISCOVERY_SUBNETS');
+ expect(networkSettingsPanelSource).toContain('./NetworkDiscoverySection');
+ expect(networkSettingsPanelSource).toContain('./NetworkBoundarySettingsSection');
+ expect(networkDiscoverySectionSource).toContain('COMMON_DISCOVERY_SUBNETS');
+ expect(networkBoundarySettingsSectionSource).toContain(
+ 'Allowed Private IP Ranges for Webhooks',
+ );
+ expect(networkSettingsModelSource).toContain('export type NetworkDiscoverySectionProps');
+ expect(networkSettingsModelSource).toContain('export type NetworkBoundarySettingsSectionProps');
expect(reportingPanelSource).toContain('@/utils/upgradePresentation');
expect(reportingPanelSource).toContain('@/components/Settings/useReportingPanelState');
expect(reportingPanelSource).toContain('@/components/Settings/reportingPanelModel');
diff --git a/scripts/release_control/subsystem_lookup_test.py b/scripts/release_control/subsystem_lookup_test.py
index e5d8903f6b..3c24b1171c 100644
--- a/scripts/release_control/subsystem_lookup_test.py
+++ b/scripts/release_control/subsystem_lookup_test.py
@@ -1785,6 +1785,34 @@ class SubsystemLookupTest(unittest.TestCase):
["frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts"],
)
+ def test_lookup_paths_assigns_network_settings_model_to_frontend_primitives(self) -> None:
+ result = lookup_paths(["frontend-modern/src/components/Settings/networkSettingsModel.ts"])
+ self.assertEqual(result["unowned_runtime_files"], [])
+ self.assertEqual(
+ {item["subsystem"] for item in result["impacted_subsystems"]},
+ {"frontend-primitives"},
+ )
+ file_entry = result["files"][0]
+ self.assertEqual(file_entry["classification"], "runtime")
+ self.assertEqual(
+ {match["subsystem"] for match in file_entry["matches"]},
+ {"frontend-primitives"},
+ )
+ match = file_entry["matches"][0]
+ self.assertEqual(
+ match["contract"],
+ "docs/release-control/v6/internal/subsystems/frontend-primitives.md",
+ )
+ self.assertEqual(match["lane_context"]["lane_id"], "L8")
+ self.assertEqual(
+ match["verification_requirement"]["id"],
+ "settings-shell-and-framing",
+ )
+ self.assertEqual(
+ match["verification_requirement"]["exact_files"],
+ ["frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts"],
+ )
+
def test_lookup_paths_assigns_security_auth_panel_to_frontend_primitives(self) -> None:
result = lookup_paths(["frontend-modern/src/components/Settings/SecurityAuthPanel.tsx"])
self.assertEqual(result["unowned_runtime_files"], [])