]>
git.proxmox.com Git - pve-manager.git/blob - www/manager6/panel/BackupAdvancedOptions.js
2 * Input panel for advanced backup options intended to be used as part of an edit/create window.
4 Ext
.define('PVE.panel.BackupAdvancedOptions', {
5 extend
: 'Proxmox.panel.InputPanel',
6 xtype
: 'pveBackupAdvancedOptionsPanel',
7 mixins
: ['Proxmox.Mixin.CBind'],
9 cbindData: function() {
11 me
.isCreate
= !!me
.isCreate
;
20 xclass
: 'Ext.app.ViewController',
22 toggleFleecing: function(cb
, value
) {
24 me
.lookup('fleecingStorage').setDisabled(!value
);
28 'proxmoxcheckbox[reference=fleecingEnabled]': {
29 change
: 'toggleFleecing',
34 onGetValues: function(formValues
) {
36 if (me
.needMask
) { // isMasked() may not yet be true if not rendered once
43 options
.delete = []; // to avoid having to check this all the time
45 const deletePropertyOnEdit
= me
.isCreate
46 ? () => { /* no-op on create */ }
47 : key
=> options
.delete.push(key
);
49 let fleecing
= {}, fleecingOptions
= ['fleecing-enabled', 'fleecing-storage'];
50 let performance
= {}, performanceOptions
= ['max-workers', 'pbs-entries-max'];
52 for (const [key
, value
] of Object
.entries(formValues
)) {
53 if (performanceOptions
.includes(key
)) {
54 performance
[key
] = value
;
55 // deleteEmpty is not currently implemented for pveBandwidthField
56 } else if (key
=== 'bwlimit' && value
=== '') {
57 deletePropertyOnEdit('bwlimit');
58 } else if (key
=== 'delete') {
59 if (Array
.isArray(value
)) {
60 value
.filter(opt
=> !performanceOptions
.includes(opt
)).forEach(
61 opt
=> deletePropertyOnEdit(opt
),
63 } else if (!performanceOptions
.includes(formValues
.delete)) {
64 deletePropertyOnEdit(value
);
66 } else if (fleecingOptions
.includes(key
)) {
67 let fleecingKey
= key
.slice('fleecing-'.length
);
68 fleecing
[fleecingKey
] = value
;
74 if (Object
.keys(performance
).length
> 0) {
75 options
.performance
= PVE
.Parser
.printPropertyString(performance
);
77 deletePropertyOnEdit('performance');
80 if (Object
.keys(fleecing
).length
> 0) {
81 options
.fleecing
= PVE
.Parser
.printPropertyString(fleecing
);
83 deletePropertyOnEdit('fleecing');
87 delete options
.delete;
93 onSetValues: function(values
) {
94 if (values
.fleecing
) {
95 for (const [key
, value
] of Object
.entries(values
.fleecing
)) {
96 values
[`fleecing-${key}`] = value
;
98 delete values
.fleecing
;
103 updateCompression: function(value
, disabled
) {
104 this.lookup('zstdThreadCount').setDisabled(disabled
|| value
!== 'zstd');
109 xtype
: 'pveTwoColumnContainer',
111 xtype
: 'pveBandwidthField',
113 fieldLabel
: gettext('Bandwidth Limit'),
114 emptyText
: gettext('Fallback'),
120 'data-qtip': Ext
.String
.format(gettext('Use {0} for unlimited'), 0),
125 xtype
: 'displayfield',
126 value
: `${gettext('Limit I/O bandwidth.')} ${Ext.String.format(gettext("Schema default: {0}"), 0)}`,
130 xtype
: 'pveTwoColumnContainer',
132 xtype
: 'proxmoxintegerfield',
134 reference
: 'zstdThreadCount',
135 fieldLabel
: Ext
.String
.format(gettext('{0} Threads'), 'Zstd'),
136 fieldStyle
: 'text-align: right',
137 emptyText
: gettext('Fallback'),
140 deleteEmpty
: '{!isCreate}',
144 'data-qtip': gettext('With 0, half of the available cores are used'),
149 xtype
: 'displayfield',
150 value
: `${gettext('Threads used for zstd compression (non-PBS).')} ${Ext.String.format(gettext("Schema default: {0}"), 1)}`,
154 xtype
: 'pveTwoColumnContainer',
156 xtype
: 'proxmoxintegerfield',
160 fieldLabel
: gettext('IO-Workers'),
161 fieldStyle
: 'text-align: right',
162 emptyText
: gettext('Fallback'),
164 deleteEmpty
: '{!isCreate}',
169 xtype
: 'displayfield',
170 value
: `${gettext('I/O workers in the QEMU process (VMs only).')} ${Ext.String.format(gettext("Schema default: {0}"), 16)}`,
174 xtype
: 'pveTwoColumnContainer',
176 xtype
: 'proxmoxcheckbox',
177 name
: 'fleecing-enabled',
178 reference
: 'fleecingEnabled',
179 fieldLabel
: gettext('Fleecing'),
185 xtype
: 'displayfield',
186 value
: gettext('Backup write cache that can reduce IO pressure inside guests (VMs only).'),
190 xtype
: 'pveTwoColumnContainer',
192 xtype
: 'pveStorageSelector',
193 name
: 'fleecing-storage',
194 fieldLabel
: gettext('Fleecing Storage'),
195 reference
: 'fleecingStorage',
197 storageContent
: 'images',
203 xtype
: 'displayfield',
204 value
: gettext('Prefer a fast and local storage, ideally with support for discard and thin-provisioning or sparse files.'),
208 // It's part of the 'performance' property string, so have a field to preserve the
209 // value, but don't expose it. It's a rather niche setting and difficult to
210 // convey/understand what it does.
211 xtype
: 'proxmoxintegerfield',
212 name
: 'pbs-entries-max',
215 fieldStyle
: 'text-align: right',
218 deleteEmpty
: '{!isCreate}',
222 xtype
: 'pveTwoColumnContainer',
224 xtype
: 'proxmoxcheckbox',
225 fieldLabel
: gettext('Repeat missed'),
226 name
: 'repeat-missed',
230 deleteDefaultValue
: '{!isCreate}',
235 xtype
: 'displayfield',
236 value
: gettext("Run jobs as soon as possible if they couldn't start on schedule, for example, due to the node being offline."),
242 html
: `<span class="pmx-hint">${gettext('Note')}</span>: ${
243 gettext("The node-specific 'vzdump.conf' or, if this is not set, the default from the config schema is used to determine fallback values.")}`,