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.

fix(ui): Fix Proxmox settings tab selection not updating visually. Related to #1127

rcourtmana444de453a0e
diff --git a/frontend-modern/src/components/Settings/Settings.tsx b/frontend-modern/src/components/Settings/Settings.tsx
index bb60e4710d..de4eb897aa 100644
--- a/frontend-modern/src/components/Settings/Settings.tsx
+++ b/frontend-modern/src/components/Settings/Settings.tsx
@@ -2545,7 +2545,7 @@ const Settings: Component<SettingsProps> = (props) => {
>
<For each={flatTabs}>
{(tab) => {
- const isActive = activeTab() === tab.id;
+ const isActive = () => activeTab() === tab.id;
const disabled = tab.disabled;
return (
<button
@@ -2553,7 +2553,7 @@ const Settings: Component<SettingsProps> = (props) => {
disabled={disabled}
class={`px-3 py-2 text-xs font-medium border-b-2 transition-colors whitespace-nowrap ${disabled
? 'opacity-60 cursor-not-allowed text-gray-400 dark:text-gray-600 border-transparent'
- : isActive
+ : isActive()
? 'text-blue-600 dark:text-blue-300 border-blue-500 dark:border-blue-400'
: 'text-gray-600 dark:text-gray-400 border-transparent hover:text-blue-500 dark:hover:text-blue-300 hover:border-blue-300/70 dark:hover:border-blue-500/50'
}`}
diff --git a/frontend-modern/src/components/Settings/SettingsSectionNav.tsx b/frontend-modern/src/components/Settings/SettingsSectionNav.tsx
index f390c051b7..5fdfb00c46 100644
--- a/frontend-modern/src/components/Settings/SettingsSectionNav.tsx
+++ b/frontend-modern/src/components/Settings/SettingsSectionNav.tsx
@@ -42,8 +42,8 @@ export const SettingsSectionNav: Component<SettingsSectionNavProps> = (props) =>
<div class={`flex flex-wrap items-center gap-2 sm:gap-4 ${props.class ?? ''}`} aria-label="Settings sections">
<For each={allSections}>
{(section) => {
- const isActive = section.id === props.current;
- const classes = isActive
+ const isActive = () => section.id === props.current;
+ const classes = () => isActive()
? `${baseClasses} text-blue-600 dark:text-blue-300 border-blue-500 dark:border-blue-400`
: `${baseClasses} hover:text-blue-500 dark:hover:text-blue-300 hover:border-blue-300/70 dark:hover:border-blue-500/50`;
@@ -52,9 +52,9 @@ export const SettingsSectionNav: Component<SettingsSectionNavProps> = (props) =>
return (
<button
type="button"
- class={classes}
+ class={classes()}
onClick={() => props.onSelect(section.id)}
- aria-pressed={isActive}
+ aria-pressed={isActive()}
>
<Icon size={14} stroke-width={2} class="sm:w-4 sm:h-4" />
<span class="whitespace-nowrap">{section.label}</span>