feat(xo-server#_listVmBackupsOnRemote): remove unused properties (#4985)
This reduce by 10/100 times the quantity of data sent to the clients, which should improve performance.
This commit is contained in:
parent
d649211330
commit
b138438036
@ -993,25 +993,30 @@ export default class BackupNg {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// inject an id usable by importVmBackupNg()
|
backupsByVm[vmUuid] = backups.map(backup => ({
|
||||||
backups.forEach(backup => {
|
disks:
|
||||||
backup.id = `${remoteId}/${backup._filename}`
|
backup.vhds === undefined
|
||||||
|
|
||||||
const { vdis, vhds } = backup
|
|
||||||
backup.disks =
|
|
||||||
vhds === undefined
|
|
||||||
? []
|
? []
|
||||||
: Object.keys(vhds).map(vdiId => {
|
: Object.keys(backup.vhds).map(vdiId => {
|
||||||
const vdi = vdis[vdiId]
|
const vdi = backup.vdis[vdiId]
|
||||||
return {
|
return {
|
||||||
id: `${dirname(backup._filename)}/${vhds[vdiId]}`,
|
id: `${dirname(backup._filename)}/${backup.vhds[vdiId]}`,
|
||||||
name: vdi.name_label,
|
name: vdi.name_label,
|
||||||
uuid: vdi.uuid,
|
uuid: vdi.uuid,
|
||||||
}
|
}
|
||||||
})
|
}),
|
||||||
})
|
|
||||||
|
|
||||||
backupsByVm[vmUuid] = backups
|
// inject an id usable by importVmBackupNg()
|
||||||
|
id: `${remoteId}/${backup._filename}`,
|
||||||
|
jobId: backup.jobId,
|
||||||
|
mode: backup.mode,
|
||||||
|
size: backup.size,
|
||||||
|
timestamp: backup.timestamp,
|
||||||
|
vm: {
|
||||||
|
name_description: backup.vm.name_description,
|
||||||
|
name_label: backup.vm.name_label,
|
||||||
|
},
|
||||||
|
}))
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
Loading…
Reference in New Issue
Block a user