]>
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
;
16 xclass
: 'Ext.app.ViewController',
19 onGetValues: function(formValues
) {
21 if (me
.needMask
) { // isMasked() may not yet be true if not rendered once
28 options
.delete = []; // to avoid having to check this all the time
30 const deletePropertyOnEdit
= me
.isCreate
31 ? () => { /* no-op on create */ }
32 : key
=> options
.delete.push(key
);
34 let performance
= {}, performanceOptions
= ['max-workers', 'pbs-entries-max'];
36 for (const [key
, value
] of Object
.entries(formValues
)) {
37 if (performanceOptions
.includes(key
)) {
38 performance
[key
] = value
;
39 // deleteEmpty is not currently implemented for pveBandwidthField
40 } else if (key
=== 'bwlimit' && value
=== '') {
41 deletePropertyOnEdit('bwlimit');
42 } else if (key
=== 'delete') {
43 if (Array
.isArray(value
)) {
44 value
.filter(opt
=> !performanceOptions
.includes(opt
)).forEach(
45 opt
=> deletePropertyOnEdit(opt
),
47 } else if (!performanceOptions
.includes(formValues
.delete)) {
48 deletePropertyOnEdit(value
);
55 if (Object
.keys(performance
).length
> 0) {
56 options
.performance
= PVE
.Parser
.printPropertyString(performance
);
58 deletePropertyOnEdit('performance');
64 updateCompression: function(value
, disabled
) {
65 this.lookup('zstdThreadCount').setDisabled(disabled
|| value
!== 'zstd');
70 xtype
: 'pveTwoColumnContainer',
72 xtype
: 'pveBandwidthField',
74 fieldLabel
: gettext('Bandwidth Limit'),
75 emptyText
: gettext('Fallback'),
81 'data-qtip': Ext
.String
.format(gettext('Use {0} for unlimited'), 0),
86 xtype
: 'displayfield',
87 value
: `${gettext('Limit I/O bandwidth.')} ${Ext.String.format(gettext("Schema default: {0}"), 0)}`,
91 xtype
: 'pveTwoColumnContainer',
93 xtype
: 'proxmoxintegerfield',
95 reference
: 'zstdThreadCount',
96 fieldLabel
: Ext
.String
.format(gettext('{0} Threads'), 'Zstd'),
97 fieldStyle
: 'text-align: right',
98 emptyText
: gettext('Fallback'),
101 deleteEmpty
: '{!isCreate}',
105 'data-qtip': gettext('With 0, half of the available cores are used'),
110 xtype
: 'displayfield',
111 value
: `${gettext('Threads used for zstd compression (non-PBS).')} ${Ext.String.format(gettext("Schema default: {0}"), 1)}`,
115 xtype
: 'pveTwoColumnContainer',
117 xtype
: 'proxmoxintegerfield',
121 fieldLabel
: gettext('IO-Workers'),
122 fieldStyle
: 'text-align: right',
123 emptyText
: gettext('Fallback'),
125 deleteEmpty
: '{!isCreate}',
130 xtype
: 'displayfield',
131 value
: `${gettext('I/O workers in the QEMU process (VMs only).')} ${Ext.String.format(gettext("Schema default: {0}"), 16)}`,
135 // It's part of the 'performance' property string, so have a field to preserve the
136 // value, but don't expose it. It's a rather niche setting and difficult to
137 // convey/understand what it does.
138 xtype
: 'proxmoxintegerfield',
139 name
: 'pbs-entries-max',
142 fieldStyle
: 'text-align: right',
145 deleteEmpty
: '{!isCreate}',
149 xtype
: 'pveTwoColumnContainer',
151 xtype
: 'proxmoxcheckbox',
152 fieldLabel
: gettext('Repeat missed'),
153 name
: 'repeat-missed',
157 deleteDefaultValue
: '{!isCreate}',
162 xtype
: 'displayfield',
163 value
: gettext("Run jobs as soon as possible if they couldn't start on schedule, for example, due to the node being offline."),
169 html
: `<span class="pmx-hint">${gettext('Note')}</span>: ${
170 gettext("The node-specific 'vzdump.conf' or, if this is not set, the default from the config schema is used to determine fallback values.")}`,