From c950c73e76e0054163167b866b8be06962ff2beb Mon Sep 17 00:00:00 2001 From: Zaid Abdulla Date: Wed, 9 Dec 2020 18:08:56 -0800 Subject: [PATCH] Add option to set limit in all-parameters comp. --- ui/components/all-parameters.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ui/components/all-parameters.ts b/ui/components/all-parameters.ts index 51f302b..709f1dc 100644 --- a/ui/components/all-parameters.ts +++ b/ui/components/all-parameters.ts @@ -55,6 +55,8 @@ const component: ClosureComponent = (): Component => { view: (vnode) => { const device = vnode.attrs["device"]; + const limit = vnode.attrs["limit"] > 0 ? vnode.attrs["limit"] : 100; + const search = m("input", { type: "text", placeholder: "Search parameters", @@ -86,7 +88,7 @@ const component: ClosureComponent = (): Component => { const str = p.value && p.value[0] ? `${k} ${p.value[0]}` : k; if (re && !re.test(str)) continue; ++c; - if (count < 100) filteredKeys.push(k); + if (count < limit) filteredKeys.push(k); } count += c; }