From: Fabian Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH v2 manager 1/1] ui: node: zfs: use ZFSDetail window from widget-toolkit
Date: Fri, 10 Sep 2021 13:45:38 +0200 [thread overview]
Message-ID: <20210910114538.175196-5-f.ebner@proxmox.com> (raw)
In-Reply-To: <20210910114538.175196-1-f.ebner@proxmox.com>
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
next prev parent reply other threads:[~2021-09-10 11:46 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-10 11:45 [pve-devel] [PATCH-SERIES v2 storage/widget-toolkit/manager] fix #3610: properly build ZFS detail tree Fabian Ebner
2021-09-10 11:45 ` [pve-devel] [PATCH v2 storage 1/1] " Fabian Ebner
2021-09-10 12:19 ` [pve-devel] applied: " Thomas Lamprecht
2021-09-10 11:45 ` [pve-devel] [PATCH v2 widget-toolkit 1/2] zfs detail: increase window height Fabian Ebner
2021-09-10 11:45 ` [pve-devel] [PATCH v2 widget-toolkit 2/2] zfs detail: hide the pool itself in tree view Fabian Ebner
2021-09-10 11:45 ` Fabian Ebner [this message]
2022-01-13 11:21 ` [pve-devel] [PATCH-SERIES v2 storage/widget-toolkit/manager] fix #3610: properly build ZFS detail tree Fabian Ebner
2022-01-13 11:58 ` [pve-devel] applied-series: " Thomas Lamprecht
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210910114538.175196-5-f.ebner@proxmox.com \
--to=f.ebner@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox