Add internal and external storage wizard for cephfs

Signed-off-by: Alwin Antreich <a.antre...@proxmox.com>
---
 www/manager6/Makefile              |  1 +
 www/manager6/Utils.js              | 10 ++++++
 www/manager6/storage/CephFSEdit.js | 71 ++++++++++++++++++++++++++++++++++++++
 3 files changed, 82 insertions(+)
 create mode 100644 www/manager6/storage/CephFSEdit.js

diff --git a/www/manager6/Makefile b/www/manager6/Makefile
index 7e9877b2..6f9b40ca 100644
--- a/www/manager6/Makefile
+++ b/www/manager6/Makefile
@@ -161,6 +161,7 @@ JSSRC=                                                      
\
        storage/IScsiEdit.js                            \
        storage/LVMEdit.js                              \
        storage/LvmThinEdit.js                          \
+       storage/CephFSEdit.js                           \
        storage/RBDEdit.js                              \
        storage/SheepdogEdit.js                         \
        storage/ZFSEdit.js                              \
diff --git a/www/manager6/Utils.js b/www/manager6/Utils.js
index ad5a0a61..f41a9562 100644
--- a/www/manager6/Utils.js
+++ b/www/manager6/Utils.js
@@ -427,6 +427,16 @@ Ext.define('PVE.Utils', { utilities: {
            hideAdd: true,
            faIcon: 'building'
        },
+       cephfs: {
+           name: 'CephFS (PVE)',
+           ipanel: 'PVECephFSInputPanel',
+           faIcon: 'building'
+       },
+       cephfs_ext: {
+           name: 'CephFS (external)',
+           ipanel: 'CephFSInputPanel',
+           faIcon: 'building'
+       },
        rbd: {
            name: 'RBD',
            ipanel: 'RBDInputPanel',
diff --git a/www/manager6/storage/CephFSEdit.js 
b/www/manager6/storage/CephFSEdit.js
new file mode 100644
index 00000000..8f745b63
--- /dev/null
+++ b/www/manager6/storage/CephFSEdit.js
@@ -0,0 +1,71 @@
+Ext.define('PVE.storage.CephFSInputPanel', {
+    extend: 'PVE.panel.StorageBase',
+
+    initComponent : function() {
+       var me = this;
+
+       if (!me.nodename) {
+           me.nodename = 'localhost';
+       }
+       me.type = 'cephfs';
+
+       me.column1 = [];
+
+       if (me.pveceph) {
+           me.column1.push(
+               {
+                   xtype: me.isCreate ? 'textfield' : 'displayfield',
+                   nodename: me.nodename,
+                   name: 'username',
+                   value: '',
+                   emptyText: gettext('admin'),
+                   fieldLabel: gettext('User name'),
+                   allowBlank: true
+               }
+           );
+       } else {
+           me.column1.push(
+               {
+                   xtype: me.isCreate ? 'textfield' : 'displayfield',
+                   name: 'monhost',
+                   vtype: 'HostList',
+                   value: '',
+                   fieldLabel: 'Monitor(s)',
+                   allowBlank: false
+               },
+               {
+                   xtype: me.isCreate ? 'textfield' : 'displayfield',
+                   name: 'username',
+                   value: '',
+                   emptyText: gettext('admin'),
+                   fieldLabel: gettext('User name'),
+                   allowBlank: true
+               }
+           );
+       }
+
+       // here value is an array,
+       // while before it was a string
+       /*jslint confusion: true*/
+       me.column2 = [
+           {
+               xtype: 'pveContentTypeSelector',
+               cts: ['backup', 'iso', 'vztmpl'],
+               fieldLabel: gettext('Content'),
+               name: 'content',
+               value: ['backup'],
+               multiSelect: true,
+               allowBlank: false
+           }
+       ];
+       /*jslint confusion: false*/
+
+       me.callParent();
+    }
+});
+
+Ext.define('PVE.storage.PVECephFSInputPanel', {
+    extend: 'PVE.storage.CephFSInputPanel',
+
+    pveceph: 1
+});
-- 
2.11.0


_______________________________________________
pve-devel mailing list
pve-devel@pve.proxmox.com
https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to