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 186A9B73E for ; Fri, 29 Apr 2022 16:54:41 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 074FEC875 for ; Fri, 29 Apr 2022 16:54:11 +0200 (CEST) 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 id 3F57CC86C for ; Fri, 29 Apr 2022 16:54:10 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 6203E43061 for ; Fri, 29 Apr 2022 16:47:58 +0200 (CEST) From: Daniel Tschlatscher To: pbs-devel@lists.proxmox.com Date: Fri, 29 Apr 2022 16:47:32 +0200 Message-Id: <20220429144732.92823-1-d.tschlatscher@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] Remove BackupFileDownloader.js file and Makefile entry 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: Fri, 29 Apr 2022 14:54:41 -0000 While finishing up my previous patch series I stumbled upon this file which is not referenced anywhere in the proxmox-backup repository nor in any of the other repositories as far as I can tell (except in the Makefile). I searched far and wide for any occurences and tested the backup explorer GUI without it, which still seems to work normally. Introduced in: 98425309b0106c9174505614525a9561d98c56d7 References removed in: 3e395378bca5a844b2c820750cd57e4f2bfbacca Therefore I think this can be safely considered dead code and be removed. It shall remain in the pve-devel archives forevermore anyway. Signed-off-by: Daniel Tschlatscher --- www/Makefile | 1 - www/window/BackupFileDownloader.js | 146 ----------------------------- 2 files changed, 147 deletions(-) delete mode 100644 www/window/BackupFileDownloader.js diff --git a/www/Makefile b/www/Makefile index 697df9c0..98b61ba0 100644 --- a/www/Makefile +++ b/www/Makefile @@ -57,7 +57,6 @@ JSSRC= \ config/CertificateView.js \ config/NodeOptionView.js \ window/ACLEdit.js \ - window/BackupFileDownloader.js \ window/BackupGroupChangeOwner.js \ window/CreateDirectory.js \ window/DataStoreEdit.js \ diff --git a/www/window/BackupFileDownloader.js b/www/window/BackupFileDownloader.js deleted file mode 100644 index 81f88b10..00000000 --- a/www/window/BackupFileDownloader.js +++ /dev/null @@ -1,146 +0,0 @@ -Ext.define('PBS.window.BackupFileDownloader', { - extend: 'Ext.window.Window', - alias: 'widget.pbsBackupFileDownloader', - - title: gettext('Download Files'), - bodyPadding: 10, - - width: 400, - modal: true, - resizable: false, - - layout: { - type: 'vbox', - align: 'stretch', - }, - - controller: { - xclass: 'Ext.app.ViewController', - - buildUrl: function(baseurl, params) { - let url = new URL(baseurl, window.location.origin); - for (const [key, value] of Object.entries(params)) { - url.searchParams.append(key, value); - } - - return url.href; - }, - - downloadFile: function() { - let me = this; - let view = me.getView(); - let combo = me.lookup('file'); - let file = combo.getValue(); - - let idx = file.lastIndexOf('.'); - let filename = file.slice(0, idx); - let atag = document.createElement('a'); - let params = view.params; - params['file-name'] = file; - atag.download = filename; - atag.href = me.buildUrl(`${view.baseurl}/download-decoded`, params); - atag.click(); - }, - - changeFile: function(comob, value) { - let me = this; - let combo = me.lookup('file'); - let rec = combo.getStore().findRecord('filename', value, 0, false, true, true); - let canDownload = rec.data['crypt-mode'] !== 'encrypt'; - me.lookup('encryptedHint').setVisible(!canDownload); - me.lookup('signedHint').setVisible(rec.data['crypt-mode'] === 'sign-only'); - me.lookup('downloadBtn').setDisabled(!canDownload); - }, - - init: function(view) { - let me = this; - if (!view.baseurl) { - throw "no baseurl given"; - } - - if (!view.params) { - throw "no params given"; - } - - if (!view.files) { - throw "no files given"; - } - - me.lookup('file').getStore().loadData(view.files, false); - }, - - control: { - 'proxmoxComboGrid': { - change: 'changeFile', - }, - 'button': { - click: 'downloadFile', - }, - }, - }, - - items: [ - { - xtype: 'proxmoxComboGrid', - valueField: 'filename', - allowBlank: false, - displayField: 'filename', - reference: 'file', - emptyText: gettext('No file selected'), - fieldLabel: gettext('File'), - store: { - fields: ['filename', 'size', 'crypt-mode'], - idProperty: ['filename'], - }, - listConfig: { - emptyText: gettext('No Data'), - columns: [ - { - text: gettext('Filename'), - dataIndex: 'filename', - renderer: Ext.String.htmlEncode, - flex: 1, - }, - { - text: gettext('Size'), - dataIndex: 'size', - renderer: val => val === undefined ? '' : Proxmox.Utils.format_size(val), - }, - { - text: gettext('Encrypted'), - dataIndex: 'crypt-mode', - renderer: function(value) { - let mode = -1; - if (value !== undefined) { - mode = PBS.Utils.cryptmap.indexOf(value); - } - return PBS.Utils.cryptText[mode] || Proxmox.Utils.unknownText; - }, - }, - ], - }, - }, - { - xtype: 'displayfield', - userCls: 'pmx-hint', - reference: 'signedHint', - hidden: true, - value: gettext('Note: Signatures of signed files will not be verified on the server. Please use the client to do this.'), - }, - { - xtype: 'displayfield', - userCls: 'pmx-hint', - reference: 'encryptedHint', - hidden: true, - value: gettext('Encrypted Files cannot be decoded on the server directly. Please use the client where the decryption key is located.'), - }, - ], - - buttons: [ - { - text: gettext('Download'), - reference: 'downloadBtn', - disabled: true, - }, - ], -}); -- 2.30.2