public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH manager v3 2/5] ui: move Utils.storageSchema to Schema.storageTypes
Date: Fri, 16 Jul 2021 16:21:23 +0200	[thread overview]
Message-ID: <20210716142126.1216972-2-d.csapak@proxmox.com> (raw)
In-Reply-To: <20210716142126.1216972-1-d.csapak@proxmox.com>

Signed-off-by: Dominik Csapak <d.csapak@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





  reply	other threads:[~2021-07-16 14:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-16 14:21 [pve-devel] [PATCH manager v3 1/5] ui: add Schema.js Dominik Csapak
2021-07-16 14:21 ` Dominik Csapak [this message]
2021-07-16 14:21 ` [pve-devel] [PATCH manager v3 3/5] ui: move sdn schemas to Schema Dominik Csapak
2021-07-16 14:21 ` [pve-devel] [PATCH manager v3 4/5] ui: use AuthView and authSchema from widget-toolkit Dominik Csapak
2021-07-16 14:21 ` [pve-devel] [PATCH manager v3 5/5] ui: remove PVE.dc.AuthEditBase window Dominik Csapak

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=20210716142126.1216972-2-d.csapak@proxmox.com \
    --to=d.csapak@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
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal