From ded128dad1f43b8be373ccc9913b5805a567a46b Mon Sep 17 00:00:00 2001 From: Tobias Neitzel Date: Wed, 24 Jul 2024 17:13:29 +0200 Subject: [PATCH] Start to implement an interface filter --- frontend/src/components/InterfacePane.vue | 39 ++++++++++++++++++++--- frontend/src/stores/processStore.js | 3 ++ 2 files changed, 38 insertions(+), 4 deletions(-) diff --git a/frontend/src/components/InterfacePane.vue b/frontend/src/components/InterfacePane.vue index 65451d0..b69c311 100644 --- a/frontend/src/components/InterfacePane.vue +++ b/frontend/src/components/InterfacePane.vue @@ -16,11 +16,12 @@ setup() { const store = processStore(); - const { selectedProcess, selectedInterface } = storeToRefs(store); - return { store, selectedProcess, selectedInterface } + const { interfaceFilter, selectedProcess, selectedInterface } = storeToRefs(store); + return { store, interfaceFilter, selectedProcess, selectedInterface } }, - components: { + components: + { VueSimpleContextMenu, }, @@ -31,6 +32,33 @@ this.selectedInterface = intf; }, + applyFilter(filter, intf) + { + if (!filter) + { + return true; + } + + filter = filter.toLowerCase(); + + if (!filter.includes(':')) + { + let inverse = false; + + if (filter.startsWith('!')) + { + filter = filter.substring(1); + inverse = true; + } + + return (intf.uuid.toLowerCase().includes(filter) || intf.location.toLowerCase().includes(filter) || + intf.decs.toLowerCase().includes(filter) || intf.name.toLowerCase().includes(filter) || + intf.annotation.toLowerCase().includes(filter)) != inverse; + } + + return true; + }, + interfaceClick(e, item) { if (item.typ != 'rpc') @@ -63,6 +91,9 @@