[pve-devel] [PATCH widget-toolkit] node/Tasks: don't count 'preFilters' as normal filters

Dominik Csapak d.csapak at proxmox.com
Tue Mar 29 16:04:10 CEST 2022


they can not be removed nor are they visible, so don't count them.

When having a prefilter, we now don't show anymore that there is an
active filter, and don't enable the button anymore.
This is the case for vms for example (vmid is a prefilter).

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 src/node/Tasks.js | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/node/Tasks.js b/src/node/Tasks.js
index 3d7113d..ef1177c 100644
--- a/src/node/Tasks.js
+++ b/src/node/Tasks.js
@@ -165,9 +165,11 @@ Ext.define('Proxmox.node.Tasks', {
 		}
 
 		if (get('extraFilter')) {
+		    let preFilter = get('preFilter') || {};
 		    let extraFilter = get('extraFilter');
-		    for (const value of Object.values(extraFilter)) {
-			if (value !== undefined && value !== null && value !== "") {
+		    for (const [name, value] of Object.entries(extraFilter)) {
+			if (value !== undefined && value !== null && value !== "" &&
+			    preFilter[name] === undefined) {
 			    count++;
 			}
 		    }
@@ -458,6 +460,8 @@ Ext.define('Proxmox.node.Tasks', {
 	    updateExtraFilters(name, value);
 	}
 
+	me.getViewModel().set('preFilter', me.preFilter);
+
 	me.callParent();
 
 	let addFields = function(items) {
-- 
2.30.2






More information about the pve-devel mailing list