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 50FB36D744 for ; Tue, 28 Sep 2021 13:40:17 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id BDCE8DF93 for ; Tue, 28 Sep 2021 13:40:15 +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 BB735DCD5 for ; Tue, 28 Sep 2021 13:40:06 +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 92C8F449BE for ; Tue, 28 Sep 2021 13:40:06 +0200 (CEST) From: Fabian Ebner To: pve-devel@lists.proxmox.com Date: Tue, 28 Sep 2021 13:40:00 +0200 Message-Id: <20210928114001.164081-21-f.ebner@proxmox.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210928114001.164081-1-f.ebner@proxmox.com> References: <20210928114001.164081-1-f.ebner@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.304 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: [pve-devel] [PATCH manager 8/9] ui: zfs create: switch to using widget-toolkit's multiDiskSelector X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Sep 2021 11:40:17 -0000 Signed-off-by: Fabian Ebner --- For this one, the dependency requirement is already new enough. www/manager6/node/ZFS.js | 80 ++-------------------------------------- 1 file changed, 4 insertions(+), 76 deletions(-) diff --git a/www/manager6/node/ZFS.js b/www/manager6/node/ZFS.js index 8ea364bf..2537ee5a 100644 --- a/www/manager6/node/ZFS.js +++ b/www/manager6/node/ZFS.js @@ -16,35 +16,13 @@ Ext.define('PVE.node.CreateZFS', { throw "no node name specified"; } - let update_disklist = function() { - let grid = me.down('#disklist'); - let disks = grid.getSelection(); - - disks.sort(function(a, b) { - let aOrder = a.get('order') || 0; - let bOrder = b.get('order') || 0; - return aOrder - bOrder; - }); - - let selectedDevices = disks.map(disk => disk.get('devpath')).join(';'); - - me.down('field[name=devices]').setValue(selectedDevices); - }; - Ext.apply(me, { url: `/nodes/${me.nodename}/disks/zfs`, method: 'POST', items: [ { xtype: 'inputpanel', - onGetValues: values => values, // FIXME leftover? column1: [ - { - xtype: 'textfield', - hidden: true, - name: 'devices', - allowBlank: false, - }, { xtype: 'proxmoxtextfield', name: 'name', @@ -99,62 +77,13 @@ Ext.define('PVE.node.CreateZFS', { ], columnB: [ { - xtype: 'grid', + xtype: 'pmxMultiDiskSelector', + name: 'devices', + nodename: me.nodename, + diskType: 'unused', height: 200, emptyText: gettext('No Disks unused'), itemId: 'disklist', - selModel: 'checkboxmodel', - listeners: { - selectionchange: update_disklist, - }, - store: { - proxy: { - type: 'proxmox', - url: `/api2/json/nodes/${me.nodename}/disks/list?type=unused`, - }, - }, - columns: [ - { - text: gettext('Device'), - dataIndex: 'devpath', - flex: 2, - }, - { - text: gettext('Model'), - dataIndex: 'model', - flex: 2, - }, - { - text: gettext('Serial'), - dataIndex: 'serial', - flex: 2, - }, - { - text: gettext('Size'), - dataIndex: 'size', - renderer: Proxmox.Utils.render_size, - flex: 1, - }, - { - header: gettext('Order'), - xtype: 'widgetcolumn', - dataIndex: 'order', - sortable: true, - flex: 1, - widget: { - xtype: 'proxmoxintegerfield', - minValue: 1, - isFormField: false, - listeners: { - change: function(numberfield, value, old_value) { - let record = numberfield.getWidgetRecord(); - record.set('order', value); - update_disklist(record); - }, - }, - }, - }, - ], }, ], }, @@ -170,7 +99,6 @@ Ext.define('PVE.node.CreateZFS', { }); me.callParent(); - me.down('#disklist').getStore().load(); }, }); -- 2.30.2