feat(instances): add VM/LXC migration, autostart/boot order, protection
All checks were successful
Backend Tests / pytest (Python 3.12) (push) Successful in 52s
Deploy to Production / Trigger production update (push) Successful in 7s

- Migrate VMs/LXCs between cluster nodes with live progress tracking
- Configure autostart, boot order, startup/shutdown delays, and delete protection from the instance settings tab
- Group OS templates by detected OS (Ubuntu, AlmaLinux, etc.) instead of a single "Cloud Images" bucket
- Expand native Proxmox backup job management (schedule, compression, retention, guest selection, notifications)
- Add ru/en translations for the above
This commit is contained in:
markmorado
2026-07-03 02:40:58 +05:00
parent e8bce3e8ae
commit c12fbf13e5
30 changed files with 1411 additions and 111 deletions

View File

@@ -4,7 +4,8 @@ import type { LXCTemplate, LXCDeployRequest } from '@/types';
export const lxcKeys = {
templates: (serverId: number) => ['lxc-templates', serverId] as const,
storages: (serverId: number, node?: string) => ['lxc-storages', serverId, node] as const,
storages: (serverId: number, node?: string, content?: string) =>
['lxc-storages', serverId, node, content] as const,
};
// CT templates change rarely — cache for 5 minutes
@@ -20,11 +21,15 @@ export function useLXCTemplates(serverId?: number) {
});
}
// Storage list changes rarely — cache for 5 minutes
export function useLXCStorages(serverId?: number, node?: string) {
const params = node ? `?node=${encodeURIComponent(node)}` : '';
// Storage list changes rarely — cache for 5 minutes.
// content: 'rootdir' (LXC rootfs) | 'images' (VM disk) | undefined (both)
export function useLXCStorages(serverId?: number, node?: string, content?: string) {
const qs = new URLSearchParams();
if (node) qs.set('node', node);
if (content) qs.set('content', content);
const params = qs.toString() ? `?${qs.toString()}` : '';
return useQuery({
queryKey: lxcKeys.storages(serverId!, node),
queryKey: lxcKeys.storages(serverId!, node, content),
queryFn: () =>
apiClient
.get<{ storages: { storage: string; type: string; avail: number; total: number }[] }>(