all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Fiona Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH v4 manager 4/5] ui: backup job: disable zstd thread count field when zstd isn't used
Date: Tue, 16 Apr 2024 14:09:54 +0200	[thread overview]
Message-ID: <20240416120957.75269-5-f.ebner@proxmox.com> (raw)
In-Reply-To: <20240416120957.75269-1-f.ebner@proxmox.com>

Also need to check for enable/disable of the compression selector,
because with PBS the value zstd is set, but the thread count setting
doesn't apply.

Suggested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---

Changes in v4:
    * adapt to rename backupPerformance -> backupAdvanced

 www/manager6/dc/Backup.js                   | 18 ++++++++++++++++++
 www/manager6/panel/BackupAdvancedOptions.js | 13 +++++++++++++
 2 files changed, 31 insertions(+)

diff --git a/www/manager6/dc/Backup.js b/www/manager6/dc/Backup.js
index aaa319f4..221fe17c 100644
--- a/www/manager6/dc/Backup.js
+++ b/www/manager6/dc/Backup.js
@@ -145,6 +145,18 @@ Ext.define('PVE.dc.BackupEdit', {
 	    }
 	},
 
+	compressionChange: function(f, value, oldValue) {
+	    this.getView().lookup('backupAdvanced').updateCompression(value, f.isDisabled());
+	},
+
+	compressionDisable: function(f) {
+	    this.getView().lookup('backupAdvanced').updateCompression(f.getValue(), true);
+	},
+
+	compressionEnable: function(f) {
+	    this.getView().lookup('backupAdvanced').updateCompression(f.getValue(), false);
+	},
+
 	init: function(view) {
 	    let me = this;
 	    if (view.isCreate) {
@@ -359,6 +371,11 @@ Ext.define('PVE.dc.BackupEdit', {
 					deleteEmpty: '{!isCreate}',
 				    },
 				    value: 'zstd',
+				    listeners: {
+					change: 'compressionChange',
+					disable: 'compressionDisable',
+					enable: 'compressionEnable',
+				    },
 				},
 				{
 				    xtype: 'pveBackupModeSelector',
@@ -473,6 +490,7 @@ Ext.define('PVE.dc.BackupEdit', {
 		},
 		{
 		    xtype: 'pveBackupAdvancedOptionsPanel',
+		    reference: 'backupAdvanced',
 		    title: gettext('Advanced'),
 		    cbind: {
 			isCreate: '{isCreate}',
diff --git a/www/manager6/panel/BackupAdvancedOptions.js b/www/manager6/panel/BackupAdvancedOptions.js
index 4d74ba3d..11a39352 100644
--- a/www/manager6/panel/BackupAdvancedOptions.js
+++ b/www/manager6/panel/BackupAdvancedOptions.js
@@ -12,6 +12,10 @@ Ext.define('PVE.panel.BackupAdvancedOptions', {
 	return {};
     },
 
+    controller: {
+	xclass: 'Ext.app.ViewController',
+    },
+
     onGetValues: function(formValues) {
 	if (this.needMask) { // isMasked() may not yet be true if not rendered once
 	    return {};
@@ -54,6 +58,14 @@ Ext.define('PVE.panel.BackupAdvancedOptions', {
 	return options;
     },
 
+    updateCompression: function(value, disabled) {
+	if (!disabled && value === 'zstd') {
+	    this.lookup('zstdThreadCount').setDisabled(false);
+	} else {
+	    this.lookup('zstdThreadCount').setDisabled(true);
+	}
+    },
+
     column1: [
 	{
 	    xtype: 'pveBandwidthField',
@@ -71,6 +83,7 @@ Ext.define('PVE.panel.BackupAdvancedOptions', {
 	{
 	    xtype: 'proxmoxintegerfield',
 	    name: 'zstd',
+	    reference: 'zstdThreadCount',
 	    fieldLabel: Ext.String.format(gettext('{0} Threads'), 'Zstd'),
 	    fieldStyle: 'text-align: right',
 	    emptyText: gettext('use fallback'),
-- 
2.39.2





  parent reply	other threads:[~2024-04-16 12:10 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-16 12:09 [pve-devel] [PATCH-SERIES v4 manager/docs] close #4513: add advanced tab for backup jobs and improve performance fallback/default Fiona Ebner
2024-04-16 12:09 ` [pve-devel] [PATCH v4 manager 1/5] vzdump: actually honor schema defaults for performance Fiona Ebner
2024-04-16 12:09 ` [pve-devel] [PATCH v4 manager 2/5] vzdump: use per-property fallback for performance settings Fiona Ebner
2024-04-16 12:09 ` [pve-devel] [PATCH v4 manager 3/5] close #4513: ui: backup job: add tab for advanced options Fiona Ebner
2024-04-16 12:09 ` Fiona Ebner [this message]
2024-04-16 12:09 ` [pve-devel] [PATCH v4 manager 5/5] ui: backup job: move repeat-missed option to advanced tab Fiona Ebner
2024-04-16 12:09 ` [pve-devel] [PATCH v4 docs 1/2] backup: update information about performance settings Fiona Ebner
2024-04-16 12:09 ` [pve-devel] [PATCH v4 docs 2/2] backup: clarify where repeat-missed option can be found now Fiona Ebner
2024-04-17 14:06 ` [pve-devel] applied-series: [PATCH-SERIES v4 manager/docs] close #4513: add advanced tab for backup jobs and improve performance fallback/default Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240416120957.75269-5-f.ebner@proxmox.com \
    --to=f.ebner@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal