public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH v5 pve-manager 00/11] sdn: add subnets management
@ 2020-09-24  8:40 Alexandre Derumier
  2020-09-24  8:40 ` [pve-devel] [PATCH v5 pve-manager 01/11] sdn: vnetedit: add subnets && remove ip/mac Alexandre Derumier
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: Alexandre Derumier @ 2020-09-24  8:40 UTC (permalink / raw)
  To: pve-devel

Following pve-network

Changelogv2:

- add ipams gui

Changelogv3:

- add internal pve ipam form
- ipam is optional for subnets

Changelogv4:
- add dns 

changelogv5:

- move subnets to vnet split panel (like ipsets)
- move controllers, ipams, dns to a new options panel

Alexandre Derumier (11):
  sdn: vnetedit: add subnets && remove ip/mac
  add sdn subnets
  add sdn ipams
  sdn: add PVEIpam
  sdn: subnets: ipam is optional
  add sdn dns
  subnets: add dns fields
  add vnet option to subnets and remove subnets list from  vnet
  add vnet panel with vnet + subnets split view
  subnets: move ipam/dns in advanced section, and use "pve" as default
    ipam
  sdn: add options panel + move controller/ipam/dns view

 www/manager6/Makefile                 |  15 +++
 www/manager6/Utils.js                 |  51 ++++++++++
 www/manager6/dc/Config.js             |  18 ++--
 www/manager6/form/SDNDnsSelector.js   |  52 ++++++++++
 www/manager6/form/SDNIpamSelector.js  |  52 ++++++++++
 www/manager6/form/SDNVnetSelector.js  |  68 +++++++++++++
 www/manager6/sdn/ControllerView.js    |   1 +
 www/manager6/sdn/DnsView.js           | 132 ++++++++++++++++++++++++
 www/manager6/sdn/IpamView.js          | 133 ++++++++++++++++++++++++
 www/manager6/sdn/OptionsPanel.js      |  41 ++++++++
 www/manager6/sdn/SubnetEdit.js        | 141 ++++++++++++++++++++++++++
 www/manager6/sdn/SubnetView.js        | 137 +++++++++++++++++++++++++
 www/manager6/sdn/VnetEdit.js          |  33 +-----
 www/manager6/sdn/VnetPanel.js         |  39 +++++++
 www/manager6/sdn/VnetView.js          |  46 +++------
 www/manager6/sdn/dns/Base.js          |  73 +++++++++++++
 www/manager6/sdn/dns/PowerdnsEdit.js  |  52 ++++++++++
 www/manager6/sdn/ipams/Base.js        |  73 +++++++++++++
 www/manager6/sdn/ipams/NetboxEdit.js  |  47 +++++++++
 www/manager6/sdn/ipams/PVEIpamEdit.js |  34 +++++++
 www/manager6/sdn/ipams/PhpIpamEdit.js |  53 ++++++++++
 21 files changed, 1217 insertions(+), 74 deletions(-)
 create mode 100644 www/manager6/form/SDNDnsSelector.js
 create mode 100644 www/manager6/form/SDNIpamSelector.js
 create mode 100644 www/manager6/form/SDNVnetSelector.js
 create mode 100644 www/manager6/sdn/DnsView.js
 create mode 100644 www/manager6/sdn/IpamView.js
 create mode 100644 www/manager6/sdn/OptionsPanel.js
 create mode 100644 www/manager6/sdn/SubnetEdit.js
 create mode 100644 www/manager6/sdn/SubnetView.js
 create mode 100644 www/manager6/sdn/VnetPanel.js
 create mode 100644 www/manager6/sdn/dns/Base.js
 create mode 100644 www/manager6/sdn/dns/PowerdnsEdit.js
 create mode 100644 www/manager6/sdn/ipams/Base.js
 create mode 100644 www/manager6/sdn/ipams/NetboxEdit.js
 create mode 100644 www/manager6/sdn/ipams/PVEIpamEdit.js
 create mode 100644 www/manager6/sdn/ipams/PhpIpamEdit.js

-- 
2.20.1




^ permalink raw reply	[flat|nested] 12+ messages in thread

* [pve-devel] [PATCH v5 pve-manager 01/11] sdn: vnetedit: add subnets && remove ip/mac
  2020-09-24  8:40 [pve-devel] [PATCH v5 pve-manager 00/11] sdn: add subnets management Alexandre Derumier
@ 2020-09-24  8:40 ` Alexandre Derumier
  2020-09-24  8:40 ` [pve-devel] [PATCH v5 pve-manager 02/11] add sdn subnets Alexandre Derumier
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Alexandre Derumier @ 2020-09-24  8:40 UTC (permalink / raw)
  To: pve-devel

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
---
 www/manager6/sdn/VnetEdit.js | 29 +++--------------------------
 www/manager6/sdn/VnetView.js | 18 +++---------------
 2 files changed, 6 insertions(+), 41 deletions(-)

diff --git a/www/manager6/sdn/VnetEdit.js b/www/manager6/sdn/VnetEdit.js
index aa40b41f..09e2f3bf 100644
--- a/www/manager6/sdn/VnetEdit.js
+++ b/www/manager6/sdn/VnetEdit.js
@@ -64,34 +64,11 @@ Ext.define('PVE.sdn.VnetInputPanel', {
 	},
 	{
 	    xtype: 'textfield',
-	    name: 'mac',
-	    fieldLabel: gettext('MAC Address'),
-	    vtype: 'MacAddress',
-	    skipEmptyText: true,
+	    name: 'subnets',
+	    fieldLabel: gettext('Subnets'),
 	    allowBlank: true,
-	    emptyText: 'auto',
 	},
-    ],
-    advancedItems: [
-	{
-	    xtype: 'textfield',
-	    name: 'ipv4',
-	    vtype: 'IPCIDRAddress',
-	    fieldLabel: 'IPv4/CIDR', // do not localize
-	    emptyText: 'Optional anycast addr. for BGP',
-	    skipEmptyText: true,
-	    allowBlank: true,
-	},
-	{
-	    xtype: 'textfield',
-	    name: 'ipv6',
-	    vtype: 'IP6CIDRAddress',
-	    fieldLabel: 'IPv6/CIDR', // do not localize
-	    emptyText: 'Optional anycast addr. for BGP',
-	    skipEmptyText: true,
-	    allowBlank: true,
-	},
-    ],
+    ]
 });
 
 Ext.define('PVE.sdn.VnetEdit', {
diff --git a/www/manager6/sdn/VnetView.js b/www/manager6/sdn/VnetView.js
index e73632d1..604a2d1a 100644
--- a/www/manager6/sdn/VnetView.js
+++ b/www/manager6/sdn/VnetView.js
@@ -98,20 +98,10 @@ Ext.define('PVE.sdn.VnetView', {
 		    dataIndex: 'vlanaware',
 		},
 		{
-		    header: 'IPv4/CIDR',
+		    header: 'Subnets',
 		    flex: 1,
-		    dataIndex: 'ipv4',
+		    dataIndex: 'subnets',
 		},
-		{
-		    header: 'IPv6/CIDR',
-		    flex: 1,
-		    dataIndex: 'ipv6',
-		},
-		{
-		    header: 'MAC',
-		    flex: 1,
-		    dataIndex: 'mac',
-		}
 	    ],
 	    listeners: {
 		activate: reload,
@@ -127,9 +117,7 @@ Ext.define('PVE.sdn.VnetView', {
 	extend: 'Ext.data.Model',
 	fields: [
 	    'alias',
-	    'ipv4',
-	    'ipv6',
-	    'mac',
+	    'subnets',
 	    'tag',
 	    'type',
 	    'vnet',
-- 
2.20.1




^ permalink raw reply	[flat|nested] 12+ messages in thread

* [pve-devel] [PATCH v5 pve-manager 02/11] add sdn subnets
  2020-09-24  8:40 [pve-devel] [PATCH v5 pve-manager 00/11] sdn: add subnets management Alexandre Derumier
  2020-09-24  8:40 ` [pve-devel] [PATCH v5 pve-manager 01/11] sdn: vnetedit: add subnets && remove ip/mac Alexandre Derumier
@ 2020-09-24  8:40 ` Alexandre Derumier
  2020-09-24  8:40 ` [pve-devel] [PATCH v5 pve-manager 03/11] add sdn ipams Alexandre Derumier
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Alexandre Derumier @ 2020-09-24  8:40 UTC (permalink / raw)
  To: pve-devel

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
---
 www/manager6/Makefile          |   2 +
 www/manager6/dc/Config.js      |   8 +++
 www/manager6/sdn/SubnetEdit.js |  95 +++++++++++++++++++++++++++++
 www/manager6/sdn/SubnetView.js | 107 +++++++++++++++++++++++++++++++++
 4 files changed, 212 insertions(+)
 create mode 100644 www/manager6/sdn/SubnetEdit.js
 create mode 100644 www/manager6/sdn/SubnetView.js

diff --git a/www/manager6/Makefile b/www/manager6/Makefile
index 4288acdd..0c940710 100644
--- a/www/manager6/Makefile
+++ b/www/manager6/Makefile
@@ -207,6 +207,8 @@ JSSRC= 							\
 	sdn/StatusView.js				\
 	sdn/VnetEdit.js					\
 	sdn/VnetView.js					\
+	sdn/SubnetEdit.js					\
+	sdn/SubnetView.js					\
 	sdn/ZoneContentView.js				\
 	sdn/ZoneView.js					\
 	sdn/controllers/Base.js				\
diff --git a/www/manager6/dc/Config.js b/www/manager6/dc/Config.js
index 905c3dc0..610b38db 100644
--- a/www/manager6/dc/Config.js
+++ b/www/manager6/dc/Config.js
@@ -176,6 +176,14 @@ Ext.define('PVE.dc.Config', {
 		    hidden: true,
 		    iconCls: 'fa fa-network-wired',
 		    itemId: 'sdnvnet'
+		},
+		{
+		    xtype: 'pveSDNSubnetView',
+		    groups: ['sdn'],
+		    title: gettext('Subnets'),
+		    hidden: true,
+		    iconCls: 'fa fa-network-wired',
+		    itemId: 'sdnsubnet'
 		});
 	    }
 
