From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id C4A31C245 for ; Mon, 28 Nov 2022 11:13:08 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id A78D631DF2 for ; Mon, 28 Nov 2022 11:13:08 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Mon, 28 Nov 2022 11:13:07 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 8A10A44324 for ; Mon, 28 Nov 2022 11:13:07 +0100 (CET) From: Dominik Csapak To: pbs-devel@lists.proxmox.com Date: Mon, 28 Nov 2022 11:13:06 +0100 Message-Id: <20221128101306.1501307-1-d.csapak@proxmox.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.064 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pbs-devel] [PATCH proxmox-backup] ui: datastore: add tuning options to gui X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2022 10:13:08 -0000 in datastore -> options a simple edit window with 2 comboboxes for * sync-level * chunk-order Signed-off-by: Dominik Csapak --- docs/storage.rst | 2 ++ www/OnlineHelpInfo.js | 4 +++ www/Utils.js | 33 +++++++++++++++++++++ www/datastore/OptionView.js | 57 +++++++++++++++++++++++++++++++++++++ 4 files changed, 96 insertions(+) diff --git a/docs/storage.rst b/docs/storage.rst index d61c3a40..07c3ad8e 100644 --- a/docs/storage.rst +++ b/docs/storage.rst @@ -316,6 +316,8 @@ There are a few per-datastore options: * :ref:`Maintenance Mode ` * Verification of incoming backups +.. _datastore_tuning_options: + Tuning ^^^^^^ There are some tuning related options for the datastore that are more advanced diff --git a/www/OnlineHelpInfo.js b/www/OnlineHelpInfo.js index cc00b658..5561f275 100644 --- a/www/OnlineHelpInfo.js +++ b/www/OnlineHelpInfo.js @@ -143,6 +143,10 @@ const proxmoxOnlineHelpInfo = { "link": "/docs/storage.html#storage-namespaces", "title": "Backup Namespaces" }, + "datastore-tuning-options": { + "link": "/docs/storage.html#datastore-tuning-options", + "title": "Tuning" + }, "sysadmin-host-administration": { "link": "/docs/sysadmin.html#sysadmin-host-administration", "title": "Host System Administration" diff --git a/www/Utils.js b/www/Utils.js index f6d353ef..298ad084 100644 --- a/www/Utils.js +++ b/www/Utils.js @@ -709,4 +709,37 @@ Ext.define('PBS.Utils', { return Ext.String.htmlEncode(value); }, + tuningOptions: { + 'chunk-order': { + '__default__': Proxmox.Utils.defaultText + ` (${gettext('None')})`, + none: gettext('None'), + inode: gettext('Inode'), + }, + 'sync-level': { + '__default__': Proxmox.Utils.defaultText + ` (${gettext('Filesystem')})`, + none: gettext('None'), + file: gettext('File'), + filesystem: gettext('Filesystem'), + }, + }, + + render_tuning_options: function(tuning) { + let options = []; + let order = tuning['chunk-order']; + delete tuning['chunk-order']; + order = PBS.Utils.tuningOptions['chunk-order'][order ?? '__default__']; + options.push(`${gettext('Chunk Order')}: ${order}`); + + let sync = tuning['sync-level']; + delete tuning['sync-level']; + sync = PBS.Utils.tuningOptions['sync-level'][sync ?? '__default__']; + options.push(`${gettext('Sync Level')}: ${sync}`); + + for (const [k, v] of Object.entries(tuning)) { + options.push(`${k}: ${v}`); + } + + return options.join(', '); + }, + }); diff --git a/www/datastore/OptionView.js b/www/datastore/OptionView.js index eb335979..e9c8ea36 100644 --- a/www/datastore/OptionView.js +++ b/www/datastore/OptionView.js @@ -157,5 +157,62 @@ Ext.define('PBS.Datastore.Options', { xtype: 'pbsMaintenanceOptionEdit', }, }, + 'tuning': { + required: true, + header: gettext('Tuning Options'), + renderer: function(value) { + let tuning = PBS.Utils.parsePropertyString(value); + return PBS.Utils.render_tuning_options(tuning); + }, + editor: { + xtype: 'proxmoxWindowEdit', + title: gettext('Tuning Options'), + onlineHelp: 'datastore_tuning_options', + width: 350, + items: { + xtype: 'inputpanel', + onGetValues: function(values) { + if (!Ext.isArray(values.delete ?? [])) { + values.delete = [values.delete]; + } + for (const k of values.delete ?? []) { + delete values[k]; + } + delete values.delete; + let tuning = PBS.Utils.printPropertyString(values); + if (!tuning) { + return { + 'delete': 'tuning', + }; + } + return { + tuning, + }; + }, + setValues: function(values) { + values = PBS.Utils.parsePropertyString(values?.tuning); + return Proxmox.panel.InputPanel.prototype.setValues.call(this, values); + }, + items: [ + { + xtype: 'proxmoxKVComboBox', + name: 'chunk-order', + fieldLabel: gettext('Chunk Order'), + comboItems: Object.entries(PBS.Utils.tuningOptions['chunk-order']), + deleteEmpty: true, + value: '__default__', + }, + { + xtype: 'proxmoxKVComboBox', + name: 'sync-level', + fieldLabel: gettext('Sync Level'), + comboItems: Object.entries(PBS.Utils.tuningOptions['sync-level']), + deleteEmpty: true, + value: '__default__', + }, + ], + }, + }, + }, }, }); -- 2.30.2