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 3/5] ui: move sdn schemas to Schema
Date: Fri, 16 Jul 2021 16:21:24 +0200	[thread overview]
Message-ID: <20210716142126.1216972-3-d.csapak@proxmox.com> (raw)
In-Reply-To: <20210716142126.1216972-1-d.csapak@proxmox.com>

but dropped the 'Schema' postfix

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





  parent 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 ` [pve-devel] [PATCH manager v3 2/5] ui: move Utils.storageSchema to Schema.storageTypes Dominik Csapak
2021-07-16 14:21 ` Dominik Csapak [this message]
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-3-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