diff --git a/www/manager6/sdn/SubnetEdit.js b/www/manager6/sdn/SubnetEdit.js
new file mode 100644
index 00000000..e165ff73
--- /dev/null
+++ b/www/manager6/sdn/SubnetEdit.js
@@ -0,0 +1,95 @@
+Ext.define('PVE.sdn.SubnetInputPanel', {
+    extend: 'Proxmox.panel.InputPanel',
+    mixins: ['Proxmox.Mixin.CBind'],
+
+    onGetValues: function(values) {
+	let me = this;
+
+	if (me.isCreate) {
+	    values.type = 'subnet';
+	    values.subnet = values.cidr;
+	    delete values.cidr;
+	}
+
+	if (!values.gateway) {
+	    delete values.gateway;
+	}
+	if (!values.snat) {
+	    delete values.snat;
+	}
+
+	return values;
+    },
+
+    items: [
+	{
+	    xtype: 'pmxDisplayEditField',
+	    name: 'cidr',
+	    cbind: {
+		editable: '{isCreate}',
+	    },
+	    flex: 1,
+	    allowBlank: false,
+	    fieldLabel: gettext('Subnet'),
+	},
+	{
+	    xtype: 'textfield',
+	    name: 'gateway',
+	    vtype: 'IP64Address',
+	    fieldLabel: gettext('Gateway'),
+	    allowBlank: true,
+	},
+	{
+	    xtype: 'proxmoxcheckbox',
+	    name: 'snat',
+	    uncheckedValue: 0,
+	    checked: false,
+	    fieldLabel: 'SNAT'
+	},
+    ]
+});
+
+Ext.define('PVE.sdn.SubnetEdit', {
+    extend: 'Proxmox.window.Edit',
+
+    subject: gettext('Subnet'),
+
+    subnet: undefined,
+
+    width: 350,
+
+    initComponent: function() {
+	var me = this;
+
+	me.isCreate = me.subnet === undefined;
+
+	if (me.isCreate) {
+	    me.url = '/api2/extjs/cluster/sdn/subnets';
+	    me.method = 'POST';
+	} else {
+	    me.url = '/api2/extjs/cluster/sdn/subnets/' + me.subnet;
+	    me.method = 'PUT';
+	}
+
+	let ipanel = Ext.create('PVE.sdn.SubnetInputPanel', {
+	    isCreate: me.isCreate,
+	});
+
+	Ext.apply(me, {
+	    items: [
+		ipanel,
+	    ],
+	});
+
+	me.callParent();
+
+	if (!me.isCreate) {
+	    me.load({
+		success: function(response, options) {
+		    let values = response.result.data;
+		    ipanel.setValues(values);
+		},
+	    });
+	}
+    },
+});
diff --git a/www/manager6/sdn/SubnetView.js b/www/manager6/sdn/SubnetView.js
new file mode 100644
index 00000000..e5cc03b7
--- /dev/null
+++ b/www/manager6/sdn/SubnetView.js
@@ -0,0 +1,107 @@
+Ext.define('PVE.sdn.SubnetView', {
+    extend: 'Ext.grid.GridPanel',
+    alias: 'widget.pveSDNSubnetView',
+
+    stateful: true,
+    stateId: 'grid-sdn-subnet',
+
+    initComponent : function() {
+	let me = this;
+
+	let store = new Ext.data.Store({
+	    model: 'pve-sdn-subnet',
+	    proxy: {
+                type: 'proxmox',
+		url: "/api2/json/cluster/sdn/subnets"
+	    },
+	    sorters: {
+		property: 'subnet',
+		order: 'DESC'
+	    }
+	});
+	let reload = () => store.load();
+
+	let sm = Ext.create('Ext.selection.RowModel', {});
+
+        let run_editor = function() {
+	    let rec = sm.getSelection()[0];
+
+	    let win = Ext.create('PVE.sdn.SubnetEdit',{
+		autoShow: true,
+		subnet: rec.data.subnet,
+	    });
+	    win.on('destroy', reload);
+        };
+
+	let edit_btn = new Proxmox.button.Button({
+	    text: gettext('Edit'),
+	    disabled: true,
+	    selModel: sm,
+	    handler: run_editor,
+	});
+
+	let remove_btn = Ext.create('Proxmox.button.StdRemoveButton', {
+	    selModel: sm,
+	    baseurl: '/cluster/sdn/subnets/',
+	    callback: reload
+	});
+
+	Ext.apply(me, {
+	    store: store,
+	    reloadStore: reload,
+	    selModel: sm,
+	    viewConfig: {
+		trackOver: false
+	    },
+	    tbar: [
+		{
+		    text: gettext('Create'),
+		    handler: function() {
+			let win = Ext.create('PVE.sdn.SubnetEdit', {
+			    autoShow: true,
+			    type: 'subnet',
+			});
+			win.on('destroy', reload);
+		    }
+		},
+		remove_btn,
+		edit_btn,
+	    ],
+	    columns: [
+		{
+		    header: 'ID',
+		    flex: 2,
+		    dataIndex: 'cidr'
+		},
+		{
+		    header: gettext('Gateway'),
+		    flex: 1,
+		    dataIndex: 'gateway',
+		},
+		{
+		    header: gettext('Snat'),
+		    flex: 1,
+		    dataIndex: 'snat',
+		}
+	    ],
+	    listeners: {
+		activate: reload,
+		itemdblclick: run_editor
+	    }
+	});
+
+	me.callParent();
+    }
+}, function() {
+
+    Ext.define('pve-sdn-subnet', {
+	extend: 'Ext.data.Model',
+	fields: [
+	    'cidr',
+	    'gateway',
+	    'snat',
+	],
+	idProperty: 'subnet'
+    });
+
+});
-- 
2.20.1




^ permalink raw reply	[flat|nested] 12+ messages in thread

* [pve-devel] [PATCH v5 pve-manager 03/11] add sdn ipams
  2020-09-24  8:40 [pve-devel] [PATCH v5 pve-manager 00/11] sdn: add subnets management Alexandre Derumier
  2020-09-24  8:40 ` [pve-devel] [PATCH v5 pve-manager 01/11] sdn: vnetedit: add subnets && remove ip/mac Alexandre Derumier
  2020-09-24  8:40 ` [pve-devel] [PATCH v5 pve-manager 02/11] add sdn subnets Alexandre Derumier
@ 2020-09-24  8:40 ` Alexandre Derumier
  2020-09-24  8:40 ` [pve-devel] [PATCH v5 pve-manager 04/11] sdn: add PVEIpam Alexandre Derumier
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Alexandre Derumier @ 2020-09-24  8:40 UTC (permalink / raw)
  To: pve-devel

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
---
 www/manager6/Makefile                 |   5 +
 www/manager6/Utils.js                 |  25 +++++
 www/manager6/dc/Config.js             |   8 ++
 www/manager6/form/SDNIpamSelector.js  |  52 ++++++++++
 www/manager6/sdn/IpamView.js          | 131 ++++++++++++++++++++++++++
 www/manager6/sdn/SubnetEdit.js        |   7 ++
 www/manager6/sdn/SubnetView.js        |   7 +-
 www/manager6/sdn/ipams/Base.js        |  73 ++++++++++++++
 www/manager6/sdn/ipams/NetboxEdit.js  |  47 +++++++++
 www/manager6/sdn/ipams/PhpIpamEdit.js |  53 +++++++++++
 10 files changed, 407 insertions(+), 1 deletion(-)
 create mode 100644 www/manager6/form/SDNIpamSelector.js
 create mode 100644 www/manager6/sdn/IpamView.js
 create mode 100644 www/manager6/sdn/ipams/Base.js
 create mode 100644 www/manager6/sdn/ipams/NetboxEdit.js
 create mode 100644 www/manager6/sdn/ipams/PhpIpamEdit.js

diff --git a/www/manager6/Makefile b/www/manager6/Makefile
index 0c940710..3587def0 100644
--- a/www/manager6/Makefile
+++ b/www/manager6/Makefile
@@ -100,6 +100,7 @@ JSSRC= 							\
 	form/QemuBiosSelector.js			\
 	form/SDNControllerSelector.js			\
 	form/SDNZoneSelector.js				\
+	form/SDNIpamSelector.js				\
 	form/ScsiHwSelector.js				\
 	form/SecurityGroupSelector.js			\
 	form/SnapshotSelector.js			\
@@ -213,6 +214,10 @@ JSSRC= 							\
 	sdn/ZoneView.js					\
 	sdn/controllers/Base.js				\
 	sdn/controllers/EvpnEdit.js			\
+        sdn/IpamView.js                                 \
+        sdn/ipams/Base.js                               \
+        sdn/ipams/NetboxEdit.js                         \
+        sdn/ipams/PhpIpamEdit.js                        \
 	sdn/zones/Base.js				\
 	sdn/zones/EvpnEdit.js				\
 	sdn/zones/QinQEdit.js				\
