[pve-devel] [PATCH manager v3 2/5] ui: move Utils.storageSchema to Schema.storageTypes

Dominik Csapak d.csapak at proxmox.com
Fri Jul 16 16:21:23 CEST 2021


Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 www/manager6/Schema.js         |  99 ++++++++++++++++++++++++++++++++
 www/manager6/Utils.js          | 102 +--------------------------------
 www/manager6/dc/StorageView.js |   4 +-
 3 files changed, 102 insertions(+), 103 deletions(-)

diff --git a/www/manager6/Schema.js b/www/manager6/Schema.js
index 5649241a..73d98889 100644
--- a/www/manager6/Schema.js
+++ b/www/manager6/Schema.js
@@ -1,4 +1,103 @@
 Ext.define('PVE.Schema', { // a singleton
     singleton: true,
 
+    storageTypes: {
+	dir: {
+	    name: Proxmox.Utils.directoryText,
+	    ipanel: 'DirInputPanel',
+	    faIcon: 'folder',
+	    backups: true,
+	},
+	lvm: {
+	    name: 'LVM',
+	    ipanel: 'LVMInputPanel',
+	    faIcon: 'folder',
+	    backups: false,
+	},
+	lvmthin: {
+	    name: 'LVM-Thin',
+	    ipanel: 'LvmThinInputPanel',
+	    faIcon: 'folder',
+	    backups: false,
+	},
+	btrfs: {
+	    name: 'BTRFS',
+	    ipanel: 'BTRFSInputPanel',
+	    faIcon: 'folder',
+	    backups: true,
+	},
+	nfs: {
+	    name: 'NFS',
+	    ipanel: 'NFSInputPanel',
+	    faIcon: 'building',
+	    backups: true,
+	},
+	cifs: {
+	    name: 'CIFS',
+	    ipanel: 'CIFSInputPanel',
+	    faIcon: 'building',
+	    backups: true,
+	},
+	glusterfs: {
+	    name: 'GlusterFS',
+	    ipanel: 'GlusterFsInputPanel',
+	    faIcon: 'building',
+	    backups: true,
+	},
+	iscsi: {
+	    name: 'iSCSI',
+	    ipanel: 'IScsiInputPanel',
+	    faIcon: 'building',
+	    backups: false,
+	},
+	cephfs: {
+	    name: 'CephFS',
+	    ipanel: 'CephFSInputPanel',
+	    faIcon: 'building',
+	    backups: true,
+	},
+	pvecephfs: {
+	    name: 'CephFS (PVE)',
+	    ipanel: 'CephFSInputPanel',
+	    hideAdd: true,
+	    faIcon: 'building',
+	    backups: true,
+	},
+	rbd: {
+	    name: 'RBD',
+	    ipanel: 'RBDInputPanel',
+	    faIcon: 'building',
+	    backups: false,
+	},
+	pveceph: {
+	    name: 'RBD (PVE)',
+	    ipanel: 'RBDInputPanel',
+	    hideAdd: true,
+	    faIcon: 'building',
+	    backups: false,
+	},
+	zfs: {
+	    name: 'ZFS over iSCSI',
+	    ipanel: 'ZFSInputPanel',
+	    faIcon: 'building',
+	    backups: false,
+	},
+	zfspool: {
+	    name: 'ZFS',
+	    ipanel: 'ZFSPoolInputPanel',
+	    faIcon: 'folder',
+	    backups: false,
+	},
+	pbs: {
+	    name: 'Proxmox Backup Server',
+	    ipanel: 'PBSInputPanel',
+	    faIcon: 'floppy-o',
+	    backups: true,
+	},
+	drbd: {
+	    name: 'DRBD',
+	    hideAdd: true,
+	    backups: false,
+	},
+    },
 });
diff --git a/www/manager6/Utils.js b/www/manager6/Utils.js
index a22eaaa7..e8c9f218 100644
--- a/www/manager6/Utils.js
+++ b/www/manager6/Utils.js
@@ -760,106 +760,6 @@ Ext.define('PVE.Utils', {
 	},
     },
 
