]> git.proxmox.com Git - pve-manager.git/commitdiff
ui: allow adding the esxi storage type
authorDominik Csapak <d.csapak@proxmox.com>
Fri, 8 Mar 2024 14:37:28 +0000 (15:37 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 14 Mar 2024 14:17:43 +0000 (15:17 +0100)
also change the icon to 'fa-cloud-download', hide the 'unknown' status
in the tree, and hide the Summary info from the storage browser

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
www/manager6/Makefile
www/manager6/Utils.js
www/manager6/storage/Browser.js
www/manager6/storage/ESXIEdit.js [new file with mode: 0644]

index dc3c85b100d3ed2bf33f85e57a409768c67d2b3e..43428df57dcc4facdff21e6bf34f424da6c1eae7 100644 (file)
@@ -316,6 +316,7 @@ JSSRC=                                                      \
        storage/TemplateView.js                         \
        storage/ZFSEdit.js                              \
        storage/ZFSPoolEdit.js                          \
+       storage/ESXIEdit.js                             \
        Workspace.js                                    \
 # end of JSSRC list
 
index a8d5786d20c091a8e1653f71d7f3ed7681f3dca9..8c2beb8c008cc6a04584a5282b08b431e3d5b389 100644 (file)
@@ -839,6 +839,12 @@ Ext.define('PVE.Utils', {
            hideAdd: true,
            backups: false,
        },
+       esxi: {
+           name: 'ESXi',
+           ipanel: 'ESXIInputPanel',
+           faIcon: 'cloud-download',
+           backups: false,
+       },
     },
 
     sdnvnetSchema: {
@@ -1236,6 +1242,8 @@ Ext.define('PVE.Utils', {
            // templates
            objType = 'template';
            status = type;
+       } else if (type === 'storage' && record.content.indexOf('import') !== -1) {
+           return 'fa fa-cloud-download';
        } else {
            // everything else
            status = record.status + ' ha-' + record.hastate;
index c2ad01e9e052ffbeeff81ee9eade4e1c722fb75d..d651c4ce7f0f63c7f482e379edd23b38de780f17 100644 (file)
@@ -17,14 +17,25 @@ Ext.define('PVE.storage.Browser', {
            throw "no storage ID specified";
        }
 
-       me.items = [
+       let storageInfo = PVE.data.ResourceStore.findRecord(
+           'id',
+           `storage/${nodename}/${storeid}`,
+           0, // startIndex
+           false, // anyMatch
+           true, // caseSensitive
+           true, // exactMatch
+       );
+       let res = storageInfo.data;
+       let plugin = res.plugintype;
+
+       me.items = plugin !== 'esxi' ? [
            {
                title: gettext('Summary'),
                xtype: 'pveStorageSummary',
                iconCls: 'fa fa-book',
                itemId: 'summary',
            },
-       ];
+       ] : [];
 
        let caps = Ext.state.Manager.get('GuiCap');
 
@@ -38,16 +49,6 @@ Ext.define('PVE.storage.Browser', {
            caps.storage['Datastore.AllocateSpace'] ||
            caps.storage['Datastore.Audit']
        ) {
-           let storageInfo = PVE.data.ResourceStore.findRecord(
-               'id',
-               `storage/${nodename}/${storeid}`,
-               0, // startIndex
-               false, // anyMatch
-               true, // caseSensitive
-               true, // exactMatch
-           );
-           let res = storageInfo.data;
-           let plugin = res.plugintype;
            let contents = res.content.split(',');
 
            let enableUpload = !!caps.storage['Datastore.AllocateTemplate'];
diff --git a/www/manager6/storage/ESXIEdit.js b/www/manager6/storage/ESXIEdit.js
new file mode 100644 (file)
index 0000000..01c8bd2
--- /dev/null
@@ -0,0 +1,52 @@
+Ext.define('PVE.storage.ESXIInputPanel', {
+    extend: 'PVE.panel.StorageBase',
+
+    onGetValues: function(values) {
+       let me = this;
+
+       if (values.password?.length === 0) {
+           delete values.password;
+       }
+       if (values.username?.length === 0) {
+           delete values.username;
+       }
+
+       return me.callParent([values]);
+    },
+
+    initComponent: function() {
+       var me = this;
+
+       me.column1 = [
+           {
+               xtype: 'pmxDisplayEditField',
+               editable: me.isCreate,
+               name: 'server',
+               fieldLabel: gettext('Server'),
+               allowBlank: false,
+           },
+           {
+               xtype: 'pmxDisplayEditField',
+               editable: me.isCreate,
+               name: 'username',
+               fieldLabel: gettext('Username'),
+               allowBlank: false,
+           },
+           {
+               xtype: 'pmxDisplayEditField',
+               editable: me.isCreate,
+               name: 'password',
+               value: me.isCreate ? '' : '********',
+               minLength: 1,
+               editConfig: {
+                   inputType: 'password',
+                   name: 'password',
+               },
+               fieldLabel: gettext('Password'),
+               allowBlank: false,
+           },
+       ];
+
+       me.callParent();
+    },
+});