From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <f.ebner@proxmox.com>
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 467B868B71
 for <pve-devel@lists.proxmox.com>; Fri, 10 Sep 2021 13:46:13 +0200 (CEST)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
 by firstgate.proxmox.com (Proxmox) with ESMTP id 3D4FE143EE
 for <pve-devel@lists.proxmox.com>; Fri, 10 Sep 2021 13:45:43 +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 3E1BB142F1
 for <pve-devel@lists.proxmox.com>; Fri, 10 Sep 2021 13:45:42 +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 168F64469B
 for <pve-devel@lists.proxmox.com>; Fri, 10 Sep 2021 13:45:42 +0200 (CEST)
From: Fabian Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Date: Fri, 10 Sep 2021 13:45:38 +0200
Message-Id: <20210910114538.175196-5-f.ebner@proxmox.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <20210910114538.175196-1-f.ebner@proxmox.com>
References: <20210910114538.175196-1-f.ebner@proxmox.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-SPAM-LEVEL: Spam detection results:  0
 AWL 0.359 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 v2 manager 1/1] ui: node: zfs: use ZFSDetail
 window from widget-toolkit
X-BeenThere: pve-devel@lists.proxmox.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Proxmox VE development discussion <pve-devel.lists.proxmox.com>
List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=unsubscribe>
List-Archive: <http://lists.proxmox.com/pipermail/pve-devel/>
List-Post: <mailto:pve-devel@lists.proxmox.com>
List-Help: <mailto:pve-devel-request@lists.proxmox.com?subject=help>
List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=subscribe>
X-List-Received-Date: Fri, 10 Sep 2021 11:46:13 -0000

The only functional differences I could see are the missing
defaultValue for 'Scan' and the reduced height. For restoring the
height, there is a proposed patch for widget-toolkit.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
---

Needs a dependency bump for pve-storage, because new widget-toolkit
hides the root, but old storage still wants that to be shown.

The ZFSDetail window was already introduced in widget-toolkit 2.2-9,
so no new bump for that needed.

It can still make sense to bump widget-toolkit for the patches in this
series. That would avoid the situation with new storage + old
widget-toolkit showing the pool as the root and the vdev with the same
name, and the reduced height.

 www/manager6/node/ZFS.js | 167 +--------------------------------------
 1 file changed, 3 insertions(+), 164 deletions(-)

diff --git a/www/manager6/node/ZFS.js b/www/manager6/node/ZFS.js
index 8ea364bf..b2fcc87a 100644
--- a/www/manager6/node/ZFS.js
+++ b/www/manager6/node/ZFS.js
@@ -174,125 +174,6 @@ Ext.define('PVE.node.CreateZFS', {
     },
 });
 
-Ext.define('PVE.node.ZFSDevices', {
-    extend: 'Ext.tree.Panel',
-    xtype: 'pveZFSDevices',
-
-    stateful: true,
-    stateId: 'grid-node-zfsstatus',
-    columns: [
-	{
-	    xtype: 'treecolumn',
-	    text: gettext('Name'),
-	    dataIndex: 'name',
-	    flex: 1,
-	},
-	{
-	    text: gettext('Health'),
-	    renderer: PVE.Utils.render_zfs_health,
-	    dataIndex: 'state',
-	},
-	{
-	    text: 'READ',
-	    dataIndex: 'read',
-	},
-	{
-	    text: 'WRITE',
-	    dataIndex: 'write',
-	},
-	{
-	    text: 'CKSUM',
-	    dataIndex: 'cksum',
-	},
-	{
-	    text: gettext('Message'),
-	    dataIndex: 'msg',
-	},
-    ],
-
-    reload: function() {
-	let me = this;
-	let sm = me.getSelectionModel();
-	Proxmox.Utils.API2Request({
-	    url: `/nodes/${me.nodename}/disks/zfs/${me.zpool}`,
-	    waitMsgTarget: me,
-	    method: 'GET',
-	    failure: (response, opts) => Proxmox.Utils.setErrorMask(me, response.htmlStatus),
-	    success: function(response, opts) {
-		sm.deselectAll();
-		me.setRootNode(response.result.data);
-		me.expandAll();
-	    },
-	});
-    },
-
-    rootVisible: true,
-    selModel: 'treemodel',
-    fields: [
-	'name',
-	'status',
-	{
-	    type: 'string',
-	    name: 'iconCls',
-	    calculate: data => data.leaf ? `fa x-fa-tree fa-hdd-o` : undefined,
-	},
-    ],
-
-    initComponent: function() {
-        let me = this;
-
-	if (!me.nodename) {
-	    throw "no node name specified";
-	}
-	if (!me.zpool) {
-	    throw "no zpool specified";
-	}
-
-	me.callParent();
-
-	me.reload();
-    },
-});
-
-Ext.define('PVE.node.ZFSStatus', {
-    extend: 'Proxmox.grid.ObjectGrid',
-    xtype: 'pveZFSStatus',
-    layout: 'fit',
-    border: false,
-
-    initComponent: function() {
-	let me = this;
-
-	if (!me.nodename) {
-	    throw "no node name specified";
-	}
-	if (!me.zpool) {
-	    throw "no zpool specified";
-	}
-
-	me.url = `/api2/extjs/nodes/${me.nodename}/disks/zfs/${me.zpool}`;
-
-	me.rows = {
-	    scan: {
-		header: gettext('Scan'),
-		defaultValue: gettext('No Data'),
-	    },
-	    status: {
-		header: gettext('Status'),
-	    },
-	    action: {
-		header: gettext('Action'),
-	    },
-	    errors: {
-		header: gettext('Errors'),
-	    },
-	};
-
-	me.callParent();
-	me.reload();
-    },
-});
-
 Ext.define('PVE.node.ZFSList', {
     extend: 'Ext.grid.Panel',
     xtype: 'pveZFSList',
@@ -383,52 +264,10 @@ Ext.define('PVE.node.ZFSList', {
     show_detail: function(zpool) {
 	let me = this;
 
-	let detailsgrid = Ext.create('PVE.node.ZFSStatus', {
-	    layout: 'fit',
-	    nodename: me.nodename,
-	    flex: 0,
-	    zpool: zpool,
-	});
-	let devicetree = Ext.create('PVE.node.ZFSDevices', {
-	    title: gettext('Devices'),
+	Ext.create('Proxmox.window.ZFSDetail', {
+	    zpool,
 	    nodename: me.nodename,
-	    flex: 1,
-	    zpool: zpool,
-	});
-
-	Ext.create('Ext.window.Window', {
-	    modal: true,
-	    width: 800,
-	    height: 600,
-	    resizable: true,
-	    layout: 'fit',
-	    title: gettext('Status') + ': ' + zpool,
-	    items: [
-		{
-		    xtype: 'panel',
-		    region: 'center',
-		    layout: {
-			type: 'vbox',
-			align: 'stretch',
-		    },
-		    items: [
-			detailsgrid,
-			devicetree,
-		    ],
-		    tbar: [
-			{
-			    text: gettext('Reload'),
-			    iconCls: 'fa fa-refresh',
-			    handler: function() {
-				devicetree.reload();
-				detailsgrid.reload();
-			    },
-			},
-		    ],
-		},
-	    ],
-	    autoShow: true,
-	});
+	}).show();
     },
 
     set_button_status: function() {
-- 
2.30.2