]> git.proxmox.com Git - pve-manager.git/commitdiff
firewall: properly detect changes when ip / cidr is used in rule
authorStefan Hanreich <s.hanreich@proxmox.com>
Tue, 16 Jan 2024 14:30:22 +0000 (15:30 +0100)
committerFabian Grünbichler <f.gruenbichler@proxmox.com>
Fri, 12 Apr 2024 12:12:43 +0000 (14:12 +0200)
With the current implementation using queryDelay, this means that the
change event for the input never completes. This in turn leads to
the input panel never changing its dirty status. By using the
beforequery event we can simply cancel the query without resorting to
the queryDelay hack.

Reported-By: Mira Limbeck <m.limbeck@proxmox.com>
Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
Tested-by: Mira Limbeck <m.limbeck@proxmox.com>
Reviewed-by: Mira Limbeck <m.limbeck@proxmox.com>
www/manager6/form/IPRefSelector.js

index 7e5eea63a65efc17b163ecbefe7af265887cbec3..d41cde5f526160d350f541fd1e5060525f3ed806 100644 (file)
@@ -56,15 +56,6 @@ Ext.define('PVE.form.IPRefSelector', {
            },
        });
 
-       var disable_query_for_ips = function(f, value) {
-           if (value === null ||
-               value.match(/^\d/)) { // IP address starts with \d
-               f.queryDelay = 9999999999; // hack: disable with long delay
-           } else {
-               f.queryDelay = 10;
-           }
-       };
-
        var columns = [];
 
        if (!me.ref_type) {
@@ -109,7 +100,9 @@ Ext.define('PVE.form.IPRefSelector', {
            },
        });
 
-       me.on('change', disable_query_for_ips);
+       me.on('beforequery', function(queryPlan) {
+           return !(queryPlan.query === null || queryPlan.query.match(/^\d/));
+       });
 
         me.callParent();
     },