[pve-devel] [PATCH manager v3 3/5] ui: move sdn schemas to Schema

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


but dropped the 'Schema' postfix

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 www/manager6/Schema.js             |  91 ++++++++++++++++++++++++++
 www/manager6/Utils.js              | 101 ++---------------------------
 www/manager6/sdn/ControllerView.js |   4 +-
 www/manager6/sdn/DnsView.js        |   4 +-
 www/manager6/sdn/IpamView.js       |   4 +-
 www/manager6/sdn/ZoneView.js       |   4 +-
 6 files changed, 104 insertions(+), 104 deletions(-)

diff --git a/www/manager6/Schema.js b/www/manager6/Schema.js
index 73d98889..374b5f17 100644
--- a/www/manager6/Schema.js
+++ b/www/manager6/Schema.js
@@ -100,4 +100,95 @@ Ext.define('PVE.Schema', { // a singleton
 	    backups: false,
 	},
     },
+
+    sdnvnet: {
+	vnet: {
+	    name: 'vnet',
+	    faIcon: 'folder',
+	},
+    },
+
+    sdnzone: {
+	zone: {
+	     name: 'zone',
+	     hideAdd: true,
+	},
+	simple: {
+	    name: 'Simple',
+	    ipanel: 'SimpleInputPanel',
+	    faIcon: 'th',
+	},
+	vlan: {
+	    name: 'VLAN',
+	    ipanel: 'VlanInputPanel',
+	    faIcon: 'th',
+	},
+	qinq: {
+	    name: 'QinQ',
+	    ipanel: 'QinQInputPanel',
+	    faIcon: 'th',
+	},
+	vxlan: {
+	    name: 'VXLAN',
+	    ipanel: 'VxlanInputPanel',
+	    faIcon: 'th',
+	},
+	evpn: {
+	    name: 'EVPN',
+	    ipanel: 'EvpnInputPanel',
+	    faIcon: 'th',
+	},
+    },
+
+    sdncontroller: {
+	controller: {
+	     name: 'controller',
+	     hideAdd: true,
+	},
+	evpn: {
+	    name: 'evpn',
+	    ipanel: 'EvpnInputPanel',
+	    faIcon: 'crosshairs',
+	},
+	bgp: {
+	    name: 'bgp',
+	    ipanel: 'BgpInputPanel',
+	    faIcon: 'crosshairs',
+	},
+    },
+
+    sdnipam: {
+	ipam: {
+	     name: 'ipam',
+	     hideAdd: true,
+	},
+	pve: {
+	    name: 'PVE',
+	    ipanel: 'PVEIpamInputPanel',
+	    faIcon: 'th',
+	    hideAdd: true,
+	},
+	netbox: {
+	    name: 'Netbox',
+	    ipanel: 'NetboxInputPanel',
+	    faIcon: 'th',
+	},
+	phpipam: {
+	    name: 'PhpIpam',
+	    ipanel: 'PhpIpamInputPanel',
+	    faIcon: 'th',
+	},
+    },
+
+    sdndns: {
+	dns: {
+	     name: 'dns',
+	     hideAdd: true,
+	},
+	powerdns: {
+	    name: 'powerdns',
+	    ipanel: 'PowerdnsInputPanel',
+	    faIcon: 'th',
+	},
+    },
 });
diff --git a/www/manager6/Utils.js b/www/manager6/Utils.js
index e8c9f218..8d210b69 100644
--- a/www/manager6/Utils.js
+++ b/www/manager6/Utils.js
@@ -760,99 +760,8 @@ Ext.define('PVE.Utils', {
 	},
     },
 
