From d5a9606710ad018c8ed9f6d0ea0139b230668552 Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Fri, 16 Jun 2023 15:05:29 +0200 Subject: [PATCH] ui: parser: add helper for lists of property strings 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 --- 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))); + }, }, });