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.

Enhance SettingsPanel with icon prop and header redesign

rcourtmanfeabb3ec1ebc
diff --git a/frontend-modern/src/components/shared/SettingsPanel.tsx b/frontend-modern/src/components/shared/SettingsPanel.tsx
index f769e23498..6bb7b44848 100644
--- a/frontend-modern/src/components/shared/SettingsPanel.tsx
+++ b/frontend-modern/src/components/shared/SettingsPanel.tsx
@@ -6,6 +6,7 @@ type SettingsPanelProps = {
title: JSX.Element;
description?: JSX.Element;
action?: JSX.Element;
+ icon?: JSX.Element;
bodyClass?: string;
tone?: 'default' | 'muted' | 'info' | 'success' | 'warning' | 'danger';
padding?: 'none' | 'sm' | 'md' | 'lg';
@@ -16,6 +17,7 @@ export function SettingsPanel(props: SettingsPanelProps) {
'title',
'description',
'action',
+ 'icon',
'bodyClass',
'children',
'class',
@@ -25,23 +27,31 @@ export function SettingsPanel(props: SettingsPanelProps) {
return (
<Card
- padding={local.padding ?? 'lg'}
+ padding="none"
tone={local.tone ?? 'default'}
- class={`space-y-6 ${local.class ?? ''}`.trim()}
+ class={`overflow-hidden border border-gray-200 dark:border-gray-700 ${local.class ?? ''}`.trim()}
+ border={false}
{...rest}
>
- <div class="flex flex-col gap-4 md:flex-row md:items-start md:justify-between">
- <SectionHeader
- title={local.title}
- description={local.description}
- size="sm"
- class="flex-1"
- />
- <Show when={local.action}>
- <div class="md:ml-6">{local.action}</div>
- </Show>
+ <div class="bg-blue-50 dark:bg-blue-900/20 px-6 py-4 border-b border-gray-200 dark:border-gray-700">
+ <div class="flex items-center gap-3">
+ <Show when={local.icon}>
+ <div class="p-2 bg-blue-100 dark:bg-blue-900/40 rounded-lg text-blue-600 dark:text-blue-300">
+ {local.icon}
+ </div>
+ </Show>
+ <SectionHeader
+ title={local.title}
+ description={local.description}
+ size="sm"
+ class="flex-1"
+ />
+ <Show when={local.action}>
+ <div>{local.action}</div>
+ </Show>
+ </div>
</div>
- <div class={local.bodyClass ?? 'space-y-4'}>{local.children}</div>
+ <div class={`p-6 ${local.bodyClass ?? 'space-y-6'}`}>{local.children}</div>
</Card>
);
}