[pve-devel] [PATCH manager v6 03/15] ui: parser: add helper for lists of property strings

Dominik Csapak d.csapak at proxmox.com
Wed Jun 14 10:46:09 CEST 2023


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 at proxmox.com>
---
changes from v5:
* removed list parser (was unused)
* changed the filter helper to a simple 'filter' call
  (the double map before/after was unnecessary)
 www/manager6/Parser.js | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/www/manager6/Parser.js b/www/manager6/Parser.js
index c3772d3b..bc6a4338 100644
--- a/www/manager6/Parser.js
+++ b/www/manager6/Parser.js
@@ -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)));
+    },
 },
 });
-- 
2.30.2






More information about the pve-devel mailing list