diff --git a/www/manager6/Utils.js b/www/manager6/Utils.js
index bf9ceda9..f8560584 100644
--- a/www/manager6/Utils.js
+++ b/www/manager6/Utils.js
@@ -801,6 +801,23 @@ Ext.define('PVE.Utils', { utilities: {
 	},
     },
 
+    sdnipamSchema: {
+	ipam: {
+	     name: 'ipam',
+	     hideAdd: true
+	},
+	netbox: {
+	    name: 'Netbox',
+	    ipanel: 'NetboxInputPanel',
+	    faIcon: 'th'
+	},
+	phpipam: {
+	    name: 'PhpIpam',
+	    ipanel: 'PhpIpamInputPanel',
+	    faIcon: 'th'
+	},
+    },
+
     format_sdnvnet_type: function(value, md, record) {
 	var schema = PVE.Utils.sdnvnetSchema[value];
 	if (schema) {
@@ -825,6 +842,14 @@ Ext.define('PVE.Utils', { utilities: {
 	return Proxmox.Utils.unknownText;
     },
 
+    format_sdnipam_type: function(value, md, record) {
+	var schema = PVE.Utils.sdnipamSchema[value];
+	if (schema) {
+	    return schema.name;
+	}
+	return Proxmox.Utils.unknownText;
+    },
+
     format_storage_type: function(value, md, record) {
 	if (value === 'rbd') {
 	    value = (!record || record.get('monhost') ? 'rbd' : 'pveceph');
diff --git a/www/manager6/dc/Config.js b/www/manager6/dc/Config.js
index 610b38db..f92bb24b 100644
--- a/www/manager6/dc/Config.js
+++ b/www/manager6/dc/Config.js
@@ -184,6 +184,14 @@ Ext.define('PVE.dc.Config', {
 		    hidden: true,
 		    iconCls: 'fa fa-network-wired',
 		    itemId: 'sdnsubnet'
+		},
+		{
+		    xtype: 'pveSDNIpamView',
+		    groups: ['sdn'],
+		    title: gettext('Ipams'),
+		    hidden: true,
+		    iconCls: 'fa fa-network-wired',
+		    itemId: 'sdnipam'
 		});
 	    }
 
diff --git a/www/manager6/form/SDNIpamSelector.js b/www/manager6/form/SDNIpamSelector.js
new file mode 100644
index 00000000..5520d0fe
--- /dev/null
+++ b/www/manager6/form/SDNIpamSelector.js
@@ -0,0 +1,52 @@
+Ext.define('PVE.form.SDNIpamSelector', {
+    extend: 'Proxmox.form.ComboGrid',
+    alias: ['widget.pveSDNIpamSelector'],
+
+    allowBlank: false,
+    valueField: 'ipam',
+    displayField: 'ipam',
+
+    initComponent: function() {
+	var me = this;
+
+	var store = new Ext.data.Store({
+	    model: 'pve-sdn-ipam',
+            sorters: {
+                property: 'ipam',
+                order: 'DESC'
+            },
+	});
+
+	Ext.apply(me, {
+	    store: store,
+	    autoSelect: false,
+            listConfig: {
+		columns: [
+		    {
+			header: gettext('Ipam'),
+			sortable: true,
+			dataIndex: 'ipam',
+			flex: 1
+		    },
+		]
+	    }
+	});
+
+        me.callParent();
+
+	store.load();
+    }
+
+}, function() {
+
+    Ext.define('pve-sdn-ipam', {
+	extend: 'Ext.data.Model',
+	fields: [ 'ipam' ],
+	proxy: {
+            type: 'proxmox',
+	    url: "/api2/json/cluster/sdn/ipams"
+	},
+	idProperty: 'ipam'
+    });
+
+});
diff --git a/www/manager6/sdn/IpamView.js b/www/manager6/sdn/IpamView.js
new file mode 100644
index 00000000..605f44c7
--- /dev/null
+++ b/www/manager6/sdn/IpamView.js
@@ -0,0 +1,131 @@
+Ext.define('PVE.sdn.IpamView', {
+    extend: 'Ext.grid.GridPanel',
+    alias: ['widget.pveSDNIpamView'],
+
+    stateful: true,
+    stateId: 'grid-sdn-ipam',
+
+    createSDNEditWindow: function(type, sid) {
+	let schema = PVE.Utils.sdnipamSchema[type];
+	if (!schema || !schema.ipanel) {
+	    throw "no editor registered for ipam type: " + type;
+	}
+
+	Ext.create('PVE.sdn.ipams.BaseEdit', {
+	    paneltype: 'PVE.sdn.ipams.' + schema.ipanel,
+	    type: type,
+	    ipam: sid,
+	    autoShow: true,
+	    listeners: {
+		destroy: this.reloadStore
+	    }
+	});
+    },
+
+    initComponent : function() {
+	let me = this;
+
+	let store = new Ext.data.Store({
+	    model: 'pve-sdn-ipam',
+	    proxy: {
+                type: 'proxmox',
+		url: "/api2/json/cluster/sdn/ipams"
+	    },
+	    sorters: {
+		property: 'ipam',
+		order: 'DESC'
+	    },
+	});
+
+	let reload = function() {
+	    store.load();
+	};
+
+	let sm = Ext.create('Ext.selection.RowModel', {});
+
+	let run_editor = function() {
+	    let rec = sm.getSelection()[0];
+	    if (!rec) {
+		return;
+	    }
+	    let type = rec.data.type,
+	        ipam = rec.data.ipam;
+
+	    me.createSDNEditWindow(type, ipam);
+	};
+
+	let edit_btn = new Proxmox.button.Button({
+	    text: gettext('Edit'),
+	    disabled: true,
+	    selModel: sm,
+	    handler: run_editor
+	});
+
+	let remove_btn = Ext.create('Proxmox.button.StdRemoveButton', {
+	    selModel: sm,
+	    baseurl: '/cluster/sdn/ipams/',
+	    callback: reload
+	});
+
+	// else we cannot dynamically generate the add menu handlers
+	let addHandleGenerator = function(type) {
+	    return function() { me.createSDNEditWindow(type); };
+	};
+	let addMenuItems = [], type;
+
+	for (type in PVE.Utils.sdnipamSchema) {
+	    let ipam = PVE.Utils.sdnipamSchema[type];
+	    if (ipam.hideAdd) {
+		continue;
+	    }
+	    addMenuItems.push({
+		text:  PVE.Utils.format_sdnipam_type(type),
+		iconCls: 'fa fa-fw fa-' + ipam.faIcon,
+		handler: addHandleGenerator(type)
+	    });
+	}
+
+	Ext.apply(me, {
+	    store: store,
+	    reloadStore: reload,
+	    selModel: sm,
+	    viewConfig: {
+		trackOver: false
+	    },
+	    tbar: [
+		{
+		    text: gettext('Add'),
+		    menu: new Ext.menu.Menu({
+			items: addMenuItems
+		    })
+		},
+		remove_btn,
+		edit_btn,
+	    ],
+	    columns: [
+		{
+		    header: 'ID',
+		    flex: 2,
+		    dataIndex: 'ipam'
+		},
+		{
+		    header: gettext('Type'),
+		    flex: 1,
+		    dataIndex: 'type',
+		    renderer: PVE.Utils.format_sdnipam_type
+		},
+		{
+		    header: 'url',
+		    flex: 1,
+		    dataIndex: 'url',
+		},
+	    ],
+	    listeners: {
+		activate: reload,
+		itemdblclick: run_editor
+	    }
+	});
+
+	me.callParent();
+    }
+});
diff --git a/www/manager6/sdn/SubnetEdit.js b/www/manager6/sdn/SubnetEdit.js
index e165ff73..c9c6475b 100644
--- a/www/manager6/sdn/SubnetEdit.js
+++ b/www/manager6/sdn/SubnetEdit.js
@@ -46,6 +46,13 @@ Ext.define('PVE.sdn.SubnetInputPanel', {
 	    checked: false,
 	    fieldLabel: 'SNAT'
 	},
+        {
+            xtype: 'pveSDNIpamSelector',
+            fieldLabel: gettext('Ipam'),
+            name: 'ipam',
+            value: '',
+            allowBlank: false,
+        },
     ]
 });
 
diff --git a/www/manager6/sdn/SubnetView.js b/www/manager6/sdn/SubnetView.js
index e5cc03b7..95a468bc 100644
--- a/www/manager6/sdn/SubnetView.js
+++ b/www/manager6/sdn/SubnetView.js
@@ -79,9 +79,14 @@ Ext.define('PVE.sdn.SubnetView', {
 		    dataIndex: 'gateway',
 		},
 		{
-		    header: gettext('Snat'),
+		    header: 'SNAT',
 		    flex: 1,
 		    dataIndex: 'snat',
+		},
+		{
+		    header: 'Ipam',
+		    flex: 1,
+		    dataIndex: 'ipam',
 		}
 	    ],
 	    listeners: {
diff --git a/www/manager6/sdn/ipams/Base.js b/www/manager6/sdn/ipams/Base.js
new file mode 100644
index 00000000..7e0bf49b
--- /dev/null
+++ b/www/manager6/sdn/ipams/Base.js
@@ -0,0 +1,73 @@
+Ext.define('PVE.panel.SDNIpamBase', {
+    extend: 'Proxmox.panel.InputPanel',
+
+    type: '',
+
+    onGetValues: function(values) {
+        var me = this;
+
+        if (me.isCreate) {
+            values.type = me.type;
+        } else {
+            delete values.ipam;
+        }
+
+        return values;
+    },
+
+    initComponent : function() {
+        var me = this;
+
+        me.callParent();
+    }
+});
+
+Ext.define('PVE.sdn.ipams.BaseEdit', {
+    extend: 'Proxmox.window.Edit',
+
+    initComponent : function() {
+	var me = this;
+
+	me.isCreate = !me.ipam;
+
+	if (me.isCreate) {
+	    me.url = '/api2/extjs/cluster/sdn/ipams';
+	    me.method = 'POST';
+	} else {
+	    me.url = '/api2/extjs/cluster/sdn/ipams/' + me.ipam;
+	    me.method = 'PUT';
+	}
+
+	var ipanel = Ext.create(me.paneltype, {
+	    type: me.type,
+	    isCreate: me.isCreate,
+	    ipam: me.ipam
+	});
+
+	Ext.apply(me, {
+            subject: PVE.Utils.format_sdnipam_type(me.type),
+	    isAdd: true,
+	    items: [ ipanel ]
+	});
+
+	me.callParent();
+
+	if (!me.isCreate) {
+	    me.load({
+		success:  function(response, options) {
+		    var values = response.result.data;
+		    var ctypes = values.content || '';
+
+		    values.content = ctypes.split(',');
+
+		    if (values.nodes) {
+			values.nodes = values.nodes.split(',');
+		    }
+		    values.enable = values.disable ? 0 : 1;
+
+		    ipanel.setValues(values);
+		}
+	    });
+	}
+    }
+});
diff --git a/www/manager6/sdn/ipams/NetboxEdit.js b/www/manager6/sdn/ipams/NetboxEdit.js
new file mode 100644
index 00000000..5a0a84c8
--- /dev/null
+++ b/www/manager6/sdn/ipams/NetboxEdit.js
@@ -0,0 +1,47 @@
+Ext.define('PVE.sdn.ipams.NetboxInputPanel', {
+    extend: 'PVE.panel.SDNIpamBase',
+
+    //onlineHelp: 'pvesdn_ipam_plugin_netbox', // FIXME uncomment once doc-gen is updated
+
+    onGetValues: function(values) {
+        var me = this;
+
+        if (me.isCreate) {
+            values.type = me.type;
+        } else {
+            delete values.ipam;
+        }
+
+        return values;
+    },
+
+    initComponent : function() {
+	var me = this;
+
+        me.items = [
+           {
+            xtype: me.isCreate ? 'textfield' : 'displayfield',
+            name: 'ipam',
+            maxLength: 10,
+            value: me.zone || '',
+            fieldLabel: 'ID',
+            allowBlank: false
+          },
+          {
+            xtype: 'textfield',
+            name: 'url',
+            fieldLabel: gettext('Url'),
+            allowBlank: false,
+          },
+          {
+            xtype: 'textfield',
+            name: 'token',
+            fieldLabel: gettext('Token'),
+            allowBlank: false,
+          },
+
+	];
+
+	me.callParent();
+    }
+});
diff --git a/www/manager6/sdn/ipams/PhpIpamEdit.js b/www/manager6/sdn/ipams/PhpIpamEdit.js
new file mode 100644
index 00000000..c8da53a6
--- /dev/null
+++ b/www/manager6/sdn/ipams/PhpIpamEdit.js
@@ -0,0 +1,53 @@
+Ext.define('PVE.sdn.ipams.PhpIpamInputPanel', {
+    extend: 'PVE.panel.SDNIpamBase',
+
+    //onlineHelp: 'pvesdn_ipam_plugin_phpipam', // FIXME uncomment once doc-gen is updated
+
+    onGetValues: function(values) {
+        var me = this;
+
+        if (me.isCreate) {
+            values.type = me.type;
+        } else {
+            delete values.ipam;
+        }
+
+        return values;
+    },
+
+    initComponent : function() {
+	var me = this;
+
+        me.items = [
+           {
+            xtype: me.isCreate ? 'textfield' : 'displayfield',
+            name: 'ipam',
+            maxLength: 10,
+            value: me.zone || '',
+            fieldLabel: 'ID',
+            allowBlank: false
+          },
+          {
+            xtype: 'textfield',
+            name: 'url',
+            fieldLabel: gettext('Url'),
+            allowBlank: false,
+          },
+          {
+            xtype: 'textfield',
+            name: 'token',
+            fieldLabel: gettext('Token'),
+            allowBlank: false,
+          },
+          {
+            xtype: 'textfield',
+            name: 'section',
+            fieldLabel: gettext('Section'),
+            allowBlank: false,
+          },
+
+	];
+
+	me.callParent();
+    }
+});
-- 
2.20.1




^ permalink raw reply	[flat|nested] 12+ messages in thread

* [pve-devel] [PATCH v5 pve-manager 04/11] sdn: add PVEIpam
  2020-09-24  8:40 [pve-devel] [PATCH v5 pve-manager 00/11] sdn: add subnets management Alexandre Derumier
                   ` (2 preceding siblings ...)
  2020-09-24  8:40 ` [pve-devel] [PATCH v5 pve-manager 03/11] add sdn ipams Alexandre Derumier
@ 2020-09-24  8:40 ` Alexandre Derumier
  2020-09-24  8:40 ` [pve-devel] [PATCH v5 pve-manager 05/11] sdn: subnets: ipam is optional Alexandre Derumier
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Alexandre Derumier @ 2020-09-24  8:40 UTC (permalink / raw)
  To: pve-devel

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
---
 www/manager6/Makefile                 |  1 +
 www/manager6/Utils.js                 |  5 ++++
 www/manager6/sdn/ipams/PVEIpamEdit.js | 34 +++++++++++++++++++++++++++
 3 files changed, 40 insertions(+)
 create mode 100644 www/manager6/sdn/ipams/PVEIpamEdit.js

diff --git a/www/manager6/Makefile b/www/manager6/Makefile
index 3587def0..90bf75c7 100644
--- a/www/manager6/Makefile
+++ b/www/manager6/Makefile
@@ -217,6 +217,7 @@ JSSRC= 							\
         sdn/IpamView.js                                 \
         sdn/ipams/Base.js                               \
         sdn/ipams/NetboxEdit.js                         \
+        sdn/ipams/PVEIpamEdit.js                        \
         sdn/ipams/PhpIpamEdit.js                        \
 	sdn/zones/Base.js				\
 	sdn/zones/EvpnEdit.js				\
diff --git a/www/manager6/Utils.js b/www/manager6/Utils.js
index f8560584..20417841 100644
--- a/www/manager6/Utils.js
+++ b/www/manager6/Utils.js
@@ -806,6 +806,11 @@ Ext.define('PVE.Utils', { utilities: {
 	     name: 'ipam',
 	     hideAdd: true
 	},
+	pve: {
+	    name: 'PVE',
+	    ipanel: 'PVEIpamInputPanel',
+	    faIcon: 'th'
+	},
 	netbox: {
 	    name: 'Netbox',
 	    ipanel: 'NetboxInputPanel',
diff --git a/www/manager6/sdn/ipams/PVEIpamEdit.js b/www/manager6/sdn/ipams/PVEIpamEdit.js
new file mode 100644
index 00000000..43d040e0
--- /dev/null
+++ b/www/manager6/sdn/ipams/PVEIpamEdit.js
@@ -0,0 +1,34 @@
+Ext.define('PVE.sdn.ipams.PVEIpamInputPanel', {
+    extend: 'PVE.panel.SDNIpamBase',
+
+    //onlineHelp: 'pvesdn_ipam_plugin_pve', // FIXME uncomment once doc-gen is updated
+
+    onGetValues: function(values) {
+        var me = this;
+
+        if (me.isCreate) {
+            values.type = me.type;
+        } else {
+            delete values.ipam;
+        }
+
+        return values;
+    },
+
+    initComponent : function() {
+	var me = this;
+
+        me.items = [
+           {
+            xtype: me.isCreate ? 'textfield' : 'displayfield',
+            name: 'ipam',
+            maxLength: 10,
+            value: me.zone || '',
+            fieldLabel: 'ID',
+            allowBlank: false
+          },
+	];
+
+	me.callParent();
+    }
+});
-- 
2.20.1




^ permalink raw reply	[flat|nested] 12+ messages in thread

* [pve-devel] [PATCH v5 pve-manager 05/11] sdn: subnets: ipam is optional
  2020-09-24  8:40 [pve-devel] [PATCH v5 pve-manager 00/11] sdn: add subnets management Alexandre Derumier
                   ` (3 preceding siblings ...)
  2020-09-24  8:40 ` [pve-devel] [PATCH v5 pve-manager 04/11] sdn: add PVEIpam Alexandre Derumier
@ 2020-09-24  8:40 ` Alexandre Derumier
  2020-09-24  8:41 ` [pve-devel] [PATCH v5 pve-manager 06/11] add sdn dns Alexandre Derumier
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Alexandre Derumier @ 2020-09-24  8:40 UTC (permalink / raw)
  To: pve-devel

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
---
 www/manager6/sdn/SubnetEdit.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/www/manager6/sdn/SubnetEdit.js b/www/manager6/sdn/SubnetEdit.js
index c9c6475b..2afa1a27 100644
--- a/www/manager6/sdn/SubnetEdit.js
+++ b/www/manager6/sdn/SubnetEdit.js
@@ -51,7 +51,7 @@ Ext.define('PVE.sdn.SubnetInputPanel', {
             fieldLabel: gettext('Ipam'),
             name: 'ipam',
             value: '',
-            allowBlank: false,
+            allowBlank: true,
         },
     ]
 });
-- 
2.20.1




^ permalink raw reply	[flat|nested] 12+ messages in thread

* [pve-devel] [PATCH v5 pve-manager 06/11] add sdn dns
  2020-09-24  8:40 [pve-devel] [PATCH v5 pve-manager 00/11] sdn: add subnets management Alexandre Derumier
                   ` (4 preceding siblings ...)
  2020-09-24  8:40 ` [pve-devel] [PATCH v5 pve-manager 05/11] sdn: subnets: ipam is optional Alexandre Derumier
@ 2020-09-24  8:41 ` Alexandre Derumier
  2020-09-24  8:41 ` [pve-devel] [PATCH v5 pve-manager 07/11] subnets: add dns fields Alexandre Derumier
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Alexandre Derumier @ 2020-09-24  8:41 UTC (permalink / raw)
  To: pve-devel

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
---
 www/manager6/Makefile                |   4 +
 www/manager6/Utils.js                |  20 ++++
 www/manager6/dc/Config.js            |   8 ++
 www/manager6/form/SDNDnsSelector.js  |  52 +++++++++++
 www/manager6/sdn/DnsView.js          | 131 +++++++++++++++++++++++++++
 www/manager6/sdn/dns/Base.js         |  73 +++++++++++++++
 www/manager6/sdn/dns/PowerdnsEdit.js |  52 +++++++++++
 7 files changed, 340 insertions(+)
 create mode 100644 www/manager6/form/SDNDnsSelector.js
 create mode 100644 www/manager6/sdn/DnsView.js
 create mode 100644 www/manager6/sdn/dns/Base.js
 create mode 100644 www/manager6/sdn/dns/PowerdnsEdit.js

diff --git a/www/manager6/Makefile b/www/manager6/Makefile
index 90bf75c7..33cb080f 100644
--- a/www/manager6/Makefile
+++ b/www/manager6/Makefile
@@ -101,6 +101,7 @@ JSSRC= 							\
 	form/SDNControllerSelector.js			\
 	form/SDNZoneSelector.js				\
 	form/SDNIpamSelector.js				\
+	form/SDNDnsSelector.js				\
 	form/ScsiHwSelector.js				\
 	form/SecurityGroupSelector.js			\
 	form/SnapshotSelector.js			\
@@ -219,6 +220,9 @@ JSSRC= 							\
         sdn/ipams/NetboxEdit.js                         \
         sdn/ipams/PVEIpamEdit.js                        \
         sdn/ipams/PhpIpamEdit.js                        \
+        sdn/DnsView.js                                 \
+        sdn/dns/Base.js                               \
+        sdn/dns/PowerdnsEdit.js                         \
 	sdn/zones/Base.js				\
 	sdn/zones/EvpnEdit.js				\
 	sdn/zones/QinQEdit.js				\
diff --git a/www/manager6/Utils.js b/www/manager6/Utils.js
index 20417841..0823510c 100644
--- a/www/manager6/Utils.js
+++ b/www/manager6/Utils.js
@@ -823,6 +823,18 @@ Ext.define('PVE.Utils', { utilities: {
 	},
     },
 
+    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];
 	if (schema) {
@@ -855,6 +867,14 @@ Ext.define('PVE.Utils', { utilities: {
 	return Proxmox.Utils.unknownText;
     },
 
+    format_sdndns_type: function(value, md, record) {
+	var schema = PVE.Utils.sdndnsSchema[value];
+	if (schema) {
+	    return schema.name;
+	}
+	return Proxmox.Utils.unknownText;
+    },
+
     format_storage_type: function(value, md, record) {
 	if (value === 'rbd') {
 	    value = (!record || record.get('monhost') ? 'rbd' : 'pveceph');
diff --git a/www/manager6/dc/Config.js b/www/manager6/dc/Config.js
index f92bb24b..d525c93d 100644
--- a/www/manager6/dc/Config.js
+++ b/www/manager6/dc/Config.js
@@ -192,6 +192,14 @@ Ext.define('PVE.dc.Config', {
 		    hidden: true,
 		    iconCls: 'fa fa-network-wired',
 		    itemId: 'sdnipam'
+		},
+		{
+		    xtype: 'pveSDNDnsView',
+		    groups: ['sdn'],
+		    title: gettext('Dns'),
+		    hidden: true,
+		    iconCls: 'fa fa-network-wired',
+		    itemId: 'sdndns'
 		});
 	    }
 
diff --git a/www/manager6/form/SDNDnsSelector.js b/www/manager6/form/SDNDnsSelector.js
new file mode 100644
index 00000000..7abb1f01
--- /dev/null
+++ b/www/manager6/form/SDNDnsSelector.js
@@ -0,0 +1,52 @@
+Ext.define('PVE.form.SDNDnsSelector', {
+    extend: 'Proxmox.form.ComboGrid',
+    alias: ['widget.pveSDNDnsSelector'],
+
+    allowBlank: false,
+    valueField: 'dns',
+    displayField: 'dns',
+
+    initComponent: function() {
+	var me = this;
+
+	var store = new Ext.data.Store({
+	    model: 'pve-sdn-dns',
+            sorters: {
+                property: 'dns',
+                order: 'DESC'
+            },
+	});
+
+	Ext.apply(me, {
+	    store: store,
+	    autoSelect: false,
+            listConfig: {
+		columns: [
+		    {
+			header: gettext('dns'),
+			sortable: true,
+			dataIndex: 'dns',
+			flex: 1
+		    },
+		]
+	    }
+	});
+
+        me.callParent();
+
+	store.load();
+    }
+
+}, function() {
+
+    Ext.define('pve-sdn-dns', {
+	extend: 'Ext.data.Model',
+	fields: [ 'dns' ],
+	proxy: {
+            type: 'proxmox',
+	    url: "/api2/json/cluster/sdn/dns"
+	},
+	idProperty: 'dns'
+    });
+
+});
diff --git a/www/manager6/sdn/DnsView.js b/www/manager6/sdn/DnsView.js
new file mode 100644
index 00000000..6d47e38f
--- /dev/null
+++ b/www/manager6/sdn/DnsView.js
@@ -0,0 +1,131 @@
+Ext.define('PVE.sdn.DnsView', {
+    extend: 'Ext.grid.GridPanel',
+    alias: ['widget.pveSDNDnsView'],
+
+    stateful: true,
+    stateId: 'grid-sdn-dns',
+
+    createSDNEditWindow: function(type, sid) {
+	let schema = PVE.Utils.sdndnsSchema[type];
+	if (!schema || !schema.ipanel) {
+	    throw "no editor registered for dns type: " + type;
+	}
+
+	Ext.create('PVE.sdn.dns.BaseEdit', {
+	    paneltype: 'PVE.sdn.dns.' + schema.ipanel,
+	    type: type,
+	    dns: sid,
+	    autoShow: true,
+	    listeners: {
+		destroy: this.reloadStore
+	    }
+	});
+    },
+
+    initComponent : function() {
+	let me = this;
+
+	let store = new Ext.data.Store({
+	    model: 'pve-sdn-dns',
+	    proxy: {
+                type: 'proxmox',
+		url: "/api2/json/cluster/sdn/dns"
+	    },
+	    sorters: {
+		property: 'dns',
+		order: 'DESC'
+	    },
+	});
+
+	let reload = function() {
+	    store.load();
+	};
+
+	let sm = Ext.create('Ext.selection.RowModel', {});
+
+	let run_editor = function() {
+	    let rec = sm.getSelection()[0];
+	    if (!rec) {
+		return;
+	    }
+	    let type = rec.data.type,
+	        dns = rec.data.dns;
+
+	    me.createSDNEditWindow(type, dns);
+	};
+
+	let edit_btn = new Proxmox.button.Button({
+	    text: gettext('Edit'),
+	    disabled: true,
+	    selModel: sm,
+	    handler: run_editor
+	});
+
+	let remove_btn = Ext.create('Proxmox.button.StdRemoveButton', {
+	    selModel: sm,
+	    baseurl: '/cluster/sdn/dns/',
+	    callback: reload
+	});
+
+	// else we cannot dynamically generate the add menu handlers
+	let addHandleGenerator = function(type) {
+	    return function() { me.createSDNEditWindow(type); };
+	};
+	let addMenuItems = [], type;
+
+	for (type in PVE.Utils.sdndnsSchema) {
+	    let dns = PVE.Utils.sdndnsSchema[type];
+	    if (dns.hideAdd) {
+		continue;
+	    }
+	    addMenuItems.push({
+		text:  PVE.Utils.format_sdndns_type(type),
+		iconCls: 'fa fa-fw fa-' + dns.faIcon,
+		handler: addHandleGenerator(type)
+	    });
+	}
+
+	Ext.apply(me, {
+	    store: store,
+	    reloadStore: reload,
+	    selModel: sm,
+	    viewConfig: {
+		trackOver: false
+	    },
+	    tbar: [
+		{
+		    text: gettext('Add'),
+		    menu: new Ext.menu.Menu({
+			items: addMenuItems
+		    })
+		},
+		remove_btn,
+		edit_btn,
+	    ],
+	    columns: [
+		{
+		    header: 'ID',
+		    flex: 2,
+		    dataIndex: 'dns'
+		},
+		{
+		    header: gettext('Type'),
+		    flex: 1,
+		    dataIndex: 'type',
+		    renderer: PVE.Utils.format_sdndns_type
+		},
+		{
+		    header: 'url',
+		    flex: 1,
+		    dataIndex: 'url',
+		},
+	    ],
+	    listeners: {
+		activate: reload,
+		itemdblclick: run_editor
+	    }
+	});
+
+	me.callParent();
+    }
+});
diff --git a/www/manager6/sdn/dns/Base.js b/www/manager6/sdn/dns/Base.js
new file mode 100644
index 00000000..d3a3720b
--- /dev/null
+++ b/www/manager6/sdn/dns/Base.js
@@ -0,0 +1,73 @@
+Ext.define('PVE.panel.SDNDnsBase', {
+    extend: 'Proxmox.panel.InputPanel',
+
+    type: '',
+
+    onGetValues: function(values) {
+        var me = this;
+
+        if (me.isCreate) {
+            values.type = me.type;
+        } else {
+            delete values.dns;
+        }
+
+        return values;
+    },
+
+    initComponent : function() {
+        var me = this;
+
+        me.callParent();
+    }
+});
+
+Ext.define('PVE.sdn.dns.BaseEdit', {
+    extend: 'Proxmox.window.Edit',
+
+    initComponent : function() {
+	var me = this;
+
+	me.isCreate = !me.dns;
+
+	if (me.isCreate) {
+	    me.url = '/api2/extjs/cluster/sdn/dns';
+	    me.method = 'POST';
+	} else {
+	    me.url = '/api2/extjs/cluster/sdn/dns/' + me.dns;
+	    me.method = 'PUT';
+	}
+
+	var ipanel = Ext.create(me.paneltype, {
+	    type: me.type,
+	    isCreate: me.isCreate,
+	    dns: me.dns
+	});
+
+	Ext.apply(me, {
+            subject: PVE.Utils.format_sdndns_type(me.type),
+	    isAdd: true,
+	    items: [ ipanel ]
+	});
+
+	me.callParent();
+
+	if (!me.isCreate) {
+	    me.load({
+		success:  function(response, options) {
+		    var values = response.result.data;
+		    var ctypes = values.content || '';
+
+		    values.content = ctypes.split(',');
+
+		    if (values.nodes) {
+			values.nodes = values.nodes.split(',');
+		    }
+		    values.enable = values.disable ? 0 : 1;
+
+		    ipanel.setValues(values);
+		}
+	    });
+	}
+    }
+});
diff --git a/www/manager6/sdn/dns/PowerdnsEdit.js b/www/manager6/sdn/dns/PowerdnsEdit.js
new file mode 100644
index 00000000..5aa289fa
--- /dev/null
+++ b/www/manager6/sdn/dns/PowerdnsEdit.js
@@ -0,0 +1,52 @@
+Ext.define('PVE.sdn.dns.PowerdnsInputPanel', {
+    extend: 'PVE.panel.SDNDnsBase',
+
+    //onlineHelp: 'pvesdn_dns_plugin_pve', // FIXME uncomment once doc-gen is updated
+
+    onGetValues: function(values) {
+        var me = this;
+
+        if (me.isCreate) {
+            values.type = me.type;
+        } else {
+            delete values.dns;
+        }
+
+        return values;
+    },
+
+    initComponent : function() {
+	var me = this;
+
+        me.items = [
+           {
+            xtype: me.isCreate ? 'textfield' : 'displayfield',
+            name: 'dns',
+            maxLength: 10,
+            value: me.dns || '',
+            fieldLabel: 'ID',
+            allowBlank: false
+          },
+          {
+            xtype: 'textfield',
+            name: 'url',
+            fieldLabel: 'url',
+            allowBlank: false,
+          },
+          {
+            xtype: 'textfield',
+            name: 'key',
+            fieldLabel: gettext('api key'),
+            allowBlank: false,
+          },
+          {
+            xtype: 'proxmoxintegerfield',
+            name: 'ttl',
+            fieldLabel: 'ttl',
+            allowBlank: true
+          },
+	];
+
+	me.callParent();
+    }
+});
-- 
2.20.1




^ permalink raw reply	[flat|nested] 12+ messages in thread

* [pve-devel] [PATCH v5 pve-manager 07/11] subnets: add dns fields
  2020-09-24  8:40 [pve-devel] [PATCH v5 pve-manager 00/11] sdn: add subnets management Alexandre Derumier
                   ` (5 preceding siblings ...)
  2020-09-24  8:41 ` [pve-devel] [PATCH v5 pve-manager 06/11] add sdn dns Alexandre Derumier
@ 2020-09-24  8:41 ` Alexandre Derumier
  2020-09-24  8:41 ` [pve-devel] [PATCH v5 pve-manager 08/11] add vnet option to subnets and remove subnets list from vnet Alexandre Derumier
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Alexandre Derumier @ 2020-09-24  8:41 UTC (permalink / raw)
  To: pve-devel

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
---
 www/manager6/sdn/SubnetEdit.js | 35 ++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/www/manager6/sdn/SubnetEdit.js b/www/manager6/sdn/SubnetEdit.js
index 2afa1a27..ac9a40ea 100644
--- a/www/manager6/sdn/SubnetEdit.js
+++ b/www/manager6/sdn/SubnetEdit.js
@@ -53,6 +53,41 @@ Ext.define('PVE.sdn.SubnetInputPanel', {
             value: '',
             allowBlank: true,
         },
+        {
+            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
+	},
     ]
 });
 
-- 
2.20.1




^ permalink raw reply	[flat|nested] 12+ messages in thread

* [pve-devel] [PATCH v5 pve-manager 08/11] add vnet option to subnets and remove subnets list from vnet
  2020-09-24  8:40 [pve-devel] [PATCH v5 pve-manager 00/11] sdn: add subnets management Alexandre Derumier
                   ` (6 preceding siblings ...)
  2020-09-24  8:41 ` [pve-devel] [PATCH v5 pve-manager 07/11] subnets: add dns fields Alexandre Derumier
@ 2020-09-24  8:41 ` Alexandre Derumier
  2020-09-24  8:41 ` [pve-devel] [PATCH v5 pve-manager 09/11] add vnet panel with vnet + subnets split view Alexandre Derumier
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Alexandre Derumier @ 2020-09-24  8:41 UTC (permalink / raw)
  To: pve-devel

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
---
 www/manager6/Makefile                |  1 +
 www/manager6/form/SDNVnetSelector.js | 68 ++++++++++++++++++++++++++++
 www/manager6/sdn/SubnetEdit.js       |  7 +++
 www/manager6/sdn/SubnetView.js       |  5 ++
 www/manager6/sdn/VnetEdit.js         |  8 +---
 www/manager6/sdn/VnetView.js         | 22 +--------
 6 files changed, 83 insertions(+), 28 deletions(-)
 create mode 100644 www/manager6/form/SDNVnetSelector.js

diff --git a/www/manager6/Makefile b/www/manager6/Makefile
index 33cb080f..fca8b6d5 100644
--- a/www/manager6/Makefile
+++ b/www/manager6/Makefile
@@ -100,6 +100,7 @@ JSSRC= 							\
 	form/QemuBiosSelector.js			\
 	form/SDNControllerSelector.js			\
 	form/SDNZoneSelector.js				\
+	form/SDNVnetSelector.js				\
 	form/SDNIpamSelector.js				\
 	form/SDNDnsSelector.js				\
 	form/ScsiHwSelector.js				\
diff --git a/www/manager6/form/SDNVnetSelector.js b/www/manager6/form/SDNVnetSelector.js
new file mode 100644
index 00000000..0f9a6613
--- /dev/null
+++ b/www/manager6/form/SDNVnetSelector.js
@@ -0,0 +1,68 @@
+Ext.define('PVE.form.SDNVnetSelector', {
+    extend: 'Proxmox.form.ComboGrid',
+    alias: ['widget.pveSDNVnetSelector'],
+
+    allowBlank: false,
+    valueField: 'vnet',
+    displayField: 'vnet',
+
+    initComponent: function() {
+	var me = this;
+
+	var store = new Ext.data.Store({
+	    model: 'pve-sdn-vnet',
+            sorters: {
+                property: 'vnet',
+                order: 'DESC'
+            },
+	});
+
+	Ext.apply(me, {
+	    store: store,
+	    autoSelect: false,
+            listConfig: {
+		columns: [
+		    {
+			header: gettext('Vnet'),
+			sortable: true,
+			dataIndex: 'vnet',
+			flex: 1
+		    },
+		    {
+			header: gettext('Alias'),
+			flex: 1,
+			dataIndex: 'alias',
+		    },
+		    {
+			header: gettext('Tag'),
+			flex: 1,
+			dataIndex: 'tag',
+		    }
+		]
+	    }
+	});
+
+        me.callParent();
+
+	store.load();
+    }
+
+}, function() {
+
+    Ext.define('pve-sdn-vnet', {
+	extend: 'Ext.data.Model',
+	fields: [
+	    'alias',
+	    'tag',
+	    'type',
+	    'vnet',
+	    'zone',
+	],
+	proxy: {
+            type: 'proxmox',
+	    url: "/api2/json/cluster/sdn/vnets"
+	},
+	idProperty: 'vnet'
+    });
+
+});
diff --git a/www/manager6/sdn/SubnetEdit.js b/www/manager6/sdn/SubnetEdit.js
index ac9a40ea..8badc34a 100644
--- a/www/manager6/sdn/SubnetEdit.js
+++ b/www/manager6/sdn/SubnetEdit.js
@@ -32,6 +32,13 @@ Ext.define('PVE.sdn.SubnetInputPanel', {
 	    allowBlank: false,
 	    fieldLabel: gettext('Subnet'),
 	},
+        {
+            xtype: 'pveSDNVnetSelector',
+            fieldLabel: gettext('Vnet'),
+            name: 'vnet',
+            value: '',
+            allowBlank: true,
+        },
 	{
 	    xtype: 'textfield',
 	    name: 'gateway',
diff --git a/www/manager6/sdn/SubnetView.js b/www/manager6/sdn/SubnetView.js
index 95a468bc..012d127b 100644
--- a/www/manager6/sdn/SubnetView.js
+++ b/www/manager6/sdn/SubnetView.js
@@ -73,6 +73,11 @@ Ext.define('PVE.sdn.SubnetView', {
 		    flex: 2,
 		    dataIndex: 'cidr'
 		},
+		{
+		    header: gettext('Vnet'),
+		    flex: 1,
+		    dataIndex: 'vnet',
+		},
 		{
 		    header: gettext('Gateway'),
 		    flex: 1,
diff --git a/www/manager6/sdn/VnetEdit.js b/www/manager6/sdn/VnetEdit.js
index 09e2f3bf..03e539ab 100644
--- a/www/manager6/sdn/VnetEdit.js
+++ b/www/manager6/sdn/VnetEdit.js
@@ -61,13 +61,7 @@ Ext.define('PVE.sdn.VnetInputPanel', {
 	    uncheckedValue: 0,
 	    checked: false,
 	    fieldLabel: gettext('VLAN Aware')
-	},
-	{
-	    xtype: 'textfield',
-	    name: 'subnets',
-	    fieldLabel: gettext('Subnets'),
-	    allowBlank: true,
-	},
+	}
     ]
 });
 
diff --git a/www/manager6/sdn/VnetView.js b/www/manager6/sdn/VnetView.js
index 604a2d1a..eefb6e42 100644
--- a/www/manager6/sdn/VnetView.js
+++ b/www/manager6/sdn/VnetView.js
@@ -96,12 +96,7 @@ Ext.define('PVE.sdn.VnetView', {
 		    header: gettext('VLAN Aware'),
 		    flex: 1,
 		    dataIndex: 'vlanaware',
-		},
-		{
-		    header: 'Subnets',
-		    flex: 1,
-		    dataIndex: 'subnets',
-		},
+		}
 	    ],
 	    listeners: {
 		activate: reload,
@@ -111,19 +106,4 @@ Ext.define('PVE.sdn.VnetView', {
 
 	me.callParent();
     }
-}, function() {
-
-    Ext.define('pve-sdn-vnet', {
-	extend: 'Ext.data.Model',
-	fields: [
-	    'alias',
-	    'subnets',
-	    'tag',
-	    'type',
-	    'vnet',
-	    'zone',
-	],
-	idProperty: 'vnet'
-    });
-
 });
-- 
2.20.1




^ permalink raw reply	[flat|nested] 12+ messages in thread

* [pve-devel] [PATCH v5 pve-manager 09/11] add vnet panel with vnet + subnets split view
  2020-09-24  8:40 [pve-devel] [PATCH v5 pve-manager 00/11] sdn: add subnets management Alexandre Derumier
                   ` (7 preceding siblings ...)
  2020-09-24  8:41 ` [pve-devel] [PATCH v5 pve-manager 08/11] add vnet option to subnets and remove subnets list from vnet Alexandre Derumier
@ 2020-09-24  8:41 ` Alexandre Derumier
  2020-09-24  8:41 ` [pve-devel] [PATCH v5 pve-manager 10/11] subnets: move ipam/dns in advanced section, and use "pve" as default ipam Alexandre Derumier
  2020-09-24  8:41 ` [pve-devel] [PATCH v5 pve-manager 11/11] sdn: add options panel + move controller/ipam/dns view Alexandre Derumier
  10 siblings, 0 replies; 12+ messages in thread
From: Alexandre Derumier @ 2020-09-24  8:41 UTC (permalink / raw)
  To: pve-devel

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
---
 www/manager6/Makefile          |  5 +--
 www/manager6/dc/Config.js      | 10 +-----
 www/manager6/sdn/SubnetEdit.js | 13 +++----
 www/manager6/sdn/SubnetView.js | 62 ++++++++++++++++++++++------------
 www/manager6/sdn/VnetPanel.js  | 39 +++++++++++++++++++++
 www/manager6/sdn/VnetView.js   | 14 ++++++--
 6 files changed, 100 insertions(+), 43 deletions(-)
 create mode 100644 www/manager6/sdn/VnetPanel.js

diff --git a/www/manager6/Makefile b/www/manager6/Makefile
index fca8b6d5..50624c3d 100644
--- a/www/manager6/Makefile
+++ b/www/manager6/Makefile
@@ -210,8 +210,9 @@ JSSRC= 							\
 	sdn/StatusView.js				\
 	sdn/VnetEdit.js					\
 	sdn/VnetView.js					\
-	sdn/SubnetEdit.js					\
-	sdn/SubnetView.js					\
+	sdn/VnetPanel.js				\
+	sdn/SubnetEdit.js				\
+	sdn/SubnetView.js				\
 	sdn/ZoneContentView.js				\
 	sdn/ZoneView.js					\
 	sdn/controllers/Base.js				\
diff --git a/www/manager6/dc/Config.js b/www/manager6/dc/Config.js
index d525c93d..97b37e6d 100644
--- a/www/manager6/dc/Config.js
+++ b/www/manager6/dc/Config.js
@@ -170,21 +170,13 @@ Ext.define('PVE.dc.Config', {
 		    itemId: 'sdnzone'
 		},
 		{
-		    xtype: 'pveSDNVnetView',
+		    xtype: 'pveSDNVnet',
 		    groups: ['sdn'],
 		    title: gettext('Vnets'),
 		    hidden: true,
 		    iconCls: 'fa fa-network-wired',
 		    itemId: 'sdnvnet'
 		},
-		{
-		    xtype: 'pveSDNSubnetView',
-		    groups: ['sdn'],
-		    title: gettext('Subnets'),
-		    hidden: true,
-		    iconCls: 'fa fa-network-wired',
-		    itemId: 'sdnsubnet'
-		},
 		{
 		    xtype: 'pveSDNIpamView',
 		    groups: ['sdn'],
diff --git a/www/manager6/sdn/SubnetEdit.js b/www/manager6/sdn/SubnetEdit.js
index 8badc34a..d8c61dd6 100644
--- a/www/manager6/sdn/SubnetEdit.js
+++ b/www/manager6/sdn/SubnetEdit.js
@@ -32,13 +32,6 @@ Ext.define('PVE.sdn.SubnetInputPanel', {
 	    allowBlank: false,
 	    fieldLabel: gettext('Subnet'),
 	},
-        {
-            xtype: 'pveSDNVnetSelector',
-            fieldLabel: gettext('Vnet'),
-            name: 'vnet',
-            value: '',
-            allowBlank: true,
-        },
 	{
 	    xtype: 'textfield',
 	    name: 'gateway',
@@ -107,16 +100,18 @@ Ext.define('PVE.sdn.SubnetEdit', {
 
     width: 350,
 
+    base_url: undefined,
+
     initComponent: function() {
 	var me = this;
 
 	me.isCreate = me.subnet === undefined;
 
 	if (me.isCreate) {
-	    me.url = '/api2/extjs/cluster/sdn/subnets';
+	    me.url = me.base_url;
 	    me.method = 'POST';
 	} else {
-	    me.url = '/api2/extjs/cluster/sdn/subnets/' + me.subnet;
+	    me.url = me.base_url + '/' + me.subnet;
 	    me.method = 'PUT';
 	}
 
diff --git a/www/manager6/sdn/SubnetView.js b/www/manager6/sdn/SubnetView.js
index 012d127b..96240617 100644
--- a/www/manager6/sdn/SubnetView.js
+++ b/www/manager6/sdn/SubnetView.js
@@ -5,21 +5,38 @@ Ext.define('PVE.sdn.SubnetView', {
     stateful: true,
     stateId: 'grid-sdn-subnet',
 
+    base_url: undefined,
+
+    remove_btn: undefined,
+
+    setBaseUrl: function(url) {
+        var me = this;
+
+        me.base_url = url;
+
+        if (url === undefined) {
+            me.store.removeAll();
+        } else {
+            me.remove_btn.baseurl = url + '/';
+            me.store.setProxy({
+                type: 'proxmox',
+                url: '/api2/json/' + url
+            });
+
+            me.store.load();
+        }
+    },
+
     initComponent : function() {
 	let me = this;
 
-	let store = new Ext.data.Store({
-	    model: 'pve-sdn-subnet',
-	    proxy: {
-                type: 'proxmox',
-		url: "/api2/json/cluster/sdn/subnets"
-	    },
-	    sorters: {
-		property: 'subnet',
-		order: 'DESC'
-	    }
-	});
-	let reload = () => store.load();
+        var store = new Ext.data.Store({
+            model: 'pve-sdn-subnet'
+        });
+
+        var reload = function() {
+            store.load();
+        };
 
 	let sm = Ext.create('Ext.selection.RowModel', {});
 
@@ -29,6 +46,7 @@ Ext.define('PVE.sdn.SubnetView', {
 	    let win = Ext.create('PVE.sdn.SubnetEdit',{
 		autoShow: true,
 		subnet: rec.data.subnet,
+		base_url: me.base_url,
 	    });
 	    win.on('destroy', reload);
         };
@@ -40,10 +58,12 @@ Ext.define('PVE.sdn.SubnetView', {
 	    handler: run_editor,
 	});
 
-	let remove_btn = Ext.create('Proxmox.button.StdRemoveButton', {
+	me.remove_btn = Ext.create('Proxmox.button.StdRemoveButton', {
 	    selModel: sm,
-	    baseurl: '/cluster/sdn/subnets/',
-	    callback: reload
+	    baseurl: me.base_url + '/',
+            callback: function() {
+                reload();
+            },
 	});
 
 	Ext.apply(me, {
@@ -59,12 +79,13 @@ Ext.define('PVE.sdn.SubnetView', {
 		    handler: function() {
 			let win = Ext.create('PVE.sdn.SubnetEdit', {
 			    autoShow: true,
+			    base_url: me.base_url,
 			    type: 'subnet',
 			});
 			win.on('destroy', reload);
 		    }
 		},
-		remove_btn,
+		me.remove_btn,
 		edit_btn,
 	    ],
 	    columns: [
@@ -73,11 +94,6 @@ Ext.define('PVE.sdn.SubnetView', {
 		    flex: 2,
 		    dataIndex: 'cidr'
 		},
-		{
-		    header: gettext('Vnet'),
-		    flex: 1,
-		    dataIndex: 'vnet',
-		},
 		{
 		    header: gettext('Gateway'),
 		    flex: 1,
@@ -101,6 +117,10 @@ Ext.define('PVE.sdn.SubnetView', {
 	});
 
 	me.callParent();
+
+        if (me.base_url) {
+            me.setBaseUrl(me.base_url); // load
+        }
     }
 }, function() {
 
diff --git a/www/manager6/sdn/VnetPanel.js b/www/manager6/sdn/VnetPanel.js
new file mode 100644
index 00000000..4b1cbc6e
--- /dev/null
+++ b/www/manager6/sdn/VnetPanel.js
@@ -0,0 +1,39 @@
+Ext.define('PVE.sdn.Vnet', {
+    extend: 'Ext.panel.Panel',
+    alias: 'widget.pveSDNVnet',
+
+    title: 'Vnet',
+
+    onlineHelp: 'pvesdn_config_vnet',
+
+    initComponent: function() {
+	var me = this;
+
+	var subnetview_panel = Ext.createWidget('pveSDNSubnetView', {
+            title: gettext('Subnets'),
+	    region: 'center',
+	    border: false
+	});
+
+	var vnetview_panel = Ext.createWidget('pveSDNVnetView', {
+            title: 'Vnets',
+	    region: 'west',
+	    subnetview_panel: subnetview_panel,
+	    width: '50%',
+	    border: false,
+	    split: true
+	});
+
+	Ext.apply(me, {
+            layout: 'border',
+            items: [ vnetview_panel, subnetview_panel ],
+	    listeners: {
+		show: function() {
+		    subnetview_panel.fireEvent('show', subnetview_panel);
+		}
+	    }
+	});
+
+	me.callParent();
+    }
+});
diff --git a/www/manager6/sdn/VnetView.js b/www/manager6/sdn/VnetView.js
index eefb6e42..e3d86c9a 100644
--- a/www/manager6/sdn/VnetView.js
+++ b/www/manager6/sdn/VnetView.js
@@ -7,6 +7,8 @@ Ext.define('PVE.sdn.VnetView', {
     stateful: true,
     stateId: 'grid-sdn-vnet',
 
+    subnetview_panel: undefined,
+
     initComponent : function() {
 	let me = this;
 
@@ -100,10 +102,18 @@ Ext.define('PVE.sdn.VnetView', {
 	    ],
 	    listeners: {
 		activate: reload,
-		itemdblclick: run_editor
+		itemdblclick: run_editor,
+                show: reload,
+                select: function(sm, rec) {
+                    var url = '/cluster/sdn/vnets/' + rec.data.vnet + '/subnets';
+                    me.subnetview_panel.setBaseUrl(url);
+                },
+                deselect: function() {
+                    me.subnetview_panel.setBaseUrl(undefined);
+                },
 	    }
 	});
-
+	store.load();
 	me.callParent();
     }
 });
-- 
2.20.1




^ permalink raw reply	[flat|nested] 12+ messages in thread

* [pve-devel] [PATCH v5 pve-manager 10/11] subnets: move ipam/dns in advanced section, and use "pve" as default ipam
  2020-09-24  8:40 [pve-devel] [PATCH v5 pve-manager 00/11] sdn: add subnets management Alexandre Derumier
                   ` (8 preceding siblings ...)
  2020-09-24  8:41 ` [pve-devel] [PATCH v5 pve-manager 09/11] add vnet panel with vnet + subnets split view Alexandre Derumier
@ 2020-09-24  8:41 ` Alexandre Derumier
  2020-09-24  8:41 ` [pve-devel] [PATCH v5 pve-manager 11/11] sdn: add options panel + move controller/ipam/dns view Alexandre Derumier
  10 siblings, 0 replies; 12+ messages in thread
From: Alexandre Derumier @ 2020-09-24  8:41 UTC (permalink / raw)
  To: pve-devel

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
---
 www/manager6/Utils.js          | 3 ++-
 www/manager6/sdn/SubnetEdit.js | 6 ++++--
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/www/manager6/Utils.js b/www/manager6/Utils.js
index 0823510c..0d6f4a96 100644
--- a/www/manager6/Utils.js
+++ b/www/manager6/Utils.js
@@ -809,7 +809,8 @@ Ext.define('PVE.Utils', { utilities: {
 	pve: {
 	    name: 'PVE',
 	    ipanel: 'PVEIpamInputPanel',
-	    faIcon: 'th'
+	    faIcon: 'th',
+	    hideAdd: true
 	},
 	netbox: {
 	    name: 'Netbox',
diff --git a/www/manager6/sdn/SubnetEdit.js b/www/manager6/sdn/SubnetEdit.js
index d8c61dd6..653c8ae5 100644
--- a/www/manager6/sdn/SubnetEdit.js
+++ b/www/manager6/sdn/SubnetEdit.js
@@ -46,12 +46,14 @@ Ext.define('PVE.sdn.SubnetInputPanel', {
 	    checked: false,
 	    fieldLabel: 'SNAT'
 	},
+    ],
+    advancedItems: [
         {
             xtype: 'pveSDNIpamSelector',
             fieldLabel: gettext('Ipam'),
             name: 'ipam',
-            value: '',
-            allowBlank: true,
+            value: 'pve',
+            allowBlank: false,
         },
         {
             xtype: 'pveSDNDnsSelector',
-- 
2.20.1




^ permalink raw reply	[flat|nested] 12+ messages in thread

* [pve-devel] [PATCH v5 pve-manager 11/11] sdn: add options panel + move controller/ipam/dns view
  2020-09-24  8:40 [pve-devel] [PATCH v5 pve-manager 00/11] sdn: add subnets management Alexandre Derumier
                   ` (9 preceding siblings ...)
  2020-09-24  8:41 ` [pve-devel] [PATCH v5 pve-manager 10/11] subnets: move ipam/dns in advanced section, and use "pve" as default ipam Alexandre Derumier
@ 2020-09-24  8:41 ` Alexandre Derumier
  10 siblings, 0 replies; 12+ messages in thread
From: Alexandre Derumier @ 2020-09-24  8:41 UTC (permalink / raw)
  To: pve-devel

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
---
 www/manager6/Makefile              |  1 +
 www/manager6/dc/Config.js          | 24 +++--------------
 www/manager6/sdn/ControllerView.js |  1 +
 www/manager6/sdn/DnsView.js        |  1 +
 www/manager6/sdn/IpamView.js       |  2 ++
 www/manager6/sdn/OptionsPanel.js   | 41 ++++++++++++++++++++++++++++++
 6 files changed, 50 insertions(+), 20 deletions(-)
 create mode 100644 www/manager6/sdn/OptionsPanel.js

diff --git a/www/manager6/Makefile b/www/manager6/Makefile
index 50624c3d..17a5ba2d 100644
--- a/www/manager6/Makefile
+++ b/www/manager6/Makefile
@@ -215,6 +215,7 @@ JSSRC= 							\
 	sdn/SubnetView.js				\
 	sdn/ZoneContentView.js				\
 	sdn/ZoneView.js					\
+        sdn/OptionsPanel.js				\
 	sdn/controllers/Base.js				\
 	sdn/controllers/EvpnEdit.js			\
         sdn/IpamView.js                                 \
diff --git a/www/manager6/dc/Config.js b/www/manager6/dc/Config.js
index 97b37e6d..e2e84c9c 100644
--- a/www/manager6/dc/Config.js
+++ b/www/manager6/dc/Config.js
@@ -153,14 +153,6 @@ Ext.define('PVE.dc.Config', {
 		    itemId: 'sdn',
 		    expandedOnInit: true
 		},
-		{
-		    xtype: 'pveSDNControllerView',
-		    groups: ['sdn'],
-		    title: gettext('Controllers'),
-		    hidden: true,
-		    iconCls: 'fa fa-crosshairs',
-		    itemId: 'sdncontroller'
-		},
 		{
 		    xtype: 'pveSDNZoneView',
 		    groups: ['sdn'],
@@ -178,20 +170,12 @@ Ext.define('PVE.dc.Config', {
 		    itemId: 'sdnvnet'
 		},
 		{
-		    xtype: 'pveSDNIpamView',
-		    groups: ['sdn'],
-		    title: gettext('Ipams'),
-		    hidden: true,
-		    iconCls: 'fa fa-network-wired',
-		    itemId: 'sdnipam'
-		},
-		{
-		    xtype: 'pveSDNDnsView',
+		    xtype: 'pveSDNOptions',
 		    groups: ['sdn'],
-		    title: gettext('Dns'),
+		    title: gettext('Options'),
 		    hidden: true,
-		    iconCls: 'fa fa-network-wired',
-		    itemId: 'sdndns'
+		    iconCls: 'fa fa-gear',
+		    itemId: 'sdnoptions'
 		});
 	    }
 
diff --git a/www/manager6/sdn/ControllerView.js b/www/manager6/sdn/ControllerView.js
index 0d991af3..4fdcdecd 100644
--- a/www/manager6/sdn/ControllerView.js
+++ b/www/manager6/sdn/ControllerView.js
@@ -125,6 +125,7 @@ Ext.define('PVE.sdn.ControllerView', {
 	    }
 	});
 
+	store.load();
 	me.callParent();
     }
 });
diff --git a/www/manager6/sdn/DnsView.js b/www/manager6/sdn/DnsView.js
index 6d47e38f..2459327e 100644
--- a/www/manager6/sdn/DnsView.js
+++ b/www/manager6/sdn/DnsView.js
@@ -126,6 +126,7 @@ Ext.define('PVE.sdn.DnsView', {
 	    }
 	});
 
+	store.load();
 	me.callParent();
     }
 });
diff --git a/www/manager6/sdn/IpamView.js b/www/manager6/sdn/IpamView.js
index 605f44c7..4635b2ab 100644
--- a/www/manager6/sdn/IpamView.js
+++ b/www/manager6/sdn/IpamView.js
@@ -126,6 +126,8 @@ Ext.define('PVE.sdn.IpamView', {
 	    }
 	});
 
