[pve-devel] [PATCH manager 3/4] gui: content view: Add checkbox for recursive search

Dominic Jäger d.jaeger at proxmox.com
Thu Apr 2 13:34:13 CEST 2020


Default is no recursion.
This commit depends on "Recursive search for iso and vztmpl" in pve-storage.

Signed-off-by: Dominic Jäger <d.jaeger at proxmox.com>
---
Changes since RFC:
* [0] became obsolte
* This did not exist in RFC

[0] https://pve.proxmox.com/pipermail/pve-devel/2019-December/040886.html

 www/manager6/storage/ContentView.js | 23 +++++++++++++++++++++--
 1 file changed, 21 insertions(+), 2 deletions(-)

diff --git a/www/manager6/storage/ContentView.js b/www/manager6/storage/ContentView.js
index 001efc7f..5c6f1418 100644
--- a/www/manager6/storage/ContentView.js
+++ b/www/manager6/storage/ContentView.js
@@ -379,12 +379,15 @@ Ext.define('PVE.storage.ContentView', {
 	}
 
 	var baseurl = "/nodes/" + nodename + "/storage/" + storage + "/content";
+	me.sp = Ext.state.Manager.getProvider();
+
 	var store = Ext.create('Ext.data.Store',{
 	    model: 'pve-storage-content',
 	    groupField: 'content',
 	    proxy: {
                 type: 'proxmox',
-		url: '/api2/json' + baseurl
+		url: '/api2/json' + baseurl + '?recursive='
+		    + (me.sp.get('recursive-search')|0), // API expects integer
 	    },
 	    sorters: {
 		property: 'volid',
@@ -578,7 +581,23 @@ Ext.define('PVE.storage.ContentView', {
 			    ]);
 			}
 		    }
-		}
+		},
+		{
+		    xtype: 'proxmoxcheckbox',
+		    fieldLabel: gettext('Recursive'),
+		    labelWidth: 65,
+		    name : 'recursive',
+		    checked: false,
+		    listeners: {
+			change: function(box, value) {
+			    me.store.proxy.url = me.store.proxy.url.replace(
+				/recursive=\d/,
+				"recursive=" + (value|0) // API expects integer
+			    );
+			    reload();
+			},
+		    },
+		},
 	    ],
 	    columns: [
 		{
-- 
2.20.1




More information about the pve-devel mailing list