From b311bdd0695d8a48289e83e66ef6e2e48e2f28fb Mon Sep 17 00:00:00 2001 From: rcourtman Date: Fri, 24 Oct 2025 08:50:18 +0000 Subject: [PATCH] Rename legacy settings tabs to Proxmox and Hosts --- .../src/components/Settings/Settings.tsx | 71 ++++++++++++------- 1 file changed, 44 insertions(+), 27 deletions(-) diff --git a/frontend-modern/src/components/Settings/Settings.tsx b/frontend-modern/src/components/Settings/Settings.tsx index e20f85c..e6866f7 100644 --- a/frontend-modern/src/components/Settings/Settings.tsx +++ b/frontend-modern/src/components/Settings/Settings.tsx @@ -227,9 +227,9 @@ interface DiscoveryScanStatus { } type SettingsTab = - | 'agent-hub' + | 'proxmox' | 'docker' - | 'servers' + | 'hosts' | 'podman' | 'kubernetes' | 'system-general' @@ -246,7 +246,7 @@ type SettingsTab = type AgentKey = 'pve' | 'pbs' | 'pmg' | 'docker' | 'host' | 'podman' | 'kubernetes'; const SETTINGS_HEADER_META: Record = { - 'agent-hub': { + proxmox: { title: 'Proxmox', description: 'Monitor your Proxmox Virtual Environment, Backup Server, and Mail Gateway infrastructure.', }, @@ -254,7 +254,7 @@ const SETTINGS_HEADER_META: Record = (props) => { const location = useLocation(); const deriveTabFromPath = (path: string): SettingsTab => { - if (path.includes('/settings/agent-hub')) return 'agent-hub'; + if (path.includes('/settings/proxmox')) return 'proxmox'; + if (path.includes('/settings/agent-hub')) return 'proxmox'; if (path.includes('/settings/docker')) return 'docker'; - if (path.includes('/settings/hosts') || path.includes('/settings/host-agents') || path.includes('/settings/servers')) return 'servers'; + if (path.includes('/settings/hosts') || path.includes('/settings/host-agents') || path.includes('/settings/servers')) return 'hosts'; if (path.includes('/settings/podman')) return 'podman'; if (path.includes('/settings/kubernetes')) return 'kubernetes'; if (path.includes('/settings/system-general')) return 'system-general'; @@ -355,7 +356,7 @@ const Settings: Component = (props) => { if (path.includes('/settings/security')) return 'security-overview'; if (path.includes('/settings/diagnostics')) return 'diagnostics'; if (path.includes('/settings/updates')) return 'updates'; - // Legacy platform paths map to the agent hub + // Legacy platform paths map to the Proxmox tab if ( path.includes('/settings/pve') || path.includes('/settings/pbs') || @@ -365,9 +366,9 @@ const Settings: Component = (props) => { path.includes('/settings/windowsServers') || path.includes('/settings/macServers') ) { - return 'agent-hub'; + return 'proxmox'; } - return 'agent-hub'; + return 'proxmox'; }; const deriveAgentFromPath = (path: string): AgentKey | null => { @@ -437,8 +438,8 @@ const Settings: Component = (props) => { const handleSelectAgent = (agent: AgentKey) => { setSelectedAgent(agent); - if (currentTab() !== 'agent-hub') { - setCurrentTab('agent-hub'); + if (currentTab() !== 'proxmox') { + setCurrentTab('proxmox'); } const target = agentPaths[agent]; if (target && location.pathname !== target) { @@ -447,13 +448,13 @@ const Settings: Component = (props) => { }; const setActiveTab = (tab: SettingsTab) => { - if (tab === 'agent-hub' && selectedAgent() === 'podman') { + if (tab === 'proxmox' && selectedAgent() === 'podman') { setSelectedAgent('pve'); - } else if (tab === 'agent-hub' && selectedAgent() === 'kubernetes') { + } else if (tab === 'proxmox' && selectedAgent() === 'kubernetes') { setSelectedAgent('pve'); } - if (tab === 'agent-hub' && !['pve', 'pbs', 'pmg', 'docker', 'host'].includes(selectedAgent())) { + if (tab === 'proxmox' && !['pve', 'pbs', 'pmg', 'docker', 'host'].includes(selectedAgent())) { setSelectedAgent('pve'); } @@ -488,19 +489,35 @@ const Settings: Component = (props) => { () => location.pathname, (path) => { if (path === '/settings' || path === '/settings/') { - if (currentTab() !== 'agent-hub') { - setCurrentTab('agent-hub'); + if (currentTab() !== 'proxmox') { + setCurrentTab('proxmox'); } setSelectedAgent('pve'); return; } + if (path.startsWith('/settings/agent-hub')) { + navigate(path.replace('/settings/agent-hub', '/settings/proxmox'), { + replace: true, + scroll: false, + }); + return; + } + + if (path.startsWith('/settings/servers')) { + navigate(path.replace('/settings/servers', '/settings/hosts'), { + replace: true, + scroll: false, + }); + return; + } + const resolved = deriveTabFromPath(path); if (resolved !== currentTab()) { setCurrentTab(resolved); } - if (resolved === 'agent-hub') { + if (resolved === 'proxmox') { const agentFromPath = deriveAgentFromPath(path); if (agentFromPath) { setSelectedAgent(agentFromPath); @@ -871,9 +888,9 @@ const Settings: Component = (props) => { id: 'platforms', label: 'Platforms', items: [ - { id: 'agent-hub', label: 'Proxmox', icon: }, + { id: 'proxmox', label: 'Proxmox', icon: }, { id: 'docker', label: 'Docker', icon: }, - { id: 'servers', label: 'Hosts', icon: }, + { id: 'hosts', label: 'Hosts', icon: }, { id: 'podman', label: 'Podman', icon: , disabled: true }, { id: 'kubernetes', label: 'Kubernetes', icon: , disabled: true }, ], @@ -1946,7 +1963,7 @@ const Settings: Component = (props) => { = (props) => {
- + = (props) => { {/* PVE Nodes Tab */} - +

@@ -2465,7 +2482,7 @@ const Settings: Component = (props) => { {/* PBS Nodes Tab */} - +

@@ -2744,7 +2761,7 @@ const Settings: Component = (props) => {

{/* PMG Nodes Tab */} - +

@@ -3015,7 +3032,7 @@ const Settings: Component = (props) => {

{/* Docker Tab */} - + = (props) => { {/* Servers Platform Tab */} - + @@ -3052,7 +3069,7 @@ const Settings: Component = (props) => { {/* Host Agents */} - +