[pve-devel] [PATCH manager v2 3/3] gui: settings: Add recursive search default

Dominic Jäger d.jaeger at proxmox.com
Tue May 19 11:58:18 CEST 2020


Add a radiobox to the settings to control if search should be done recursively
as default or not. Set to no recursion as default.

Signed-off-by: Dominic Jäger <d.jaeger at proxmox.com>
---
v2: Like patch 2/3

 www/manager6/storage/ContentView.js |  6 +++--
 www/manager6/window/Settings.js     | 38 +++++++++++++++++++++++++++++
 2 files changed, 42 insertions(+), 2 deletions(-)

diff --git a/www/manager6/storage/ContentView.js b/www/manager6/storage/ContentView.js
index 526a8dee..d953ba17 100644
--- a/www/manager6/storage/ContentView.js
+++ b/www/manager6/storage/ContentView.js
@@ -380,7 +380,9 @@ Ext.define('PVE.storage.ContentView', {
 
 	var baseurl = "/nodes/" + nodename + "/storage/" + storage + "/content";
 
-	let get_proxy_url = function(recursive = false) {
+	me.sp = Ext.state.Manager.getProvider();
+	let recursiveSetting = me.sp.get('recursive-search');
+	let get_proxy_url = function(recursive = recursiveSetting) {
 	    let url = `/api2/json${baseurl}`;
 	    if (recursive) {
 		url += `?recursive=1`;
@@ -592,7 +594,7 @@ Ext.define('PVE.storage.ContentView', {
 		    fieldLabel: gettext('Recursive'),
 		    labelWidth: 65,
 		    name: 'recursive',
-		    checked: false,
+		    checked: recursiveSetting,
 		    listeners: {
 			change: function(box, newValue) {
 			    me.store.proxy.url = get_proxy_url(newValue);
diff --git a/www/manager6/window/Settings.js b/www/manager6/window/Settings.js
index e3519b1f..16ead5b0 100644
--- a/www/manager6/window/Settings.js
+++ b/www/manager6/window/Settings.js
@@ -41,6 +41,9 @@ Ext.define('PVE.window.Settings', {
 	    if (vncMode !== undefined) {
 		me.lookupReference('noVNCScalingGroup').setValue({ noVNCScalingField: vncMode });
 	    }
+	    var spSearchValue = sp.get('recursive-search');
+	    me.lookupReference('recursiveSearchGroup').setValue({
+		recursiveSearchField: spSearchValue });
 
 	    let summarycolumns = sp.get('summarycolumns', 'auto');
 	    me.lookup('summarycolumns').setValue(summarycolumns);
@@ -428,6 +431,41 @@ Ext.define('PVE.window.Settings', {
 			},
 		    },
 		]
+	    },{
+		xtype: 'fieldset',
+		title: gettext('Storage Settings'),
+		items: [
+		    {
+			xtype: 'radiogroup',
+			fieldLabel: gettext('Recursive Search'),
+			reference: 'recursiveSearchGroup',
+			height: '15px', // renders faster with value assigned
+			layout: {
+			    type: 'hbox',
+			},
+			items: [
+			    {
+				xtype: 'radiofield',
+				name: 'recursiveSearchField',
+				inputValue: 1,
+				boxLabel: gettext('On'),
+			    },{
+				xtype: 'radiofield',
+				name: 'recursiveSearchField',
+				inputValue: 0,
+				boxLabel: gettext('Off'),
+				margin: '0 0 0 10',
+				checked: true,
+			    }
+			],
+			listeners: {
+			    change: function(el, newValue, undefined) {
+				var sp = Ext.state.Manager.getProvider();
+				sp.set('recursive-search', newValue.recursiveSearchField);
+			    }
+			},
+		    },
+		]
 	    },
 	]
     }],
-- 
2.20.1




More information about the pve-devel mailing list