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.

Adopt SettingsPanel with icons across settings pages

rcourtmana8f61147b7ee
diff --git a/frontend-modern/src/components/Settings/AgentProfilesPanel.tsx b/frontend-modern/src/components/Settings/AgentProfilesPanel.tsx
index 9d3384dc13..51cc11538e 100644
--- a/frontend-modern/src/components/Settings/AgentProfilesPanel.tsx
+++ b/frontend-modern/src/components/Settings/AgentProfilesPanel.tsx
@@ -1,6 +1,7 @@
import { Component, createSignal, createMemo, onMount, Show, For } from 'solid-js';
import { useWebSocket } from '@/App';
import { Card } from '@/components/shared/Card';
+import SettingsPanel from '@/components/shared/SettingsPanel';
import { AgentProfilesAPI, type AgentProfile, type AgentProfileAssignment, type ProfileSuggestion } from '@/api/agentProfiles';
import { LicenseAPI } from '@/api/license';
import { notificationStore } from '@/stores/notifications';
@@ -266,7 +267,7 @@ export const AgentProfilesPanel: Component = () => {
href="https://pulserelay.pro/"
target="_blank"
rel="noopener noreferrer"
- class="inline-flex items-center gap-2 rounded-lg bg-gradient-to-r from-amber-500 to-orange-500 px-4 py-2 text-sm font-medium text-white transition-all hover:from-amber-600 hover:to-orange-600"
+ class="inline-flex items-center gap-2 rounded-lg bg-amber-500 px-4 py-2 text-sm font-medium text-white transition-all hover:bg-amber-600"
>
<Crown class="w-4 h-4" />
Upgrade to Pro
@@ -274,398 +275,390 @@ export const AgentProfilesPanel: Component = () => {
</Card>
}
>
- <div class="space-y-6">
- {/* Profiles Section */}
- <Card padding="lg" class="space-y-4">
- <div class="flex items-center justify-between">
- <div class="flex items-center gap-3">
- <div class="flex items-center justify-center w-10 h-10 rounded-lg bg-blue-100 dark:bg-blue-900/30">
- <Settings class="w-5 h-5 text-blue-600 dark:text-blue-400" />
- </div>
- <div>
- <h3 class="text-base font-semibold text-gray-900 dark:text-gray-100">Configuration Profiles</h3>
- <p class="text-sm text-gray-600 dark:text-gray-400">Reusable agent configurations</p>
- </div>
- </div>
- <div class="flex items-center gap-2">
- <button
- type="button"
- onClick={handleSuggest}
- class="inline-flex items-center gap-2 rounded-lg bg-purple-600 px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-purple-700"
- >
- <Sparkles class="w-4 h-4" />
- Suggest Profile
- </button>
- <button
- type="button"
- onClick={handleCreate}
- class="inline-flex items-center gap-2 rounded-lg bg-blue-600 px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-blue-700"
- >
- <Plus class="w-4 h-4" />
- New Profile
- </button>
- </div>
- </div>
-
- <Show when={loading()}>
- <div class="flex items-center justify-center py-8">
- <div class="animate-spin rounded-full h-6 w-6 border-b-2 border-blue-500" />
- </div>
- </Show>
+ <div class="space-y-6">
+ {/* Profiles Section */}
+ <SettingsPanel
+ title="Configuration Profiles"
+ description="Reusable agent configurations"
+ icon={<Settings class="w-5 h-5" strokeWidth={2} />}
+ bodyClass="space-y-4"
+ action={
+ <div class="flex items-center gap-2">
+ <button
+ type="button"
+ onClick={handleSuggest}
+ class="inline-flex items-center gap-2 rounded-lg bg-purple-600 px-3 py-1.5 text-xs font-medium text-white transition-colors hover:bg-purple-700 sm:px-4 sm:py-2 sm:text-sm"
+ >
+ <Sparkles class="w-4 h-4" />
+ <span class="hidden sm:inline">Suggest Profile</span>
+ <span class="sm:hidden">Suggest</span>
+ </button>
+ <button
+ type="button"
+ onClick={handleCreate}
+ class="inline-flex items-center gap-2 rounded-lg bg-blue-600 px-3 py-1.5 text-xs font-medium text-white transition-colors hover:bg-blue-700 sm:px-4 sm:py-2 sm:text-sm"
+ >
+ <Plus class="w-4 h-4" />
+ <span class="hidden sm:inline">New Profile</span>
+ <span class="sm:hidden">New</span>
+ </button>
+ </div>
+ }
+ >
+ <Show when={loading()}>
+ <div class="flex items-center justify-center py-8">
+ <div class="animate-spin rounded-full h-6 w-6 border-b-2 border-blue-500" />
+ </div>
+ </Show>
- <Show when={!loading() && profiles().length === 0}>
- <div class="text-center py-8 text-gray-500 dark:text-gray-400">
- <Settings class="w-12 h-12 mx-auto mb-3 opacity-50" />
- <p class="text-sm">No profiles yet. Create one to get started.</p>
- </div>
- </Show>
-
- <Show when={!loading() && profiles().length > 0}>
- <div class="overflow-x-auto">
- <table class="w-full text-sm">
- <thead>
- <tr class="border-b border-gray-200 dark:border-gray-700">
- <th class="text-left py-2 px-3 font-medium text-gray-600 dark:text-gray-400">Name</th>
- <th class="text-left py-2 px-3 font-medium text-gray-600 dark:text-gray-400">Settings</th>
- <th class="text-left py-2 px-3 font-medium text-gray-600 dark:text-gray-400">Agents</th>
- <th class="text-right py-2 px-3 font-medium text-gray-600 dark:text-gray-400">Actions</th>
- </tr>
- </thead>
- <tbody>
- <For each={profiles()}>
- {(profile) => (
- <tr class="border-b border-gray-100 dark:border-gray-800 hover:bg-gray-50 dark:hover:bg-gray-800/50">
- <td class="py-3 px-3">
- <span class="font-medium text-gray-900 dark:text-gray-100">{profile.name}</span>
- </td>
- <td class="py-3 px-3">
- <span class="text-gray-600 dark:text-gray-400">{getSettingsCount(profile)}</span>
- </td>
- <td class="py-3 px-3">
- <span class="inline-flex items-center gap-1 text-gray-600 dark:text-gray-400">
- <Users class="w-4 h-4" />
- {getAssignmentCount(profile.id)}
- </span>
- </td>
- <td class="py-3 px-3 text-right">
- <div class="inline-flex items-center gap-1">
- <button
- type="button"
- onClick={() => handleEdit(profile)}
- class="p-1.5 rounded-md text-gray-500 hover:text-blue-600 hover:bg-blue-50 dark:hover:text-blue-400 dark:hover:bg-blue-900/30"
- title="Edit profile"
- >
- <Pencil class="w-4 h-4" />
- </button>
- <button
- type="button"
- onClick={() => handleDelete(profile)}
- class="p-1.5 rounded-md text-gray-500 hover:text-red-600 hover:bg-red-50 dark:hover:text-red-400 dark:hover:bg-red-900/30"
- title="Delete profile"
- >
- <Trash2 class="w-4 h-4" />
- </button>
- </div>
- </td>
+ <Show when={!loading() && profiles().length === 0}>
+ <div class="text-center py-8 text-gray-500 dark:text-gray-400">
+ <Settings class="w-12 h-12 mx-auto mb-3 opacity-50" />
+ <p class="text-sm">No profiles yet. Create one to get started.</p>
+ </div>
+ </Show>
+
+ <Show when={!loading() && profiles().length > 0}>
+ <div class="overflow-x-auto">
+ <table class="w-full text-sm">
+ <thead>
+ <tr class="border-b border-gray-200 dark:border-gray-700">
+ <th class="text-left py-2 px-3 font-medium text-gray-600 dark:text-gray-400">Name</th>
+ <th class="text-left py-2 px-3 font-medium text-gray-600 dark:text-gray-400">Settings</th>
+ <th class="text-left py-2 px-3 font-medium text-gray-600 dark:text-gray-400">Agents</th>
+ <th class="text-right py-2 px-3 font-medium text-gray-600 dark:text-gray-400">Actions</th>
</tr>
- )}
- </For>
- </tbody>
- </table>
- </div>
- </Show>
- </Card>
-
- {/* Assignments Section */}
- <Card padding="lg" class="space-y-4">
- <div class="flex items-center gap-3">
- <div class="flex items-center justify-center w-10 h-10 rounded-lg bg-green-100 dark:bg-green-900/30">
- <Users class="w-5 h-5 text-green-600 dark:text-green-400" />
- </div>
- <div>
- <h3 class="text-base font-semibold text-gray-900 dark:text-gray-100">Agent Assignments</h3>
- <p class="text-sm text-gray-600 dark:text-gray-400">Assign profiles to connected agents</p>
- </div>
- </div>
-
- <Show when={connectedAgents().length === 0}>
- <div class="text-center py-8 text-gray-500 dark:text-gray-400">
- <Users class="w-12 h-12 mx-auto mb-3 opacity-50" />
- <p class="text-sm">No agents connected. Install an agent to assign profiles.</p>
- </div>
- </Show>
-
- <Show when={connectedAgents().length > 0}>
- <div class="overflow-x-auto">
- <table class="w-full text-sm">
- <thead>
- <tr class="border-b border-gray-200 dark:border-gray-700">
- <th class="text-left py-2 px-3 font-medium text-gray-600 dark:text-gray-400">Agent</th>
- <th class="text-left py-2 px-3 font-medium text-gray-600 dark:text-gray-400">Profile</th>
- <th class="text-left py-2 px-3 font-medium text-gray-600 dark:text-gray-400">Status</th>
- <th class="text-left py-2 px-3 font-medium text-gray-600 dark:text-gray-400">Last Seen</th>
- </tr>
- </thead>
- <tbody>
- <For each={connectedAgents()}>
- {(agent) => {
- const assignment = () => getAgentAssignment(agent.id);
- const isOnline = () => agent.status?.toLowerCase() === 'online' || agent.status?.toLowerCase() === 'running';
-
- return (
- <tr class="border-b border-gray-100 dark:border-gray-800 hover:bg-gray-50 dark:hover:bg-gray-800/50">
- <td class="py-3 px-3">
- <div>
- <span class="font-medium text-gray-900 dark:text-gray-100">
- {agent.displayName || agent.hostname}
+ </thead>
+ <tbody>
+ <For each={profiles()}>
+ {(profile) => (
+ <tr class="border-b border-gray-100 dark:border-gray-800 hover:bg-gray-50 dark:hover:bg-gray-800/50">
+ <td class="py-3 px-3">
+ <span class="font-medium text-gray-900 dark:text-gray-100">{profile.name}</span>
+ </td>
+ <td class="py-3 px-3">
+ <span class="text-gray-600 dark:text-gray-400">{getSettingsCount(profile)}</span>
+ </td>
+ <td class="py-3 px-3">
+ <span class="inline-flex items-center gap-1 text-gray-600 dark:text-gray-400">
+ <Users class="w-4 h-4" />
+ {getAssignmentCount(profile.id)}
</span>
- <Show when={agent.displayName && agent.hostname !== agent.displayName}>
- <span class="ml-2 text-xs text-gray-500 dark:text-gray-400">
- ({agent.hostname})
+ </td>
+ <td class="py-3 px-3 text-right">
+ <div class="inline-flex items-center gap-1">
+ <button
+ type="button"
+ onClick={() => handleEdit(profile)}
+ class="p-1.5 rounded-md text-gray-500 hover:text-blue-600 hover:bg-blue-50 dark:hover:text-blue-400 dark:hover:bg-blue-900/30"
+ title="Edit profile"
+ >
+ <Pencil class="w-4 h-4" />
+ </button>
+ <button
+ type="button"
+ onClick={() => handleDelete(profile)}
+ class="p-1.5 rounded-md text-gray-500 hover:text-red-600 hover:bg-red-50 dark:hover:text-red-400 dark:hover:bg-red-900/30"
+ title="Delete profile"
+ >
+ <Trash2 class="w-4 h-4" />
+ </button>
+ </div>
+ </td>
+ </tr>
+ )}
+ </For>
+ </tbody>
+ </table>
+ </div>
+ </Show>
+ </SettingsPanel>
+
+ {/* Assignments Section */}
+ <SettingsPanel
+ title="Agent Assignments"
+ description="Assign profiles to connected agents"
+ icon={<Users class="w-5 h-5" strokeWidth={2} />}
+ bodyClass="space-y-4"
+ >
+ <Show when={connectedAgents().length === 0}>
+ <div class="text-center py-8 text-gray-500 dark:text-gray-400">
+ <Users class="w-12 h-12 mx-auto mb-3 opacity-50" />
+ <p class="text-sm">No agents connected. Install an agent to assign profiles.</p>
+ </div>
+ </Show>
+
+ <Show when={connectedAgents().length > 0}>
+ <div class="overflow-x-auto">
+ <table class="w-full text-sm">
+ <thead>
+ <tr class="border-b border-gray-200 dark:border-gray-700">
+ <th class="text-left py-2 px-3 font-medium text-gray-600 dark:text-gray-400">Agent</th>
+ <th class="text-left py-2 px-3 font-medium text-gray-600 dark:text-gray-400">Profile</th>
+ <th class="text-left py-2 px-3 font-medium text-gray-600 dark:text-gray-400">Status</th>
+ <th class="text-left py-2 px-3 font-medium text-gray-600 dark:text-gray-400">Last Seen</th>
+ </tr>
+ </thead>
+ <tbody>
+ <For each={connectedAgents()}>
+ {(agent) => {
+ const assignment = () => getAgentAssignment(agent.id);
+ const isOnline = () => agent.status?.toLowerCase() === 'online' || agent.status?.toLowerCase() === 'running';
+
+ return (
+ <tr class="border-b border-gray-100 dark:border-gray-800 hover:bg-gray-50 dark:hover:bg-gray-800/50">
+ <td class="py-3 px-3">
+ <div>
+ <span class="font-medium text-gray-900 dark:text-gray-100">
+ {agent.displayName || agent.hostname}
+ </span>
+ <Show when={agent.displayName && agent.hostname !== agent.displayName}>
+ <span class="ml-2 text-xs text-gray-500 dark:text-gray-400">
+ ({agent.hostname})
+ </span>
+ </Show>
+ </div>
+ </td>
+ <td class="py-3 px-3">
+ <select
+ value={assignment()?.profile_id || ''}
+ onChange={(e) => handleAssign(agent.id, e.currentTarget.value)}
+ class="rounded-md border border-gray-300 bg-white px-2 py-1 text-sm text-gray-900 shadow-sm focus:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-100"
+ >
+ <option value="">No profile</option>
+ <For each={profiles()}>
+ {(profile) => (
+ <option value={profile.id}>{profile.name}</option>
+ )}
+ </For>
+ </select>
+ </td>
+ <td class="py-3 px-3">
+ <span class={`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${isOnline()
+ ? 'bg-green-100 text-green-700 dark:bg-green-900/40 dark:text-green-300'
+ : 'bg-gray-100 text-gray-600 dark:bg-gray-800 dark:text-gray-400'
+ }`}>
+ {isOnline() ? 'Online' : 'Offline'}
</span>
- </Show>
- </div>
- </td>
- <td class="py-3 px-3">
- <select
- value={assignment()?.profile_id || ''}
- onChange={(e) => handleAssign(agent.id, e.currentTarget.value)}
- class="rounded-md border border-gray-300 bg-white px-2 py-1 text-sm text-gray-900 shadow-sm focus:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-100"
- >
- <option value="">No profile</option>
- <For each={profiles()}>
- {(profile) => (
- <option value={profile.id}>{profile.name}</option>
- )}
- </For>
- </select>
- </td>
- <td class="py-3 px-3">
- <span class={`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${isOnline()
- ? 'bg-green-100 text-green-700 dark:bg-green-900/40 dark:text-green-300'
- : 'bg-gray-100 text-gray-600 dark:bg-gray-800 dark:text-gray-400'
- }`}>
- {isOnline() ? 'Online' : 'Offline'}
- </span>
- </td>
- <td class="py-3 px-3 text-gray-600 dark:text-gray-400">
- {agent.lastSeen ? formatRelativeTime(agent.lastSeen) : 'Never'}
- </td>
- </tr>
- );
- }}
- </For>
- </tbody>
- </table>
- </div>
- </Show>
- </Card>
-
- {/* Profile Modal */}
- <Show when={showModal()}>
- <div class="fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm">
- <div class="w-full max-w-lg bg-white dark:bg-gray-900 rounded-xl shadow-2xl border border-gray-200 dark:border-gray-700 mx-4">
- <div class="flex items-center justify-between px-6 py-4 border-b border-gray-200 dark:border-gray-700">
- <h3 class="text-lg font-semibold text-gray-900 dark:text-gray-100">
- {editingProfile() ? 'Edit Profile' : 'New Profile'}
- </h3>
- <button
- type="button"
- onClick={() => setShowModal(false)}
- class="p-1.5 rounded-md text-gray-500 hover:text-gray-700 hover:bg-gray-100 dark:hover:text-gray-300 dark:hover:bg-gray-800"
- >
- <svg class="w-5 h-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
- </svg>
- </button>
- </div>
-
- <div class="px-6 py-4 space-y-4 max-h-[60vh] overflow-y-auto">
- {/* Profile Name */}
- <div class="space-y-1">
- <label class="block text-sm font-medium text-gray-700 dark:text-gray-300">
- Profile Name
- </label>
- <input
- type="text"
- value={formName()}
- onInput={(e) => setFormName(e.currentTarget.value)}
- placeholder="e.g., Production Servers"
- class="w-full rounded-lg border border-gray-300 bg-white px-3 py-2 text-sm text-gray-900 shadow-sm focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-200 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-100 dark:focus:border-blue-400 dark:focus:ring-blue-800/60"
- />
+ </td>
+ <td class="py-3 px-3 text-gray-600 dark:text-gray-400">
+ {agent.lastSeen ? formatRelativeTime(agent.lastSeen) : 'Never'}
+ </td>
+ </tr>
+ );
+ }}
+ </For>
+ </tbody>
+ </table>
</div>
+ </Show>
+ </SettingsPanel>
+
+ {/* Profile Modal */}
+ <Show when={showModal()}>
+ <div class="fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm">
+ <div class="w-full max-w-lg bg-white dark:bg-gray-900 rounded-xl shadow-2xl border border-gray-200 dark:border-gray-700 mx-4">
+ <div class="flex items-center justify-between px-6 py-4 border-b border-gray-200 dark:border-gray-700">
+ <h3 class="text-lg font-semibold text-gray-900 dark:text-gray-100">
+ {editingProfile() ? 'Edit Profile' : 'New Profile'}
+ </h3>
+ <button
+ type="button"
+ onClick={() => setShowModal(false)}
+ class="p-1.5 rounded-md text-gray-500 hover:text-gray-700 hover:bg-gray-100 dark:hover:text-gray-300 dark:hover:bg-gray-800"
+ >
+ <svg class="w-5 h-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
+ </svg>
+ </button>
+ </div>
+
+ <div class="px-6 py-4 space-y-4 max-h-[60vh] overflow-y-auto">
+ {/* Profile Name */}
+ <div class="space-y-1">
+ <label class="block text-sm font-medium text-gray-700 dark:text-gray-300">
+ Profile Name
+ </label>
+ <input
+ type="text"
+ value={formName()}
+ onInput={(e) => setFormName(e.currentTarget.value)}
+ placeholder="e.g., Production Servers"
+ class="w-full rounded-lg border border-gray-300 bg-white px-3 py-2 text-sm text-gray-900 shadow-sm focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-200 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-100 dark:focus:border-blue-400 dark:focus:ring-blue-800/60"
+ />
+ </div>
- {/* Profile Description */}
- <div class="space-y-1">
- <label class="block text-sm font-medium text-gray-700 dark:text-gray-300">
- Description <span class="text-gray-400 font-normal">(optional)</span>
- </label>
- <textarea
- value={formDescription()}
- onInput={(e) => setFormDescription(e.currentTarget.value)}
- placeholder="What is this profile for?"
- rows={2}
- class="w-full rounded-lg border border-gray-300 bg-white px-3 py-2 text-sm text-gray-900 shadow-sm focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-200 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-100 dark:focus:border-blue-400 dark:focus:ring-blue-800/60 resize-none"
- />
- </div>
+ {/* Profile Description */}
+ <div class="space-y-1">
+ <label class="block text-sm font-medium text-gray-700 dark:text-gray-300">
+ Description <span class="text-gray-400 font-normal">(optional)</span>
+ </label>
+ <textarea
+ value={formDescription()}
+ onInput={(e) => setFormDescription(e.currentTarget.value)}
+ placeholder="What is this profile for?"
+ rows={2}
+ class="w-full rounded-lg border border-gray-300 bg-white px-3 py-2 text-sm text-gray-900 shadow-sm focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-200 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-100 dark:focus:border-blue-400 dark:focus:ring-blue-800/60 resize-none"
+ />
+ </div>
- {/* Settings */}
- <div class="space-y-3">
- <label class="block text-sm font-medium text-gray-700 dark:text-gray-300">
- Settings
- </label>
-
- <For each={KNOWN_SETTINGS}>
- {(setting) => (
- <div class="rounded-lg border border-gray-200 dark:border-gray-700 p-3 space-y-1">
- <div class="flex items-center justify-between">
- <label class="text-sm font-medium text-gray-700 dark:text-gray-300">
- {setting.label}
- </label>
- <Show when={setting.type === 'boolean'}>
- <button
- type="button"
- onClick={() => {
- const current = formSettings()[setting.key];
- if (current === undefined) {
- updateSetting(setting.key, true);
- } else if (current === true) {
- updateSetting(setting.key, false);
- } else {
- updateSetting(setting.key, undefined);
- }
- }}
- class={`relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${formSettings()[setting.key] === true
- ? 'bg-blue-600'
- : formSettings()[setting.key] === false
- ? 'bg-gray-400'
- : 'bg-gray-200 dark:bg-gray-700'
- }`}
- >
- <span
- class={`inline-block h-4 w-4 transform rounded-full bg-white transition-transform ${formSettings()[setting.key] === true
- ? 'translate-x-6'
- : formSettings()[setting.key] === false
- ? 'translate-x-1'
- : 'translate-x-3'
- }`}
- />
- </button>
- </Show>
- <Show when={setting.type === 'select'}>
- <select
- value={(formSettings()[setting.key] as string) || ''}
- onChange={(e) => updateSetting(setting.key, e.currentTarget.value || undefined)}
- class="rounded-md border border-gray-300 bg-white px-2 py-1 text-sm text-gray-900 shadow-sm focus:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-100"
- >
- <option value="">Default</option>
- <For each={(setting as SelectSetting).options}>
- {(opt) => <option value={opt}>{opt}</option>}
- </For>
- </select>
- </Show>
- <Show when={setting.type === 'duration'}>
- <input
- type="text"
- value={(formSettings()[setting.key] as string) || ''}
- onInput={(e) => updateSetting(setting.key, e.currentTarget.value || undefined)}
- placeholder="30s"
- class="w-24 rounded-md border border-gray-300 bg-white px-2 py-1 text-sm text-gray-900 shadow-sm focus:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-100"
- />
- </Show>
- <Show when={setting.type === 'string'}>
- <input
- type="text"
- value={(formSettings()[setting.key] as string) || ''}
- onInput={(e) => updateSetting(setting.key, e.currentTarget.value || undefined)}
- placeholder={(setting as StringSetting).placeholder || ''}
- class="w-40 rounded-md border border-gray-300 bg-white px-2 py-1 text-sm text-gray-900 shadow-sm focus:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-100"
- />
- </Show>
- </div>
- <p class="text-xs text-gray-500 dark:text-gray-400">{setting.description}</p>
- </div>
- )}
- </For>
-
- {/* Unknown Keys Section */}
- <Show when={unknownKeys().length > 0}>
- <div class="pt-3 mt-3 border-t border-gray-200 dark:border-gray-700">
- <p class="text-xs text-amber-600 dark:text-amber-400 mb-2">
- Additional settings (not in standard list):
- </p>
- <For each={unknownKeys()}>
- {(key) => (
- <div class="rounded-lg border border-amber-200 dark:border-amber-800 bg-amber-50 dark:bg-amber-900/20 p-3 mb-2">
+ {/* Settings */}
+ <div class="space-y-3">
+ <label class="block text-sm font-medium text-gray-700 dark:text-gray-300">
+ Settings
+ </label>
+
+ <For each={KNOWN_SETTINGS}>
+ {(setting) => (
+ <div class="rounded-lg border border-gray-200 dark:border-gray-700 p-3 space-y-1">
<div class="flex items-center justify-between">
- <label class="text-sm font-medium text-gray-700 dark:text-gray-300 font-mono">
- {key}
+ <label class="text-sm font-medium text-gray-700 dark:text-gray-300">
+ {setting.label}
</label>
- <div class="flex items-center gap-2">
- <input
- type="text"
- value={String(formSettings()[key] ?? '')}
- onInput={(e) => {
- const val = e.currentTarget.value;
- // Try to parse as JSON for complex values
- try {
- updateSetting(key, JSON.parse(val));
- } catch {
- updateSetting(key, val || undefined);
- }
- }}
- class="w-32 rounded-md border border-gray-300 bg-white px-2 py-1 text-sm text-gray-900 shadow-sm focus:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-100"
- />
+ <Show when={setting.type === 'boolean'}>
<button
type="button"
- onClick={() => updateSetting(key, undefined)}
- class="p-1 rounded text-gray-400 hover:text-red-500 hover:bg-red-50 dark:hover:bg-red-900/30"
- title="Remove this setting"
+ onClick={() => {
+ const current = formSettings()[setting.key];
+ if (current === undefined) {
+ updateSetting(setting.key, true);
+ } else if (current === true) {
+ updateSetting(setting.key, false);
+ } else {
+ updateSetting(setting.key, undefined);
+ }
+ }}
+ class={`relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${formSettings()[setting.key] === true
+ ? 'bg-blue-600'
+ : formSettings()[setting.key] === false
+ ? 'bg-gray-400'
+ : 'bg-gray-200 dark:bg-gray-700'
+ }`}
>
- <svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
- </svg>
+ <span
+ class={`inline-block h-4 w-4 transform rounded-full bg-white transition-transform ${formSettings()[setting.key] === true
+ ? 'translate-x-6'
+ : formSettings()[setting.key] === false
+ ? 'translate-x-1'
+ : 'translate-x-3'
+ }`}
+ />
</button>
- </div>
+ </Show>
+ <Show when={setting.type === 'select'}>
+ <select
+ value={(formSettings()[setting.key] as string) || ''}
+ onChange={(e) => updateSetting(setting.key, e.currentTarget.value || undefined)}
+ class="rounded-md border border-gray-300 bg-white px-2 py-1 text-sm text-gray-900 shadow-sm focus:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-100"
+ >
+ <option value="">Default</option>
+ <For each={(setting as SelectSetting).options}>
+ {(opt) => <option value={opt}>{opt}</option>}
+ </For>
+ </select>
+ </Show>
+ <Show when={setting.type === 'duration'}>
+ <input
+ type="text"
+ value={(formSettings()[setting.key] as string) || ''}
+ onInput={(e) => updateSetting(setting.key, e.currentTarget.value || undefined)}
+ placeholder="30s"
+ class="w-24 rounded-md border border-gray-300 bg-white px-2 py-1 text-sm text-gray-900 shadow-sm focus:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-100"
+ />
+ </Show>
+ <Show when={setting.type === 'string'}>
+ <input
+ type="text"
+ value={(formSettings()[setting.key] as string) || ''}
+ onInput={(e) => updateSetting(setting.key, e.currentTarget.value || undefined)}
+ placeholder={(setting as StringSetting).placeholder || ''}
+ class="w-40 rounded-md border border-gray-300 bg-white px-2 py-1 text-sm text-gray-900 shadow-sm focus:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-100"
+ />
+ </Show>
</div>
+ <p class="text-xs text-gray-500 dark:text-gray-400">{setting.description}</p>
</div>
)}
</For>
+
+ {/* Unknown Keys Section */}
+ <Show when={unknownKeys().length > 0}>
+ <div class="pt-3 mt-3 border-t border-gray-200 dark:border-gray-700">
+ <p class="text-xs text-amber-600 dark:text-amber-400 mb-2">
+ Additional settings (not in standard list):
+ </p>
+ <For each={unknownKeys()}>
+ {(key) => (
+ <div class="rounded-lg border border-amber-200 dark:border-amber-800 bg-amber-50 dark:bg-amber-900/20 p-3 mb-2">
+ <div class="flex items-center justify-between">
+ <label class="text-sm font-medium text-gray-700 dark:text-gray-300 font-mono">
+ {key}
+ </label>
+ <div class="flex items-center gap-2">
+ <input
+ type="text"
+ value={String(formSettings()[key] ?? '')}
+ onInput={(e) => {
+ const val = e.currentTarget.value;
+ // Try to parse as JSON for complex values
+ try {
+ updateSetting(key, JSON.parse(val));
+ } catch {
+ updateSetting(key, val || undefined);
+ }
+ }}
+ class="w-32 rounded-md border border-gray-300 bg-white px-2 py-1 text-sm text-gray-900 shadow-sm focus:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-100"
+ />
+ <button
+ type="button"
+ onClick={() => updateSetting(key, undefined)}
+ class="p-1 rounded text-gray-400 hover:text-red-500 hover:bg-red-50 dark:hover:bg-red-900/30"
+ title="Remove this setting"
+ >
+ <svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
+ </svg>
+ </button>
+ </div>
+ </div>
+ </div>
+ )}
+ </For>
+ </div>
+ </Show>
</div>
- </Show>
+ </div>
+
+ <div class="flex items-center justify-end gap-3 px-6 py-4 border-t border-gray-200 dark:border-gray-700">
+ <button
+ type="button"
+ onClick={() => setShowModal(false)}
+ class="rounded-lg px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-800"
+ >
+ Cancel
+ </button>
+ <button
+ type="button"
+ onClick={handleSave}
+ disabled={saving() || !formName().trim()}
+ class="inline-flex items-center gap-2 rounded-lg bg-blue-600 px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-blue-700 disabled:cursor-not-allowed disabled:opacity-60"
+ >
+ {saving() ? 'Saving...' : editingProfile() ? 'Update Profile' : 'Create Profile'}
+ </button>
+ </div>
</div>
</div>
-
- <div class="flex items-center justify-end gap-3 px-6 py-4 border-t border-gray-200 dark:border-gray-700">
- <button
- type="button"
- onClick={() => setShowModal(false)}
- class="rounded-lg px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-800"
- >
- Cancel
- </button>
- <button
- type="button"
- onClick={handleSave}
- disabled={saving() || !formName().trim()}
- class="inline-flex items-center gap-2 rounded-lg bg-blue-600 px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-blue-700 disabled:cursor-not-allowed disabled:opacity-60"
- >
- {saving() ? 'Saving...' : editingProfile() ? 'Update Profile' : 'Create Profile'}
- </button>
- </div>
- </div>
+ </Show>
+
+ {/* Suggest Profile Modal */}
+ <Show when={showSuggestModal()}>
+ <SuggestProfileModal
+ onClose={() => setShowSuggestModal(false)}
+ onSuggestionAccepted={handleSuggestionAccepted}
+ />
+ </Show>
</div>
</Show>
-
- {/* Suggest Profile Modal */}
- <Show when={showSuggestModal()}>
- <SuggestProfileModal
- onClose={() => setShowSuggestModal(false)}
- onSuggestionAccepted={handleSuggestionAccepted}
- />
- </Show>
- </div>
- </Show>
</Show>
);
};
diff --git a/frontend-modern/src/components/Settings/BackupsSettingsPanel.tsx b/frontend-modern/src/components/Settings/BackupsSettingsPanel.tsx
index 11ef0522ea..7ed38a779e 100644
--- a/frontend-modern/src/components/Settings/BackupsSettingsPanel.tsx
+++ b/frontend-modern/src/components/Settings/BackupsSettingsPanel.tsx
@@ -1,5 +1,5 @@
import { Component, Show, For, Accessor, Setter } from 'solid-js';
-import { Card } from '@/components/shared/Card';
+import SettingsPanel from '@/components/shared/SettingsPanel';
import { SectionHeader } from '@/components/shared/SectionHeader';
import Clock from 'lucide-solid/icons/clock';
@@ -41,351 +41,267 @@ interface BackupsSettingsPanelProps {
export const BackupsSettingsPanel: Component<BackupsSettingsPanelProps> = (props) => {
return (
<div class="space-y-6">
- <Card
- padding="none"
- class="overflow-hidden border border-gray-200 dark:border-gray-700"
- border={false}
+ <SettingsPanel
+ title="Backups"
+ description="Backup polling and configuration management"
+ icon={<Clock class="w-5 h-5" strokeWidth={2} />}
+ bodyClass="space-y-8"
>
- {/* Header */}
- <div class="bg-gradient-to-r from-blue-50 to-indigo-50 dark:from-blue-900/20 dark:to-indigo-900/20 px-6 py-4 border-b border-gray-200 dark:border-gray-700">
- <div class="flex items-center gap-3">
- <div class="p-2 bg-blue-100 dark:bg-blue-900/40 rounded-lg">
- <Clock class="w-5 h-5 text-blue-600 dark:text-blue-300" strokeWidth={2} />
- </div>
- <SectionHeader
- title="Backups"
- description="Backup polling and configuration management"
- size="sm"
- class="flex-1"
- />
- </div>
- </div>
+ {/* Backup Polling Section */}
+ <section class="space-y-3">
+ <h4 class="flex items-center gap-2 text-sm font-medium text-gray-700 dark:text-gray-300">
+ <svg
+ width="16"
+ height="16"
+ viewBox="0 0 24 24"
+ fill="none"
+ stroke="currentColor"
+ >
+ <circle cx="12" cy="12" r="9" stroke-width="2" />
+ <path
+ d="M12 7v5l3 3"
+ stroke-width="2"
+ stroke-linecap="round"
+ stroke-linejoin="round"
+ />
+ </svg>
+ Backup polling
+ </h4>
+ <p class="text-xs text-gray-600 dark:text-gray-400">
+ Control how often Pulse queries Proxmox backup tasks, datastore contents, and guest
+ snapshots. Longer intervals reduce disk activity and API load.
+ </p>
- <div class="p-6 space-y-8">
- {/* Backup Polling Section */}
- <section class="space-y-3">
- <h4 class="flex items-center gap-2 text-sm font-medium text-gray-700 dark:text-gray-300">
- <svg
- width="16"
- height="16"
- viewBox="0 0 24 24"
- fill="none"
- stroke="currentColor"
- >
- <circle cx="12" cy="12" r="9" stroke-width="2" />
- <path
- d="M12 7v5l3 3"
- stroke-width="2"
- stroke-linecap="round"
- stroke-linejoin="round"
+ <div class="space-y-3">
+ {/* Enable toggle */}
+ <div class="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between">
+ <div>
+ <p class="text-sm font-medium text-gray-900 dark:text-gray-100">
+ Enable backup polling
+ </p>
+ <p class="text-xs text-gray-600 dark:text-gray-400">
+ Required for dashboard backup status, storage snapshots, and alerting.
+ </p>
+ </div>
+ <label class="relative inline-flex items-center cursor-pointer">
+ <input
+ type="checkbox"
+ class="sr-only peer"
+ checked={props.backupPollingEnabled()}
+ disabled={props.backupPollingEnvLocked()}
+ onChange={(e) => {
+ props.setBackupPollingEnabled(e.currentTarget.checked);
+ if (!props.backupPollingEnvLocked()) {
+ props.setHasUnsavedChanges(true);
+ }
+ }}
/>
- </svg>
- Backup polling
- </h4>
- <p class="text-xs text-gray-600 dark:text-gray-400">
- Control how often Pulse queries Proxmox backup tasks, datastore contents, and guest
- snapshots. Longer intervals reduce disk activity and API load.
- </p>
+ <div class="w-11 h-6 bg-gray-200 peer-focus:outline-none rounded-full peer dark:bg-gray-700 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-blue-600 peer-disabled:opacity-50"></div>
+ </label>
+ </div>
- <div class="space-y-3">
- {/* Enable toggle */}
- <div class="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between">
- <div>
- <p class="text-sm font-medium text-gray-900 dark:text-gray-100">
- Enable backup polling
- </p>
- <p class="text-xs text-gray-600 dark:text-gray-400">
- Required for dashboard backup status, storage snapshots, and alerting.
- </p>
- </div>
- <label class="relative inline-flex items-center cursor-pointer">
- <input
- type="checkbox"
- class="sr-only peer"
- checked={props.backupPollingEnabled()}
+ {/* Polling interval options */}
+ <Show when={props.backupPollingEnabled()}>
+ <div class="space-y-3 rounded-md border border-gray-200 dark:border-gray-600 p-3">
+ <div class="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between">
+ <div>
+ <label class="text-sm font-medium text-gray-900 dark:text-gray-100">
+ Polling interval
+ </label>
+ <p class="text-xs text-gray-600 dark:text-gray-400">
+ {props.backupIntervalSummary()}
+ </p>
+ </div>
+ <select
+ value={props.backupIntervalSelectValue()}
disabled={props.backupPollingEnvLocked()}
onChange={(e) => {
- props.setBackupPollingEnabled(e.currentTarget.checked);
+ const value = e.currentTarget.value;
+ if (value === 'custom') {
+ props.setBackupPollingUseCustom(true);
+ const minutes = Math.max(1, props.backupPollingCustomMinutes());
+ props.setBackupPollingInterval(minutes * 60);
+ } else {
+ props.setBackupPollingUseCustom(false);
+ const seconds = parseInt(value, 10);
+ if (!Number.isNaN(seconds)) {
+ props.setBackupPollingInterval(seconds);
+ if (seconds > 0) {
+ props.setBackupPollingCustomMinutes(
+ Math.max(1, Math.round(seconds / 60))
+ );
+ }
+ }
+ }
if (!props.backupPollingEnvLocked()) {
props.setHasUnsavedChanges(true);
}
}}
- />
- <div class="w-11 h-6 bg-gray-200 peer-focus:outline-none rounded-full peer dark:bg-gray-700 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-blue-600 peer-disabled:opacity-50"></div>
- </label>
- </div>
+ class="px-3 py-1.5 text-sm border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-800 disabled:opacity-50"
+ >
+ <For each={BACKUP_INTERVAL_OPTIONS}>
+ {(option) => <option value={String(option.value)}>{option.label}</option>}
+ </For>
+ <option value="custom">Custom interval...</option>
+ </select>
+ </div>
- {/* Polling interval options */}
- <Show when={props.backupPollingEnabled()}>
- <div class="space-y-3 rounded-md border border-gray-200 dark:border-gray-600 p-3">
- <div class="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between">
- <div>
- <label class="text-sm font-medium text-gray-900 dark:text-gray-100">
- Polling interval
- </label>
- <p class="text-xs text-gray-600 dark:text-gray-400">
- {props.backupIntervalSummary()}
- </p>
- </div>
- <select
- value={props.backupIntervalSelectValue()}
- disabled={props.backupPollingEnvLocked()}
- onChange={(e) => {
- const value = e.currentTarget.value;
- if (value === 'custom') {
- props.setBackupPollingUseCustom(true);
- const minutes = Math.max(1, props.backupPollingCustomMinutes());
- props.setBackupPollingInterval(minutes * 60);
- } else {
- props.setBackupPollingUseCustom(false);
- const seconds = parseInt(value, 10);
- if (!Number.isNaN(seconds)) {
- props.setBackupPollingInterval(seconds);
- if (seconds > 0) {
- props.setBackupPollingCustomMinutes(
- Math.max(1, Math.round(seconds / 60))
- );
- }
+ {/* Custom interval input */}
+ <Show when={props.backupIntervalSelectValue() === 'custom'}>
+ <div class="space-y-2">
+ <label class="text-xs font-medium text-gray-700 dark:text-gray-300">
+ Custom interval (minutes)
+ </label>
+ <div class="flex items-center gap-3">
+ <input
+ type="number"
+ min="1"
+ max={BACKUP_INTERVAL_MAX_MINUTES}
+ value={props.backupPollingCustomMinutes()}
+ disabled={props.backupPollingEnvLocked()}
+ onInput={(e) => {
+ const value = Number(e.currentTarget.value);
+ if (Number.isNaN(value)) {
+ return;
}
- }
- if (!props.backupPollingEnvLocked()) {
- props.setHasUnsavedChanges(true);
- }
- }}
- class="px-3 py-1.5 text-sm border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-800 disabled:opacity-50"
- >
- <For each={BACKUP_INTERVAL_OPTIONS}>
- {(option) => <option value={String(option.value)}>{option.label}</option>}
- </For>
- <option value="custom">Custom interval...</option>
- </select>
- </div>
-
- {/* Custom interval input */}
- <Show when={props.backupIntervalSelectValue() === 'custom'}>
- <div class="space-y-2">
- <label class="text-xs font-medium text-gray-700 dark:text-gray-300">
- Custom interval (minutes)
- </label>
- <div class="flex items-center gap-3">
- <input
- type="number"
- min="1"
- max={BACKUP_INTERVAL_MAX_MINUTES}
- value={props.backupPollingCustomMinutes()}
- disabled={props.backupPollingEnvLocked()}
- onInput={(e) => {
- const value = Number(e.currentTarget.value);
- if (Number.isNaN(value)) {
- return;
- }
- const clamped = Math.max(
- 1,
- Math.min(BACKUP_INTERVAL_MAX_MINUTES, Math.floor(value))
- );
- props.setBackupPollingCustomMinutes(clamped);
- props.setBackupPollingInterval(clamped * 60);
- if (!props.backupPollingEnvLocked()) {
- props.setHasUnsavedChanges(true);
- }
- }}
- class="w-24 px-3 py-1.5 text-sm border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-800 disabled:opacity-50"
- />
- <span class="text-xs text-gray-500 dark:text-gray-400">
- 1 - {BACKUP_INTERVAL_MAX_MINUTES} minutes (~7 days max)
- </span>
- </div>
+ const clamped = Math.max(
+ 1,
+ Math.min(BACKUP_INTERVAL_MAX_MINUTES, Math.floor(value))
+ );
+ props.setBackupPollingCustomMinutes(clamped);
+ props.setBackupPollingInterval(clamped * 60);
+ if (!props.backupPollingEnvLocked()) {
+ props.setHasUnsavedChanges(true);
+ }
+ }}
+ class="w-24 px-3 py-1.5 text-sm border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-800 disabled:opacity-50"
+ />
+ <span class="text-xs text-gray-500 dark:text-gray-400">
+ 1 - {BACKUP_INTERVAL_MAX_MINUTES} minutes (~7 days max)
+ </span>
</div>
- </Show>
- </div>
- </Show>
-
- {/* Env override warning */}
- <Show when={props.backupPollingEnvLocked()}>
- <div class="flex items-start gap-2 rounded-md border border-amber-200 bg-amber-50 dark:border-amber-700 dark:bg-amber-900/20 p-3 text-xs text-amber-700 dark:text-amber-200">
- <svg
- class="w-4 h-4 flex-shrink-0 mt-0.5"
- 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>
- <div>
- <p class="font-medium">Environment override detected</p>
- <p class="mt-1">
- The <code class="font-mono">ENABLE_BACKUP_POLLING</code> or{' '}
- <code class="font-mono">BACKUP_POLLING_INTERVAL</code> environment variables
- are set. Remove them and restart Pulse to manage backup polling here.
- </p>
</div>
- </div>
- </Show>
- </div>
- </section>
-
- {/* Backup & Restore Section */}
- <SectionHeader
- title="Backup & restore"
- description="Backup your node configurations and credentials or restore from a previous backup."
- size="md"
- class="mb-4"
- />
+ </Show>
+ </div>
+ </Show>
- <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
- {/* Export Section */}
- <div class="group border border-gray-200 dark:border-gray-700 rounded-xl p-5 bg-gradient-to-br from-blue-50/50 to-indigo-50/30 dark:from-blue-900/10 dark:to-indigo-900/10 hover:border-blue-300 dark:hover:border-blue-700 transition-all duration-200">
- <div class="flex items-start gap-4">
- <div class="flex-shrink-0 w-12 h-12 bg-gradient-to-br from-blue-500 to-indigo-600 rounded-xl flex items-center justify-center shadow-lg shadow-blue-500/20">
- {/* Archive/Download Box Icon */}
- <svg
- class="w-6 h-6 text-white"
- fill="none"
- stroke="currentColor"
- viewBox="0 0 24 24"
+ {/* Env override warning */}
+ <Show when={props.backupPollingEnvLocked()}>
+ <div class="flex items-start gap-2 rounded-md border border-amber-200 bg-amber-50 dark:border-amber-700 dark:bg-amber-900/20 p-3 text-xs text-amber-700 dark:text-amber-200">
+ <svg
+ class="w-4 h-4 flex-shrink-0 mt-0.5"
+ fill="none"
+ stroke="currentColor"
+ viewBox="0 0 24 24"
+ >
+ <path
+ stroke-linecap="round"
+ stroke-linejoin="round"
stroke-width="2"
- >
- <path
- stroke-linecap="round"
- stroke-linejoin="round"
- d="M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4"
- />
- </svg>
- </div>
- <div class="flex-1 min-w-0">
- <h4 class="text-base font-semibold text-gray-900 dark:text-gray-100 mb-1">
- Export Configuration
- </h4>
- <p class="text-sm text-gray-600 dark:text-gray-400 mb-3">
- Create an encrypted backup package
+ 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>
+ <div>
+ <p class="font-medium">Environment override detected</p>
+ <p class="mt-1">
+ The <code class="font-mono">ENABLE_BACKUP_POLLING</code> or{' '}
+ <code class="font-mono">BACKUP_POLLING_INTERVAL</code> environment variables
+ are set. Remove them and restart Pulse to manage backup polling here.
</p>
+ </div>
+ </div>
+ </Show>
+ </div>
+ </section>
- {/* Feature list */}
- <ul class="space-y-1 mb-4">
- <li class="flex items-center gap-2 text-xs text-gray-500 dark:text-gray-400">
- <svg class="w-3.5 h-3.5 text-green-500" fill="currentColor" viewBox="0 0 20 20">
- <path fill-rule="evenodd" d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z" clip-rule="evenodd" />
- </svg>
- <span>All node connections & credentials</span>
- </li>
- <li class="flex items-center gap-2 text-xs text-gray-500 dark:text-gray-400">
- <svg class="w-3.5 h-3.5 text-green-500" fill="currentColor" viewBox="0 0 20 20">
- <path fill-rule="evenodd" d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z" clip-rule="evenodd" />
- </svg>
- <span>Alert thresholds & overrides</span>
- </li>
- <li class="flex items-center gap-2 text-xs text-gray-500 dark:text-gray-400">
- <svg class="w-3.5 h-3.5 text-green-500" fill="currentColor" viewBox="0 0 20 20">
- <path fill-rule="evenodd" d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z" clip-rule="evenodd" />
- </svg>
- <span>AES-256 encryption</span>
- </li>
- </ul>
+ {/* Backup & Restore Section */}
+ <SectionHeader
+ title="Backup & restore"
+ description="Backup your node configurations and credentials or restore from a previous backup."
+ size="md"
+ class="mb-4"
+ />
- <button
- type="button"
- onClick={() => {
- // Default to custom passphrase if no auth is configured
- props.setUseCustomPassphrase(!props.securityStatus()?.hasAuthentication);
- props.setShowExportDialog(true);
- }}
- class="w-full sm:w-auto px-4 py-2 bg-gradient-to-r from-blue-600 to-indigo-600 text-white text-sm font-medium rounded-lg hover:from-blue-700 hover:to-indigo-700 transition-all duration-200 inline-flex items-center justify-center gap-2 shadow-md hover:shadow-lg"
- >
- <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="M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"
- />
- </svg>
- Create Backup
- </button>
- </div>
+ <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
+ {/* Export Section */}
+ <div class="group border border-gray-200 dark:border-gray-700 rounded-xl p-5 bg-blue-50/50 dark:bg-blue-900/10 hover:border-blue-300 dark:hover:border-blue-700 transition-all duration-200">
+ <div class="flex items-start gap-4">
+ <div class="flex-shrink-0 w-12 h-12 bg-blue-500 rounded-xl flex items-center justify-center shadow-lg shadow-blue-500/20">
+ {/* Archive/Download Box Icon */}
+ <svg
+ class="w-6 h-6 text-white"
+ fill="none"
+ stroke="currentColor"
+ viewBox="0 0 24 24"
+ stroke-width="2"
+ >
+ <path
+ stroke-linecap="round"
+ stroke-linejoin="round"
+ d="M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4"
+ />
+ </svg>
</div>
- </div>
+ <div class="flex-1 min-w-0">
+ <h4 class="text-base font-semibold text-gray-900 dark:text-gray-100 mb-1">
+ Export Configuration
+ </h4>
+ <p class="text-sm text-gray-600 dark:text-gray-400 mb-3">
+ Create an encrypted backup package
+ </p>
- {/* Import Section */}
- <div class="group border border-gray-200 dark:border-gray-700 rounded-xl p-5 bg-gradient-to-br from-gray-50/50 to-slate-50/30 dark:from-gray-800/30 dark:to-slate-800/20 hover:border-gray-400 dark:hover:border-gray-600 transition-all duration-200">
- <div class="flex items-start gap-4">
- <div class="flex-shrink-0 w-12 h-12 bg-gradient-to-br from-gray-500 to-slate-600 rounded-xl flex items-center justify-center shadow-lg shadow-gray-500/20">
- {/* Upload/Restore Icon */}
- <svg
- class="w-6 h-6 text-white"
- fill="none"
- stroke="currentColor"
- viewBox="0 0 24 24"
- stroke-width="2"
- >
+ {/* Feature list */}
+ <ul class="space-y-1 mb-4">
+ <li class="flex items-center gap-2 text-xs text-gray-500 dark:text-gray-400">
+ <svg class="w-3.5 h-3.5 text-green-500" fill="currentColor" viewBox="0 0 20 20">
+ <path fill-rule="evenodd" d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z" clip-rule="evenodd" />
+ </svg>
+ <span>All node connections & credentials</span>
+ </li>
+ <li class="flex items-center gap-2 text-xs text-gray-500 dark:text-gray-400">
+ <svg class="w-3.5 h-3.5 text-green-500" fill="currentColor" viewBox="0 0 20 20">
+ <path fill-rule="evenodd" d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z" clip-rule="evenodd" />
+ </svg>
+ <span>Alert thresholds & overrides</span>
+ </li>
+ <li class="flex items-center gap-2 text-xs text-gray-500 dark:text-gray-400">
+ <svg class="w-3.5 h-3.5 text-green-500" fill="currentColor" viewBox="0 0 20 20">
+ <path fill-rule="evenodd" d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z" clip-rule="evenodd" />
+ </svg>
+ <span>AES-256 encryption</span>
+ </li>
+ </ul>
+
+ <button
+ type="button"
+ onClick={() => {
+ // Default to custom passphrase if no auth is configured
+ props.setUseCustomPassphrase(!props.securityStatus()?.hasAuthentication);
+ props.setShowExportDialog(true);
+ }}
+ class="w-full sm:w-auto px-4 py-2 bg-blue-600 text-white text-sm font-medium rounded-lg hover:bg-blue-700 transition-all duration-200 inline-flex items-center justify-center gap-2 shadow-md hover:shadow-lg"
+ >
+ <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path
stroke-linecap="round"
stroke-linejoin="round"
- d="M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12"
+ stroke-width="2"
+ d="M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"
/>
</svg>
- </div>
- <div class="flex-1 min-w-0">
- <h4 class="text-base font-semibold text-gray-900 dark:text-gray-100 mb-1">
- Restore Configuration
- </h4>
- <p class="text-sm text-gray-600 dark:text-gray-400 mb-3">
- Import from an encrypted backup file
- </p>
-
- {/* Feature list */}
- <ul class="space-y-1 mb-4">
- <li class="flex items-center gap-2 text-xs text-gray-500 dark:text-gray-400">
- <svg class="w-3.5 h-3.5 text-blue-500" fill="currentColor" viewBox="0 0 20 20">
- <path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd" />
- </svg>
- <span>Merge or replace existing config</span>
- </li>
- <li class="flex items-center gap-2 text-xs text-gray-500 dark:text-gray-400">
- <svg class="w-3.5 h-3.5 text-blue-500" fill="currentColor" viewBox="0 0 20 20">
- <path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd" />
- </svg>
- <span>Validates backup before applying</span>
- </li>
- <li class="flex items-center gap-2 text-xs text-gray-500 dark:text-gray-400">
- <svg class="w-3.5 h-3.5 text-blue-500" fill="currentColor" viewBox="0 0 20 20">
- <path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd" />
- </svg>
- <span>Requires original passphrase</span>
- </li>
- </ul>
-
- <button
- type="button"
- onClick={() => props.setShowImportDialog(true)}
- class="w-full sm:w-auto px-4 py-2 bg-gradient-to-r from-gray-600 to-slate-600 text-white text-sm font-medium rounded-lg hover:from-gray-700 hover:to-slate-700 transition-all duration-200 inline-flex items-center justify-center gap-2 shadow-md hover:shadow-lg"
- >
- <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="M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12"
- />
- </svg>
- Restore Backup
- </button>
- </div>
+ Create Backup
+ </button>
</div>
</div>
</div>
- {/* Security Tips */}
- <div class="mt-6 p-4 bg-gradient-to-r from-amber-50 to-yellow-50 dark:from-amber-900/20 dark:to-yellow-900/10 rounded-xl border border-amber-200 dark:border-amber-800/50">
- <div class="flex gap-3">
- {/* Shield Icon */}
- <div class="flex-shrink-0 w-10 h-10 bg-amber-100 dark:bg-amber-900/40 rounded-lg flex items-center justify-center">
+ {/* Import Section */}
+ <div class="group border border-gray-200 dark:border-gray-700 rounded-xl p-5 bg-gray-50/50 dark:bg-gray-800/30 hover:border-gray-400 dark:hover:border-gray-600 transition-all duration-200">
+ <div class="flex items-start gap-4">
+ <div class="flex-shrink-0 w-12 h-12 bg-gray-500 rounded-xl flex items-center justify-center shadow-lg shadow-gray-500/20">
+ {/* Upload/Restore Icon */}
<svg
- class="w-5 h-5 text-amber-600 dark:text-amber-400"
+ class="w-6 h-6 text-white"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
@@ -394,37 +310,105 @@ export const BackupsSettingsPanel: Component<BackupsSettingsPanelProps> = (props
<path
stroke-linecap="round"
stroke-linejoin="round"
- d="M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"
+ d="M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12"
/>
</svg>
</div>
- <div class="flex-1">
- <p class="text-sm font-medium text-amber-800 dark:text-amber-200 mb-2">Security Tips</p>
- <ul class="space-y-2">
- <li class="flex items-start gap-2 text-xs text-amber-700 dark:text-amber-300">
- <svg class="w-4 h-4 text-amber-500 flex-shrink-0 mt-0.5" fill="currentColor" viewBox="0 0 20 20">
- <path fill-rule="evenodd" d="M5 9V7a5 5 0 0110 0v2a2 2 0 012 2v5a2 2 0 01-2 2H5a2 2 0 01-2-2v-5a2 2 0 012-2zm8-2v2H7V7a3 3 0 016 0z" clip-rule="evenodd" />
+ <div class="flex-1 min-w-0">
+ <h4 class="text-base font-semibold text-gray-900 dark:text-gray-100 mb-1">
+ Restore Configuration
+ </h4>
+ <p class="text-sm text-gray-600 dark:text-gray-400 mb-3">
+ Import from an encrypted backup file
+ </p>
+
+ {/* Feature list */}
+ <ul class="space-y-1 mb-4">
+ <li class="flex items-center gap-2 text-xs text-gray-500 dark:text-gray-400">
+ <svg class="w-3.5 h-3.5 text-blue-500" fill="currentColor" viewBox="0 0 20 20">
+ <path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd" />
</svg>
- <span>Backups contain encrypted credentials and sensitive data</span>
+ <span>Merge or replace existing config</span>
</li>
- <li class="flex items-start gap-2 text-xs text-amber-700 dark:text-amber-300">
- <svg class="w-4 h-4 text-amber-500 flex-shrink-0 mt-0.5" fill="currentColor" viewBox="0 0 20 20">
- <path fill-rule="evenodd" d="M18 8a6 6 0 01-7.743 5.743L10 14l-1 1-1 1H6v2H2v-4l4.257-4.257A6 6 0 1118 8zm-6-4a1 1 0 100 2 2 2 0 012 2 1 1 0 102 0 4 4 0 00-4-4z" clip-rule="evenodd" />
+ <li class="flex items-center gap-2 text-xs text-gray-500 dark:text-gray-400">
+ <svg class="w-3.5 h-3.5 text-blue-500" fill="currentColor" viewBox="0 0 20 20">
+ <path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd" />
</svg>
- <span>Use a strong passphrase (12+ characters, mix of letters, numbers, symbols)</span>
+ <span>Validates backup before applying</span>
</li>
- <li class="flex items-start gap-2 text-xs text-amber-700 dark:text-amber-300">
- <svg class="w-4 h-4 text-amber-500 flex-shrink-0 mt-0.5" fill="currentColor" viewBox="0 0 20 20">
- <path d="M10 2a5 5 0 00-5 5v2a2 2 0 00-2 2v5a2 2 0 002 2h10a2 2 0 002-2v-5a2 2 0 00-2-2V7a5 5 0 00-5-5zm3 7V7a3 3 0 10-6 0v2h6z" />
+ <li class="flex items-center gap-2 text-xs text-gray-500 dark:text-gray-400">
+ <svg class="w-3.5 h-3.5 text-blue-500" fill="currentColor" viewBox="0 0 20 20">
+ <path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd" />
</svg>
- <span>Store backup files securely and never share the passphrase</span>
+ <span>Requires original passphrase</span>
</li>
</ul>
+
+ <button
+ type="button"
+ onClick={() => props.setShowImportDialog(true)}
+ class="w-full sm:w-auto px-4 py-2 bg-gray-600 text-white text-sm font-medium rounded-lg hover:bg-gray-700 transition-all duration-200 inline-flex items-center justify-center gap-2 shadow-md hover:shadow-lg"
+ >
+ <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="M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12"
+ />
+ </svg>
+ Restore Backup
+ </button>
</div>
</div>
</div>
</div>
- </Card>
+
+ {/* Security Tips */}
+ <div class="mt-6 p-4 bg-amber-50 dark:bg-amber-900/20 rounded-xl border border-amber-200 dark:border-amber-800/50">
+ <div class="flex gap-3">
+ {/* Shield Icon */}
+ <div class="flex-shrink-0 w-10 h-10 bg-amber-100 dark:bg-amber-900/40 rounded-lg flex items-center justify-center">
+ <svg
+ class="w-5 h-5 text-amber-600 dark:text-amber-400"
+ fill="none"
+ stroke="currentColor"
+ viewBox="0 0 24 24"
+ stroke-width="2"
+ >
+ <path
+ stroke-linecap="round"
+ stroke-linejoin="round"
+ d="M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"
+ />
+ </svg>
+ </div>
+ <div class="flex-1">
+ <p class="text-sm font-medium text-amber-800 dark:text-amber-200 mb-2">Security Tips</p>
+ <ul class="space-y-2">
+ <li class="flex items-start gap-2 text-xs text-amber-700 dark:text-amber-300">
+ <svg class="w-4 h-4 text-amber-500 flex-shrink-0 mt-0.5" fill="currentColor" viewBox="0 0 20 20">
+ <path fill-rule="evenodd" d="M5 9V7a5 5 0 0110 0v2a2 2 0 012 2v5a2 2 0 01-2 2H5a2 2 0 01-2-2v-5a2 2 0 012-2zm8-2v2H7V7a3 3 0 016 0z" clip-rule="evenodd" />
+ </svg>
+ <span>Backups contain encrypted credentials and sensitive data</span>
+ </li>
+ <li class="flex items-start gap-2 text-xs text-amber-700 dark:text-amber-300">
+ <svg class="w-4 h-4 text-amber-500 flex-shrink-0 mt-0.5" fill="currentColor" viewBox="0 0 20 20">
+ <path fill-rule="evenodd" d="M18 8a6 6 0 01-7.743 5.743L10 14l-1 1-1 1H6v2H2v-4l4.257-4.257A6 6 0 1118 8zm-6-4a1 1 0 100 2 2 2 0 012 2 1 1 0 102 0 4 4 0 00-4-4z" clip-rule="evenodd" />
+ </svg>
+ <span>Use a strong passphrase (12+ characters, mix of letters, numbers, symbols)</span>
+ </li>
+ <li class="flex items-start gap-2 text-xs text-amber-700 dark:text-amber-300">
+ <svg class="w-4 h-4 text-amber-500 flex-shrink-0 mt-0.5" fill="currentColor" viewBox="0 0 20 20">
+ <path d="M10 2a5 5 0 00-5 5v2a2 2 0 00-2 2v5a2 2 0 002 2h10a2 2 0 002-2v-5a2 2 0 00-2-2V7a5 5 0 00-5-5zm3 7V7a3 3 0 10-6 0v2h6z" />
+ </svg>
+ <span>Store backup files securely and never share the passphrase</span>
+ </li>
+ </ul>
+ </div>
+ </div>
+ </div>
+ </SettingsPanel>
</div>
);
};
diff --git a/frontend-modern/src/components/Settings/DiagnosticsPanel.tsx b/frontend-modern/src/components/Settings/DiagnosticsPanel.tsx
index 69c3afa058..2d8b32c563 100644
--- a/frontend-modern/src/components/Settings/DiagnosticsPanel.tsx
+++ b/frontend-modern/src/components/Settings/DiagnosticsPanel.tsx
@@ -313,10 +313,10 @@ export const DiagnosticsPanel: Component = () => {
const healthColor = () => {
const health = systemHealth();
- if (health === 'healthy') return 'from-green-500 to-emerald-600';
- if (health === 'warning') return 'from-amber-500 to-orange-600';
- if (health === 'critical') return 'from-red-500 to-rose-600';
- return 'from-gray-400 to-gray-500';
+ if (health === 'healthy') return 'bg-green-500';
+ if (health === 'warning') return 'bg-amber-500';
+ if (health === 'critical') return 'bg-red-500';
+ return 'bg-gray-400';
};
return (
@@ -327,7 +327,7 @@ export const DiagnosticsPanel: Component = () => {
class="overflow-hidden border border-gray-200 dark:border-gray-700"
border={false}
>
- <div class={`bg-gradient-to-r ${healthColor()} px-4 sm:px-6 py-4 sm:py-5`}>
+ <div class={`${healthColor()} px-4 sm:px-6 py-4 sm:py-5`}>
<div class="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4">
<div class="flex items-center gap-3 sm:gap-4">
<div class="p-2 sm:p-3 bg-white/20 rounded-xl backdrop-blur-sm flex-shrink-0">
diff --git a/frontend-modern/src/components/Settings/GeneralSettingsPanel.tsx b/frontend-modern/src/components/Settings/GeneralSettingsPanel.tsx
index cccbcd0e8e..4ac020bd72 100644
--- a/frontend-modern/src/components/Settings/GeneralSettingsPanel.tsx
+++ b/frontend-modern/src/components/Settings/GeneralSettingsPanel.tsx
@@ -1,6 +1,5 @@
import { Component, Show, For, Accessor, Setter } from 'solid-js';
-import { Card } from '@/components/shared/Card';
-import { SectionHeader } from '@/components/shared/SectionHeader';
+import SettingsPanel from '@/components/shared/SettingsPanel';
import { Toggle } from '@/components/shared/Toggle';
import Sliders from 'lucide-solid/icons/sliders-horizontal';
import Activity from 'lucide-solid/icons/activity';
@@ -37,255 +36,227 @@ export const GeneralSettingsPanel: Component<GeneralSettingsPanelProps> = (props
return (
<div class="space-y-6">
{/* Appearance Card */}
- <Card
- padding="none"
- class="overflow-hidden border border-gray-200 dark:border-gray-700"
- border={false}
+ <SettingsPanel
+ title="General"
+ description="Appearance and display preferences"
+ icon={<Sliders class="w-5 h-5" strokeWidth={2} />}
+ bodyClass="space-y-5"
>
- <div class="bg-gradient-to-r from-blue-50 to-indigo-50 dark:from-blue-900/20 dark:to-indigo-900/20 px-6 py-4 border-b border-gray-200 dark:border-gray-700">
+ <div class="flex items-center justify-between gap-4">
<div class="flex items-center gap-3">
- <div class="p-2 bg-blue-100 dark:bg-blue-900/40 rounded-lg">
- <Sliders class="w-5 h-5 text-blue-600 dark:text-blue-300" strokeWidth={2} />
- </div>
- <SectionHeader
- title="General"
- description="Appearance and display preferences"
- size="sm"
- class="flex-1"
- />
- </div>
- </div>
- <div class="p-6 space-y-5">
- <div class="flex items-center justify-between gap-4">
- <div class="flex items-center gap-3">
- {/* Animated theme icon */}
- <div class={`relative p-2.5 rounded-xl transition-all duration-300 ${props.darkMode()
- ? 'bg-gradient-to-br from-indigo-500 to-purple-600 shadow-lg shadow-indigo-500/25'
- : 'bg-gradient-to-br from-amber-400 to-orange-500 shadow-lg shadow-amber-500/25'
- }`}>
- <div class="relative w-5 h-5">
- <Sun class={`absolute inset-0 w-5 h-5 text-white transition-all duration-300 ${props.darkMode() ? 'opacity-0 rotate-90 scale-50' : 'opacity-100 rotate-0 scale-100'
- }`} strokeWidth={2} />
- <Moon class={`absolute inset-0 w-5 h-5 text-white transition-all duration-300 ${props.darkMode() ? 'opacity-100 rotate-0 scale-100' : 'opacity-0 -rotate-90 scale-50'
- }`} strokeWidth={2} />
- </div>
- </div>
- <div class="text-sm text-gray-600 dark:text-gray-400">
- <p class="font-medium text-gray-900 dark:text-gray-100">
- {props.darkMode() ? 'Dark mode' : 'Light mode'}
- </p>
- <p class="text-xs text-gray-500 dark:text-gray-400">
- Toggle to match your environment. Pulse remembers this preference on each browser.
- </p>
+ {/* Animated theme icon */}
+ <div class={`relative p-2.5 rounded-xl transition-all duration-300 ${props.darkMode()
+ ? 'bg-indigo-500 shadow-lg shadow-indigo-500/25'
+ : 'bg-amber-400 shadow-lg shadow-amber-500/25'
+ }`}>
+ <div class="relative w-5 h-5">
+ <Sun class={`absolute inset-0 w-5 h-5 text-white transition-all duration-300 ${props.darkMode() ? 'opacity-0 rotate-90 scale-50' : 'opacity-100 rotate-0 scale-100'
+ }`} strokeWidth={2} />
+ <Moon class={`absolute inset-0 w-5 h-5 text-white transition-all duration-300 ${props.darkMode() ? 'opacity-100 rotate-0 scale-100' : 'opacity-0 -rotate-90 scale-50'
+ }`} strokeWidth={2} />
</div>
</div>
- <Toggle
- checked={props.darkMode()}
- onChange={(event) => {
- const desired = (event.currentTarget as HTMLInputElement).checked;
- if (desired !== props.darkMode()) {
- props.toggleDarkMode();
- }
- }}
- />
+ <div class="text-sm text-gray-600 dark:text-gray-400">
+ <p class="font-medium text-gray-900 dark:text-gray-100">
+ {props.darkMode() ? 'Dark mode' : 'Light mode'}
+ </p>
+ <p class="text-xs text-gray-500 dark:text-gray-400">
+ Toggle to match your environment. Pulse remembers this preference on each browser.
+ </p>
+ </div>
</div>
+ <Toggle
+ checked={props.darkMode()}
+ onChange={(event) => {
+ const desired = (event.currentTarget as HTMLInputElement).checked;
+ if (desired !== props.darkMode()) {
+ props.toggleDarkMode();
+ }
+ }}
+ />
+ </div>
- {/* Temperature Unit Selector */}
- <div class="flex items-center justify-between gap-4 pt-4 border-t border-gray-200 dark:border-gray-700">
- <div class="flex items-center gap-3">
- <div class="p-2.5 rounded-xl bg-gradient-to-br from-orange-400 to-red-500 shadow-lg shadow-orange-500/25">
- <Thermometer class="w-5 h-5 text-white" strokeWidth={2} />
- </div>
- <div class="text-sm text-gray-600 dark:text-gray-400">
- <p class="font-medium text-gray-900 dark:text-gray-100">
- Temperature unit
- </p>
- <p class="text-xs text-gray-500 dark:text-gray-400">
- Display temperatures in Celsius or Fahrenheit
- </p>
- </div>
+ {/* Temperature Unit Selector */}
+ <div class="flex items-center justify-between gap-4 pt-4 border-t border-gray-200 dark:border-gray-700">
+ <div class="flex items-center gap-3">
+ <div class="p-2.5 rounded-xl bg-orange-400 shadow-lg shadow-orange-500/25">
+ <Thermometer class="w-5 h-5 text-white" strokeWidth={2} />
</div>
- <div class="flex items-center gap-1 bg-gray-100 dark:bg-gray-800 rounded-lg p-1">
- <button
- type="button"
- class={`px-3 py-1.5 text-xs font-medium rounded-md transition-all ${temperatureStore.unit() === 'celsius'
- ? 'bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 shadow-sm'
- : 'text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-200'
- }`}
- onClick={() => temperatureStore.setUnit('celsius')}
- >
- °C
- </button>
- <button
- type="button"
- class={`px-3 py-1.5 text-xs font-medium rounded-md transition-all ${temperatureStore.unit() === 'fahrenheit'
- ? 'bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 shadow-sm'
- : 'text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-200'
- }`}
- onClick={() => temperatureStore.setUnit('fahrenheit')}
- >
- °F
- </button>
+ <div class="text-sm text-gray-600 dark:text-gray-400">
+ <p class="font-medium text-gray-900 dark:text-gray-100">
+ Temperature unit
+ </p>
+ <p class="text-xs text-gray-500 dark:text-gray-400">
+ Display temperatures in Celsius or Fahrenheit
+ </p>
</div>
</div>
+ <div class="flex items-center gap-1 bg-gray-100 dark:bg-gray-800 rounded-lg p-1">
+ <button
+ type="button"
+ class={`px-3 py-1.5 text-xs font-medium rounded-md transition-all ${temperatureStore.unit() === 'celsius'
+ ? 'bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 shadow-sm'
+ : 'text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-200'
+ }`}
+ onClick={() => temperatureStore.setUnit('celsius')}
+ >
+ °C
+ </button>
+ <button
+ type="button"
+ class={`px-3 py-1.5 text-xs font-medium rounded-md transition-all ${temperatureStore.unit() === 'fahrenheit'
+ ? 'bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 shadow-sm'
+ : 'text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-200'
+ }`}
+ onClick={() => temperatureStore.setUnit('fahrenheit')}
+ >
+ °F
+ </button>
+ </div>
+ </div>
- {/* Full-width Mode Toggle */}
- <div class="flex items-center justify-between gap-4 pt-4 border-t border-gray-200 dark:border-gray-700">
- <div class="flex items-center gap-3">
- <div class={`p-2.5 rounded-xl transition-all duration-300 ${layoutStore.isFullWidth()
- ? 'bg-gradient-to-br from-blue-500 to-indigo-600 shadow-lg shadow-blue-500/25'
- : 'bg-gradient-to-br from-gray-400 to-gray-500 shadow-lg shadow-gray-500/25'
- }`}>
- <Maximize2 class="w-5 h-5 text-white" strokeWidth={2} />
- </div>
- <div class="text-sm text-gray-600 dark:text-gray-400">
- <p class="font-medium text-gray-900 dark:text-gray-100">
- Full-width mode
- </p>
- <p class="text-xs text-gray-500 dark:text-gray-400">
- Expand content to use all available screen width on large monitors
- </p>
- </div>
+ {/* Full-width Mode Toggle */}
+ <div class="flex items-center justify-between gap-4 pt-4 border-t border-gray-200 dark:border-gray-700">
+ <div class="flex items-center gap-3">
+ <div class={`p-2.5 rounded-xl transition-all duration-300 ${layoutStore.isFullWidth()
+ ? 'bg-blue-500 shadow-lg shadow-blue-500/25'
+ : 'bg-gray-400 shadow-lg shadow-gray-500/25'
+ }`}>
+ <Maximize2 class="w-5 h-5 text-white" strokeWidth={2} />
+ </div>
+ <div class="text-sm text-gray-600 dark:text-gray-400">
+ <p class="font-medium text-gray-900 dark:text-gray-100">
+ Full-width mode
+ </p>
+ <p class="text-xs text-gray-500 dark:text-gray-400">
+ Expand content to use all available screen width on large monitors
+ </p>
</div>
- <Toggle
- checked={layoutStore.isFullWidth()}
- onChange={() => layoutStore.toggle()}
- />
</div>
+ <Toggle
+ checked={layoutStore.isFullWidth()}
+ onChange={() => layoutStore.toggle()}
+ />
</div>
- </Card>
+ </SettingsPanel>
{/* Monitoring Cadence Card */}
- <Card
- padding="none"
- class="overflow-hidden border border-gray-200 dark:border-gray-700"
- border={false}
+ <SettingsPanel
+ title="Monitoring cadence"
+ description="Control how frequently Pulse polls Proxmox VE nodes."
+ icon={<Activity class="w-5 h-5" strokeWidth={2} />}
+ bodyClass="space-y-5"
>
- <div class="bg-gradient-to-r from-blue-50 to-indigo-50 dark:from-blue-900/20 dark:to-indigo-900/20 px-6 py-4 border-b border-gray-200 dark:border-gray-700">
- <div class="flex items-center gap-3">
- <div class="p-2 bg-blue-100 dark:bg-blue-900/40 rounded-lg">
- <Activity class="w-5 h-5 text-blue-600 dark:text-blue-300" strokeWidth={2} />
- </div>
- <SectionHeader
- title="Monitoring cadence"
- description="Control how frequently Pulse polls Proxmox VE nodes."
- size="sm"
- class="flex-1"
- />
- </div>
+ <div class="space-y-2">
+ <p class="text-sm text-gray-600 dark:text-gray-400">
+ Shorter intervals provide near-real-time updates at the cost of higher API and CPU
+ usage on each node. Set a longer interval to reduce load on busy clusters.
+ </p>
+ <p class="text-xs text-gray-500 dark:text-gray-400">
+ Current cadence: {props.pvePollingInterval()} seconds (
+ {props.pvePollingInterval() >= 60
+ ? `${(props.pvePollingInterval() / 60).toFixed(
+ props.pvePollingInterval() % 60 === 0 ? 0 : 1
+ )} minute${props.pvePollingInterval() / 60 === 1 ? '' : 's'}`
+ : 'under a minute'}
+ ).
+ </p>
</div>
- <div class="p-6 space-y-5">
- <div class="space-y-2">
- <p class="text-sm text-gray-600 dark:text-gray-400">
- Shorter intervals provide near-real-time updates at the cost of higher API and CPU
- usage on each node. Set a longer interval to reduce load on busy clusters.
- </p>
- <p class="text-xs text-gray-500 dark:text-gray-400">
- Current cadence: {props.pvePollingInterval()} seconds (
- {props.pvePollingInterval() >= 60
- ? `${(props.pvePollingInterval() / 60).toFixed(
- props.pvePollingInterval() % 60 === 0 ? 0 : 1
- )} minute${props.pvePollingInterval() / 60 === 1 ? '' : 's'}`
- : 'under a minute'}
- ).
- </p>
+
+ <div class="space-y-4">
+ {/* Preset buttons */}
+ <div class="grid gap-2 sm:grid-cols-3">
+ <For each={PVE_POLLING_PRESETS}>
+ {(option) => (
+ <button
+ type="button"
+ class={`rounded-lg border px-3 py-2 text-left text-sm transition-colors ${props.pvePollingSelection() === option.value
+ ? 'border-blue-500 bg-blue-50 text-blue-700 dark:border-blue-400 dark:bg-blue-900/30 dark:text-blue-100'
+ : 'border-gray-200 bg-white text-gray-700 hover:border-blue-400 hover:text-blue-600 dark:border-gray-600 dark:bg-gray-900/50 dark:text-gray-200'
+ } ${props.pvePollingEnvLocked() ? 'opacity-60 cursor-not-allowed' : ''}`}
+ disabled={props.pvePollingEnvLocked()}
+ onClick={() => {
+ if (props.pvePollingEnvLocked()) return;
+ props.setPVEPollingSelection(option.value);
+ props.setPVEPollingInterval(option.value);
+ props.setHasUnsavedChanges(true);
+ }}
+ >
+ {option.label}
+ </button>
+ )}
+ </For>
+ <button
+ type="button"
+ class={`rounded-lg border px-3 py-2 text-left text-sm transition-colors ${props.pvePollingSelection() === 'custom'
+ ? 'border-blue-500 bg-blue-50 text-blue-700 dark:border-blue-400 dark:bg-blue-900/30 dark:text-blue-100'
+ : 'border-gray-200 bg-white text-gray-700 hover:border-blue-400 hover:text-blue-600 dark:border-gray-600 dark:bg-gray-900/50 dark:text-gray-200'
+ } ${props.pvePollingEnvLocked() ? 'opacity-60 cursor-not-allowed' : ''}`}
+ disabled={props.pvePollingEnvLocked()}
+ onClick={() => {
+ if (props.pvePollingEnvLocked()) return;
+ props.setPVEPollingSelection('custom');
+ props.setPVEPollingInterval(props.pvePollingCustomSeconds());
+ props.setHasUnsavedChanges(true);
+ }}
+ >
+ Custom interval
+ </button>
</div>
- <div class="space-y-4">
- {/* Preset buttons */}
- <div class="grid gap-2 sm:grid-cols-3">
- <For each={PVE_POLLING_PRESETS}>
- {(option) => (
- <button
- type="button"
- class={`rounded-lg border px-3 py-2 text-left text-sm transition-colors ${props.pvePollingSelection() === option.value
- ? 'border-blue-500 bg-blue-50 text-blue-700 dark:border-blue-400 dark:bg-blue-900/30 dark:text-blue-100'
- : 'border-gray-200 bg-white text-gray-700 hover:border-blue-400 hover:text-blue-600 dark:border-gray-600 dark:bg-gray-900/50 dark:text-gray-200'
- } ${props.pvePollingEnvLocked() ? 'opacity-60 cursor-not-allowed' : ''}`}
- disabled={props.pvePollingEnvLocked()}
- onClick={() => {
- if (props.pvePollingEnvLocked()) return;
- props.setPVEPollingSelection(option.value);
- props.setPVEPollingInterval(option.value);
- props.setHasUnsavedChanges(true);
- }}
- >
- {option.label}
- </button>
- )}
- </For>
- <button
- type="button"
- class={`rounded-lg border px-3 py-2 text-left text-sm transition-colors ${props.pvePollingSelection() === 'custom'
- ? 'border-blue-500 bg-blue-50 text-blue-700 dark:border-blue-400 dark:bg-blue-900/30 dark:text-blue-100'
- : 'border-gray-200 bg-white text-gray-700 hover:border-blue-400 hover:text-blue-600 dark:border-gray-600 dark:bg-gray-900/50 dark:text-gray-200'
- } ${props.pvePollingEnvLocked() ? 'opacity-60 cursor-not-allowed' : ''}`}
+ {/* Custom interval input */}
+ <Show when={props.pvePollingSelection() === 'custom'}>
+ <div class="space-y-2 rounded-md border border-dashed border-gray-300 p-4 dark:border-gray-600">
+ <label class="text-xs font-medium text-gray-700 dark:text-gray-200">
+ Custom polling interval (10-3600 seconds)
+ </label>
+ <input
+ type="number"
+ min={PVE_POLLING_MIN_SECONDS}
+ max={PVE_POLLING_MAX_SECONDS}
+ value={props.pvePollingCustomSeconds()}
+ class="w-full rounded-lg border border-gray-300 px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 dark:border-gray-600 dark:bg-gray-900/60"
disabled={props.pvePollingEnvLocked()}
- onClick={() => {
+ onInput={(e) => {
if (props.pvePollingEnvLocked()) return;
- props.setPVEPollingSelection('custom');
- props.setPVEPollingInterval(props.pvePollingCustomSeconds());
+ const parsed = Math.floor(Number(e.currentTarget.value));
+ if (Number.isNaN(parsed)) {
+ return;
+ }
+ const clamped = Math.min(
+ PVE_POLLING_MAX_SECONDS,
+ Math.max(PVE_POLLING_MIN_SECONDS, parsed)
+ );
+ props.setPVEPollingCustomSeconds(clamped);
+ props.setPVEPollingInterval(clamped);
props.setHasUnsavedChanges(true);
}}
- >
- Custom interval
- </button>
+ />
+ <p class="text-[0.68rem] text-gray-500 dark:text-gray-400">
+ Applies to all PVE clusters and standalone nodes.
+ </p>
</div>
+ </Show>
- {/* Custom interval input */}
- <Show when={props.pvePollingSelection() === 'custom'}>
- <div class="space-y-2 rounded-md border border-dashed border-gray-300 p-4 dark:border-gray-600">
- <label class="text-xs font-medium text-gray-700 dark:text-gray-200">
- Custom polling interval (10-3600 seconds)
- </label>
- <input
- type="number"
- min={PVE_POLLING_MIN_SECONDS}
- max={PVE_POLLING_MAX_SECONDS}
- value={props.pvePollingCustomSeconds()}
- class="w-full rounded-lg border border-gray-300 px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 dark:border-gray-600 dark:bg-gray-900/60"
- disabled={props.pvePollingEnvLocked()}
- onInput={(e) => {
- if (props.pvePollingEnvLocked()) return;
- const parsed = Math.floor(Number(e.currentTarget.value));
- if (Number.isNaN(parsed)) {
- return;
- }
- const clamped = Math.min(
- PVE_POLLING_MAX_SECONDS,
- Math.max(PVE_POLLING_MIN_SECONDS, parsed)
- );
- props.setPVEPollingCustomSeconds(clamped);
- props.setPVEPollingInterval(clamped);
- props.setHasUnsavedChanges(true);
- }}
- />
- <p class="text-[0.68rem] text-gray-500 dark:text-gray-400">
- Applies to all PVE clusters and standalone nodes.
- </p>
- </div>
- </Show>
-
- {/* Env override warning */}
- <Show when={props.pvePollingEnvLocked()}>
- <div class="flex items-center gap-2 rounded-md border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-800 dark:border-amber-800 dark:bg-amber-900/30 dark:text-amber-200">
- <svg
- class="h-4 w-4 flex-shrink-0"
- viewBox="0 0 24 24"
- fill="none"
- stroke="currentColor"
- stroke-width="2"
- >
- <circle cx="12" cy="12" r="10" />
- <line x1="12" y1="8" x2="12" y2="12" />
- <circle cx="12" cy="16" r="0.5" />
- </svg>
- <span>Managed via environment variable PVE_POLLING_INTERVAL.</span>
- </div>
- </Show>
- </div>
+ {/* Env override warning */}
+ <Show when={props.pvePollingEnvLocked()}>
+ <div class="flex items-center gap-2 rounded-md border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-800 dark:border-amber-800 dark:bg-amber-900/30 dark:text-amber-200">
+ <svg
+ class="h-4 w-4 flex-shrink-0"
+ viewBox="0 0 24 24"
+ fill="none"
+ stroke="currentColor"
+ stroke-width="2"
+ >
+ <circle cx="12" cy="12" r="10" />
+ <line x1="12" y1="8" x2="12" y2="12" />
+ <circle cx="12" cy="16" r="0.5" />
+ </svg>
+ <span>Managed via environment variable PVE_POLLING_INTERVAL.</span>
+ </div>
+ </Show>
</div>
- </Card>
+ </SettingsPanel>
</div>
);
};
diff --git a/frontend-modern/src/components/Settings/NetworkSettingsPanel.tsx b/frontend-modern/src/components/Settings/NetworkSettingsPanel.tsx
index d64bbc4209..07201d3513 100644
--- a/frontend-modern/src/components/Settings/NetworkSettingsPanel.tsx
+++ b/frontend-modern/src/components/Settings/NetworkSettingsPanel.tsx
@@ -1,5 +1,6 @@
import { Component, Show, For, Accessor, Setter } from 'solid-js';
import { Card } from '@/components/shared/Card';
+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';
@@ -92,593 +93,577 @@ export const NetworkSettingsPanel: Component<NetworkSettingsPanelProps> = (props
</Card>
{/* Main Network Card */}
- <Card
- padding="none"
- class="overflow-hidden border border-gray-200 dark:border-gray-700"
- border={false}
+ <SettingsPanel
+ title="Network"
+ description="Discovery, CORS, and embedding settings"
+ icon={<Network class="w-5 h-5" strokeWidth={2} />}
+ bodyClass="space-y-8"
>
- {/* Header */}
- <div class="bg-gradient-to-r from-blue-50 to-indigo-50 dark:from-blue-900/20 dark:to-indigo-900/20 px-6 py-4 border-b border-gray-200 dark:border-gray-700">
- <div class="flex items-center gap-3">
- <div class="p-2 bg-blue-100 dark:bg-blue-900/40 rounded-lg">
- <Network class="w-5 h-5 text-blue-600 dark:text-blue-300" strokeWidth={2} />
+ {/* Network Discovery Section */}
+ <section class="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-gray-600 dark:text-gray-400">
+ <p class="font-medium text-gray-900 dark:text-gray-100">Automatic scanning</p>
+ <p class="text-xs text-gray-500 dark:text-gray-400">
+ Enable discovery to surface Proxmox VE, PBS, and PMG endpoints automatically.
+ </p>
</div>
- <SectionHeader
- title="Network"
- description="Discovery, CORS, and embedding settings"
- size="sm"
- class="flex-1"
+ <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-gray-600 dark:text-gray-400">
+ {props.discoveryEnabled() ? 'On' : 'Off'}
+ </span>
+ }
/>
</div>
- </div>
-
- <div class="p-6 space-y-8">
- {/* Network Discovery Section */}
- <section class="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-gray-600 dark:text-gray-400">
- <p class="font-medium text-gray-900 dark:text-gray-100">Automatic scanning</p>
- <p class="text-xs text-gray-500 dark:text-gray-400">
- 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-gray-600 dark:text-gray-400">
- {props.discoveryEnabled() ? 'On' : 'Off'}
- </span>
- }
- />
- </div>
-
- {/* Discovery Options (shown when enabled) */}
- <Show when={props.discoveryEnabled()}>
- <div class="space-y-4 rounded-lg border border-gray-200 bg-white/40 p-3 dark:border-gray-600 dark:bg-gray-800/40">
- <fieldset class="space-y-2">
- <legend class="text-xs font-medium text-gray-700 dark:text-gray-300">
- Scan scope
- </legend>
- <div class="space-y-2">
- {/* Auto mode */}
- <label
- class={`flex items-start gap-3 rounded-lg border p-2 transition-colors ${props.discoveryMode() === 'auto'
- ? 'border-blue-200 bg-blue-50/80 dark:border-blue-700 dark:bg-blue-900/20'
- : 'border-transparent hover:border-gray-200 dark:hover:border-gray-600'
- }`}
- >
- <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()
+ {/* Discovery Options (shown when enabled) */}
+ <Show when={props.discoveryEnabled()}>
+ <div class="space-y-4 rounded-lg border border-gray-200 bg-white/40 p-3 dark:border-gray-600 dark:bg-gray-800/40">
+ <fieldset class="space-y-2">
+ <legend class="text-xs font-medium text-gray-700 dark:text-gray-300">
+ Scan scope
+ </legend>
+ <div class="space-y-2">
+ {/* Auto mode */}
+ <label
+ class={`flex items-start gap-3 rounded-lg border p-2 transition-colors ${props.discoveryMode() === 'auto'
+ ? 'border-blue-200 bg-blue-50/80 dark:border-blue-700 dark:bg-blue-900/20'
+ : 'border-transparent hover:border-gray-200 dark:hover:border-gray-600'
+ }`}
+ >
+ <input
+ type="radio"
+ name="discoveryMode"
+ value="auto"
+ checked={props.discoveryMode() === 'auto'}
+ onChange={async () => {
+ if (props.discoveryMode() !== 'auto') {
+ await props.handleDiscoveryModeChange('auto');
}
- class="mt-1 h-4 w-4 border-gray-300 text-blue-600 focus:ring-blue-500"
- />
- <div class="space-y-1">
- <p class="text-sm font-medium text-gray-900 dark:text-gray-100">
- Auto (slower, full scan)
- </p>
- <p class="text-xs text-gray-500 dark:text-gray-400">
- Scans container, local, and gateway networks. Large networks may time out
- after two minutes.
- </p>
- </div>
- </label>
+ }}
+ disabled={
+ props.envOverrides().discoverySubnet || props.savingDiscoverySettings()
+ }
+ class="mt-1 h-4 w-4 border-gray-300 text-blue-600 focus:ring-blue-500"
+ />
+ <div class="space-y-1">
+ <p class="text-sm font-medium text-gray-900 dark:text-gray-100">
+ Auto (slower, full scan)
+ </p>
+ <p class="text-xs text-gray-500 dark:text-gray-400">
+ Scans container, local, and gateway networks. Large networks may time out
+ after two minutes.
+ </p>
+ </div>
+ </label>
- {/* Custom mode */}
- <label
- class={`flex items-start gap-3 rounded-lg border p-2 transition-colors ${props.discoveryMode() === 'custom'
- ? 'border-blue-200 bg-blue-50/80 dark:border-blue-700 dark:bg-blue-900/20'
- : 'border-transparent hover:border-gray-200 dark:hover:border-gray-600'
- }`}
- >
- <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()
+ {/* Custom mode */}
+ <label
+ class={`flex items-start gap-3 rounded-lg border p-2 transition-colors ${props.discoveryMode() === 'custom'
+ ? 'border-blue-200 bg-blue-50/80 dark:border-blue-700 dark:bg-blue-900/20'
+ : 'border-transparent hover:border-gray-200 dark:hover:border-gray-600'
+ }`}
+ >
+ <input
+ type="radio"
+ name="discoveryMode"
+ value="custom"
+ checked={props.discoveryMode() === 'custom'}
+ onChange={() => {
+ if (props.discoveryMode() !== 'custom') {
+ props.handleDiscoveryModeChange('custom');
}
- class="mt-1 h-4 w-4 border-gray-300 text-blue-600 focus:ring-blue-500"
- />
- <div class="space-y-1">
- <p class="text-sm font-medium text-gray-900 dark:text-gray-100">
- Custom subnet (faster)
- </p>
- <p class="text-xs text-gray-500 dark:text-gray-400">
- 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-gray-500 dark:text-gray-400">
- 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-gray-300 text-gray-700 hover:border-blue-400 hover:bg-blue-50 dark:border-gray-600 dark:text-gray-300 dark:hover:border-blue-500 dark:hover:bg-blue-900/30'
- }`}
- onClick={async () => {
- if (props.envOverrides().discoverySubnet) {
- return;
- }
- let selections = [...currentSelections];
- if (isActive) {
- selections = selections.filter((item) => item !== preset);
- } else {
- selections.push(preset);
- }
+ }}
+ disabled={
+ props.envOverrides().discoverySubnet || props.savingDiscoverySettings()
+ }
+ class="mt-1 h-4 w-4 border-gray-300 text-blue-600 focus:ring-blue-500"
+ />
+ <div class="space-y-1">
+ <p class="text-sm font-medium text-gray-900 dark:text-gray-100">
+ Custom subnet (faster)
+ </p>
+ <p class="text-xs text-gray-500 dark:text-gray-400">
+ Limit discovery to one or more CIDR ranges to finish faster on large
+ networks.
+ </p>
+ </div>
+ </label>
- 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;
- }
+ {/* 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-gray-500 dark:text-gray-400">
+ 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-gray-300 text-gray-700 hover:border-blue-400 hover:bg-blue-50 dark:border-gray-600 dark:text-gray-300 dark:hover:border-blue-500 dark:hover:bg-blue-900/30'
+ }`}
+ onClick={async () => {
+ if (props.envOverrides().discoverySubnet) {
+ return;
+ }
+ let selections = [...currentSelections];
+ if (isActive) {
+ selections = selections.filter((item) => item !== preset);
+ } else {
+ selections.push(preset);
+ }
- const updatedValue = props.normalizeSubnetList(
- selections.join(', ')
+ 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)'
);
- 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>
+ return;
+ }
- {/* 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-gray-700 dark:text-gray-300"
- >
- Discovery subnet
- </label>
- <span
- class="text-gray-400 hover:text-gray-500 dark:text-gray-500 dark:hover:text-gray-300"
- 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-4 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 rounded-lg border px-3 py-2 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/20 dark:text-amber-200 cursor-not-allowed opacity-60'
- : 'border-gray-300 bg-white dark:border-gray-600 dark:bg-gray-900/70'
- }`}
- 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-gray-500 dark:text-gray-400">
- Auto scans every reachable network phase. Large networks may time out — switch
- to custom subnets to narrow the search.
- </p>
- </Show>
- <Show when={!props.discoverySubnetError() && props.discoveryMode() === 'custom'}>
- <p class="text-xs text-gray-500 dark:text-gray-400">
- Example: 192.168.1.0/24, 10.0.0.0/24 (comma-separated). Smaller ranges finish
- faster and avoid timeouts.
- </p>
+ 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>
- </div>
- </Show>
-
- {/* Env override warning */}
- <Show when={props.envOverrides().discoveryEnabled || props.envOverrides().discoverySubnet}>
- <div class="rounded-lg border border-amber-200 bg-amber-100/80 p-3 text-xs text-amber-800 dark:border-amber-700 dark:bg-amber-900/20 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>
+ </fieldset>
- {/* Public URL Setting */}
- <section class="space-y-3">
- <h4 class="flex items-center gap-2 text-sm font-medium text-gray-700 dark:text-gray-300">
- <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-gray-900 dark:text-gray-100">
- Dashboard URL for Notifications
- </label>
- <p class="text-xs text-gray-600 dark:text-gray-400">
- The URL included in email alerts to link back to Pulse. Required for Docker deployments with custom ports.
- </p>
- <div class="relative">
+ {/* 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-gray-700 dark:text-gray-300"
+ >
+ Discovery subnet
+ </label>
+ <span
+ class="text-gray-400 hover:text-gray-500 dark:text-gray-500 dark:hover:text-gray-300"
+ 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-4 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.publicURL()}
+ 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 rounded-lg border px-3 py-2 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/20 dark:text-amber-200 cursor-not-allowed opacity-60'
+ : 'border-gray-300 bg-white dark:border-gray-600 dark:bg-gray-900/70'
+ }`}
+ disabled={props.envOverrides().discoverySubnet}
onInput={(e) => {
- if (!props.envOverrides().publicURL) {
- props.setPublicURL(e.currentTarget.value);
- props.setHasUnsavedChanges(true);
+ 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);
}
}}
- disabled={props.envOverrides().publicURL}
- placeholder="http://192.168.1.100:8080"
- class={`w-full px-3 py-1.5 text-sm border rounded-lg ${props.envOverrides().publicURL
- ? 'border-amber-300 dark:border-amber-600 bg-amber-50 dark:bg-amber-900/20 cursor-not-allowed opacity-75'
- : 'border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800'
- }`}
- />
- {props.envOverrides().publicURL && (
- <div class="mt-2 p-2 bg-amber-100 dark:bg-amber-900/30 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-gray-500 dark:text-gray-400 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="space-y-3">
- <h4 class="flex items-center gap-2 text-sm font-medium text-gray-700 dark:text-gray-300">
- <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-gray-900 dark:text-gray-100">
- CORS Allowed Origins
- </label>
- <p class="text-xs text-gray-600 dark:text-gray-400">
- 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);
+ 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();
}
}}
- disabled={props.envOverrides().allowedOrigins}
- placeholder="* or https://example.com"
- class={`w-full px-3 py-1.5 text-sm border rounded-lg ${props.envOverrides().allowedOrigins
- ? 'border-amber-300 dark:border-amber-600 bg-amber-50 dark:bg-amber-900/20 cursor-not-allowed opacity-75'
- : 'border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800'
- }`}
/>
- {props.envOverrides().allowedOrigins && (
- <div class="mt-2 p-2 bg-amber-100 dark:bg-amber-900/30 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>
- )}
+ <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-gray-500 dark:text-gray-400">
+ Auto scans every reachable network phase. Large networks may time out — switch
+ to custom subnets to narrow the search.
+ </p>
+ </Show>
+ <Show when={!props.discoverySubnetError() && props.discoveryMode() === 'custom'}>
+ <p class="text-xs text-gray-500 dark:text-gray-400">
+ Example: 192.168.1.0/24, 10.0.0.0/24 (comma-separated). Smaller ranges finish
+ faster and avoid timeouts.
+ </p>
+ </Show>
</div>
</div>
- </section>
+ </Show>
- {/* Embedding Section */}
- <section class="space-y-3">
- <h4 class="flex items-center gap-2 text-sm font-medium text-gray-700 dark:text-gray-300">
- <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>
+ {/* Env override warning */}
+ <Show when={props.envOverrides().discoveryEnabled || props.envOverrides().discoverySubnet}>
+ <div class="rounded-lg border border-amber-200 bg-amber-100/80 p-3 text-xs text-amber-800 dark:border-amber-700 dark:bg-amber-900/20 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="space-y-3">
+ <h4 class="flex items-center gap-2 text-sm font-medium text-gray-700 dark:text-gray-300">
+ <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-gray-900 dark:text-gray-100">
+ Dashboard URL for Notifications
+ </label>
<p class="text-xs text-gray-600 dark:text-gray-400">
- Allow Pulse to be embedded in iframes (e.g., Homepage dashboard)
+ The URL included in email alerts to link back to Pulse. Required for Docker deployments with custom ports.
</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);
+ <div class="relative">
+ <input
+ type="text"
+ value={props.publicURL()}
+ onInput={(e) => {
+ if (!props.envOverrides().publicURL) {
+ props.setPublicURL(e.currentTarget.value);
props.setHasUnsavedChanges(true);
- }}
- class="rounded border-gray-300 dark:border-gray-600 text-blue-600 focus:ring-blue-500"
- />
- <label for="allowEmbedding" class="text-sm text-gray-700 dark:text-gray-300">
- Allow iframe embedding
- </label>
- </div>
+ }
+ }}
+ disabled={props.envOverrides().publicURL}
+ placeholder="http://192.168.1.100:8080"
+ class={`w-full px-3 py-1.5 text-sm border rounded-lg ${props.envOverrides().publicURL
+ ? 'border-amber-300 dark:border-amber-600 bg-amber-50 dark:bg-amber-900/20 cursor-not-allowed opacity-75'
+ : 'border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800'
+ }`}
+ />
+ {props.envOverrides().publicURL && (
+ <div class="mt-2 p-2 bg-amber-100 dark:bg-amber-900/30 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-gray-500 dark:text-gray-400 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>
- <Show when={props.allowEmbedding()}>
- <div class="space-y-2">
- <label class="text-xs font-medium text-gray-700 dark:text-gray-300">
- Allowed Embed Origins (optional)
- </label>
- <p class="text-xs text-gray-600 dark:text-gray-400">
- 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 px-3 py-1.5 text-sm border rounded-lg border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800"
- />
- <p class="text-xs text-gray-500 dark:text-gray-400">
- 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>
+ {/* CORS Settings Section */}
+ <section class="space-y-3">
+ <h4 class="flex items-center gap-2 text-sm font-medium text-gray-700 dark:text-gray-300">
+ <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-gray-900 dark:text-gray-100">
+ CORS Allowed Origins
+ </label>
+ <p class="text-xs text-gray-600 dark:text-gray-400">
+ 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 px-3 py-1.5 text-sm border rounded-lg ${props.envOverrides().allowedOrigins
+ ? 'border-amber-300 dark:border-amber-600 bg-amber-50 dark:bg-amber-900/20 cursor-not-allowed opacity-75'
+ : 'border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800'
+ }`}
+ />
+ {props.envOverrides().allowedOrigins && (
+ <div class="mt-2 p-2 bg-amber-100 dark:bg-amber-900/30 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>
- </Show>
+ )}
</div>
- </section>
+ </div>
+ </section>
- {/* Webhook Security Section */}
- <section class="space-y-3">
- <h3 class="text-sm font-semibold text-gray-900 dark:text-gray-100 flex items-center gap-2">
- <svg
- xmlns="http://www.w3.org/2000/svg"
- class="h-4 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-gray-700 dark:text-gray-300">
- Allowed Private IP Ranges for Webhooks
+ {/* Embedding Section */}
+ <section class="space-y-3">
+ <h4 class="flex items-center gap-2 text-sm font-medium text-gray-700 dark:text-gray-300">
+ <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-gray-600 dark:text-gray-400">
+ 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="rounded border-gray-300 dark:border-gray-600 text-blue-600 focus:ring-blue-500"
+ />
+ <label for="allowEmbedding" class="text-sm text-gray-700 dark:text-gray-300">
+ Allow iframe embedding
+ </label>
+ </div>
+
+ <Show when={props.allowEmbedding()}>
+ <div class="space-y-2">
+ <label class="text-xs font-medium text-gray-700 dark:text-gray-300">
+ Allowed Embed Origins (optional)
</label>
- <p class="text-xs text-gray-500 dark:text-gray-400 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 class="text-xs text-gray-600 dark:text-gray-400">
+ Comma-separated list of origins that can embed Pulse (leave empty for same-origin
+ only)
</p>
<input
type="text"
- value={props.webhookAllowedPrivateCIDRs()}
+ value={props.allowedEmbedOrigins()}
onChange={(e) => {
- props.setWebhookAllowedPrivateCIDRs(e.currentTarget.value);
+ props.setAllowedEmbedOrigins(e.currentTarget.value);
props.setHasUnsavedChanges(true);
}}
- placeholder="192.168.1.0/24, 10.0.0.0/8"
+ placeholder="https://my.domain, https://dashboard.example.com"
class="w-full px-3 py-1.5 text-sm border rounded-lg border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800"
/>
- <p class="text-xs text-gray-500 dark:text-gray-400 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 class="text-xs text-gray-500 dark:text-gray-400">
+ 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="space-y-3">
+ <h3 class="text-sm font-semibold text-gray-900 dark:text-gray-100 flex items-center gap-2">
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ class="h-4 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-gray-700 dark:text-gray-300">
+ Allowed Private IP Ranges for Webhooks
+ </label>
+ <p class="text-xs text-gray-500 dark:text-gray-400 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 px-3 py-1.5 text-sm border rounded-lg border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800"
+ />
+ <p class="text-xs text-gray-500 dark:text-gray-400 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>
- </section>
+ </div>
+ </section>
- {/* Port Configuration Notice */}
- <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>
- </Card>
+ {/* Port Configuration Notice */}
+ <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>
+ </SettingsPanel>
</div>
);
};
diff --git a/frontend-modern/src/components/Settings/ReportingPanel.tsx b/frontend-modern/src/components/Settings/ReportingPanel.tsx
index ae22c48cfe..ed66bff680 100644
--- a/frontend-modern/src/components/Settings/ReportingPanel.tsx
+++ b/frontend-modern/src/components/Settings/ReportingPanel.tsx
@@ -2,8 +2,7 @@ import { createSignal, For, Show, JSX } from 'solid-js';
import FileText from 'lucide-solid/icons/file-text';
import Download from 'lucide-solid/icons/download';
import BarChart from 'lucide-solid/icons/bar-chart';
-import { Card } from '@/components/shared/Card';
-import { SectionHeader } from '@/components/shared/SectionHeader';
+import SettingsPanel from '@/components/shared/SettingsPanel';
import { formField, formLabel, formHelpText, formControl, formSelect } from '@/components/shared/Form';
import { showSuccess, showWarning } from '@/utils/toast';
import { apiFetch } from '@/utils/apiClient';
@@ -89,126 +88,124 @@ export function ReportingPanel() {
return (
<div class="space-y-6">
- <SectionHeader
- title={<>Advanced Reporting</>}
- description={<>Generate detailed infrastructure reports in PDF or CSV format.</>}
- />
-
- <Card>
- <div class="p-6 space-y-6">
- <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
- <FormField label="Resource Type" helpText="Select the type of infrastructure resource">
- <select
- id="resource-type"
- class={formSelect}
- value={resourceType()}
- onChange={(e) => setResourceType(e.currentTarget.value)}
- >
- <option value="node">Proxmox Node</option>
- <option value="vm">Virtual Machine (QEMU)</option>
- <option value="container">Container (LXC)</option>
- <option value="storage">Storage</option>
- </select>
- </FormField>
-
- <FormField label="Resource ID" helpText="Enter the full ID of the resource">
- <input
- id="resource-id"
- type="text"
- class={formControl}
- placeholder="e.g. pve1:node1 or pve1:node1:100"
- value={resourceId()}
- onInput={(e) => setResourceId(e.currentTarget.value)}
- />
- </FormField>
- </div>
+ <SettingsPanel
+ title="Advanced Reporting"
+ description="Generate detailed infrastructure reports in PDF or CSV format."
+ icon={<BarChart class="w-5 h-5" strokeWidth={2} />}
+ bodyClass="space-y-6"
+ >
+ <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
+ <FormField label="Resource Type" helpText="Select the type of infrastructure resource">
+ <select
+ id="resource-type"
+ class={formSelect}
+ value={resourceType()}
+ onChange={(e) => setResourceType(e.currentTarget.value)}
+ >
+ <option value="node">Proxmox Node</option>
+ <option value="vm">Virtual Machine (QEMU)</option>
+ <option value="container">Container (LXC)</option>
+ <option value="storage">Storage</option>
+ </select>
+ </FormField>
+
+ <FormField label="Resource ID" helpText="Enter the full ID of the resource">
+ <input
+ id="resource-id"
+ type="text"
+ class={formControl}
+ placeholder="e.g. pve1:node1 or pve1:node1:100"
+ value={resourceId()}
+ onInput={(e) => setResourceId(e.currentTarget.value)}
+ />
+ </FormField>
+ </div>
- <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
- <FormField label="Metric Type (Optional)" helpText="Filter by specific metric type">
- <input
- id="metric-type"
- type="text"
- class={formControl}
- placeholder="e.g. cpu, memory, netin (leave empty for all)"
- value={metricType()}
- onInput={(e) => setMetricType(e.currentTarget.value)}
- />
- </FormField>
-
- <FormField label="Report Title" helpText="Custom title for the PDF report">
- <input
- id="report-title"
- type="text"
- class={formControl}
- placeholder="Auto-generated if empty"
- value={title()}
- onInput={(e) => setTitle(e.currentTarget.value)}
- />
- </FormField>
- </div>
+ <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
+ <FormField label="Metric Type (Optional)" helpText="Filter by specific metric type">
+ <input
+ id="metric-type"
+ type="text"
+ class={formControl}
+ placeholder="e.g. cpu, memory, netin (leave empty for all)"
+ value={metricType()}
+ onInput={(e) => setMetricType(e.currentTarget.value)}
+ />
+ </FormField>
+
+ <FormField label="Report Title" helpText="Custom title for the PDF report">
+ <input
+ id="report-title"
+ type="text"
+ class={formControl}
+ placeholder="Auto-generated if empty"
+ value={title()}
+ onInput={(e) => setTitle(e.currentTarget.value)}
+ />
+ </FormField>
+ </div>
- <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
- <FormField label="Time Range">
- <div class="flex gap-2">
- <For each={['24h', '7d', '30d']}>
- {(r) => (
- <button
- class={`px-4 py-2 rounded-lg border transition-all ${range() === r
- ? 'bg-blue-600/20 border-blue-500 text-blue-400'
- : 'bg-slate-800/50 border-slate-700 text-slate-400 hover:border-slate-500'
- }`}
- onClick={() => setRange(r)}
- >
- {r === '24h' ? 'Last 24 Hours' : r === '7d' ? 'Last 7 Days' : 'Last 30 Days'}
- </button>
- )}
- </For>
- </div>
- </FormField>
-
- <FormField label="Export Format">
- <div class="flex gap-2">
- <button
- class={`flex items-center gap-2 px-4 py-2 rounded-lg border transition-all ${format() === 'pdf'
- ? 'bg-blue-600/20 border-blue-500 text-blue-400'
- : 'bg-slate-800/50 border-slate-700 text-slate-400 hover:border-slate-500'
- }`}
- onClick={() => setFormat('pdf')}
- >
- <FileText size={16} />
- PDF Report
- </button>
- <button
- class={`flex items-center gap-2 px-4 py-2 rounded-lg border transition-all ${format() === 'csv'
- ? 'bg-blue-600/20 border-blue-500 text-blue-400'
- : 'bg-slate-800/50 border-slate-700 text-slate-400 hover:border-slate-500'
- }`}
- onClick={() => setFormat('csv')}
- >
- <BarChart size={16} />
- CSV Data
- </button>
- </div>
- </FormField>
- </div>
+ <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
+ <FormField label="Time Range">
+ <div class="flex gap-2">
+ <For each={['24h', '7d', '30d']}>
+ {(r) => (
+ <button
+ class={`px-4 py-2 rounded-lg border transition-all ${range() === r
+ ? 'bg-blue-600/20 border-blue-500 text-blue-400'
+ : 'bg-slate-800/50 border-slate-700 text-slate-400 hover:border-slate-500'
+ }`}
+ onClick={() => setRange(r)}
+ >
+ {r === '24h' ? 'Last 24 Hours' : r === '7d' ? 'Last 7 Days' : 'Last 30 Days'}
+ </button>
+ )}
+ </For>
+ </div>
+ </FormField>
+
+ <FormField label="Export Format">
+ <div class="flex gap-2">
+ <button
+ class={`flex items-center gap-2 px-4 py-2 rounded-lg border transition-all ${format() === 'pdf'
+ ? 'bg-blue-600/20 border-blue-500 text-blue-400'
+ : 'bg-slate-800/50 border-slate-700 text-slate-400 hover:border-slate-500'
+ }`}
+ onClick={() => setFormat('pdf')}
+ >
+ <FileText size={16} />
+ PDF Report
+ </button>
+ <button
+ class={`flex items-center gap-2 px-4 py-2 rounded-lg border transition-all ${format() === 'csv'
+ ? 'bg-blue-600/20 border-blue-500 text-blue-400'
+ : 'bg-slate-800/50 border-slate-700 text-slate-400 hover:border-slate-500'
+ }`}
+ onClick={() => setFormat('csv')}
+ >
+ <BarChart size={16} />
+ CSV Data
+ </button>
+ </div>
+ </FormField>
+ </div>
- <div class="flex justify-end pt-4 border-t border-slate-800">
- <button
- class={`flex items-center gap-2 px-6 py-3 rounded-xl font-semibold transition-all ${generating()
- ? 'bg-slate-700 text-slate-400 cursor-not-allowed'
- : 'bg-blue-600 hover:bg-blue-500 text-white shadow-lg shadow-blue-900/20'
- }`}
- disabled={generating()}
- onClick={handleGenerate}
- >
- <Show when={generating()} fallback={<Download size={20} />}>
- <div class="w-5 h-5 border-2 border-white/30 border-t-white rounded-full animate-spin" />
- </Show>
- {generating() ? 'Generating...' : 'Generate Report'}
- </button>
- </div>
+ <div class="flex justify-end pt-4 border-t border-slate-800">
+ <button
+ class={`flex items-center gap-2 px-6 py-3 rounded-xl font-semibold transition-all ${generating()
+ ? 'bg-slate-700 text-slate-400 cursor-not-allowed'
+ : 'bg-blue-600 hover:bg-blue-500 text-white shadow-lg shadow-blue-900/20'
+ }`}
+ disabled={generating()}
+ onClick={handleGenerate}
+ >
+ <Show when={generating()} fallback={<Download size={20} />}>
+ <div class="w-5 h-5 border-2 border-white/30 border-t-white rounded-full animate-spin" />
+ </Show>
+ {generating() ? 'Generating...' : 'Generate Report'}
+ </button>
</div>
- </Card>
+ </SettingsPanel>
<div class="bg-blue-900/10 border border-blue-900/20 rounded-xl p-6 mt-8">
<div class="flex gap-4">
diff --git a/frontend-modern/src/components/Settings/SystemLogsPanel.tsx b/frontend-modern/src/components/Settings/SystemLogsPanel.tsx
index 595146c4ec..3c5fb57c24 100644
--- a/frontend-modern/src/components/Settings/SystemLogsPanel.tsx
+++ b/frontend-modern/src/components/Settings/SystemLogsPanel.tsx
@@ -1,6 +1,5 @@
import { Component, createSignal, onMount, onCleanup, For } from 'solid-js';
-import { Card } from '@/components/shared/Card';
-import { SectionHeader } from '@/components/shared/SectionHeader';
+import SettingsPanel from '@/components/shared/SettingsPanel';
import { apiFetchJSON } from '@/utils/apiClient';
import { notificationStore } from '@/stores/notifications';
import { logger } from '@/utils/logger';
@@ -92,95 +91,93 @@ export const SystemLogsPanel: Component = () => {
return (
<div class="space-y-6">
- <Card>
- <SectionHeader
- title="System Logs"
- description="View real-time system logs and download support bundles."
- />
-
- <div class="px-6 pb-6 space-y-4">
- {/* Controls */}
- <div class="flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4">
- <div class="flex items-center space-x-3">
- <label class="text-sm font-medium text-slate-700 dark:text-slate-300">Log Level:</label>
- <select
- value={level()}
- onChange={(e) => handleLevelChange(e.currentTarget.value)}
- class="form-select text-sm py-1.5 px-3 rounded-md border-gray-300 dark:border-gray-600 bg-white dark:bg-slate-800 text-slate-600 dark:text-slate-300 focus:ring-primary-500 focus:border-primary-500"
- >
- <option value="debug">Debug</option>
- <option value="info">Info</option>
- <option value="warn">Warn</option>
- <option value="error">Error</option>
- </select>
- </div>
-
- <div class="flex items-center space-x-2">
- <button
- onClick={() => setIsPaused(!isPaused())}
- class={`p-2 rounded transition-colors ${isPaused()
- ? 'bg-amber-100 text-amber-600 dark:bg-amber-900/30 dark:text-amber-400'
- : 'hover:bg-slate-100 dark:hover:bg-slate-700 text-slate-600 dark:text-slate-400'
- }`}
- title={isPaused() ? "Resume Stream" : "Pause Stream"}
- >
- {isPaused() ? <Play size={18} /> : <Pause size={18} />}
- </button>
- <button
- onClick={() => setLogs([])}
- class="p-2 rounded hover:bg-slate-100 dark:hover:bg-slate-700 text-slate-600 dark:text-slate-400 transition-colors"
- title="Clear Logs"
- >
- <Trash2 size={18} />
- </button>
- <div class="h-6 w-px bg-slate-200 dark:bg-slate-700 mx-2"></div>
- <button
- onClick={handleDownload}
- class="flex items-center space-x-2 px-3 py-1.5 bg-primary-600 text-white rounded-md hover:bg-primary-700 text-sm font-medium transition-colors shadow-sm"
- >
- <Download size={16} />
- <span>Support Bundle</span>
- </button>
- </div>
+ <SettingsPanel
+ title="System Logs"
+ description="View real-time system logs and download support bundles."
+ icon={<Terminal class="w-5 h-5" strokeWidth={2} />}
+ bodyClass="space-y-4"
+ >
+ {/* Controls */}
+ <div class="flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4">
+ <div class="flex items-center space-x-3">
+ <label class="text-sm font-medium text-slate-700 dark:text-slate-300">Log Level:</label>
+ <select
+ value={level()}
+ onChange={(e) => handleLevelChange(e.currentTarget.value)}
+ class="form-select text-sm py-1.5 px-3 rounded-md border-gray-300 dark:border-gray-600 bg-white dark:bg-slate-800 text-slate-600 dark:text-slate-300 focus:ring-primary-500 focus:border-primary-500"
+ >
+ <option value="debug">Debug</option>
+ <option value="info">Info</option>
+ <option value="warn">Warn</option>
+ <option value="error">Error</option>
+ </select>
</div>
- {/* Terminal View */}
- <div
- ref={logContainer}
- class="bg-slate-950 text-slate-300 font-mono text-xs p-4 rounded-lg h-[500px] overflow-y-auto whitespace-pre-wrap leading-relaxed shadow-inner border border-slate-800 scrollbar-thin scrollbar-thumb-slate-700 scrollbar-track-transparent"
- >
- <For each={logs()}>{(log) =>
- <div class="border-b border-slate-900/50 last:border-0 pb-0.5 mb-0.5 hover:bg-slate-900/50 px-1 -mx-1 rounded">
- {/* Basic highlighting for log levels */}
- {log.includes('"level":"error"') || log.includes('ERR') || log.includes('[ERROR]') ? (
- <span class="text-red-400">{log}</span>
- ) : log.includes('"level":"warn"') || log.includes('WRN') || log.includes('[WARN]') ? (
- <span class="text-amber-400">{log}</span>
- ) : log.includes('"level":"debug"') || log.includes('DBG') || log.includes('[DEBUG]') ? (
- <span class="text-blue-400">{log}</span>
- ) : (
- <span class="text-slate-300">{log}</span>
- )}
- </div>
- }</For>
-
- {logs().length === 0 && !isLoading() && (
- <div class="h-full flex flex-col items-center justify-center text-slate-600">
- <Terminal size={48} class="mb-4 opacity-50" />
- <p>Waiting for logs...</p>
- </div>
- )}
+ <div class="flex items-center space-x-2">
+ <button
+ onClick={() => setIsPaused(!isPaused())}
+ class={`p-2 rounded transition-colors ${isPaused()
+ ? 'bg-amber-100 text-amber-600 dark:bg-amber-900/30 dark:text-amber-400'
+ : 'hover:bg-slate-100 dark:hover:bg-slate-700 text-slate-600 dark:text-slate-400'
+ }`}
+ title={isPaused() ? "Resume Stream" : "Pause Stream"}
+ >
+ {isPaused() ? <Play size={18} /> : <Pause size={18} />}
+ </button>
+ <button
+ onClick={() => setLogs([])}
+ class="p-2 rounded hover:bg-slate-100 dark:hover:bg-slate-700 text-slate-600 dark:text-slate-400 transition-colors"
+ title="Clear Logs"
+ >
+ <Trash2 size={18} />
+ </button>
+ <div class="h-6 w-px bg-slate-200 dark:bg-slate-700 mx-2"></div>
+ <button
+ onClick={handleDownload}
+ class="flex items-center space-x-2 px-3 py-1.5 bg-primary-600 text-white rounded-md hover:bg-primary-700 text-sm font-medium transition-colors shadow-sm"
+ >
+ <Download size={16} />
+ <span>Support Bundle</span>
+ </button>
</div>
+ </div>
- <div class="text-xs text-slate-500 dark:text-slate-400 flex justify-between px-1">
- <span>Buffer: {logs().length} / {MAX_LOGS} lines</span>
- <span class="flex items-center gap-2">
- <div class={`w-2 h-2 rounded-full ${isPaused() ? 'bg-amber-500' : 'bg-green-500 animate-pulse'}`}></div>
- {isPaused() ? "Stream Paused" : "Live"}
- </span>
- </div>
+ {/* Terminal View */}
+ <div
+ ref={logContainer}
+ class="bg-slate-950 text-slate-300 font-mono text-xs p-4 rounded-lg h-[500px] overflow-y-auto whitespace-pre-wrap leading-relaxed shadow-inner border border-slate-800 scrollbar-thin scrollbar-thumb-slate-700 scrollbar-track-transparent"
+ >
+ <For each={logs()}>{(log) =>
+ <div class="border-b border-slate-900/50 last:border-0 pb-0.5 mb-0.5 hover:bg-slate-900/50 px-1 -mx-1 rounded">
+ {/* Basic highlighting for log levels */}
+ {log.includes('"level":"error"') || log.includes('ERR') || log.includes('[ERROR]') ? (
+ <span class="text-red-400">{log}</span>
+ ) : log.includes('"level":"warn"') || log.includes('WRN') || log.includes('[WARN]') ? (
+ <span class="text-amber-400">{log}</span>
+ ) : log.includes('"level":"debug"') || log.includes('DBG') || log.includes('[DEBUG]') ? (
+ <span class="text-blue-400">{log}</span>
+ ) : (
+ <span class="text-slate-300">{log}</span>
+ )}
+ </div>
+ }</For>
+
+ {logs().length === 0 && !isLoading() && (
+ <div class="h-full flex flex-col items-center justify-center text-slate-600">
+ <Terminal size={48} class="mb-4 opacity-50" />
+ <p>Waiting for logs...</p>
+ </div>
+ )}
+ </div>
+
+ <div class="text-xs text-slate-500 dark:text-slate-400 flex justify-between px-1">
+ <span>Buffer: {logs().length} / {MAX_LOGS} lines</span>
+ <span class="flex items-center gap-2">
+ <div class={`w-2 h-2 rounded-full ${isPaused() ? 'bg-amber-500' : 'bg-green-500 animate-pulse'}`}></div>
+ {isPaused() ? "Stream Paused" : "Live"}
+ </span>
</div>
- </Card>
+ </SettingsPanel>
</div>
);
};
diff --git a/frontend-modern/src/components/Settings/UpdatesSettingsPanel.tsx b/frontend-modern/src/components/Settings/UpdatesSettingsPanel.tsx
index 6221a53ad2..75a352b69f 100644
--- a/frontend-modern/src/components/Settings/UpdatesSettingsPanel.tsx
+++ b/frontend-modern/src/components/Settings/UpdatesSettingsPanel.tsx
@@ -1,6 +1,5 @@
import { Component, Show, Accessor, Setter } from 'solid-js';
-import { Card } from '@/components/shared/Card';
-import { SectionHeader } from '@/components/shared/SectionHeader';
+import SettingsPanel from '@/components/shared/SettingsPanel';
import { HelpIcon } from '@/components/shared/HelpIcon';
import RefreshCw from 'lucide-solid/icons/refresh-cw';
import CheckCircle from 'lucide-solid/icons/check-circle';
@@ -32,652 +31,636 @@ interface UpdatesSettingsPanelProps {
export const UpdatesSettingsPanel: Component<UpdatesSettingsPanelProps> = (props) => {
return (
<div class="space-y-6">
- <Card
- padding="none"
- class="overflow-hidden border border-gray-200 dark:border-gray-700"
- border={false}
+ <SettingsPanel
+ title="Updates"
+ description="Version checking and automatic update configuration"
+ icon={<RefreshCw class="w-5 h-5" strokeWidth={2} />}
+ bodyClass="space-y-6"
>
- {/* Header */}
- <div class="bg-gradient-to-r from-blue-50 to-indigo-50 dark:from-blue-900/20 dark:to-indigo-900/20 px-6 py-4 border-b border-gray-200 dark:border-gray-700">
- <div class="flex items-center gap-3">
- <div class="p-2 bg-blue-100 dark:bg-blue-900/40 rounded-lg">
- <RefreshCw class="w-5 h-5 text-blue-600 dark:text-blue-300" strokeWidth={2} />
- </div>
- <SectionHeader
- title="Updates"
- description="Version checking and automatic update configuration"
- size="sm"
- class="flex-1"
- />
- </div>
- </div>
-
- <div class="p-6 space-y-6">
- <section class="space-y-4">
- <div class="space-y-4">
- {/* Version Status Section */}
- <div class="rounded-xl border border-gray-200 dark:border-gray-700 overflow-hidden">
- {/* Version Grid */}
- <div class={`grid gap-px ${props.updateInfo()?.available ? 'sm:grid-cols-3' : 'sm:grid-cols-2'}`}>
- {/* Current Version */}
- <div class="bg-gray-50 dark:bg-gray-800/60 p-4">
- <div class="flex items-start gap-3">
- <div class="p-2 bg-blue-100 dark:bg-blue-900/50 rounded-lg">
- <Package class="w-5 h-5 text-blue-600 dark:text-blue-400" />
- </div>
- <div class="flex-1 min-w-0">
- <p class="text-xs font-medium uppercase tracking-wide text-gray-500 dark:text-gray-400">
- Current Version
- </p>
- <p class="mt-1 text-lg font-bold text-gray-900 dark:text-gray-100 truncate">
- {props.versionInfo()?.version || 'Loading...'}
- </p>
- <div class="mt-1.5 flex flex-wrap items-center gap-1.5">
- <Show when={props.versionInfo()?.isDevelopment}>
- <span class="inline-flex items-center px-2 py-0.5 text-[10px] font-medium rounded-full bg-amber-100 text-amber-700 dark:bg-amber-900/50 dark:text-amber-300">
- Development
- </span>
- </Show>
- <Show when={props.versionInfo()?.isDocker}>
- <span class="inline-flex items-center px-2 py-0.5 text-[10px] font-medium rounded-full bg-blue-100 text-blue-700 dark:bg-blue-900/50 dark:text-blue-300">
- Docker
- </span>
- </Show>
- <Show when={props.versionInfo()?.isSourceBuild}>
- <span class="inline-flex items-center px-2 py-0.5 text-[10px] font-medium rounded-full bg-purple-100 text-purple-700 dark:bg-purple-900/50 dark:text-purple-300">
- Source
- </span>
- </Show>
- </div>
+ <section class="space-y-4">
+ <div class="space-y-4">
+ {/* Version Status Section */}
+ <div class="rounded-xl border border-gray-200 dark:border-gray-700 overflow-hidden">
+ {/* Version Grid */}
+ <div class={`grid gap-px ${props.updateInfo()?.available ? 'sm:grid-cols-3' : 'sm:grid-cols-2'}`}>
+ {/* Current Version */}
+ <div class="bg-gray-50 dark:bg-gray-800/60 p-4">
+ <div class="flex items-start gap-3">
+ <div class="p-2 bg-blue-100 dark:bg-blue-900/50 rounded-lg">
+ <Package class="w-5 h-5 text-blue-600 dark:text-blue-400" />
+ </div>
+ <div class="flex-1 min-w-0">
+ <p class="text-xs font-medium uppercase tracking-wide text-gray-500 dark:text-gray-400">
+ Current Version
+ </p>
+ <p class="mt-1 text-lg font-bold text-gray-900 dark:text-gray-100 truncate">
+ {props.versionInfo()?.version || 'Loading...'}
+ </p>
+ <div class="mt-1.5 flex flex-wrap items-center gap-1.5">
+ <Show when={props.versionInfo()?.isDevelopment}>
+ <span class="inline-flex items-center px-2 py-0.5 text-[10px] font-medium rounded-full bg-amber-100 text-amber-700 dark:bg-amber-900/50 dark:text-amber-300">
+ Development
+ </span>
+ </Show>
+ <Show when={props.versionInfo()?.isDocker}>
+ <span class="inline-flex items-center px-2 py-0.5 text-[10px] font-medium rounded-full bg-blue-100 text-blue-700 dark:bg-blue-900/50 dark:text-blue-300">
+ Docker
+ </span>
+ </Show>
+ <Show when={props.versionInfo()?.isSourceBuild}>
+ <span class="inline-flex items-center px-2 py-0.5 text-[10px] font-medium rounded-full bg-purple-100 text-purple-700 dark:bg-purple-900/50 dark:text-purple-300">
+ Source
+ </span>
+ </Show>
</div>
</div>
</div>
+ </div>
- {/* Update Status / Arrow */}
- <Show when={props.updateInfo()?.available}>
- <div class="bg-gradient-to-r from-green-50 to-emerald-50 dark:from-green-900/30 dark:to-emerald-900/30 p-4 flex items-center justify-center">
- <div class="flex flex-col items-center gap-1.5">
- <div class="flex items-center gap-2 text-green-600 dark:text-green-400">
- <ArrowRight class="w-5 h-5" />
- </div>
- <span class="text-xs font-semibold text-green-700 dark:text-green-300 uppercase tracking-wide">
- Update Ready
- </span>
+ {/* Update Status / Arrow */}
+ <Show when={props.updateInfo()?.available}>
+ <div class="bg-green-50 dark:bg-green-900/30 p-4 flex items-center justify-center">
+ <div class="flex flex-col items-center gap-1.5">
+ <div class="flex items-center gap-2 text-green-600 dark:text-green-400">
+ <ArrowRight class="w-5 h-5" />
</div>
+ <span class="text-xs font-semibold text-green-700 dark:text-green-300 uppercase tracking-wide">
+ Update Ready
+ </span>
</div>
- </Show>
+ </div>
+ </Show>
- {/* Latest Version / Status */}
- <div class={`p-4 ${props.updateInfo()?.available
- ? 'bg-gradient-to-br from-green-50 to-emerald-50 dark:from-green-900/20 dark:to-emerald-900/20'
- : 'bg-gray-50 dark:bg-gray-800/60'
- }`}>
- <div class="flex items-start gap-3">
- <div class={`p-2 rounded-lg ${props.updateInfo()?.available
- ? 'bg-green-100 dark:bg-green-900/50'
- : 'bg-gray-100 dark:bg-gray-700'
- }`}>
- <Show when={props.updateInfo()?.available} fallback={
- <CheckCircle class="w-5 h-5 text-gray-500 dark:text-gray-400" />
- }>
- <CheckCircle class="w-5 h-5 text-green-600 dark:text-green-400" />
- </Show>
- </div>
- <div class="flex-1 min-w-0">
- <p class="text-xs font-medium uppercase tracking-wide text-gray-500 dark:text-gray-400">
- {props.updateInfo()?.available ? 'Available' : 'Status'}
+ {/* Latest Version / Status */}
+ <div class={`p-4 ${props.updateInfo()?.available
+ ? 'bg-green-50 dark:bg-green-900/20'
+ : 'bg-gray-50 dark:bg-gray-800/60'
+ }`}>
+ <div class="flex items-start gap-3">
+ <div class={`p-2 rounded-lg ${props.updateInfo()?.available
+ ? 'bg-green-100 dark:bg-green-900/50'
+ : 'bg-gray-100 dark:bg-gray-700'
+ }`}>
+ <Show when={props.updateInfo()?.available} fallback={
+ <CheckCircle class="w-5 h-5 text-gray-500 dark:text-gray-400" />
+ }>
+ <CheckCircle class="w-5 h-5 text-green-600 dark:text-green-400" />
+ </Show>
+ </div>
+ <div class="flex-1 min-w-0">
+ <p class="text-xs font-medium uppercase tracking-wide text-gray-500 dark:text-gray-400">
+ {props.updateInfo()?.available ? 'Available' : 'Status'}
+ </p>
+ <Show when={props.updateInfo()?.available} fallback={
+ <p class="mt-1 text-lg font-bold text-gray-900 dark:text-gray-100">
+ Up to date
</p>
- <Show when={props.updateInfo()?.available} fallback={
- <p class="mt-1 text-lg font-bold text-gray-900 dark:text-gray-100">
- Up to date
- </p>
- }>
- <p class="mt-1 text-lg font-bold text-green-700 dark:text-green-300">
- {props.updateInfo()?.latestVersion}
+ }>
+ <p class="mt-1 text-lg font-bold text-green-700 dark:text-green-300">
+ {props.updateInfo()?.latestVersion}
+ </p>
+ <Show when={props.updateInfo()?.releaseDate}>
+ <p class="mt-0.5 text-xs text-green-600 dark:text-green-400">
+ Released {new Date(props.updateInfo()!.releaseDate).toLocaleDateString()}
</p>
- <Show when={props.updateInfo()?.releaseDate}>
- <p class="mt-0.5 text-xs text-green-600 dark:text-green-400">
- Released {new Date(props.updateInfo()!.releaseDate).toLocaleDateString()}
- </p>
- </Show>
</Show>
- </div>
+ </Show>
</div>
</div>
</div>
+ </div>
- {/* Check for updates button */}
- <div class="bg-white dark:bg-gray-900/50 border-t border-gray-200 dark:border-gray-700 px-4 py-3 flex items-center justify-between">
- <p class="text-xs text-gray-500 dark:text-gray-400">
- <Show when={props.autoUpdateEnabled()}>
- Auto-check enabled
- </Show>
- <Show when={!props.autoUpdateEnabled()}>
- Manual checks only
- </Show>
- </p>
- <button
- type="button"
- onClick={props.checkForUpdates}
- disabled={
- props.checkingForUpdates() ||
- props.versionInfo()?.isSourceBuild
- }
- class={`px-4 py-2 text-sm rounded-lg transition-colors flex items-center gap-2 ${props.versionInfo()?.isSourceBuild
- ? 'bg-gray-100 dark:bg-gray-700 text-gray-400 dark:text-gray-500 cursor-not-allowed'
- : 'bg-blue-600 text-white hover:bg-blue-700'
- }`}
- >
- {props.checkingForUpdates() ? (
- <>
- <div class="animate-spin h-4 w-4 border-2 border-white border-t-transparent rounded-full"></div>
- Checking...
- </>
- ) : (
- <>
- <RefreshCw class="w-4 h-4" />
- Check Now
- </>
- )}
- </button>
- </div>
+ {/* Check for updates button */}
+ <div class="bg-white dark:bg-gray-900/50 border-t border-gray-200 dark:border-gray-700 px-4 py-3 flex items-center justify-between">
+ <p class="text-xs text-gray-500 dark:text-gray-400">
+ <Show when={props.autoUpdateEnabled()}>
+ Auto-check enabled
+ </Show>
+ <Show when={!props.autoUpdateEnabled()}>
+ Manual checks only
+ </Show>
+ </p>
+ <button
+ type="button"
+ onClick={props.checkForUpdates}
+ disabled={
+ props.checkingForUpdates() ||
+ props.versionInfo()?.isSourceBuild
+ }
+ class={`px-4 py-2 text-sm rounded-lg transition-colors flex items-center gap-2 ${props.versionInfo()?.isSourceBuild
+ ? 'bg-gray-100 dark:bg-gray-700 text-gray-400 dark:text-gray-500 cursor-not-allowed'
+ : 'bg-blue-600 text-white hover:bg-blue-700'
+ }`}
+ >
+ {props.checkingForUpdates() ? (
+ <>
+ <div class="animate-spin h-4 w-4 border-2 border-white border-t-transparent rounded-full"></div>
+ Checking...
+ </>
+ ) : (
+ <>
+ <RefreshCw class="w-4 h-4" />
+ Check Now
+ </>
+ )}
+ </button>
</div>
+ </div>
- {/* Docker installation notice - enhanced with copy-able commands */}
- <Show when={props.versionInfo()?.isDocker && !props.updateInfo()?.available}>
- <div class="p-4 bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 rounded-lg space-y-3">
- <div class="flex items-center gap-2">
- <svg class="w-5 h-5 text-blue-600 dark:text-blue-400 flex-shrink-0" viewBox="0 0 24 24" fill="currentColor">
- <path d="M13.983 11.078h2.119a.186.186 0 00.186-.185V9.006a.186.186 0 00-.186-.186h-2.119a.186.186 0 00-.185.186v1.887c0 .102.083.185.185.185m-2.954-5.43h2.118a.186.186 0 00.186-.186V3.574a.186.186 0 00-.186-.185h-2.118a.186.186 0 00-.185.185v1.888c0 .102.082.186.185.186m0 2.716h2.118a.187.187 0 00.186-.186V6.29a.186.186 0 00-.186-.185h-2.118a.186.186 0 00-.185.185v1.888c0 .102.082.185.185.186m-2.93 0h2.12a.186.186 0 00.184-.186V6.29a.185.185 0 00-.185-.185H8.1a.185.185 0 00-.185.185v1.888c0 .102.083.185.185.186m-2.964 0h2.119a.186.186 0 00.185-.186V6.29a.186.186 0 00-.185-.185H5.136a.186.186 0 00-.186.185v1.888c0 .102.084.185.186.186m5.893 2.715h2.118a.186.186 0 00.186-.185V9.006a.186.186 0 00-.186-.186h-2.118a.186.186 0 00-.185.186v1.887c0 .102.082.185.185.185m-2.93 0h2.12a.185.185 0 00.184-.185V9.006a.185.185 0 00-.184-.186h-2.12a.185.185 0 00-.184.186v1.887c0 .102.083.185.185.185m-2.964 0h2.119a.185.185 0 00.185-.185V9.006a.185.185 0 00-.185-.186h-2.119a.186.186 0 00-.186.186v1.887c0 .102.084.185.186.185m-2.92 0h2.12a.185.185 0 00.184-.185V9.006a.185.185 0 00-.184-.186h-2.12a.186.186 0 00-.186.186v1.887c0 .102.084.185.186.185m-.001 2.716h2.118a.185.185 0 00.185-.185v-1.888a.185.185 0 00-.185-.185H2.136a.185.185 0 00-.186.185v1.888c0 .102.084.185.186.185m23.063-3.167a.509.509 0 00-.376-.25.431.431 0 00-.116-.01.431.431 0 00-.114.01 3.6 3.6 0 00-1.618.877c-.186.166-.356.36-.509.577a6.6 6.6 0 00-1.117-1.474 6.6 6.6 0 00-9.336 0 6.6 6.6 0 00-1.938 4.684 6.6 6.6 0 001.938 4.684 6.6 6.6 0 004.668 1.938 6.6 6.6 0 004.668-1.938 6.6 6.6 0 001.938-4.684 6.6 6.6 0 00-.185-1.41 3.6 3.6 0 001.587-.904.509.509 0 00.134-.459" />
- </svg>
- <p class="text-sm font-medium text-blue-800 dark:text-blue-200">
- Docker Installation
- </p>
+ {/* Docker installation notice - enhanced with copy-able commands */}
+ <Show when={props.versionInfo()?.isDocker && !props.updateInfo()?.available}>
+ <div class="p-4 bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 rounded-lg space-y-3">
+ <div class="flex items-center gap-2">
+ <svg class="w-5 h-5 text-blue-600 dark:text-blue-400 flex-shrink-0" viewBox="0 0 24 24" fill="currentColor">
+ <path d="M13.983 11.078h2.119a.186.186 0 00.186-.185V9.006a.186.186 0 00-.186-.186h-2.119a.186.186 0 00-.185.186v1.887c0 .102.083.185.185.185m-2.954-5.43h2.118a.186.186 0 00.186-.186V3.574a.186.186 0 00-.186-.185h-2.118a.186.186 0 00-.185.185v1.888c0 .102.082.186.185.186m0 2.716h2.118a.187.187 0 00.186-.186V6.29a.186.186 0 00-.186-.185h-2.118a.186.186 0 00-.185.185v1.888c0 .102.082.185.185.186m-2.93 0h2.12a.186.186 0 00.184-.186V6.29a.185.185 0 00-.185-.185H8.1a.185.185 0 00-.185.185v1.888c0 .102.083.185.185.186m-2.964 0h2.119a.186.186 0 00.185-.186V6.29a.186.186 0 00-.185-.185H5.136a.186.186 0 00-.186.185v1.888c0 .102.084.185.186.186m5.893 2.715h2.118a.186.186 0 00.186-.185V9.006a.186.186 0 00-.186-.186h-2.118a.186.186 0 00-.185.186v1.887c0 .102.082.185.185.185m-2.93 0h2.12a.185.185 0 00.184-.185V9.006a.185.185 0 00-.184-.186h-2.12a.185.185 0 00-.184.186v1.887c0 .102.083.185.185.185m-2.964 0h2.119a.185.185 0 00.185-.185V9.006a.185.185 0 00-.185-.186h-2.119a.186.186 0 00-.186.186v1.887c0 .102.084.185.186.185m-2.92 0h2.12a.185.185 0 00.184-.185V9.006a.185.185 0 00-.184-.186h-2.12a.186.186 0 00-.186.186v1.887c0 .102.084.185.186.185m-.001 2.716h2.118a.185.185 0 00.185-.185v-1.888a.185.185 0 00-.185-.185H2.136a.185.185 0 00-.186.185v1.888c0 .102.084.185.186.185m23.063-3.167a.509.509 0 00-.376-.25.431.431 0 00-.116-.01.431.431 0 00-.114.01 3.6 3.6 0 00-1.618.877c-.186.166-.356.36-.509.577a6.6 6.6 0 00-1.117-1.474 6.6 6.6 0 00-9.336 0 6.6 6.6 0 00-1.938 4.684 6.6 6.6 0 001.938 4.684 6.6 6.6 0 004.668 1.938 6.6 6.6 0 004.668-1.938 6.6 6.6 0 001.938-4.684 6.6 6.6 0 00-.185-1.41 3.6 3.6 0 001.587-.904.509.509 0 00.134-.459" />
+ </svg>
+ <p class="text-sm font-medium text-blue-800 dark:text-blue-200">
+ Docker Installation
+ </p>
+ </div>
+ <p class="text-xs text-blue-700 dark:text-blue-300">
+ Updates are managed through Docker. Use these commands to check for and apply updates:
+ </p>
+ <div class="space-y-2">
+ <div class="relative group">
+ <code class="block p-2.5 bg-gray-900 dark:bg-gray-950 rounded-lg text-xs font-mono text-blue-400 border border-gray-700">
+ docker pull rcourtman/pulse:latest && docker restart pulse
+ </code>
+ <button
+ type="button"
+ onClick={() => navigator.clipboard.writeText('docker pull rcourtman/pulse:latest && docker restart pulse')}
+ class="absolute top-1.5 right-1.5 p-1 rounded bg-gray-700 hover:bg-gray-600 text-gray-300 opacity-60 hover:opacity-100 transition-opacity"
+ title="Copy to clipboard"
+ >
+ <svg class="w-3.5 h-3.5" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
+ <path stroke-linecap="round" stroke-linejoin="round" d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z" />
+ </svg>
+ </button>
</div>
- <p class="text-xs text-blue-700 dark:text-blue-300">
- Updates are managed through Docker. Use these commands to check for and apply updates:
+ <p class="text-[10px] text-blue-600 dark:text-blue-400">
+ Or with Docker Compose: <code class="px-1 py-0.5 bg-blue-100 dark:bg-blue-800/50 rounded text-[10px]">docker-compose pull && docker-compose up -d</code>
</p>
- <div class="space-y-2">
- <div class="relative group">
- <code class="block p-2.5 bg-gray-900 dark:bg-gray-950 rounded-lg text-xs font-mono text-blue-400 border border-gray-700">
- docker pull rcourtman/pulse:latest && docker restart pulse
- </code>
+ </div>
+ </div>
+ </Show>
+
+ {/* Source build notice */}
+ <Show when={props.versionInfo()?.isSourceBuild}>
+ <div class="p-3 bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 rounded-lg">
+ <p class="text-xs text-blue-800 dark:text-blue-200">
+ <strong>Built from source:</strong> Pull the latest code from git and rebuild to
+ update.
+ </p>
+ </div>
+ </Show>
+
+ {/* Warning message */}
+ <Show when={Boolean(props.updateInfo()?.warning)}>
+ <div class="p-3 bg-amber-50 dark:bg-amber-900/20 border border-amber-200 dark:border-amber-700 rounded-lg">
+ <p class="text-xs text-amber-800 dark:text-amber-200">
+ {props.updateInfo()?.warning}
+ </p>
+ </div>
+ </Show>
+
+ {/* Update available */}
+ <Show when={props.updateInfo()?.available}>
+ <div class="rounded-xl border border-green-200 dark:border-green-700 overflow-hidden bg-green-50 dark:bg-green-900/20">
+ {/* Header */}
+ <div class="px-5 py-4 border-b border-green-200 dark:border-green-800/50 bg-green-100/80 dark:bg-green-900/40">
+ <div class="flex items-center justify-between gap-3">
+ <div class="flex items-center gap-3">
+ <div class="p-2 bg-green-500 rounded-lg shadow-lg shadow-green-500/20">
+ <svg class="w-5 h-5 text-white" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
+ <path stroke-linecap="round" stroke-linejoin="round" d="M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12" />
+ </svg>
+ </div>
+ <div>
+ <h4 class="text-base font-semibold text-green-900 dark:text-green-100">
+ Update Available
+ </h4>
+ <p class="text-xs text-green-700 dark:text-green-300">
+ Version {props.updateInfo()?.latestVersion} is ready to install
+ </p>
+ </div>
+ </div>
+
+ {/* Automated Install Button */}
+ <Show when={props.updatePlan()?.canAutoUpdate}>
<button
type="button"
- onClick={() => navigator.clipboard.writeText('docker pull rcourtman/pulse:latest && docker restart pulse')}
- class="absolute top-1.5 right-1.5 p-1 rounded bg-gray-700 hover:bg-gray-600 text-gray-300 opacity-60 hover:opacity-100 transition-opacity"
- title="Copy to clipboard"
+ onClick={props.onInstallUpdate}
+ disabled={props.isInstalling()}
+ class={`px-4 py-2.5 rounded-lg text-sm font-medium transition-all flex items-center gap-2 ${props.isInstalling()
+ ? 'bg-green-400 dark:bg-green-600 text-white cursor-not-allowed'
+ : 'bg-green-600 hover:bg-green-700 text-white shadow-lg shadow-green-500/25 hover:shadow-green-500/40'
+ }`}
>
- <svg class="w-3.5 h-3.5" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
- <path stroke-linecap="round" stroke-linejoin="round" d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z" />
- </svg>
+ <Show when={props.isInstalling()} fallback={
+ <>
+ <Download class="w-4 h-4" />
+ Install Update
+ </>
+ }>
+ <div class="animate-spin h-4 w-4 border-2 border-white border-t-transparent rounded-full"></div>
+ Installing...
+ </Show>
</button>
- </div>
- <p class="text-[10px] text-blue-600 dark:text-blue-400">
- Or with Docker Compose: <code class="px-1 py-0.5 bg-blue-100 dark:bg-blue-800/50 rounded text-[10px]">docker-compose pull && docker-compose up -d</code>
- </p>
+ </Show>
</div>
</div>
- </Show>
- {/* Source build notice */}
- <Show when={props.versionInfo()?.isSourceBuild}>
- <div class="p-3 bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 rounded-lg">
- <p class="text-xs text-blue-800 dark:text-blue-200">
- <strong>Built from source:</strong> Pull the latest code from git and rebuild to
- update.
- </p>
- </div>
- </Show>
+ {/* Installation Steps */}
+ <div class="p-5 space-y-4">
+ {/* Manual Steps Header */}
+ <Show when={!props.updatePlan()?.canAutoUpdate}>
+ <div class="text-sm font-medium text-green-800 dark:text-green-200 mb-3">
+ Follow these steps to update manually:
+ </div>
+ </Show>
- {/* Warning message */}
- <Show when={Boolean(props.updateInfo()?.warning)}>
- <div class="p-3 bg-amber-50 dark:bg-amber-900/20 border border-amber-200 dark:border-amber-700 rounded-lg">
- <p class="text-xs text-amber-800 dark:text-amber-200">
- {props.updateInfo()?.warning}
- </p>
- </div>
- </Show>
+ <Show when={props.updatePlan()?.canAutoUpdate}>
+ <div class="text-sm text-green-700 dark:text-green-300 mb-3">
+ Click "Install Update" above for automatic installation, or update manually:
+ </div>
+ </Show>
- {/* Update available */}
- <Show when={props.updateInfo()?.available}>
- <div class="rounded-xl border border-green-200 dark:border-green-700 overflow-hidden bg-gradient-to-br from-green-50 to-emerald-50 dark:from-green-900/20 dark:to-emerald-900/10">
- {/* Header */}
- <div class="px-5 py-4 border-b border-green-200 dark:border-green-800/50 bg-gradient-to-r from-green-100/80 to-emerald-100/50 dark:from-green-900/40 dark:to-emerald-900/30">
- <div class="flex items-center justify-between gap-3">
- <div class="flex items-center gap-3">
- <div class="p-2 bg-gradient-to-br from-green-500 to-emerald-600 rounded-lg shadow-lg shadow-green-500/20">
- <svg class="w-5 h-5 text-white" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
- <path stroke-linecap="round" stroke-linejoin="round" d="M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12" />
- </svg>
- </div>
- <div>
- <h4 class="text-base font-semibold text-green-900 dark:text-green-100">
- Update Available
- </h4>
- <p class="text-xs text-green-700 dark:text-green-300">
- Version {props.updateInfo()?.latestVersion} is ready to install
- </p>
- </div>
+ {/* ProxmoxVE LXC Installation */}
+ <Show when={props.versionInfo()?.deploymentType === 'proxmoxve'}>
+ <div class="space-y-3">
+ <div class="flex items-center gap-2 text-sm font-medium text-green-800 dark:text-green-200">
+ <span class="flex items-center justify-center w-6 h-6 rounded-full bg-green-200 dark:bg-green-800 text-xs font-bold text-green-700 dark:text-green-300">1</span>
+ Open your Pulse LXC console
</div>
-
- {/* Automated Install Button */}
- <Show when={props.updatePlan()?.canAutoUpdate}>
+ <div class="flex items-center gap-2 text-sm font-medium text-green-800 dark:text-green-200">
+ <span class="flex items-center justify-center w-6 h-6 rounded-full bg-green-200 dark:bg-green-800 text-xs font-bold text-green-700 dark:text-green-300">2</span>
+ Run the update command:
+ </div>
+ <div class="ml-8 relative group">
+ <code class="block p-3 bg-gray-900 dark:bg-gray-950 rounded-lg text-sm font-mono text-green-400 border border-gray-700">
+ update
+ </code>
<button
type="button"
- onClick={props.onInstallUpdate}
- disabled={props.isInstalling()}
- class={`px-4 py-2.5 rounded-lg text-sm font-medium transition-all flex items-center gap-2 ${props.isInstalling()
- ? 'bg-green-400 dark:bg-green-600 text-white cursor-not-allowed'
- : 'bg-gradient-to-r from-green-600 to-emerald-600 hover:from-green-700 hover:to-emerald-700 text-white shadow-lg shadow-green-500/25 hover:shadow-green-500/40'
- }`}
+ onClick={() => navigator.clipboard.writeText('update')}
+ class="absolute top-2 right-2 p-1.5 rounded bg-gray-700 hover:bg-gray-600 text-gray-300 opacity-60 hover:opacity-100 transition-opacity"
+ title="Copy to clipboard"
>
- <Show when={props.isInstalling()} fallback={
- <>
- <Download class="w-4 h-4" />
- Install Update
- </>
- }>
- <div class="animate-spin h-4 w-4 border-2 border-white border-t-transparent rounded-full"></div>
- Installing...
- </Show>
+ <svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
+ <path stroke-linecap="round" stroke-linejoin="round" d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z" />
+ </svg>
</button>
- </Show>
+ </div>
+ <p class="ml-8 text-xs text-green-600 dark:text-green-400">
+ The script will automatically download and install the latest version.
+ </p>
</div>
- </div>
+ </Show>
- {/* Installation Steps */}
- <div class="p-5 space-y-4">
- {/* Manual Steps Header */}
- <Show when={!props.updatePlan()?.canAutoUpdate}>
- <div class="text-sm font-medium text-green-800 dark:text-green-200 mb-3">
- Follow these steps to update manually:
+ {/* Docker Installation */}
+ <Show when={props.versionInfo()?.deploymentType === 'docker' || (!props.versionInfo()?.deploymentType && props.versionInfo()?.isDocker)}>
+ <div class="space-y-3">
+ <div class="flex items-center gap-2 text-sm font-medium text-green-800 dark:text-green-200">
+ <span class="flex items-center justify-center w-6 h-6 rounded-full bg-green-200 dark:bg-green-800 text-xs font-bold text-green-700 dark:text-green-300">1</span>
+ Pull the latest image
</div>
- </Show>
-
- <Show when={props.updatePlan()?.canAutoUpdate}>
- <div class="text-sm text-green-700 dark:text-green-300 mb-3">
- Click "Install Update" above for automatic installation, or update manually:
+ <div class="ml-8 relative group">
+ <code class="block p-3 bg-gray-900 dark:bg-gray-950 rounded-lg text-sm font-mono text-green-400 border border-gray-700">
+ docker pull rcourtman/pulse:{props.updateInfo()?.latestVersion.replace(/^v/, '')}
+ </code>
+ <button
+ type="button"
+ onClick={() => navigator.clipboard.writeText(`docker pull rcourtman/pulse:${props.updateInfo()?.latestVersion.replace(/^v/, '')}`)}
+ class="absolute top-2 right-2 p-1.5 rounded bg-gray-700 hover:bg-gray-600 text-gray-300 opacity-60 hover:opacity-100 transition-opacity"
+ title="Copy to clipboard"
+ >
+ <svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
+ <path stroke-linecap="round" stroke-linejoin="round" d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z" />
+ </svg>
+ </button>
</div>
- </Show>
- {/* ProxmoxVE LXC Installation */}
- <Show when={props.versionInfo()?.deploymentType === 'proxmoxve'}>
- <div class="space-y-3">
- <div class="flex items-center gap-2 text-sm font-medium text-green-800 dark:text-green-200">
- <span class="flex items-center justify-center w-6 h-6 rounded-full bg-green-200 dark:bg-green-800 text-xs font-bold text-green-700 dark:text-green-300">1</span>
- Open your Pulse LXC console
- </div>
- <div class="flex items-center gap-2 text-sm font-medium text-green-800 dark:text-green-200">
- <span class="flex items-center justify-center w-6 h-6 rounded-full bg-green-200 dark:bg-green-800 text-xs font-bold text-green-700 dark:text-green-300">2</span>
- Run the update command:
- </div>
- <div class="ml-8 relative group">
- <code class="block p-3 bg-gray-900 dark:bg-gray-950 rounded-lg text-sm font-mono text-green-400 border border-gray-700">
- update
- </code>
- <button
- type="button"
- onClick={() => navigator.clipboard.writeText('update')}
- class="absolute top-2 right-2 p-1.5 rounded bg-gray-700 hover:bg-gray-600 text-gray-300 opacity-60 hover:opacity-100 transition-opacity"
- title="Copy to clipboard"
- >
- <svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
- <path stroke-linecap="round" stroke-linejoin="round" d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z" />
- </svg>
- </button>
- </div>
- <p class="ml-8 text-xs text-green-600 dark:text-green-400">
- The script will automatically download and install the latest version.
- </p>
+ <div class="flex items-center gap-2 text-sm font-medium text-green-800 dark:text-green-200">
+ <span class="flex items-center justify-center w-6 h-6 rounded-full bg-green-200 dark:bg-green-800 text-xs font-bold text-green-700 dark:text-green-300">2</span>
+ Restart the container
</div>
- </Show>
-
- {/* Docker Installation */}
- <Show when={props.versionInfo()?.deploymentType === 'docker' || (!props.versionInfo()?.deploymentType && props.versionInfo()?.isDocker)}>
- <div class="space-y-3">
- <div class="flex items-center gap-2 text-sm font-medium text-green-800 dark:text-green-200">
- <span class="flex items-center justify-center w-6 h-6 rounded-full bg-green-200 dark:bg-green-800 text-xs font-bold text-green-700 dark:text-green-300">1</span>
- Pull the latest image
- </div>
- <div class="ml-8 relative group">
- <code class="block p-3 bg-gray-900 dark:bg-gray-950 rounded-lg text-sm font-mono text-green-400 border border-gray-700">
- docker pull rcourtman/pulse:{props.updateInfo()?.latestVersion.replace(/^v/, '')}
- </code>
- <button
- type="button"
- onClick={() => navigator.clipboard.writeText(`docker pull rcourtman/pulse:${props.updateInfo()?.latestVersion.replace(/^v/, '')}`)}
- class="absolute top-2 right-2 p-1.5 rounded bg-gray-700 hover:bg-gray-600 text-gray-300 opacity-60 hover:opacity-100 transition-opacity"
- title="Copy to clipboard"
- >
- <svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
- <path stroke-linecap="round" stroke-linejoin="round" d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z" />
- </svg>
- </button>
- </div>
-
- <div class="flex items-center gap-2 text-sm font-medium text-green-800 dark:text-green-200">
- <span class="flex items-center justify-center w-6 h-6 rounded-full bg-green-200 dark:bg-green-800 text-xs font-bold text-green-700 dark:text-green-300">2</span>
- Restart the container
- </div>
- <div class="ml-8 relative group">
- <code class="block p-3 bg-gray-900 dark:bg-gray-950 rounded-lg text-sm font-mono text-green-400 border border-gray-700">
- docker restart pulse
- </code>
- <button
- type="button"
- onClick={() => navigator.clipboard.writeText('docker restart pulse')}
- class="absolute top-2 right-2 p-1.5 rounded bg-gray-700 hover:bg-gray-600 text-gray-300 opacity-60 hover:opacity-100 transition-opacity"
- title="Copy to clipboard"
- >
- <svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
- <path stroke-linecap="round" stroke-linejoin="round" d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z" />
- </svg>
- </button>
- </div>
- <p class="ml-8 text-xs text-green-600 dark:text-green-400">
- Or use Docker Compose: <code class="px-1.5 py-0.5 bg-gray-200 dark:bg-gray-700 rounded text-xs">docker-compose pull && docker-compose up -d</code>
- </p>
+ <div class="ml-8 relative group">
+ <code class="block p-3 bg-gray-900 dark:bg-gray-950 rounded-lg text-sm font-mono text-green-400 border border-gray-700">
+ docker restart pulse
+ </code>
+ <button
+ type="button"
+ onClick={() => navigator.clipboard.writeText('docker restart pulse')}
+ class="absolute top-2 right-2 p-1.5 rounded bg-gray-700 hover:bg-gray-600 text-gray-300 opacity-60 hover:opacity-100 transition-opacity"
+ title="Copy to clipboard"
+ >
+ <svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
+ <path stroke-linecap="round" stroke-linejoin="round" d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z" />
+ </svg>
+ </button>
</div>
- </Show>
+ <p class="ml-8 text-xs text-green-600 dark:text-green-400">
+ Or use Docker Compose: <code class="px-1.5 py-0.5 bg-gray-200 dark:bg-gray-700 rounded text-xs">docker-compose pull && docker-compose up -d</code>
+ </p>
+ </div>
+ </Show>
- {/* Systemd/Manual Installation */}
- <Show when={props.versionInfo()?.deploymentType === 'systemd' || props.versionInfo()?.deploymentType === 'manual'}>
- <div class="space-y-3">
- <div class="flex items-center gap-2 text-sm font-medium text-green-800 dark:text-green-200">
- <span class="flex items-center justify-center w-6 h-6 rounded-full bg-green-200 dark:bg-green-800 text-xs font-bold text-green-700 dark:text-green-300">1</span>
- Stop the service
- </div>
- <div class="ml-8 relative group">
- <code class="block p-3 bg-gray-900 dark:bg-gray-950 rounded-lg text-sm font-mono text-green-400 border border-gray-700">
- sudo systemctl stop pulse
- </code>
- <button
- type="button"
- onClick={() => navigator.clipboard.writeText('sudo systemctl stop pulse')}
- class="absolute top-2 right-2 p-1.5 rounded bg-gray-700 hover:bg-gray-600 text-gray-300 opacity-60 hover:opacity-100 transition-opacity"
- title="Copy to clipboard"
- >
- <svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
- <path stroke-linecap="round" stroke-linejoin="round" d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z" />
- </svg>
- </button>
- </div>
+ {/* Systemd/Manual Installation */}
+ <Show when={props.versionInfo()?.deploymentType === 'systemd' || props.versionInfo()?.deploymentType === 'manual'}>
+ <div class="space-y-3">
+ <div class="flex items-center gap-2 text-sm font-medium text-green-800 dark:text-green-200">
+ <span class="flex items-center justify-center w-6 h-6 rounded-full bg-green-200 dark:bg-green-800 text-xs font-bold text-green-700 dark:text-green-300">1</span>
+ Stop the service
+ </div>
+ <div class="ml-8 relative group">
+ <code class="block p-3 bg-gray-900 dark:bg-gray-950 rounded-lg text-sm font-mono text-green-400 border border-gray-700">
+ sudo systemctl stop pulse
+ </code>
+ <button
+ type="button"
+ onClick={() => navigator.clipboard.writeText('sudo systemctl stop pulse')}
+ class="absolute top-2 right-2 p-1.5 rounded bg-gray-700 hover:bg-gray-600 text-gray-300 opacity-60 hover:opacity-100 transition-opacity"
+ title="Copy to clipboard"
+ >
+ <svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
+ <path stroke-linecap="round" stroke-linejoin="round" d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z" />
+ </svg>
+ </button>
+ </div>
- <div class="flex items-center gap-2 text-sm font-medium text-green-800 dark:text-green-200">
- <span class="flex items-center justify-center w-6 h-6 rounded-full bg-green-200 dark:bg-green-800 text-xs font-bold text-green-700 dark:text-green-300">2</span>
- Download and extract the new version
- </div>
- <div class="ml-8 relative group">
- <code class="block p-3 bg-gray-900 dark:bg-gray-950 rounded-lg text-sm font-mono text-green-400 border border-gray-700 whitespace-pre-wrap break-all">
- {`curl -LO https://github.com/rcourtman/Pulse/releases/download/${props.updateInfo()?.latestVersion}/pulse-${props.updateInfo()?.latestVersion}-linux-amd64.tar.gz
+ <div class="flex items-center gap-2 text-sm font-medium text-green-800 dark:text-green-200">
+ <span class="flex items-center justify-center w-6 h-6 rounded-full bg-green-200 dark:bg-green-800 text-xs font-bold text-green-700 dark:text-green-300">2</span>
+ Download and extract the new version
+ </div>
+ <div class="ml-8 relative group">
+ <code class="block p-3 bg-gray-900 dark:bg-gray-950 rounded-lg text-sm font-mono text-green-400 border border-gray-700 whitespace-pre-wrap break-all">
+ {`curl -LO https://github.com/rcourtman/Pulse/releases/download/${props.updateInfo()?.latestVersion}/pulse-${props.updateInfo()?.latestVersion}-linux-amd64.tar.gz
sudo tar -xzf pulse-${props.updateInfo()?.latestVersion}-linux-amd64.tar.gz -C /usr/local/bin pulse`}
- </code>
- <button
- type="button"
- onClick={() => navigator.clipboard.writeText(`curl -LO https://github.com/rcourtman/Pulse/releases/download/${props.updateInfo()?.latestVersion}/pulse-${props.updateInfo()?.latestVersion}-linux-amd64.tar.gz\nsudo tar -xzf pulse-${props.updateInfo()?.latestVersion}-linux-amd64.tar.gz -C /usr/local/bin pulse`)}
- class="absolute top-2 right-2 p-1.5 rounded bg-gray-700 hover:bg-gray-600 text-gray-300 opacity-60 hover:opacity-100 transition-opacity"
- title="Copy to clipboard"
- >
- <svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
- <path stroke-linecap="round" stroke-linejoin="round" d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z" />
- </svg>
- </button>
- </div>
-
- <div class="flex items-center gap-2 text-sm font-medium text-green-800 dark:text-green-200">
- <span class="flex items-center justify-center w-6 h-6 rounded-full bg-green-200 dark:bg-green-800 text-xs font-bold text-green-700 dark:text-green-300">3</span>
- Start the service
- </div>
- <div class="ml-8 relative group">
- <code class="block p-3 bg-gray-900 dark:bg-gray-950 rounded-lg text-sm font-mono text-green-400 border border-gray-700">
- sudo systemctl start pulse
- </code>
- <button
- type="button"
- onClick={() => navigator.clipboard.writeText('sudo systemctl start pulse')}
- class="absolute top-2 right-2 p-1.5 rounded bg-gray-700 hover:bg-gray-600 text-gray-300 opacity-60 hover:opacity-100 transition-opacity"
- title="Copy to clipboard"
- >
- <svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
- <path stroke-linecap="round" stroke-linejoin="round" d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z" />
- </svg>
- </button>
- </div>
+ </code>
+ <button
+ type="button"
+ onClick={() => navigator.clipboard.writeText(`curl -LO https://github.com/rcourtman/Pulse/releases/download/${props.updateInfo()?.latestVersion}/pulse-${props.updateInfo()?.latestVersion}-linux-amd64.tar.gz\nsudo tar -xzf pulse-${props.updateInfo()?.latestVersion}-linux-amd64.tar.gz -C /usr/local/bin pulse`)}
+ class="absolute top-2 right-2 p-1.5 rounded bg-gray-700 hover:bg-gray-600 text-gray-300 opacity-60 hover:opacity-100 transition-opacity"
+ title="Copy to clipboard"
+ >
+ <svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
+ <path stroke-linecap="round" stroke-linejoin="round" d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z" />
+ </svg>
+ </button>
</div>
- </Show>
-
- {/* Development Installation */}
- <Show when={props.versionInfo()?.deploymentType === 'development'}>
- <div class="space-y-3">
- <div class="flex items-center gap-2 text-sm font-medium text-green-800 dark:text-green-200">
- <span class="flex items-center justify-center w-6 h-6 rounded-full bg-green-200 dark:bg-green-800 text-xs font-bold text-green-700 dark:text-green-300">1</span>
- Pull the latest changes
- </div>
- <div class="ml-8 relative group">
- <code class="block p-3 bg-gray-900 dark:bg-gray-950 rounded-lg text-sm font-mono text-green-400 border border-gray-700">
- git pull origin main
- </code>
- <button
- type="button"
- onClick={() => navigator.clipboard.writeText('git pull origin main')}
- class="absolute top-2 right-2 p-1.5 rounded bg-gray-700 hover:bg-gray-600 text-gray-300 opacity-60 hover:opacity-100 transition-opacity"
- title="Copy to clipboard"
- >
- <svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
- <path stroke-linecap="round" stroke-linejoin="round" d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z" />
- </svg>
- </button>
- </div>
- <div class="flex items-center gap-2 text-sm font-medium text-green-800 dark:text-green-200">
- <span class="flex items-center justify-center w-6 h-6 rounded-full bg-green-200 dark:bg-green-800 text-xs font-bold text-green-700 dark:text-green-300">2</span>
- Rebuild and restart
- </div>
- <div class="ml-8 relative group">
- <code class="block p-3 bg-gray-900 dark:bg-gray-950 rounded-lg text-sm font-mono text-green-400 border border-gray-700">
- make build && make run
- </code>
- <button
- type="button"
- onClick={() => navigator.clipboard.writeText('make build && make run')}
- class="absolute top-2 right-2 p-1.5 rounded bg-gray-700 hover:bg-gray-600 text-gray-300 opacity-60 hover:opacity-100 transition-opacity"
- title="Copy to clipboard"
- >
- <svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
- <path stroke-linecap="round" stroke-linejoin="round" d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z" />
- </svg>
- </button>
- </div>
+ <div class="flex items-center gap-2 text-sm font-medium text-green-800 dark:text-green-200">
+ <span class="flex items-center justify-center w-6 h-6 rounded-full bg-green-200 dark:bg-green-800 text-xs font-bold text-green-700 dark:text-green-300">3</span>
+ Start the service
</div>
- </Show>
- </div>
-
- {/* Release notes footer */}
- <Show when={props.updateInfo()?.releaseNotes}>
- <div class="px-5 py-3 border-t border-green-200 dark:border-green-800/50 bg-white/50 dark:bg-gray-900/30">
- <details class="group">
- <summary class="flex items-center gap-2 text-sm font-medium text-green-700 dark:text-green-300 cursor-pointer hover:text-green-800 dark:hover:text-green-200 transition-colors">
- <svg class="w-4 h-4 transition-transform group-open:rotate-90" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
- <path stroke-linecap="round" stroke-linejoin="round" d="M9 5l7 7-7 7" />
+ <div class="ml-8 relative group">
+ <code class="block p-3 bg-gray-900 dark:bg-gray-950 rounded-lg text-sm font-mono text-green-400 border border-gray-700">
+ sudo systemctl start pulse
+ </code>
+ <button
+ type="button"
+ onClick={() => navigator.clipboard.writeText('sudo systemctl start pulse')}
+ class="absolute top-2 right-2 p-1.5 rounded bg-gray-700 hover:bg-gray-600 text-gray-300 opacity-60 hover:opacity-100 transition-opacity"
+ title="Copy to clipboard"
+ >
+ <svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
+ <path stroke-linecap="round" stroke-linejoin="round" d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z" />
</svg>
- View Release Notes
- </summary>
- <pre class="mt-3 p-4 text-xs text-gray-700 dark:text-gray-300 whitespace-pre-wrap font-mono bg-gray-100 dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 max-h-64 overflow-y-auto">
- {props.updateInfo()?.releaseNotes}
- </pre>
- </details>
+ </button>
+ </div>
</div>
</Show>
- </div>
- </Show>
- {/* Update settings */}
- <div class="border-t border-gray-200 dark:border-gray-700 pt-6 space-y-5">
- <h4 class="flex items-center gap-2 text-sm font-medium text-gray-700 dark:text-gray-300">
- <svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
- <path stroke-linecap="round" stroke-linejoin="round" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z" />
- <path stroke-linecap="round" stroke-linejoin="round" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
- </svg>
- Update Preferences
- <HelpIcon contentId="updates.pulse.channel" size="xs" />
- </h4>
-
- {/* Update Channel */}
- <div class="grid grid-cols-1 sm:grid-cols-2 gap-3">
- <button
- type="button"
- onClick={() => {
- props.setUpdateChannel('stable');
- props.setHasUnsavedChanges(true);
- }}
- disabled={props.versionInfo()?.isSourceBuild}
- class={`p-4 rounded-xl border-2 transition-all text-left disabled:opacity-50 disabled:cursor-not-allowed ${props.updateChannel() === 'stable'
- ? 'border-green-500 bg-green-50 dark:bg-green-900/20'
- : 'border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600'
- }`}
- >
- <div class="flex items-center gap-3">
- <div class={`p-2 rounded-lg ${props.updateChannel() === 'stable'
- ? 'bg-green-100 dark:bg-green-900/40'
- : 'bg-gray-100 dark:bg-gray-800'
- }`}>
- <svg class={`w-5 h-5 ${props.updateChannel() === 'stable'
- ? 'text-green-600 dark:text-green-400'
- : 'text-gray-500 dark:text-gray-400'
- }`} fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
- <path stroke-linecap="round" stroke-linejoin="round" d="M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z" />
- </svg>
+ {/* Development Installation */}
+ <Show when={props.versionInfo()?.deploymentType === 'development'}>
+ <div class="space-y-3">
+ <div class="flex items-center gap-2 text-sm font-medium text-green-800 dark:text-green-200">
+ <span class="flex items-center justify-center w-6 h-6 rounded-full bg-green-200 dark:bg-green-800 text-xs font-bold text-green-700 dark:text-green-300">1</span>
+ Pull the latest changes
</div>
- <div>
- <p class={`text-sm font-semibold ${props.updateChannel() === 'stable'
- ? 'text-green-900 dark:text-green-100'
- : 'text-gray-900 dark:text-gray-100'
- }`}>Stable</p>
- <p class="text-xs text-gray-500 dark:text-gray-400">
- Production-ready releases
- </p>
+ <div class="ml-8 relative group">
+ <code class="block p-3 bg-gray-900 dark:bg-gray-950 rounded-lg text-sm font-mono text-green-400 border border-gray-700">
+ git pull origin main
+ </code>
+ <button
+ type="button"
+ onClick={() => navigator.clipboard.writeText('git pull origin main')}
+ class="absolute top-2 right-2 p-1.5 rounded bg-gray-700 hover:bg-gray-600 text-gray-300 opacity-60 hover:opacity-100 transition-opacity"
+ title="Copy to clipboard"
+ >
+ <svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
+ <path stroke-linecap="round" stroke-linejoin="round" d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z" />
+ </svg>
+ </button>
</div>
- </div>
- </button>
- <button
- type="button"
- onClick={() => {
- props.setUpdateChannel('rc');
- props.setHasUnsavedChanges(true);
- }}
- disabled={props.versionInfo()?.isSourceBuild}
- class={`p-4 rounded-xl border-2 transition-all text-left disabled:opacity-50 disabled:cursor-not-allowed ${props.updateChannel() === 'rc'
- ? 'border-purple-500 bg-purple-50 dark:bg-purple-900/20'
- : 'border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600'
- }`}
- >
- <div class="flex items-center gap-3">
- <div class={`p-2 rounded-lg ${props.updateChannel() === 'rc'
- ? 'bg-purple-100 dark:bg-purple-900/40'
- : 'bg-gray-100 dark:bg-gray-800'
- }`}>
- <svg class={`w-5 h-5 ${props.updateChannel() === 'rc'
- ? 'text-purple-600 dark:text-purple-400'
- : 'text-gray-500 dark:text-gray-400'
- }`} fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
- <path stroke-linecap="round" stroke-linejoin="round" d="M19.428 15.428a2 2 0 00-1.022-.547l-2.387-.477a6 6 0 00-3.86.517l-.318.158a6 6 0 01-3.86.517L6.05 15.21a2 2 0 00-1.806.547M8 4h8l-1 1v5.172a2 2 0 00.586 1.414l5 5c1.26 1.26.367 3.414-1.415 3.414H4.828c-1.782 0-2.674-2.154-1.414-3.414l5-5A2 2 0 009 10.172V5L8 4z" />
- </svg>
+ <div class="flex items-center gap-2 text-sm font-medium text-green-800 dark:text-green-200">
+ <span class="flex items-center justify-center w-6 h-6 rounded-full bg-green-200 dark:bg-green-800 text-xs font-bold text-green-700 dark:text-green-300">2</span>
+ Rebuild and restart
</div>
- <div>
- <p class={`text-sm font-semibold ${props.updateChannel() === 'rc'
- ? 'text-purple-900 dark:text-purple-100'
- : 'text-gray-900 dark:text-gray-100'
- }`}>Release Candidate</p>
- <p class="text-xs text-gray-500 dark:text-gray-400">
- Preview upcoming features
- </p>
+ <div class="ml-8 relative group">
+ <code class="block p-3 bg-gray-900 dark:bg-gray-950 rounded-lg text-sm font-mono text-green-400 border border-gray-700">
+ make build && make run
+ </code>
+ <button
+ type="button"
+ onClick={() => navigator.clipboard.writeText('make build && make run')}
+ class="absolute top-2 right-2 p-1.5 rounded bg-gray-700 hover:bg-gray-600 text-gray-300 opacity-60 hover:opacity-100 transition-opacity"
+ title="Copy to clipboard"
+ >
+ <svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
+ <path stroke-linecap="round" stroke-linejoin="round" d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z" />
+ </svg>
+ </button>
</div>
</div>
- </button>
+ </Show>
</div>
- {/* Auto Update Toggle */}
- <div class="p-4 rounded-xl border border-gray-200 dark:border-gray-700 bg-gray-50/50 dark:bg-gray-800/30">
- <div class="flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between">
- <div class="flex items-center gap-3">
- <div class="p-2 bg-blue-100 dark:bg-blue-900/40 rounded-lg">
- <svg class="w-5 h-5 text-blue-600 dark:text-blue-400" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
- <path stroke-linecap="round" stroke-linejoin="round" d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z" />
+ {/* Release notes footer */}
+ <Show when={props.updateInfo()?.releaseNotes}>
+ <div class="px-5 py-3 border-t border-green-200 dark:border-green-800/50 bg-white/50 dark:bg-gray-900/30">
+ <details class="group">
+ <summary class="flex items-center gap-2 text-sm font-medium text-green-700 dark:text-green-300 cursor-pointer hover:text-green-800 dark:hover:text-green-200 transition-colors">
+ <svg class="w-4 h-4 transition-transform group-open:rotate-90" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
+ <path stroke-linecap="round" stroke-linejoin="round" d="M9 5l7 7-7 7" />
</svg>
- </div>
- <div>
- <label class="text-sm font-medium text-gray-900 dark:text-gray-100">
- Automatic Update Checks
- </label>
- <p class="text-xs text-gray-600 dark:text-gray-400">
- Periodically check for new versions (installation is always manual)
- </p>
- </div>
+ View Release Notes
+ </summary>
+ <pre class="mt-3 p-4 text-xs text-gray-700 dark:text-gray-300 whitespace-pre-wrap font-mono bg-gray-100 dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 max-h-64 overflow-y-auto">
+ {props.updateInfo()?.releaseNotes}
+ </pre>
+ </details>
+ </div>
+ </Show>
+ </div>
+ </Show>
+
+ {/* Update settings */}
+ <div class="border-t border-gray-200 dark:border-gray-700 pt-6 space-y-5">
+ <h4 class="flex items-center gap-2 text-sm font-medium text-gray-700 dark:text-gray-300">
+ <svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
+ <path stroke-linecap="round" stroke-linejoin="round" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z" />
+ <path stroke-linecap="round" stroke-linejoin="round" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
+ </svg>
+ Update Preferences
+ <HelpIcon contentId="updates.pulse.channel" size="xs" />
+ </h4>
+
+ {/* Update Channel */}
+ <div class="grid grid-cols-1 sm:grid-cols-2 gap-3">
+ <button
+ type="button"
+ onClick={() => {
+ props.setUpdateChannel('stable');
+ props.setHasUnsavedChanges(true);
+ }}
+ disabled={props.versionInfo()?.isSourceBuild}
+ class={`p-4 rounded-xl border-2 transition-all text-left disabled:opacity-50 disabled:cursor-not-allowed ${props.updateChannel() === 'stable'
+ ? 'border-green-500 bg-green-50 dark:bg-green-900/20'
+ : 'border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600'
+ }`}
+ >
+ <div class="flex items-center gap-3">
+ <div class={`p-2 rounded-lg ${props.updateChannel() === 'stable'
+ ? 'bg-green-100 dark:bg-green-900/40'
+ : 'bg-gray-100 dark:bg-gray-800'
+ }`}>
+ <svg class={`w-5 h-5 ${props.updateChannel() === 'stable'
+ ? 'text-green-600 dark:text-green-400'
+ : 'text-gray-500 dark:text-gray-400'
+ }`} fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
+ <path stroke-linecap="round" stroke-linejoin="round" d="M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z" />
+ </svg>
</div>
- <label class="relative inline-flex items-center cursor-pointer">
+ <div>
+ <p class={`text-sm font-semibold ${props.updateChannel() === 'stable'
+ ? 'text-green-900 dark:text-green-100'
+ : 'text-gray-900 dark:text-gray-100'
+ }`}>Stable</p>
+ <p class="text-xs text-gray-500 dark:text-gray-400">
+ Production-ready releases
+ </p>
+ </div>
+ </div>
+ </button>
+
+ <button
+ type="button"
+ onClick={() => {
+ props.setUpdateChannel('rc');
+ props.setHasUnsavedChanges(true);
+ }}
+ disabled={props.versionInfo()?.isSourceBuild}
+ class={`p-4 rounded-xl border-2 transition-all text-left disabled:opacity-50 disabled:cursor-not-allowed ${props.updateChannel() === 'rc'
+ ? 'border-purple-500 bg-purple-50 dark:bg-purple-900/20'
+ : 'border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600'
+ }`}
+ >
+ <div class="flex items-center gap-3">
+ <div class={`p-2 rounded-lg ${props.updateChannel() === 'rc'
+ ? 'bg-purple-100 dark:bg-purple-900/40'
+ : 'bg-gray-100 dark:bg-gray-800'
+ }`}>
+ <svg class={`w-5 h-5 ${props.updateChannel() === 'rc'
+ ? 'text-purple-600 dark:text-purple-400'
+ : 'text-gray-500 dark:text-gray-400'
+ }`} fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
+ <path stroke-linecap="round" stroke-linejoin="round" d="M19.428 15.428a2 2 0 00-1.022-.547l-2.387-.477a6 6 0 00-3.86.517l-.318.158a6 6 0 01-3.86.517L6.05 15.21a2 2 0 00-1.806.547M8 4h8l-1 1v5.172a2 2 0 00.586 1.414l5 5c1.26 1.26.367 3.414-1.415 3.414H4.828c-1.782 0-2.674-2.154-1.414-3.414l5-5A2 2 0 009 10.172V5L8 4z" />
+ </svg>
+ </div>
+ <div>
+ <p class={`text-sm font-semibold ${props.updateChannel() === 'rc'
+ ? 'text-purple-900 dark:text-purple-100'
+ : 'text-gray-900 dark:text-gray-100'
+ }`}>Release Candidate</p>
+ <p class="text-xs text-gray-500 dark:text-gray-400">
+ Preview upcoming features
+ </p>
+ </div>
+ </div>
+ </button>
+ </div>
+
+ {/* Auto Update Toggle */}
+ <div class="p-4 rounded-xl border border-gray-200 dark:border-gray-700 bg-gray-50/50 dark:bg-gray-800/30">
+ <div class="flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between">
+ <div class="flex items-center gap-3">
+ <div class="p-2 bg-blue-100 dark:bg-blue-900/40 rounded-lg">
+ <svg class="w-5 h-5 text-blue-600 dark:text-blue-400" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
+ <path stroke-linecap="round" stroke-linejoin="round" d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z" />
+ </svg>
+ </div>
+ <div>
+ <label class="text-sm font-medium text-gray-900 dark:text-gray-100">
+ Automatic Update Checks
+ </label>
+ <p class="text-xs text-gray-600 dark:text-gray-400">
+ Periodically check for new versions (installation is always manual)
+ </p>
+ </div>
+ </div>
+ <label class="relative inline-flex items-center cursor-pointer">
+ <input
+ type="checkbox"
+ data-testid="updates-auto-check-toggle"
+ checked={props.autoUpdateEnabled()}
+ onChange={(e) => {
+ props.setAutoUpdateEnabled(e.currentTarget.checked);
+ props.setHasUnsavedChanges(true);
+ }}
+ disabled={props.versionInfo()?.isSourceBuild}
+ class="sr-only peer"
+ />
+ <div class="w-11 h-6 bg-gray-200 peer-focus:outline-none rounded-full peer dark:bg-gray-700 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-blue-600 peer-disabled:opacity-50"></div>
+ </label>
+ </div>
+
+ {/* Auto update options (shown when enabled) */}
+ <Show when={props.autoUpdateEnabled()}>
+ <div class="mt-4 pt-4 border-t border-gray-200 dark:border-gray-700 grid grid-cols-1 sm:grid-cols-2 gap-4">
+ {/* Check Interval */}
+ <div class="space-y-2">
+ <label class="text-xs font-medium text-gray-700 dark:text-gray-300">
+ Check Interval
+ </label>
+ <select
+ value={props.autoUpdateCheckInterval()}
+ onChange={(e) => {
+ props.setAutoUpdateCheckInterval(parseInt(e.currentTarget.value));
+ props.setHasUnsavedChanges(true);
+ }}
+ class="w-full px-3 py-2 text-sm border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-800"
+ >
+ <option value="6">Every 6 hours</option>
+ <option value="12">Every 12 hours</option>
+ <option value="24">Daily</option>
+ <option value="168">Weekly</option>
+ </select>
+ </div>
+
+ {/* Check Time */}
+ <div class="space-y-2">
+ <label class="text-xs font-medium text-gray-700 dark:text-gray-300">
+ Preferred Time
+ </label>
<input
- type="checkbox"
- data-testid="updates-auto-check-toggle"
- checked={props.autoUpdateEnabled()}
+ type="time"
+ value={props.autoUpdateTime()}
onChange={(e) => {
- props.setAutoUpdateEnabled(e.currentTarget.checked);
+ props.setAutoUpdateTime(e.currentTarget.value);
props.setHasUnsavedChanges(true);
}}
- disabled={props.versionInfo()?.isSourceBuild}
- class="sr-only peer"
+ class="w-full px-3 py-2 text-sm border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-800"
/>
- <div class="w-11 h-6 bg-gray-200 peer-focus:outline-none rounded-full peer dark:bg-gray-700 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-blue-600 peer-disabled:opacity-50"></div>
- </label>
- </div>
-
- {/* Auto update options (shown when enabled) */}
- <Show when={props.autoUpdateEnabled()}>
- <div class="mt-4 pt-4 border-t border-gray-200 dark:border-gray-700 grid grid-cols-1 sm:grid-cols-2 gap-4">
- {/* Check Interval */}
- <div class="space-y-2">
- <label class="text-xs font-medium text-gray-700 dark:text-gray-300">
- Check Interval
- </label>
- <select
- value={props.autoUpdateCheckInterval()}
- onChange={(e) => {
- props.setAutoUpdateCheckInterval(parseInt(e.currentTarget.value));
- props.setHasUnsavedChanges(true);
- }}
- class="w-full px-3 py-2 text-sm border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-800"
- >
- <option value="6">Every 6 hours</option>
- <option value="12">Every 12 hours</option>
- <option value="24">Daily</option>
- <option value="168">Weekly</option>
- </select>
- </div>
-
- {/* Check Time */}
- <div class="space-y-2">
- <label class="text-xs font-medium text-gray-700 dark:text-gray-300">
- Preferred Time
- </label>
- <input
- type="time"
- value={props.autoUpdateTime()}
- onChange={(e) => {
- props.setAutoUpdateTime(e.currentTarget.value);
- props.setHasUnsavedChanges(true);
- }}
- class="w-full px-3 py-2 text-sm border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-800"
- />
- </div>
</div>
- </Show>
- </div>
+ </div>
+ </Show>
</div>
</div>
- </section>
- </div>
- </Card>
+ </div>
+ </section>
+ </SettingsPanel>
</div>
);
};