-    sdnvnetSchema: {
-	vnet: {
-	    name: 'vnet',
-	    faIcon: 'folder',
-	},
-    },
-
-    sdnzoneSchema: {
-	zone: {
-	     name: 'zone',
-	     hideAdd: true,
-	},
-	simple: {
-	    name: 'Simple',
-	    ipanel: 'SimpleInputPanel',
-	    faIcon: 'th',
-	},
-	vlan: {
-	    name: 'VLAN',
-	    ipanel: 'VlanInputPanel',
-	    faIcon: 'th',
-	},
-	qinq: {
-	    name: 'QinQ',
-	    ipanel: 'QinQInputPanel',
-	    faIcon: 'th',
-	},
-	vxlan: {
-	    name: 'VXLAN',
-	    ipanel: 'VxlanInputPanel',
-	    faIcon: 'th',
-	},
-	evpn: {
-	    name: 'EVPN',
-	    ipanel: 'EvpnInputPanel',
-	    faIcon: 'th',
-	},
-    },
-
-    sdncontrollerSchema: {
-	controller: {
-	     name: 'controller',
-	     hideAdd: true,
-	},
-	evpn: {
-	    name: 'evpn',
-	    ipanel: 'EvpnInputPanel',
-	    faIcon: 'crosshairs',
-	},
-	bgp: {
-	    name: 'bgp',
-	    ipanel: 'BgpInputPanel',
-	    faIcon: 'crosshairs',
-	},
-    },
-
-    sdnipamSchema: {
-	ipam: {
-	     name: 'ipam',
-	     hideAdd: true,
-	},
-	pve: {
-	    name: 'PVE',
-	    ipanel: 'PVEIpamInputPanel',
-	    faIcon: 'th',
-	    hideAdd: true,
-	},
-	netbox: {
-	    name: 'Netbox',
-	    ipanel: 'NetboxInputPanel',
-	    faIcon: 'th',
-	},
-	phpipam: {
-	    name: 'PhpIpam',
-	    ipanel: 'PhpIpamInputPanel',
-	    faIcon: 'th',
-	},
-    },
-
-    sdndnsSchema: {
-	dns: {
-	     name: 'dns',
-	     hideAdd: true,
-	},
-	powerdns: {
-	    name: 'powerdns',
-	    ipanel: 'PowerdnsInputPanel',
-	    faIcon: 'th',
-	},
-    },
-
     format_sdnvnet_type: function(value, md, record) {
-	var schema = PVE.Utils.sdnvnetSchema[value];
+	var schema = PVE.Schema.sdnvnet[value];
 	if (schema) {
 	    return schema.name;
 	}
@@ -860,7 +769,7 @@ Ext.define('PVE.Utils', {
     },
 
     format_sdnzone_type: function(value, md, record) {
-	var schema = PVE.Utils.sdnzoneSchema[value];
+	var schema = PVE.Schema.sdnzone[value];
 	if (schema) {
 	    return schema.name;
 	}
@@ -868,7 +777,7 @@ Ext.define('PVE.Utils', {
     },
 
     format_sdncontroller_type: function(value, md, record) {
-	var schema = PVE.Utils.sdncontrollerSchema[value];
+	var schema = PVE.Schema.sdncontroller[value];
 	if (schema) {
 	    return schema.name;
 	}
@@ -876,7 +785,7 @@ Ext.define('PVE.Utils', {
     },
 
     format_sdnipam_type: function(value, md, record) {
-	var schema = PVE.Utils.sdnipamSchema[value];
+	var schema = PVE.Schema.sdnipam[value];
 	if (schema) {
 	    return schema.name;
 	}
@@ -884,7 +793,7 @@ Ext.define('PVE.Utils', {
     },
 
     format_sdndns_type: function(value, md, record) {
-	var schema = PVE.Utils.sdndnsSchema[value];
+	var schema = PVE.Schema.sdndns[value];
 	if (schema) {
 	    return schema.name;
 	}
diff --git a/www/manager6/sdn/ControllerView.js b/www/manager6/sdn/ControllerView.js
index 8d92a715..e548de23 100644
--- a/www/manager6/sdn/ControllerView.js
+++ b/www/manager6/sdn/ControllerView.js
@@ -8,7 +8,7 @@ Ext.define('PVE.sdn.ControllerView', {
     stateId: 'grid-sdn-controller',
 
     createSDNControllerEditWindow: function(type, sid) {
-	var schema = PVE.Utils.sdncontrollerSchema[type];
+	var schema = PVE.Schema.sdncontroller[type];
 	if (!schema || !schema.ipanel) {
 	    throw "no editor registered for controller type: " + type;
 	}
@@ -68,7 +68,7 @@ Ext.define('PVE.sdn.ControllerView', {
 	    return function() { me.createSDNControllerEditWindow(type); };
 	};
 	let addMenuItems = [];
-	for (const [type, controller] of Object.entries(PVE.Utils.sdncontrollerSchema)) {
+	for (const [type, controller] of Object.entries(PVE.Schema.sdncontroller)) {
 	    if (controller.hideAdd) {
 		continue;
 	    }
diff --git a/www/manager6/sdn/DnsView.js b/www/manager6/sdn/DnsView.js
index d1654cab..ed42cbfe 100644
--- a/www/manager6/sdn/DnsView.js
+++ b/www/manager6/sdn/DnsView.js
@@ -6,7 +6,7 @@ Ext.define('PVE.sdn.DnsView', {
     stateId: 'grid-sdn-dns',
 
     createSDNEditWindow: function(type, sid) {
-	let schema = PVE.Utils.sdndnsSchema[type];
+	let schema = PVE.Schema.sdndns[type];
 	if (!schema || !schema.ipanel) {
 	    throw "no editor registered for dns type: " + type;
 	}
@@ -68,7 +68,7 @@ Ext.define('PVE.sdn.DnsView', {
 	    return function() { me.createSDNEditWindow(type); };
 	};
 	let addMenuItems = [];
-	for (const [type, dns] of Object.entries(PVE.Utils.sdndnsSchema)) {
+	for (const [type, dns] of Object.entries(PVE.Schema.sdndns)) {
 	    if (dns.hideAdd) {
 		continue;
 	    }
diff --git a/www/manager6/sdn/IpamView.js b/www/manager6/sdn/IpamView.js
index 0d00d8e6..cc526a9f 100644
--- a/www/manager6/sdn/IpamView.js
+++ b/www/manager6/sdn/IpamView.js
@@ -6,7 +6,7 @@ Ext.define('PVE.sdn.IpamView', {
     stateId: 'grid-sdn-ipam',
 
     createSDNEditWindow: function(type, sid) {
-	let schema = PVE.Utils.sdnipamSchema[type];
+	let schema = PVE.Schema.sdnipam[type];
 	if (!schema || !schema.ipanel) {
 	    throw "no editor registered for ipam type: " + type;
 	}
@@ -66,7 +66,7 @@ Ext.define('PVE.sdn.IpamView', {
 	    return function() { me.createSDNEditWindow(type); };
 	};
 	let addMenuItems = [];
-	for (const [type, ipam] of Object.entries(PVE.Utils.sdnipamSchema)) {
+	for (const [type, ipam] of Object.entries(PVE.Schema.sdnipam)) {
 	    if (ipam.hideAdd) {
 		continue;
 	    }
diff --git a/www/manager6/sdn/ZoneView.js b/www/manager6/sdn/ZoneView.js
index ac812d4a..b700909a 100644
--- a/www/manager6/sdn/ZoneView.js
+++ b/www/manager6/sdn/ZoneView.js
@@ -8,7 +8,7 @@ Ext.define('PVE.sdn.ZoneView', {
     stateId: 'grid-sdn-zone',
 
     createSDNEditWindow: function(type, sid) {
-	let schema = PVE.Utils.sdnzoneSchema[type];
+	let schema = PVE.Schema.sdnzone[type];
 	if (!schema || !schema.ipanel) {
 	    throw "no editor registered for zone type: " + type;
 	}
@@ -83,7 +83,7 @@ Ext.define('PVE.sdn.ZoneView', {
 	    return function() { me.createSDNEditWindow(type); };
 	};
 	let addMenuItems = [];
-	for (const [type, zone] of Object.entries(PVE.Utils.sdnzoneSchema)) {
+	for (const [type, zone] of Object.entries(PVE.Schema.sdnzone)) {
 	    if (zone.hideAdd) {
 		continue;
 	    }
-- 
2.30.2






More information about the pve-devel mailing list