-    storageSchema: {
-	dir: {
-	    name: Proxmox.Utils.directoryText,
-	    ipanel: 'DirInputPanel',
-	    faIcon: 'folder',
-	    backups: true,
-	},
-	lvm: {
-	    name: 'LVM',
-	    ipanel: 'LVMInputPanel',
-	    faIcon: 'folder',
-	    backups: false,
-	},
-	lvmthin: {
-	    name: 'LVM-Thin',
-	    ipanel: 'LvmThinInputPanel',
-	    faIcon: 'folder',
-	    backups: false,
-	},
-	btrfs: {
-	    name: 'BTRFS',
-	    ipanel: 'BTRFSInputPanel',
-	    faIcon: 'folder',
-	    backups: true,
-	},
-	nfs: {
-	    name: 'NFS',
-	    ipanel: 'NFSInputPanel',
-	    faIcon: 'building',
-	    backups: true,
-	},
-	cifs: {
-	    name: 'CIFS',
-	    ipanel: 'CIFSInputPanel',
-	    faIcon: 'building',
-	    backups: true,
-	},
-	glusterfs: {
-	    name: 'GlusterFS',
-	    ipanel: 'GlusterFsInputPanel',
-	    faIcon: 'building',
-	    backups: true,
-	},
-	iscsi: {
-	    name: 'iSCSI',
-	    ipanel: 'IScsiInputPanel',
-	    faIcon: 'building',
-	    backups: false,
-	},
-	cephfs: {
-	    name: 'CephFS',
-	    ipanel: 'CephFSInputPanel',
-	    faIcon: 'building',
-	    backups: true,
-	},
-	pvecephfs: {
-	    name: 'CephFS (PVE)',
-	    ipanel: 'CephFSInputPanel',
-	    hideAdd: true,
-	    faIcon: 'building',
-	    backups: true,
-	},
-	rbd: {
-	    name: 'RBD',
-	    ipanel: 'RBDInputPanel',
-	    faIcon: 'building',
-	    backups: false,
-	},
-	pveceph: {
-	    name: 'RBD (PVE)',
-	    ipanel: 'RBDInputPanel',
-	    hideAdd: true,
-	    faIcon: 'building',
-	    backups: false,
-	},
-	zfs: {
-	    name: 'ZFS over iSCSI',
-	    ipanel: 'ZFSInputPanel',
-	    faIcon: 'building',
-	    backups: false,
-	},
-	zfspool: {
-	    name: 'ZFS',
-	    ipanel: 'ZFSPoolInputPanel',
-	    faIcon: 'folder',
-	    backups: false,
-	},
-	pbs: {
-	    name: 'Proxmox Backup Server',
-	    ipanel: 'PBSInputPanel',
-	    faIcon: 'floppy-o',
-	    backups: true,
-	},
-	drbd: {
-	    name: 'DRBD',
-	    hideAdd: true,
-	    backups: false,
-	},
-    },
-
     sdnvnetSchema: {
 	vnet: {
 	    name: 'vnet',
@@ -998,7 +898,7 @@ Ext.define('PVE.Utils', {
 	    value = !record || record.get('monhost') ? 'cephfs' : 'pvecephfs';
 	}
 
-	var schema = PVE.Utils.storageSchema[value];
+	var schema = PVE.Schema.storageTypes[value];
 	if (schema) {
 	    return schema.name;
 	}
diff --git a/www/manager6/dc/StorageView.js b/www/manager6/dc/StorageView.js
index c6417ee7..4f44ad05 100644
--- a/www/manager6/dc/StorageView.js
+++ b/www/manager6/dc/StorageView.js
@@ -9,7 +9,7 @@ Ext.define('PVE.dc.StorageView', {
     stateId: 'grid-dc-storage',
 
     createStorageEditWindow: function(type, sid) {
-	let schema = PVE.Utils.storageSchema[type];
+	let schema = PVE.Schema.storageTypes[type];
 	if (!schema || !schema.ipanel) {
 	    throw "no editor registered for storage type: " + type;
 	}
@@ -69,7 +69,7 @@ Ext.define('PVE.dc.StorageView', {
 	    return function() { me.createStorageEditWindow(type); };
 	};
 	let addMenuItems = [];
-	for (const [type, storage] of Object.entries(PVE.Utils.storageSchema)) {
+	for (const [type, storage] of Object.entries(PVE.Schema.storageTypes)) {
 	    if (storage.hideAdd) {
 		continue;
 	    }
-- 
2.30.2






More information about the pve-devel mailing list