feat(xo-web/backup): expose maxExportRate from UI (#6737)

This commit is contained in:
Mathieu
2023-03-29 14:48:53 +02:00
committed by GitHub
parent 23da202790
commit dc6a13962f
4 changed files with 25 additions and 0 deletions

View File

@@ -11,6 +11,7 @@
- [Backup] Display the VM name label in the log even if the VM is not currently connected
- [Backup] Display the SR name label in the log even if the SR is not currently connected
- [Import VM] Ability to import multiple VMs from ESXi (PR [#6718](https://github.com/vatesfr/xen-orchestra/pull/6718))
- [Backup/Advanced setting] Ability to add transfer limit per job (PRs [#6737](https://github.com/vatesfr/xen-orchestra/pull/6737), [#6728](https://github.com/vatesfr/xen-orchestra/pull/6728))
### Bug fixes

View File

@@ -17,6 +17,11 @@ const SCHEMA_SETTINGS = {
minimum: 0,
optional: true,
},
maxExportRate: {
type: 'number',
minimum: 0,
optional: true,
},
},
additionalProperties: true,
},

View File

@@ -584,6 +584,7 @@ const messages = {
confirmDeleteBackupJobsBody:
'Are you sure you want to delete {nJobs, number} backup job{nJobs, plural, one {} other {s}}?',
runBackupJob: 'Run backup job once',
speedLimit: 'Speed limit (in MiB/s)',
// ------ Remote -----
remoteName: 'Name',

View File

@@ -608,6 +608,11 @@ const New = decorate([
fullInterval,
})
},
setMaxExportRate({ setGlobalSettings }, rate) {
setGlobalSettings({
maxExportRate: rate * (1024 * 1024),
})
},
setOfflineBackup:
({ setGlobalSettings }, { target: { checked: offlineBackup } }) =>
() => {
@@ -621,6 +626,7 @@ const New = decorate([
formId: generateId,
inputConcurrencyId: generateId,
inputFullIntervalId: generateId,
inputMaxExportRate: generateId,
inputTimeoutId: generateId,
// In order to keep the user preference, the offline backup is kept in the DB
@@ -731,6 +737,7 @@ const New = decorate([
checkpointSnapshot,
concurrency,
fullInterval,
maxExportRate,
offlineBackup,
offlineSnapshot,
reportRecipients,
@@ -1005,6 +1012,17 @@ const New = decorate([
/>
</FormGroup>
)}
<FormGroup>
<label htmlFor={state.inputMaxExportRate}>
<strong>{_('speedLimit')}</strong>
</label>
<Number
id={state.inputMaxExportRate}
min={0}
onChange={effects.setMaxExportRate}
value={maxExportRate / (1024 * 1024)}
/>
</FormGroup>
{state.isFull && (
<div>
<FormGroup>