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 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 - [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)) - [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 ### Bug fixes

View File

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

View File

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

View File

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