diff --git a/AppImage/components/virtual-machines.tsx b/AppImage/components/virtual-machines.tsx index 300fcd89..cd4bef5d 100644 --- a/AppImage/components/virtual-machines.tsx +++ b/AppImage/components/virtual-machines.tsx @@ -381,13 +381,16 @@ export function VirtualMachines() { setModalPage(0) setVmBackups([]) setDetailsLoading(true) + setLoadingBackups(true) try { - const [details, storagesData] = await Promise.all([ + const [details, storagesData, backupsData] = await Promise.all([ fetchApi(`/api/vms/${vm.vmid}`), - fetchApi('/api/backup-storages') + fetchApi('/api/backup-storages'), + fetchApi(`/api/vms/${vm.vmid}/backups`) ]) setVMDetails(details) setBackupStorages(storagesData.storages || []) + setVmBackups(backupsData.backups || []) if (storagesData.storages?.length > 0) { setSelectedBackupStorage(storagesData.storages[0].storage) } @@ -395,6 +398,7 @@ export function VirtualMachines() { console.error("Error fetching VM details:", error) } finally { setDetailsLoading(false) + setLoadingBackups(false) } } @@ -1239,14 +1243,17 @@ const handleDownloadLogs = async (vmid: number, vmName: string) => {
{/* Mobile carousel container */} -
+
{/* Page 0: Main content */} -
+
{selectedVM && ( <> @@ -1370,7 +1377,7 @@ const handleDownloadLogs = async (vmid: number, vmName: string) => {
{/* Page 1: Backups */} -
+
@@ -1443,14 +1450,14 @@ const handleDownloadLogs = async (vmid: number, vmName: string) => {
{/* Mobile pagination dots */} -
+
@@ -2141,18 +2148,13 @@ const handleDownloadLogs = async (vmid: number, vmName: string) => { No backups found
) : ( -
- {vmBackups.slice(0, 5).map((backup, index) => ( +
+ {vmBackups.map((backup, index) => (
{backup.date} {backup.size_human}
))} - {vmBackups.length > 5 && ( -
- +{vmBackups.length - 5} more -
- )}
)}