+	store.load();
 	me.callParent();
+
     }
 });
diff --git a/www/manager6/sdn/OptionsPanel.js b/www/manager6/sdn/OptionsPanel.js
new file mode 100644
index 00000000..d9145299
--- /dev/null
+++ b/www/manager6/sdn/OptionsPanel.js
@@ -0,0 +1,41 @@
+Ext.define('PVE.sdn.Options', {
+    extend: 'Ext.panel.Panel',
+    alias: 'widget.pveSDNOptions',
+
+    title: 'Options',
+
+    layout: {
+        type: 'vbox',
+        align: 'stretch'
+    },
+
+//    onlineHelp: 'pvesdn_config_vnet',
+
+   initComponent: function() {
+        var me = this;
+
+        me.items = [
+	{
+            xtype: 'pveSDNControllerView',
+            title: gettext('Controllers'),
+            border: 0,
+            collapsible: true,
+            padding: '0 0 20 0'
+        },
+	{
+            xtype: 'pveSDNIpamView',
+            title: gettext('Ipams'),
+            border: 0,
+            collapsible: true,
+            padding: '0 0 20 0'
+        },{
+            xtype: 'pveSDNDnsView',
+            flex: 1,
+            collapsible: true,
+            title: gettext('Dns'),
+            border: 0,
+        }];
+
+        me.callParent();
+    }
+});
-- 
2.20.1




