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