import React from 'react'; import { Card, CardContent, CardHeader, CardTitle, CardDescription } from '@/components/ui/index'; import { Label } from '@/components/ui/index'; import { Switch } from '@/components/ui/index'; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/index'; import { Button } from '@/components/ui/index'; import { RefreshCw, Check, AlertCircle, Loader } from 'lucide-react'; import { checkAppUpdatesCmd, installAppUpdatesCmd, getUpdateChannelCmd, setUpdateChannelCmd, } from '@/lib/tauriCommands'; export function ProxmoxSettings() { const [autoUpdate, setAutoUpdate] = React.useState(true); const [updateChannel, setUpdateChannel] = React.useState<'stable' | 'pre-release'>('stable'); const [autoCheck, setAutoCheck] = React.useState(true); const [lastCheck, setLastCheck] = React.useState('Never'); const [defaultPort, setDefaultPort] = React.useState('8006'); const [connectionTimeout, setConnectionTimeout] = React.useState('30'); const [retryAttempts, setRetryAttempts] = React.useState('3'); const [verifyCertificates, setVerifyCertificates] = React.useState(true); const [enableCaching, setEnableCaching] = React.useState(true); const [enableDebug, setEnableDebug] = React.useState(false); const [checking, setChecking] = React.useState(false); const [updateAvailable, setUpdateAvailable] = React.useState(false); const [error, setError] = React.useState(null); const loadChannel = async () => { try { const ch = await getUpdateChannelCmd(); setUpdateChannel(ch as 'stable' | 'pre-release'); } catch { console.error('Failed to load channel'); } }; const handleCheckUpdates = async () => { setChecking(true); setError(null); try { const available = await checkAppUpdatesCmd(); setUpdateAvailable(available); setLastCheck(new Date().toLocaleString()); } catch { setError('Failed to check for updates'); } finally { setChecking(false); } }; const handleInstallUpdate = async () => { try { await installAppUpdatesCmd(); setUpdateAvailable(false); } catch { setError('Failed to install update'); } }; const handleChannelChange = async (value: string) => { setUpdateChannel(value as 'stable' | 'pre-release'); try { await setUpdateChannelCmd(value); } catch { setError('Failed to update channel'); } }; React.useEffect(() => { void loadChannel(); void handleCheckUpdates(); }, []); return (

Proxmox Settings

Configure Proxmox Datacenter Manager integration

Update Management Configure how Proxmox updates are managed

Automatically check for new Proxmox updates

{updateChannel === 'stable' ? 'Receive only stable, production-ready updates' : 'Receive pre-release updates with new features (may be less stable)'}

Automatically download updates when available

{lastCheck}

{error && (
{error}
)} {updateAvailable ? (
Update Available
A new version is ready to install
) : (
Up to Date
You are running the latest version
)}
Cluster Configuration Default settings for new Proxmox clusters

Used when connecting to new clusters

Advanced Options Advanced Proxmox integration settings

Require valid SSL certificates for cluster connections

Reuse connections to improve performance

Log detailed Proxmox API interactions

); }