^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2020-09-24  8:42 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-24  8:40 [pve-devel] [PATCH v5 pve-manager 00/11] sdn: add subnets management Alexandre Derumier
2020-09-24  8:40 ` [pve-devel] [PATCH v5 pve-manager 01/11] sdn: vnetedit: add subnets && remove ip/mac Alexandre Derumier
2020-09-24  8:40 ` [pve-devel] [PATCH v5 pve-manager 02/11] add sdn subnets Alexandre Derumier
2020-09-24  8:40 ` [pve-devel] [PATCH v5 pve-manager 03/11] add sdn ipams Alexandre Derumier
2020-09-24  8:40 ` [pve-devel] [PATCH v5 pve-manager 04/11] sdn: add PVEIpam Alexandre Derumier
2020-09-24  8:40 ` [pve-devel] [PATCH v5 pve-manager 05/11] sdn: subnets: ipam is optional Alexandre Derumier
2020-09-24  8:41 ` [pve-devel] [PATCH v5 pve-manager 06/11] add sdn dns Alexandre Derumier
2020-09-24  8:41 ` [pve-devel] [PATCH v5 pve-manager 07/11] subnets: add dns fields Alexandre Derumier
2020-09-24  8:41 ` [pve-devel] [PATCH v5 pve-manager 08/11] add vnet option to subnets and remove subnets list from vnet Alexandre Derumier
2020-09-24  8:41 ` [pve-devel] [PATCH v5 pve-manager 09/11] add vnet panel with vnet + subnets split view Alexandre Derumier
2020-09-24  8:41 ` [pve-devel] [PATCH v5 pve-manager 10/11] subnets: move ipam/dns in advanced section, and use "pve" as default ipam Alexandre Derumier
2020-09-24  8:41 ` [pve-devel] [PATCH v5 pve-manager 11/11] sdn: add options panel + move controller/ipam/dns view Alexandre Derumier

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