[pve-devel] [PATCH manager] edit/show lxc pending changes in gui

Oguz Bektas o.bektas at proxmox.com
Thu Sep 5 16:46:57 CEST 2019


uses the new /pending and the adapted /config API endpoints
to get pending changes and show them in a PendingObjectGrid

Signed-off-by: Oguz Bektas <o.bektas at proxmox.com>
---
 www/manager6/lxc/DNS.js       | 11 +++++++----
 www/manager6/lxc/Options.js   |  4 ++--
 www/manager6/lxc/Resources.js |  4 ++--
 3 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/www/manager6/lxc/DNS.js b/www/manager6/lxc/DNS.js
index 4eab6b11..89e2c694 100644
--- a/www/manager6/lxc/DNS.js
+++ b/www/manager6/lxc/DNS.js
@@ -93,7 +93,7 @@ Ext.define('PVE.lxc.DNSEdit', {
 
 /*jslint confusion: true */
 Ext.define('PVE.lxc.DNS', {
-    extend: 'Proxmox.grid.ObjectGrid',
+    extend: 'Proxmox.grid.PendingObjectGrid',
     alias: ['widget.pveLxcDNS'],
 
     onlineHelp: 'pct_container_network',
@@ -186,13 +186,13 @@ Ext.define('PVE.lxc.DNS', {
 		win = Ext.create(rowdef.editor, {
 		    pveSelNode: me.pveSelNode,
 		    confid: rec.data.key,
-		    url: '/api2/extjs/' + baseurl
+		    url: '/api2/extjs/nodes/' + nodename + '/lxc/' + vmid + '/config'
 		});
 	    } else {
 		var config = Ext.apply({
 		    pveSelNode: me.pveSelNode,
 		    confid: rec.data.key,
-		    url: '/api2/extjs/' + baseurl
+		    url: '/api2/extjs/nodes/' + nodename + '/lxc/' + vmid + '/config'
 		}, rowdef.editor);
 		win = Ext.createWidget(rowdef.editor.xtype, config);
 		win.load();
@@ -226,12 +226,15 @@ Ext.define('PVE.lxc.DNS', {
 	};
 
 	Ext.apply(me, {
-	    url: "/api2/json/nodes/" + nodename + "/lxc/" + vmid + "/config",
+	    url: "/api2/json/nodes/" + nodename + "/lxc/" + vmid + "/pending",
 	    selModel: sm,
 	    cwidth1: 150,
 	    run_editor: run_editor,
 	    tbar: [ edit_btn ],
 	    rows: rows,
+	    editorConfig: {
+		url: "/api2/extjs/" + baseurl
+	    },
 	    listeners: {
 		itemdblclick: run_editor,
 		selectionchange: set_button_status,
diff --git a/www/manager6/lxc/Options.js b/www/manager6/lxc/Options.js
index 23409938..5e1e0222 100644
--- a/www/manager6/lxc/Options.js
+++ b/www/manager6/lxc/Options.js
@@ -1,6 +1,6 @@
 /*jslint confusion: true */
 Ext.define('PVE.lxc.Options', {
-    extend: 'Proxmox.grid.ObjectGrid',
+    extend: 'Proxmox.grid.PendingObjectGrid',
     alias: ['widget.pveLxcOptions'],
 
     onlineHelp: 'pct_options',
@@ -162,7 +162,7 @@ Ext.define('PVE.lxc.Options', {
 	});
 
 	Ext.apply(me, {
-	    url: "/api2/json/" + baseurl,
+	    url: "/api2/json/nodes/" + nodename + "/lxc/" + vmid + "/pending",
 	    selModel: sm,
 	    interval: 5000,
 	    tbar: [ edit_btn ],
diff --git a/www/manager6/lxc/Resources.js b/www/manager6/lxc/Resources.js
index 501ddf69..8b924a49 100644
--- a/www/manager6/lxc/Resources.js
+++ b/www/manager6/lxc/Resources.js
@@ -1,6 +1,6 @@
 /*jslint confusion: true */
 Ext.define('PVE.lxc.RessourceView', {
-    extend: 'Proxmox.grid.ObjectGrid',
+    extend: 'Proxmox.grid.PendingObjectGrid',
     alias: ['widget.pveLxcRessourceView'],
 
     onlineHelp: 'pct_configuration',
@@ -271,7 +271,7 @@ Ext.define('PVE.lxc.RessourceView', {
 	};
 
 	Ext.apply(me, {
-	    url: '/api2/json/' + baseurl,
+	    url: "/api2/json/nodes/" + nodename + "/lxc/" + vmid + "/pending",
 	    selModel: me.selModel,
 	    interval: 2000,
 	    cwidth1: 170,
-- 
2.20.1




More information about the pve-devel mailing list