public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Alexandre Derumier <aderumier@odiso.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH v10 pve-manager 13/19] move ipams && dns options to zone
Date: Tue,  5 Jan 2021 10:07:03 +0100	[thread overview]
Message-ID: <20210105090709.1706377-14-aderumier@odiso.com> (raw)
In-Reply-To: <20210105090709.1706377-1-aderumier@odiso.com>

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
---
 www/manager6/Utils.js                |  4 +--
 www/manager6/sdn/SubnetEdit.js       | 39 +-------------------------
 www/manager6/sdn/SubnetView.js       | 23 ++-------------
 www/manager6/sdn/VnetEdit.js         | 10 ++-----
 www/manager6/sdn/ZoneView.js         | 42 ++++++++++++++++++++++++++--
 www/manager6/sdn/zones/Base.js       | 31 ++++++++++++++++++++
 www/manager6/sdn/zones/SimpleEdit.js |  1 -
 7 files changed, 78 insertions(+), 72 deletions(-)

diff --git a/www/manager6/Utils.js b/www/manager6/Utils.js
index 257af3fd..98cb8ca1 100644
--- a/www/manager6/Utils.js
+++ b/www/manager6/Utils.js
@@ -178,7 +178,7 @@ Ext.define('PVE.Utils', { utilities: {
     render_sdn_pending: function(rec,value,key, index) {
         if (rec.data.state === 'deleted') {
             if (value === undefined) {
-                return '';
+                return ' ';
             } else {
                 return '<div style="text-decoration: line-through;">'+ value +'</div>';
             }
@@ -188,7 +188,7 @@ Ext.define('PVE.Utils', { utilities: {
                 value = rec.data.pending[key];
             }
             if (value === undefined || value === null) {
-                value = '';
+                value = ' ';
             }
             return '<div style="color:green">' + value + '</div>';
         } else if (rec.data.state === 'changed') {
diff --git a/www/manager6/sdn/SubnetEdit.js b/www/manager6/sdn/SubnetEdit.js
index 653c8ae5..83c6961c 100644
--- a/www/manager6/sdn/SubnetEdit.js
+++ b/www/manager6/sdn/SubnetEdit.js
@@ -46,50 +46,13 @@ Ext.define('PVE.sdn.SubnetInputPanel', {
 	    checked: false,
 	    fieldLabel: 'SNAT'
 	},
-    ],
-    advancedItems: [
-        {
-            xtype: 'pveSDNIpamSelector',
-            fieldLabel: gettext('Ipam'),
-            name: 'ipam',
-            value: 'pve',
-            allowBlank: false,
-        },
-        {
-            xtype: 'pveSDNDnsSelector',
-            fieldLabel: gettext('Dns server'),
-            name: 'dns',
-            value: '',
-            allowBlank: true,
-        },
-	{
-	    xtype: 'proxmoxtextfield',
-	    name: 'dnszone',
-	    skipEmptyText: true,
-	    fieldLabel: gettext('DNS zone'),
-	    allowBlank: true
-	},
 	{
 	    xtype: 'proxmoxtextfield',
 	    name: 'dnszoneprefix',
 	    skipEmptyText: true,
 	    fieldLabel: gettext('DNS zone prefix'),
 	    allowBlank: true
-	},
-        {
-            xtype: 'pveSDNDnsSelector',
-            fieldLabel: gettext('Reverse Dns server'),
-            name: 'reversedns',
-            value: '',
-            allowBlank: true,
-        },
-	{
-	    xtype: 'proxmoxtextfield',
-	    name: 'reversednszone',
-	    skipEmptyText: true,
-	    fieldLabel: gettext('Reverse DNS zone'),
-	    allowBlank: true
-	},
+	}
     ]
 });
 
diff --git a/www/manager6/sdn/SubnetView.js b/www/manager6/sdn/SubnetView.js
index 0c04ddf1..bff047fb 100644
--- a/www/manager6/sdn/SubnetView.js
+++ b/www/manager6/sdn/SubnetView.js
@@ -124,30 +124,13 @@ Ext.define('PVE.sdn.SubnetView', {
                     }
 		},
 		{
-		    header: 'Ipam',
+		    header: gettext('Dns prefix'),
 		    flex: 1,
-		    dataIndex: 'ipam',
+		    dataIndex: 'dnszoneprefix',
                     renderer: function(value, metaData, rec) {
-                        return PVE.Utils.render_sdn_pending(rec, value, 'ipam');
+                        return PVE.Utils.render_sdn_pending(rec, value, 'dnszoneprefix');
                     }
 		},
-                {
-                    header: gettext('Pending'),
-                    flex: 3,
-                    dataIndex: 'pending',
-                    renderer: function(value, metaData, rec) {
-                        if(value !== undefined ) {
-                                delete value.cidr;
-                                delete value.gateway;
-                                delete value.snat;
-                                delete value.ipam;
-				if(!Ext.Object.isEmpty(value)){
-				    return JSON.stringify(value);
-				}
-                        }
-                        return '';
-                    }
-                },
 
 	    ],
 	    listeners: {
diff --git a/www/manager6/sdn/VnetEdit.js b/www/manager6/sdn/VnetEdit.js
index 03e539ab..af5d6cde 100644
--- a/www/manager6/sdn/VnetEdit.js
+++ b/www/manager6/sdn/VnetEdit.js
@@ -9,14 +9,8 @@ Ext.define('PVE.sdn.VnetInputPanel', {
 	    values.type = 'vnet';
 	}
 
-	if (!values.ipv6) {
-	    delete values.ipv6;
-	}
-	if (!values.ipv4) {
-	    delete values.ipv4;
-	}
-	if (!values.mac) {
-	    delete values.mac;
+	if (!values.vlanaware) {
+	    delete values.vlanaware;
 	}
 
 	return values;
diff --git a/www/manager6/sdn/ZoneView.js b/www/manager6/sdn/ZoneView.js
index b530bd5f..d842654a 100644
--- a/www/manager6/sdn/ZoneView.js
+++ b/www/manager6/sdn/ZoneView.js
@@ -117,7 +117,7 @@ Ext.define('PVE.sdn.ZoneView', {
 	    columns: [
 		{
 		    header: 'ID',
-		    flex: 2,
+		    width: 100,
 		    dataIndex: 'zone',
                     renderer: function(value, metaData, rec) {
                         return PVE.Utils.render_sdn_pending(rec, value, 'zone', 1);
@@ -125,7 +125,7 @@ Ext.define('PVE.sdn.ZoneView', {
 		},
 		{
 		    header: gettext('Type'),
-		    flex: 1,
+		    width: 100,
 		    dataIndex: 'type',
                     renderer: function(value, metaData, rec) {
                         return PVE.Utils.render_sdn_pending(rec, value, 'type', 1);
@@ -133,7 +133,7 @@ Ext.define('PVE.sdn.ZoneView', {
 		},
 		{
 		    header: 'MTU',
-		    flex: 1,
+		    width: 50,
 		    dataIndex: 'mtu',
                     renderer: function(value, metaData, rec) {
                         return PVE.Utils.render_sdn_pending(rec, value, 'mtu');
@@ -147,6 +147,38 @@ Ext.define('PVE.sdn.ZoneView', {
                         return PVE.Utils.render_sdn_pending(rec, value, 'nodes');
                     }
 		},
+		{
+		    header: 'Ipam',
+		    flex: 3,
+		    dataIndex: 'ipam',
+                    renderer: function(value, metaData, rec) {
+                        return PVE.Utils.render_sdn_pending(rec, value, 'ipam');
+                    }
+		},
+		{
+		    header: gettext('Domain'),
+		    flex: 3,
+		    dataIndex: 'dnszone',
+                    renderer: function(value, metaData, rec) {
+                        return PVE.Utils.render_sdn_pending(rec, value, 'dnszone');
+                    }
+		},
+		{
+		    header: gettext('Dns'),
+		    flex: 3,
+		    dataIndex: 'dns',
+                    renderer: function(value, metaData, rec) {
+                        return PVE.Utils.render_sdn_pending(rec, value, 'dns');
+                    }
+		},
+		{
+		    header: gettext('Reverse dns'),
+		    flex: 3,
+		    dataIndex: 'reversedns',
+                    renderer: function(value, metaData, rec) {
+                        return PVE.Utils.render_sdn_pending(rec, value, 'reversedns');
+                    }
+		},
 		{
 		    header: gettext('Pending'),
 		    flex: 3,
@@ -157,6 +189,10 @@ Ext.define('PVE.sdn.ZoneView', {
 				delete value.zone;
 				delete value.type;
 				delete value.mtu;
+				delete value.ipam;
+				delete value.dns;
+				delete value.reversedns;
+				delete value.dnszone;
 				if(!Ext.Object.isEmpty(value)){
 				    return JSON.stringify(value);
  				}
diff --git a/www/manager6/sdn/zones/Base.js b/www/manager6/sdn/zones/Base.js
index 724ae317..6e2f5c1c 100644
--- a/www/manager6/sdn/zones/Base.js
+++ b/www/manager6/sdn/zones/Base.js
@@ -18,6 +18,37 @@ Ext.define('PVE.panel.SDNZoneBase', {
     initComponent : function() {
         var me = this;
 
+        me.advancedItems = [
+            {
+                xtype: 'pveSDNIpamSelector',
+                fieldLabel: gettext('Ipam'),
+                name: 'ipam',
+                value: 'pve',
+                allowBlank: false,
+            },
+            {
+                xtype: 'pveSDNDnsSelector',
+                fieldLabel: gettext('Dns server'),
+                name: 'dns',
+                value: '',
+                allowBlank: true,
+            },
+            {
+                xtype: 'pveSDNDnsSelector',
+                fieldLabel: gettext('Reverse Dns server'),
+                name: 'reversedns',
+                value: '',
+                allowBlank: true,
+            },
+            {
+                xtype: 'proxmoxtextfield',
+                name: 'dnszone',
+                skipEmptyText: true,
+                fieldLabel: gettext('DNS zone'),
+                allowBlank: true
+            },
+        ];
+
         me.callParent();
     }
 });
diff --git a/www/manager6/sdn/zones/SimpleEdit.js b/www/manager6/sdn/zones/SimpleEdit.js
index 7e2d8dd7..c9faa5a0 100644
--- a/www/manager6/sdn/zones/SimpleEdit.js
+++ b/www/manager6/sdn/zones/SimpleEdit.js
@@ -45,7 +45,6 @@ Ext.define('PVE.sdn.zones.SimpleInputPanel', {
             multiSelect: true,
             autoSelect: false
           },
-
 	];
 
 	me.callParent();
-- 
2.20.1




  parent reply	other threads:[~2021-01-05  9:07 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-05  9:06 [pve-devel] [PATCH v10 pve-manager 00/19] sdn: add subnets management Alexandre Derumier
2021-01-05  9:06 ` [pve-devel] [PATCH v10 pve-manager 01/19] sdn: vnetedit: add subnets && remove ip/mac Alexandre Derumier
2021-01-05  9:06 ` [pve-devel] [PATCH v10 pve-manager 02/19] add sdn subnets Alexandre Derumier
2021-01-05  9:06 ` [pve-devel] [PATCH v10 pve-manager 03/19] add sdn ipams Alexandre Derumier
2021-01-05  9:06 ` [pve-devel] [PATCH v10 pve-manager 04/19] sdn: add PVEIpam Alexandre Derumier
2021-01-05  9:06 ` [pve-devel] [PATCH v10 pve-manager 05/19] sdn: subnets: ipam is optional Alexandre Derumier
2021-01-05  9:06 ` [pve-devel] [PATCH v10 pve-manager 06/19] add sdn dns Alexandre Derumier
2021-01-05  9:06 ` [pve-devel] [PATCH v10 pve-manager 07/19] subnets: add dns fields Alexandre Derumier
2021-01-05  9:06 ` [pve-devel] [PATCH v10 pve-manager 08/19] add vnet option to subnets and remove subnets list from vnet Alexandre Derumier
2021-01-05  9:06 ` [pve-devel] [PATCH v10 pve-manager 09/19] add vnet panel with vnet + subnets split view Alexandre Derumier
2021-01-05  9:07 ` [pve-devel] [PATCH v10 pve-manager 10/19] subnets: move ipam/dns in advanced section, and use "pve" as default ipam Alexandre Derumier
2021-01-05  9:07 ` [pve-devel] [PATCH v10 pve-manager 11/19] sdn: add options panel + move controller/ipam/dns view Alexandre Derumier
2021-01-05  9:07 ` [pve-devel] [PATCH v10 pve-manager 12/19] sdn: display pending values Alexandre Derumier
2021-01-05  9:07 ` Alexandre Derumier [this message]
2021-01-05  9:07 ` [pve-devel] [PATCH v10 pve-manager 14/19] sdn: browser: add onlinehelp Alexandre Derumier
2021-01-05  9:07 ` [pve-devel] [PATCH v10 pve-manager 15/19] sdn: evpn improvments Alexandre Derumier
2021-01-05  9:07 ` [pve-devel] [PATCH v10 pve-manager 16/19] sdn: update onlinehelp links Alexandre Derumier
2021-01-05  9:07 ` [pve-devel] [PATCH v10 pve-manager 17/19] sdn : zone content view: add alias && resize column Alexandre Derumier
2021-01-05  9:07 ` [pve-devel] [PATCH v10 pve-manager 18/19] sdn: add pending state column with hover tip Alexandre Derumier
2021-01-05  9:07 ` [pve-devel] [PATCH v10 pve-manager 19/19] vnets: readd missing mac address advanced field Alexandre Derumier

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=20210105090709.1706377-14-aderumier@odiso.com \
    --to=aderumier@odiso.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