node/Tasks: don't count 'preFilters' as normal filters

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@proxmox.com>
This commit is contained in:
Dominik Csapak 2022-03-29 16:04:10 +02:00 committed by Thomas Lamprecht
parent 96fb7eaacd
commit 64c1d6191c

View File

@ -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) {