]> git.proxmox.com Git - pve-manager.git/commitdiff
ui: parser: add helper for lists of property strings
authorDominik Csapak <d.csapak@proxmox.com>
Fri, 16 Jun 2023 13:05:29 +0000 (15:05 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 16 Jun 2023 14:25:42 +0000 (16:25 +0200)
namely the filtering while preserving the original string,
it's just one line, but having a shorthand for it still makes it a bit
nicer

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
www/manager6/Parser.js

index c3772d3bb688e39ba1eb3059e7dcfd8e25c0e762..bc6a4338038adf1fcf963bf05da4d3bae0b1b4d0 100644 (file)
@@ -604,5 +604,9 @@ Ext.define('PVE.Parser', {
        });
        return [res, extradata];
     },
+
+    filterPropertyStringList: function(list, filterFn, defaultKey) {
+       return list.filter((entry) => filterFn(PVE.Parser.parsePropertyString(entry, defaultKey)));
+    },
 },
 });