chore(settings): Clean up unused imports and optimize polling

- Removed unused getPulsePort/getPulseWebSocketUrl imports
- Optimized polling to only run on proxmox tab (DiagnosticsPanel handles its own fetching)
- Remaining lint warnings are for legacy code that may need future refactoring
This commit is contained in:
rcourtman 2025-12-13 07:59:52 +00:00
parent de2f6e0edb
commit 065cbe46cf

View file

@ -13,7 +13,6 @@ import { useNavigate, useLocation } from '@solidjs/router';
import { useWebSocket } from '@/App';
import { showSuccess, showError, showWarning } from '@/utils/toast';
import { copyToClipboard } from '@/utils/clipboard';
import { getPulsePort, getPulseWebSocketUrl } from '@/utils/url';
import { logger } from '@/utils/logger';
import {
apiFetch,
@ -1103,7 +1102,7 @@ const Settings: Component<SettingsProps> = (props) => {
if (typeof window === 'undefined') {
return;
}
const shouldPoll = currentTab() === 'proxmox' || currentTab() === 'diagnostics';
const shouldPoll = currentTab() === 'proxmox';
if (!shouldPoll) {
return;
}
@ -5391,8 +5390,8 @@ const Settings: Component<SettingsProps> = (props) => {
</Card >
</div >
{/* Delete Node Modal */ }
< Show when = { showDeleteNodeModal() } >
{/* Delete Node Modal */}
< Show when={showDeleteNodeModal()} >
<div class="fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4">
<Card padding="lg" class="w-full max-w-lg space-y-5">
<SectionHeader title={`Remove ${nodePendingDeleteLabel()}`} size="md" class="mb-1" />
@ -5458,8 +5457,8 @@ const Settings: Component<SettingsProps> = (props) => {
</div>
</Show >
{/* Node Modal - Use separate modals for PVE and PBS to ensure clean state */ }
< Show when = { isNodeModalVisible('pve') } >
{/* Node Modal - Use separate modals for PVE and PBS to ensure clean state */}
< Show when={isNodeModalVisible('pve')} >
<NodeModal
isOpen={true}
resetKey={modalResetKey()}
@ -5530,8 +5529,8 @@ const Settings: Component<SettingsProps> = (props) => {
/>
</Show >
{/* PBS Node Modal - Separate instance to prevent contamination */ }
< Show when = { isNodeModalVisible('pbs') } >
{/* PBS Node Modal - Separate instance to prevent contamination */}
< Show when={isNodeModalVisible('pbs')} >
<NodeModal
isOpen={true}
resetKey={modalResetKey()}
@ -5601,8 +5600,8 @@ const Settings: Component<SettingsProps> = (props) => {
/>
</Show >
{/* PMG Node Modal */ }
< Show when = { isNodeModalVisible('pmg') } >
{/* PMG Node Modal */}
< Show when={isNodeModalVisible('pmg')} >
<NodeModal
isOpen={true}
resetKey={modalResetKey()}
@ -5663,8 +5662,8 @@ const Settings: Component<SettingsProps> = (props) => {
}}
/>
</Show >
{/* Export Dialog */ }
< Show when = { showExportDialog() } >
{/* Export Dialog */}
< Show when={showExportDialog()} >
<div class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50">
<Card padding="lg" class="max-w-md w-full">
<SectionHeader title="Export configuration" size="md" class="mb-4" />
@ -5803,8 +5802,8 @@ const Settings: Component<SettingsProps> = (props) => {
</div>
</Show >
{/* API Token Modal */ }
< Show when = { showApiTokenModal() } >
{/* API Token Modal */}
< Show when={showApiTokenModal()} >
<div class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50">
<Card padding="lg" class="max-w-md w-full">
<SectionHeader title="API token required" size="md" class="mb-4" />
@ -5873,8 +5872,8 @@ const Settings: Component<SettingsProps> = (props) => {
</div>
</Show >
{/* Import Dialog */ }
< Show when = { showImportDialog() } >
{/* Import Dialog */}
< Show when={showImportDialog()} >
<div class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50">
<Card padding="lg" class="max-w-md w-full">
<SectionHeader title="Import configuration" size="md" class="mb-4" />