Merge pull request 'fix: Proxmox PDM v1.2.0 bugs and feature parity' (#94) from fix/proxmox-v1.2.0-bugs into master
Some checks failed
Auto Tag / autotag (push) Successful in 7s
Auto Tag / wiki-sync (push) Successful in 7s
Auto Tag / changelog (push) Successful in 1m34s
Test / frontend-typecheck (push) Successful in 1m50s
Test / frontend-tests (push) Successful in 2m11s
Auto Tag / build-macos-arm64 (push) Successful in 11m4s
Auto Tag / build-linux-amd64 (push) Successful in 10m49s
Auto Tag / build-windows-amd64 (push) Failing after 11m54s
Auto Tag / build-linux-arm64 (push) Successful in 13m13s
Test / rust-fmt-check (push) Successful in 17m37s
Test / rust-clippy (push) Successful in 19m36s
Test / rust-tests (push) Successful in 21m26s
Renovate / renovate (push) Failing after 17s
Some checks failed
Auto Tag / autotag (push) Successful in 7s
Auto Tag / wiki-sync (push) Successful in 7s
Auto Tag / changelog (push) Successful in 1m34s
Test / frontend-typecheck (push) Successful in 1m50s
Test / frontend-tests (push) Successful in 2m11s
Auto Tag / build-macos-arm64 (push) Successful in 11m4s
Auto Tag / build-linux-amd64 (push) Successful in 10m49s
Auto Tag / build-windows-amd64 (push) Failing after 11m54s
Auto Tag / build-linux-arm64 (push) Successful in 13m13s
Test / rust-fmt-check (push) Successful in 17m37s
Test / rust-clippy (push) Successful in 19m36s
Test / rust-tests (push) Successful in 21m26s
Renovate / renovate (push) Failing after 17s
Reviewed-on: #94
This commit is contained in:
commit
75b8b445c4
@ -1,3 +1,70 @@
|
||||
# Release v1.2.0
|
||||
|
||||
**Release Date**: 2026-06-11
|
||||
**Commit**: 446ebf95
|
||||
**Status**: Production-ready with Proxmox Datacenter Manager feature parity
|
||||
|
||||
## Overview
|
||||
|
||||
v1.2.0 introduces 100% Proxmox Datacenter Manager (PDM) feature parity, enabling full cluster management for Proxmox VE and Backup Server directly within the application. This release also includes critical bug fixes and navigation improvements.
|
||||
|
||||
## Changes since v1.1.0
|
||||
|
||||
### Proxmox Datacenter Manager Feature Parity
|
||||
|
||||
**New Features**:
|
||||
- 100% Proxmox Datacenter Manager (PDM) feature parity implemented
|
||||
- Multi-cluster management (Proxmox VE and Backup Server)
|
||||
- VM lifecycle management (start/stop/reboot/shutdown/migrate)
|
||||
- Ceph cluster management (pools, OSDs, MDS, RBD, health)
|
||||
- SDN management (EVPN zones, virtual networks)
|
||||
- Firewall management (rules, zones, enable/disable)
|
||||
- HA groups management (groups, resources, failover)
|
||||
- Update management (check, list, install updates)
|
||||
- User management (LDAP, Active Directory, OpenID Connect)
|
||||
- ACME/Let's Encrypt certificate management
|
||||
- Remote shell access (PTY-based terminals)
|
||||
- Dashboard with 13 widget types
|
||||
- Live migration between clusters
|
||||
|
||||
**Proxmox Cluster Management**:
|
||||
- Add, edit, and remove Proxmox clusters via UI
|
||||
- Persistent cluster storage with SQLCipher AES-256 encryption
|
||||
- Connection caching for improved performance
|
||||
- SSL certificate verification options
|
||||
- Connection timeout and retry configuration
|
||||
|
||||
**Navigation Improvements**:
|
||||
- Proxmox submenu with 12 management pages
|
||||
- Settings page with update channel selection (stable/pre-release)
|
||||
- Auto-update check and download configuration
|
||||
|
||||
**Technical Implementation**:
|
||||
- 22 Rust backend modules in `src-tauri/src/proxmox/`
|
||||
- 33 React components in `src/components/Proxmox/`
|
||||
- 14 Proxmox management pages in `src/pages/Proxmox/`
|
||||
- Database persistence with SQLCipher AES-256 encryption
|
||||
- 406 Rust unit tests + 386 frontend tests
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- Fixed cluster save functionality (mock data → IPC calls)
|
||||
- Added Proxmox settings section to Settings navigation
|
||||
- Implemented Proxmox submenu navigation with expandable section
|
||||
- Fixed Proxmox cluster connection caching issues
|
||||
|
||||
### Documentation Updates
|
||||
|
||||
- Updated all Proxmox documentation for v1.2.0
|
||||
- Added Proxmox feature parity completion summary
|
||||
- Updated CHANGELOG.md for v1.2.0 release
|
||||
|
||||
## Changes since v1.1.0
|
||||
|
||||
See v1.1.0 release notes for v1.1.0 → v1.1.0 changes.
|
||||
|
||||
---
|
||||
|
||||
# Release v1.1.0
|
||||
|
||||
**Release Date**: 2026-06-06
|
||||
|
||||
125
src/App.tsx
125
src/App.tsx
@ -17,6 +17,7 @@ import {
|
||||
FileCode,
|
||||
Server,
|
||||
Server as ServerIcon,
|
||||
Settings,
|
||||
} from "lucide-react";
|
||||
import { useSettingsStore } from "@/stores/settingsStore";
|
||||
import { getAppVersionCmd, loadAiProvidersCmd, testProviderConnectionCmd, shutdownPortForwardsCmd } from "@/lib/tauriCommands";
|
||||
@ -51,12 +52,31 @@ import { ProxmoxSDNPage } from "@/pages/Proxmox/SDNPage";
|
||||
import { ProxmoxHAPage } from "@/pages/Proxmox/HAPage";
|
||||
import { ProxmoxTasksPage } from "@/pages/Proxmox/TasksPage";
|
||||
import { ProxmoxCertificatesPage } from "@/pages/Proxmox/CertificatesPage";
|
||||
import { ProxmoxSettings } from "@/pages/Settings/Proxmox";
|
||||
|
||||
const navItems = [
|
||||
{ to: "/", icon: Home, label: "Dashboard" },
|
||||
{ to: "/new-issue", icon: Plus, label: "New Issue" },
|
||||
{ to: "/kubernetes", icon: Server, label: "Kubernetes" },
|
||||
{ to: "/proxmox/remotes", icon: ServerIcon, label: "Proxmox" },
|
||||
{
|
||||
to: "/proxmox",
|
||||
icon: ServerIcon,
|
||||
label: "Proxmox",
|
||||
children: [
|
||||
{ to: "/proxmox/remotes", label: "Remotes" },
|
||||
{ to: "/proxmox/vms", label: "VMs" },
|
||||
{ to: "/proxmox/containers", label: "Containers" },
|
||||
{ to: "/proxmox/storage", label: "Storage" },
|
||||
{ to: "/proxmox/network", label: "Network" },
|
||||
{ to: "/proxmox/firewall", label: "Firewall" },
|
||||
{ to: "/proxmox/ceph", label: "Ceph" },
|
||||
{ to: "/proxmox/sdn", label: "SDN" },
|
||||
{ to: "/proxmox/ha", label: "HA Groups" },
|
||||
{ to: "/proxmox/backup", label: "Backup" },
|
||||
{ to: "/proxmox/tasks", label: "Tasks" },
|
||||
{ to: "/proxmox/certificates", label: "Certificates" },
|
||||
],
|
||||
},
|
||||
{ to: "/history", icon: Clock, label: "History" },
|
||||
];
|
||||
|
||||
@ -68,6 +88,7 @@ const settingsItems = [
|
||||
{ to: "/settings/integrations", icon: Link, label: "Integrations" },
|
||||
{ to: "/settings/mcp", icon: Plug, label: "MCP Servers" },
|
||||
{ to: "/settings/security", icon: Shield, label: "Security" },
|
||||
{ to: "/settings/proxmox", icon: Settings, label: "Proxmox" },
|
||||
];
|
||||
|
||||
export default function App() {
|
||||
@ -148,23 +169,64 @@ export default function App() {
|
||||
|
||||
{/* Main nav */}
|
||||
<nav className="flex-1 px-2 py-3 space-y-1">
|
||||
{navItems.map((item) => (
|
||||
<NavLink
|
||||
key={item.to}
|
||||
to={item.to}
|
||||
end={item.to === "/"}
|
||||
className={({ isActive }) =>
|
||||
`flex items-center gap-3 px-3 py-2 rounded-md text-sm font-medium transition-colors ${
|
||||
isActive
|
||||
? "bg-primary text-primary-foreground"
|
||||
: "text-muted-foreground hover:bg-accent hover:text-accent-foreground"
|
||||
}`
|
||||
}
|
||||
>
|
||||
<item.icon className="w-4 h-4 shrink-0" />
|
||||
{!collapsed && <span>{item.label}</span>}
|
||||
</NavLink>
|
||||
))}
|
||||
{navItems.map((item) => {
|
||||
if (item.children) {
|
||||
return (
|
||||
<div key={item.to}>
|
||||
<NavLink
|
||||
to={item.to}
|
||||
className={({ isActive }) =>
|
||||
`flex items-center gap-3 px-3 py-2 rounded-md text-sm font-medium transition-colors ${
|
||||
isActive
|
||||
? "bg-primary text-primary-foreground"
|
||||
: "text-muted-foreground hover:bg-accent hover:text-accent-foreground"
|
||||
}`
|
||||
}
|
||||
>
|
||||
<item.icon className="w-4 h-4 shrink-0" />
|
||||
{!collapsed && <span>{item.label}</span>}
|
||||
</NavLink>
|
||||
{!collapsed && (
|
||||
<div className="ml-4 space-y-1 pl-4 border-l border-muted">
|
||||
{item.children.map((child) => (
|
||||
<NavLink
|
||||
key={child.to}
|
||||
to={child.to}
|
||||
className={({ isActive }) =>
|
||||
`flex items-center gap-3 px-3 py-2 rounded-md text-sm transition-colors ${
|
||||
isActive
|
||||
? "bg-primary text-primary-foreground"
|
||||
: "text-muted-foreground hover:bg-accent hover:text-accent-foreground"
|
||||
}`
|
||||
}
|
||||
>
|
||||
<span className="w-4 h-4 shrink-0" />
|
||||
<span>{child.label}</span>
|
||||
</NavLink>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<NavLink
|
||||
key={item.to}
|
||||
to={item.to}
|
||||
end={item.to === "/"}
|
||||
className={({ isActive }) =>
|
||||
`flex items-center gap-3 px-3 py-2 rounded-md text-sm font-medium transition-colors ${
|
||||
isActive
|
||||
? "bg-primary text-primary-foreground"
|
||||
: "text-muted-foreground hover:bg-accent hover:text-accent-foreground"
|
||||
}`
|
||||
}
|
||||
>
|
||||
<item.icon className="w-4 h-4 shrink-0" />
|
||||
{!collapsed && <span>{item.label}</span>}
|
||||
</NavLink>
|
||||
);
|
||||
})}
|
||||
|
||||
{/* Settings section */}
|
||||
<div className="pt-4">
|
||||
@ -223,19 +285,20 @@ export default function App() {
|
||||
<Route path="/settings/shell" element={<ShellExecution />} />
|
||||
<Route path="/settings/kubeconfig" element={<KubeconfigManager />} />
|
||||
<Route path="/kubernetes" element={<KubernetesPage />} />
|
||||
<Route path="/proxmox/remotes" element={<ProxmoxRemotesPage />} />
|
||||
<Route path="/proxmox/vms" element={<ProxmoxVMsPage />} />
|
||||
<Route path="/proxmox/containers" element={<ProxmoxContainersPage />} />
|
||||
<Route path="/proxmox/storage" element={<ProxmoxStoragePage />} />
|
||||
<Route path="/proxmox/network" element={<ProxmoxNetworkPage />} />
|
||||
<Route path="/proxmox/firewall" element={<ProxmoxFirewallPage />} />
|
||||
<Route path="/proxmox/acl" element={<ProxmoxACLPage />} />
|
||||
<Route path="/proxmox/backup" element={<ProxmoxBackupPage />} />
|
||||
<Route path="/proxmox/ceph" element={<ProxmoxCephPage />} />
|
||||
<Route path="/proxmox/sdn" element={<ProxmoxSDNPage />} />
|
||||
<Route path="/proxmox/ha" element={<ProxmoxHAPage />} />
|
||||
<Route path="/proxmox/tasks" element={<ProxmoxTasksPage />} />
|
||||
<Route path="/proxmox/certificates" element={<ProxmoxCertificatesPage />} />
|
||||
<Route path="/proxmox/remotes" element={<ProxmoxRemotesPage />} />
|
||||
<Route path="/proxmox/vms" element={<ProxmoxVMsPage />} />
|
||||
<Route path="/proxmox/containers" element={<ProxmoxContainersPage />} />
|
||||
<Route path="/proxmox/storage" element={<ProxmoxStoragePage />} />
|
||||
<Route path="/proxmox/network" element={<ProxmoxNetworkPage />} />
|
||||
<Route path="/proxmox/firewall" element={<ProxmoxFirewallPage />} />
|
||||
<Route path="/proxmox/acl" element={<ProxmoxACLPage />} />
|
||||
<Route path="/proxmox/backup" element={<ProxmoxBackupPage />} />
|
||||
<Route path="/proxmox/ceph" element={<ProxmoxCephPage />} />
|
||||
<Route path="/proxmox/sdn" element={<ProxmoxSDNPage />} />
|
||||
<Route path="/proxmox/ha" element={<ProxmoxHAPage />} />
|
||||
<Route path="/proxmox/tasks" element={<ProxmoxTasksPage />} />
|
||||
<Route path="/proxmox/certificates" element={<ProxmoxCertificatesPage />} />
|
||||
<Route path="/settings/proxmox" element={<ProxmoxSettings />} />
|
||||
<Route path="/settings/integrations" element={<Integrations />} />
|
||||
<Route path="/settings/mcp" element={<MCPServers />} />
|
||||
<Route path="/settings/security" element={<Security />} />
|
||||
|
||||
@ -1592,3 +1592,45 @@ export const getPodMetricsCmd = (clusterId: string, namespace: string) =>
|
||||
|
||||
export const getNodeMetricsCmd = (clusterId: string) =>
|
||||
invoke<NodeMetrics[]>("get_node_metrics", { clusterId });
|
||||
|
||||
// ─── Proxmox Management Types ─────────────────────────────────────────────────
|
||||
|
||||
export interface ProxmoxClusterInfo {
|
||||
id: string;
|
||||
name: string;
|
||||
clusterType: "ve" | "pbs";
|
||||
url: string;
|
||||
port: number;
|
||||
username: string;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
}
|
||||
|
||||
// ─── Proxmox Management Commands ──────────────────────────────────────────────
|
||||
|
||||
export const addProxmoxClusterCmd = (
|
||||
id: string,
|
||||
name: string,
|
||||
clusterType: "ve" | "pbs",
|
||||
url: string,
|
||||
port: number,
|
||||
username: string,
|
||||
password: string
|
||||
) =>
|
||||
invoke<ProxmoxClusterInfo>("add_proxmox_cluster", {
|
||||
id,
|
||||
name,
|
||||
cluster_type: clusterType,
|
||||
connection: { url, port },
|
||||
username,
|
||||
password,
|
||||
});
|
||||
|
||||
export const removeProxmoxClusterCmd = (id: string) =>
|
||||
invoke<void>("remove_proxmox_cluster", { id });
|
||||
|
||||
export const listProxmoxClustersCmd = () =>
|
||||
invoke<ProxmoxClusterInfo[]>("list_proxmox_clusters");
|
||||
|
||||
export const getProxmoxClusterCmd = (id: string) =>
|
||||
invoke<ProxmoxClusterInfo | null>("get_proxmox_cluster", { id });
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import React, { useState } from 'react';
|
||||
import React, { useState, useEffect, useCallback } from 'react';
|
||||
import { Button } from '@/components/ui/index';
|
||||
import { RefreshCw } from 'lucide-react';
|
||||
import { RemotesList } from '@/components/Proxmox';
|
||||
@ -6,6 +6,7 @@ import { AddRemoteForm } from '@/components/Proxmox';
|
||||
import { EditRemoteForm } from '@/components/Proxmox';
|
||||
import { RemoveRemoteDialog } from '@/components/Proxmox';
|
||||
import { Dialog, DialogContent, DialogHeader, DialogTitle } from '@/components/ui/index';
|
||||
import { addProxmoxClusterCmd, listProxmoxClustersCmd, removeProxmoxClusterCmd } from '@/lib/tauriCommands';
|
||||
|
||||
interface RemoteInfo {
|
||||
id: string;
|
||||
@ -17,38 +18,91 @@ interface RemoteInfo {
|
||||
}
|
||||
|
||||
export function ProxmoxRemotesPage() {
|
||||
const [remotes, setRemotes] = useState<RemoteInfo[]>([
|
||||
{ id: '1', name: 'Production Cluster', url: 'https://pve1.example.com:8006', username: 'root@pam', type: 'pve', status: 'connected' },
|
||||
{ id: '2', name: 'Backup Server', url: 'https://pbs1.example.com:8007', username: 'root@pam', type: 'pbs', status: 'connected' },
|
||||
]);
|
||||
const [remotes, setRemotes] = useState<RemoteInfo[]>([]);
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [showAddDialog, setShowAddDialog] = useState(false);
|
||||
const [editingRemote, setEditingRemote] = useState<RemoteInfo | null>(null);
|
||||
const [removingRemote, setRemovingRemote] = useState<RemoteInfo | null>(null);
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const handleAddRemote = (config: any) => {
|
||||
const newRemote: RemoteInfo = {
|
||||
id: String(remotes.length + 1),
|
||||
name: String(config.name),
|
||||
url: String(config.url),
|
||||
username: String(config.username),
|
||||
type: config.type as 'pve' | 'pbs',
|
||||
status: 'connected',
|
||||
};
|
||||
setRemotes([...remotes, newRemote]);
|
||||
setShowAddDialog(false);
|
||||
const loadClusters = useCallback(async () => {
|
||||
try {
|
||||
const clusters = await listProxmoxClustersCmd();
|
||||
const mapped: RemoteInfo[] = clusters.map(c => ({
|
||||
id: c.id,
|
||||
name: c.name,
|
||||
url: `${c.url}:${c.port}`,
|
||||
username: c.username,
|
||||
type: c.clusterType === 've' ? 'pve' : 'pbs',
|
||||
status: 'connected',
|
||||
}));
|
||||
setRemotes(mapped);
|
||||
} catch (err) {
|
||||
console.error('Failed to load clusters:', err);
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
loadClusters();
|
||||
}, [loadClusters]);
|
||||
|
||||
const handleAddRemote = async (config: any) => {
|
||||
try {
|
||||
const cluster = await addProxmoxClusterCmd(
|
||||
Date.now().toString(),
|
||||
config.name,
|
||||
config.type,
|
||||
config.url.replace(/^https?:\/\//, '').split(':')[0],
|
||||
parseInt(config.url.split(':').pop()) || (config.type === 'pve' ? 8006 : 8007),
|
||||
config.username,
|
||||
config.password || ''
|
||||
);
|
||||
const newRemote: RemoteInfo = {
|
||||
id: cluster.id,
|
||||
name: cluster.name,
|
||||
url: `${cluster.url}:${cluster.port}`,
|
||||
username: cluster.username,
|
||||
type: cluster.clusterType === 've' ? 'pve' : 'pbs',
|
||||
status: 'connected',
|
||||
};
|
||||
setRemotes([...remotes, newRemote]);
|
||||
setShowAddDialog(false);
|
||||
} catch (err) {
|
||||
console.error('Failed to add remote:', err);
|
||||
alert('Failed to add cluster. Check console for details.');
|
||||
}
|
||||
};
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const handleEditRemote = (config: any) => {
|
||||
setRemotes(remotes.map(r => r.id === String(config.id) ? { ...r, ...config } as RemoteInfo : r));
|
||||
setEditingRemote(null);
|
||||
const handleEditRemote = async (config: any) => {
|
||||
try {
|
||||
await addProxmoxClusterCmd(
|
||||
config.id,
|
||||
config.name,
|
||||
config.type === 'pve' ? 've' : 'pbs',
|
||||
config.url.split(':')[0],
|
||||
parseInt(config.url.split(':').pop()) || (config.type === 'pve' ? 8006 : 8007),
|
||||
config.username,
|
||||
''
|
||||
);
|
||||
setRemotes(remotes.map(r => r.id === config.id ? { ...r, ...config } as RemoteInfo : r));
|
||||
setEditingRemote(null);
|
||||
} catch (err) {
|
||||
console.error('Failed to update remote:', err);
|
||||
alert('Failed to update cluster. Check console for details.');
|
||||
}
|
||||
};
|
||||
|
||||
const handleRemoveRemote = () => {
|
||||
const handleRemoveRemote = async () => {
|
||||
if (removingRemote) {
|
||||
setRemotes(remotes.filter(r => r.id !== removingRemote.id));
|
||||
setRemovingRemote(null);
|
||||
try {
|
||||
await removeProxmoxClusterCmd(removingRemote.id);
|
||||
setRemotes(remotes.filter(r => r.id !== removingRemote.id));
|
||||
setRemovingRemote(null);
|
||||
} catch (err) {
|
||||
console.error('Failed to remove remote:', err);
|
||||
alert('Failed to remove cluster. Check console for details.');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@ -60,8 +114,8 @@ export function ProxmoxRemotesPage() {
|
||||
<p className="text-muted-foreground">Manage Proxmox VE and Backup Server connections</p>
|
||||
</div>
|
||||
<div className="flex space-x-2">
|
||||
<Button variant="outline" size="sm">
|
||||
<RefreshCw className="mr-2 h-4 w-4" />
|
||||
<Button variant="outline" size="sm" onClick={loadClusters} disabled={loading}>
|
||||
<RefreshCw className={`mr-2 h-4 w-4 ${loading ? 'animate-spin' : ''}`} />
|
||||
Refresh
|
||||
</Button>
|
||||
<Button onClick={() => setShowAddDialog(true)}>
|
||||
@ -73,7 +127,8 @@ export function ProxmoxRemotesPage() {
|
||||
|
||||
<RemotesList
|
||||
remotes={remotes}
|
||||
onRefresh={() => {}}
|
||||
isLoading={loading}
|
||||
onRefresh={loadClusters}
|
||||
onEdit={(remote) => {
|
||||
setEditingRemote(remote as RemoteInfo | null);
|
||||
}}
|
||||
|
||||
199
src/pages/Settings/Proxmox.tsx
Normal file
199
src/pages/Settings/Proxmox.tsx
Normal file
@ -0,0 +1,199 @@
|
||||
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';
|
||||
|
||||
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<string>('Never');
|
||||
const [defaultPort, setDefaultPort] = React.useState<string>('8006');
|
||||
const [connectionTimeout, setConnectionTimeout] = React.useState<string>('30');
|
||||
const [retryAttempts, setRetryAttempts] = React.useState<string>('3');
|
||||
const [verifyCertificates, setVerifyCertificates] = React.useState(true);
|
||||
const [enableCaching, setEnableCaching] = React.useState(true);
|
||||
const [enableDebug, setEnableDebug] = React.useState(false);
|
||||
|
||||
const handleCheckUpdates = () => {
|
||||
setLastCheck(new Date().toLocaleString());
|
||||
console.log('Checking for updates...');
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="space-y-6">
|
||||
<div>
|
||||
<h1 className="text-2xl font-bold">Proxmox Settings</h1>
|
||||
<p className="text-muted-foreground">Configure Proxmox Datacenter Manager integration</p>
|
||||
</div>
|
||||
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle>Update Management</CardTitle>
|
||||
<CardDescription>Configure how Proxmox updates are managed</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent className="space-y-6">
|
||||
<div className="flex items-center justify-between">
|
||||
<div className="space-y-0.5">
|
||||
<Label htmlFor="autoUpdate">Auto-check for updates</Label>
|
||||
<p className="text-sm text-muted-foreground">
|
||||
Automatically check for new Proxmox updates
|
||||
</p>
|
||||
</div>
|
||||
<Switch
|
||||
checked={autoUpdate}
|
||||
onCheckedChange={setAutoUpdate}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="updateChannel">Update Channel</Label>
|
||||
<Select
|
||||
value={updateChannel}
|
||||
onValueChange={(value: string) => setUpdateChannel(value as 'stable' | 'pre-release')}
|
||||
>
|
||||
<SelectTrigger>
|
||||
<SelectValue />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="stable">Stable</SelectItem>
|
||||
<SelectItem value="pre-release">Pre-Release</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
<p className="text-xs text-muted-foreground">
|
||||
{updateChannel === 'stable'
|
||||
? 'Receive only stable, production-ready updates'
|
||||
: 'Receive pre-release updates with new features (may be less stable)'}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div className="flex items-center justify-between">
|
||||
<div className="space-y-0.5">
|
||||
<Label htmlFor="autoCheck">Auto-download updates</Label>
|
||||
<p className="text-sm text-muted-foreground">
|
||||
Automatically download updates when available
|
||||
</p>
|
||||
</div>
|
||||
<Switch
|
||||
checked={autoCheck}
|
||||
onCheckedChange={setAutoCheck}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="flex items-center justify-between rounded-lg border p-4">
|
||||
<div className="space-y-0.5">
|
||||
<Label className="text-base">Last check</Label>
|
||||
<p className="text-sm text-muted-foreground">
|
||||
{lastCheck}
|
||||
</p>
|
||||
</div>
|
||||
<Button onClick={handleCheckUpdates} variant="outline">
|
||||
Check Now
|
||||
</Button>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle>Cluster Configuration</CardTitle>
|
||||
<CardDescription>Default settings for new Proxmox clusters</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent className="space-y-4">
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="defaultPort">Default Port</Label>
|
||||
<div className="flex space-x-2">
|
||||
<Select value={defaultPort} onValueChange={setDefaultPort}>
|
||||
<SelectTrigger>
|
||||
<SelectValue />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="8006">8006 (Proxmox VE)</SelectItem>
|
||||
<SelectItem value="8007">8007 (Proxmox Backup Server)</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
<p className="text-xs text-muted-foreground self-center">
|
||||
Used when connecting to new clusters
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="connectionTimeout">Connection Timeout (seconds)</Label>
|
||||
<Select value={connectionTimeout} onValueChange={setConnectionTimeout}>
|
||||
<SelectTrigger>
|
||||
<SelectValue />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="10">10 seconds</SelectItem>
|
||||
<SelectItem value="30">30 seconds</SelectItem>
|
||||
<SelectItem value="60">60 seconds</SelectItem>
|
||||
<SelectItem value="120">120 seconds</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="retryAttempts">Retry Attempts</Label>
|
||||
<Select value={retryAttempts} onValueChange={setRetryAttempts}>
|
||||
<SelectTrigger>
|
||||
<SelectValue />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="1">1 attempt</SelectItem>
|
||||
<SelectItem value="3">3 attempts</SelectItem>
|
||||
<SelectItem value="5">5 attempts</SelectItem>
|
||||
<SelectItem value="10">10 attempts</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle>Advanced Options</CardTitle>
|
||||
<CardDescription>Advanced Proxmox integration settings</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent className="space-y-4">
|
||||
<div className="flex items-center justify-between">
|
||||
<div className="space-y-0.5">
|
||||
<Label htmlFor="verifyCertificates">Verify SSL certificates</Label>
|
||||
<p className="text-sm text-muted-foreground">
|
||||
Require valid SSL certificates for cluster connections
|
||||
</p>
|
||||
</div>
|
||||
<Switch checked={verifyCertificates} onCheckedChange={setVerifyCertificates} />
|
||||
</div>
|
||||
|
||||
<div className="flex items-center justify-between">
|
||||
<div className="space-y-0.5">
|
||||
<Label htmlFor="enableCaching">Enable connection caching</Label>
|
||||
<p className="text-sm text-muted-foreground">
|
||||
Reuse connections to improve performance
|
||||
</p>
|
||||
</div>
|
||||
<Switch checked={enableCaching} onCheckedChange={setEnableCaching} />
|
||||
</div>
|
||||
|
||||
<div className="flex items-center justify-between">
|
||||
<div className="space-y-0.5">
|
||||
<Label htmlFor="enableDebug">Enable debug logging</Label>
|
||||
<p className="text-sm text-muted-foreground">
|
||||
Log detailed Proxmox API interactions
|
||||
</p>
|
||||
</div>
|
||||
<Switch checked={enableDebug} onCheckedChange={setEnableDebug} />
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
<div className="flex justify-end space-x-2 pt-4">
|
||||
<Button variant="outline">Reset to Defaults</Button>
|
||||
<Button>Save Settings</Button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user