public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Felix Driessler <fdriessler@inett.de>
To: pve-devel@lists.proxmox.com
Subject: [PATCH pve-manager 1/4] ui: Add Display of WWID for ISCSI
Date: Fri, 27 Mar 2026 11:14:53 +0100	[thread overview]
Message-ID: <20260327101456.16614-2-fdriessler@inett.de> (raw)
In-Reply-To: <20260327101456.16614-1-fdriessler@inett.de>

Signed-off-by: Felix Driessler <fdriessler@inett.de>
---
 www/manager6/Utils.js               |  8 +++
 www/manager6/form/FileSelector.js   | 81 +++++++++++++++++++++--------
 www/manager6/storage/ContentView.js | 24 ++++++++-
 3 files changed, 89 insertions(+), 24 deletions(-)

diff --git a/www/manager6/Utils.js b/www/manager6/Utils.js
index 77dae42e..aa766f85 100644
--- a/www/manager6/Utils.js
+++ b/www/manager6/Utils.js
@@ -1056,6 +1056,14 @@ Ext.define('PVE.Utils', {
             return Ext.String.htmlEncode(result);
         },
 
+        render_storage_wwid: function (value, metaData, record) {
+            let data = record.data;
+            if ('wwid' in data) {
+                return Ext.String.htmlEncode(data.wwid);
+            } else {
+                return undefined;
+            }
+        },
         render_serverity: function (value) {
             return PVE.Utils.log_severity_hash[value] || value;
         },
diff --git a/www/manager6/form/FileSelector.js b/www/manager6/form/FileSelector.js
index b8f6a8c2..47c187e8 100644
--- a/www/manager6/form/FileSelector.js
+++ b/www/manager6/form/FileSelector.js
@@ -15,6 +15,45 @@ Ext.define('PVE.form.FileSelector', {
         },
     },
 
+    initComponent: function () {
+        var me = this;
+
+        me.listConfig = Ext.apply({
+            width: 600,
+            columns: this.getColumns(false),
+        }, me.listConfig);
+
+        me.callParent();
+    },
+
+    getColumns: function (isIscsi) {
+        return [
+            {
+                header: gettext('Name'),
+                dataIndex: 'text',
+                hideable: false,
+                flex: 1,
+            },
+            ...isIscsi ? [{
+                header: 'WWID',
+                flex: 1,
+                renderer: PVE.Utils.render_storage_wwid,
+                dataIndex: 'wwid',
+            }] : [],
+            {
+                header: gettext('Format'),
+                width: 60,
+                dataIndex: 'format',
+            },
+            {
+                header: gettext('Size'),
+                width: 100,
+                dataIndex: 'size',
+                renderer: Proxmox.Utils.format_size,
+            },
+        ];
+    },
+
     setStorage: function (storage, nodename) {
         var me = this;
 
@@ -52,6 +91,25 @@ Ext.define('PVE.form.FileSelector', {
 
         me.store.removeAll();
         me.store.load();
+
+        let storageInfo = PVE.data.ResourceStore.findRecord(
+            'id',
+            `storage/${me.nodename}/${me.storage}`,
+            0, // startIndex
+            false, // anyMatch
+            true, // caseSensitive
+            true, // exactMatch
+        );
+
+        let res = storageInfo.data;
+        let plugin = res.plugintype;
+        let isIscsi = plugin === 'iscsi';
+
+        let grid = me.getPicker();
+
+        if (grid) {
+            grid.reconfigure(me.store, me.getColumns(isIscsi));
+        }
     },
 
     setNodename: function (nodename) {
@@ -69,27 +127,4 @@ Ext.define('PVE.form.FileSelector', {
 
     // An optional filter function
     filter: undefined,
-
-    listConfig: {
-        width: 600,
-        columns: [
-            {
-                header: gettext('Name'),
-                dataIndex: 'text',
-                hideable: false,
-                flex: 1,
-            },
-            {
-                header: gettext('Format'),
-                width: 60,
-                dataIndex: 'format',
-            },
-            {
-                header: gettext('Size'),
-                width: 100,
-                dataIndex: 'size',
-                renderer: Proxmox.Utils.format_size,
-            },
-        ],
-    },
 });
diff --git a/www/manager6/storage/ContentView.js b/www/manager6/storage/ContentView.js
index 75b81e69..94dd2f08 100644
--- a/www/manager6/storage/ContentView.js
+++ b/www/manager6/storage/ContentView.js
@@ -30,6 +30,19 @@ Ext.define(
             }
             const storage = me.storage;
 
+            let storageInfo = PVE.data.ResourceStore.findRecord(
+                'id',
+                `storage/${nodename}/${storage}`,
+                0, // startIndex
+                false, // anyMatch
+                true, // caseSensitive
+                true, // exactMatch
+            );
+
+            let res = storageInfo.data;
+            let plugin = res.plugintype;
+            let isIscsi = plugin === 'iscsi';
+
             var content = me.content;
             if (!content) {
                 throw 'no content type specified';
@@ -159,6 +172,12 @@ Ext.define(
                             .localeCompare(b.data.text.toString(), undefined, { numeric: true }),
                     dataIndex: 'text',
                 },
+                wwid: {
+                    header: 'WWID',
+                    flex: 2,
+                    renderer: PVE.Utils.render_storage_wwid,
+                    dataIndex: 'wwid',
+                },
                 notes: {
                     header: gettext('Notes'),
                     flex: 1,
@@ -192,7 +211,9 @@ Ext.define(
                 },
             };
 
-            let showColumns = me.showColumns || ['name', 'date', 'format', 'size'];
+            let showColumns = me.showColumns || isIscsi ?
+                ['name', 'date', 'format', 'size', 'wwid'] :
+                ['name', 'date', 'format', 'size'];
 
             Object.keys(availableColumns).forEach(function (key) {
                 if (!showColumns.includes(key)) {
@@ -224,6 +245,7 @@ Ext.define(
             extend: 'Ext.data.Model',
             fields: [
                 'volid',
+                'wwid',
                 'content',
                 'format',
                 'size',
-- 
2.52.0



Felix Driessler
Junior Systems Engineer // #GernPerDU

Linux - Open Source - IT Solutions

T: +49-681-410993-0
E: fdriessler@inett.de
https://www.inett.de



inett GmbH | Altenkesseler Strasse 17 / B8 | 66115 Saarbrücken | Germany

Vertrieb: vertrieb@inett.de // +49-681-410993-33
Support: support@inett.de // +49-681-410993-42





Geschäftsführung: Marco Gabriel | Amtsgericht Saarbrücken HRB 16588



  parent reply	other threads:[~2026-03-27 10:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <f53ca227-2275-443f-84f8-48b2785269b2.2bc2ceb6-a3a3-4c49-9566-519c7d2ab20e.21103ee5-34fe-43b6-b130-08f8ab2b25ae@emailsignatures365.codetwo.com>
2026-03-27 10:14 ` [PATCH pve-manager/pve-storage 0/4] extend iscsi configuration Felix Driessler
     [not found]   ` <f53ca227-2275-443f-84f8-48b2785269b2.2bc2ceb6-a3a3-4c49-9566-519c7d2ab20e.d935a384-10c1-4974-ba2a-7adab51bb127@emailsignatures365.codetwo.com>
2026-03-27 10:14     ` Felix Driessler [this message]
     [not found]   ` <f53ca227-2275-443f-84f8-48b2785269b2.2bc2ceb6-a3a3-4c49-9566-519c7d2ab20e.5ac71d0a-bc32-41c3-8898-7681716f7a92@emailsignatures365.codetwo.com>
2026-03-27 10:14     ` [PATCH pve-manager 2/4] ui: Add CHAP Authentication for ISCSI Felix Driessler
     [not found]   ` <f53ca227-2275-443f-84f8-48b2785269b2.2bc2ceb6-a3a3-4c49-9566-519c7d2ab20e.24fbb610-73bc-4d0e-8ec7-c0b5fbde4ff8@emailsignatures365.codetwo.com>
2026-03-27 10:14     ` [PATCH pve-stoage 3/4] iscsiPlugin: add wwid Felix Driessler
     [not found]   ` <f53ca227-2275-443f-84f8-48b2785269b2.2bc2ceb6-a3a3-4c49-9566-519c7d2ab20e.6c58b149-eb37-45dd-84d7-651f4453edab@emailsignatures365.codetwo.com>
2026-03-27 10:14     ` [PATCH pve-stoage 4/4] iscsiPlugin: add chap auth Felix Driessler

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=20260327101456.16614-2-fdriessler@inett.de \
    --to=fdriessler@inett.de \
    --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
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal