From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id B93A51FF185 for ; Mon, 23 Jun 2025 11:48:37 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 55E5CE330; Mon, 23 Jun 2025 11:49:09 +0200 (CEST) From: Christian Ebner To: pbs-devel@lists.proxmox.com Date: Mon, 23 Jun 2025 11:40:54 +0200 Message-ID: <20250623094106.299251-37-c.ebner@proxmox.com> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250623094106.299251-1-c.ebner@proxmox.com> References: <20250623094106.299251-1-c.ebner@proxmox.com> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.036 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. 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 v4 33/45] ui: add S3 client view for configuration 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: , Reply-To: Proxmox Backup Server development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pbs-devel-bounces@lists.proxmox.com Sender: "pbs-devel" Adds the view to configure S3 clients in the Configuration section of the UI. Signed-off-by: Christian Ebner --- www/config/S3ClientView.js | 141 +++++++++++++++++++++++++++++++++++++ 1 file changed, 141 insertions(+) create mode 100644 www/config/S3ClientView.js diff --git a/www/config/S3ClientView.js b/www/config/S3ClientView.js new file mode 100644 index 000000000..61c143e03 --- /dev/null +++ b/www/config/S3ClientView.js @@ -0,0 +1,141 @@ +Ext.define('pmx-s3client', { + extend: 'Ext.data.Model', + fields: ['id', 'endpoint', 'port', 'access-key', 'secret-key', 'region', 'fingerprint'], + idProperty: 'id', + proxy: { + type: 'proxmox', + url: '/api2/json/config/s3', + }, +}); + +Ext.define('PBS.config.S3ClientView', { + extend: 'Ext.grid.GridPanel', + alias: 'widget.pbsS3ClientView', + + title: gettext('S3 Clients'), + + stateful: true, + stateId: 'grid-s3clients', + tools: [PBS.Utils.get_help_tool('backup-s3-client')], + + controller: { + xclass: 'Ext.app.ViewController', + + addS3Client: function () { + let me = this; + Ext.create('PBS.window.S3ClientEdit', { + listeners: { + destroy: function () { + me.reload(); + }, + }, + }).show(); + }, + + editS3Client: function () { + let me = this; + let view = me.getView(); + let selection = view.getSelection(); + if (selection.length < 1) { + return; + } + + Ext.create('PBS.window.S3ClientEdit', { + id: selection[0].data.id, + listeners: { + destroy: function () { + me.reload(); + }, + }, + }).show(); + }, + + reload: function () { + this.getView().getStore().rstore.load(); + }, + + init: function (view) { + Proxmox.Utils.monStoreErrors(view, view.getStore().rstore); + }, + }, + + listeners: { + activate: 'reload', + itemdblclick: 'editS3Client', + }, + + store: { + type: 'diff', + autoDestroy: true, + autoDestroyRstore: true, + sorters: 'id', + rstore: { + type: 'update', + storeid: 'pmx-s3client', + model: 'pmx-s3client', + autoStart: true, + interval: 5000, + }, + }, + + tbar: [ + { + xtype: 'proxmoxButton', + text: gettext('Add'), + handler: 'addS3Client', + selModel: false, + }, + { + xtype: 'proxmoxButton', + text: gettext('Edit'), + handler: 'editS3Client', + disabled: true, + }, + { + xtype: 'proxmoxStdRemoveButton', + baseurl: '/config/s3', + callback: 'reload', + }, + ], + + viewConfig: { + trackOver: false, + }, + + columns: [ + { + dataIndex: 'id', + header: gettext('Unique Identifier'), + renderer: Ext.String.htmlEncode, + sortable: true, + width: 200, + }, + { + dataIndex: 'endpoint', + header: gettext('Endpoint'), + sortable: true, + width: 200, + }, + { + dataIndex: 'port', + header: gettext('Port'), + renderer: Ext.String.htmlEncode, + sortable: true, + width: 100, + }, + { + dataIndex: 'region', + header: gettext('Region'), + renderer: Ext.String.htmlEncode, + sortable: true, + width: 100, + }, + { + dataIndex: 'fingerprint', + header: gettext('Fingerprint'), + renderer: Ext.String.htmlEncode, + sortable: false, + flex: 1, + }, + ], +}); -- 2.47.2 _______________________________________________ pbs-devel mailing list pbs-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel