Skip to content

Commit

Permalink
Start to implement an interface filter
Browse files Browse the repository at this point in the history
  • Loading branch information
qtc-de committed Jul 24, 2024
1 parent 876786f commit ded128d
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 4 deletions.
39 changes: 35 additions & 4 deletions frontend/src/components/InterfacePane.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand All @@ -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')
Expand Down Expand Up @@ -63,6 +91,9 @@

<template>
<h3 class="ml-2">RPC Interfaces</h3>

<input v-model="interfaceFilter" class="form-control mb-1" style="width: 95%" placeholder="filter: (<str> | type:<str> | uuid:<str> | location:<str> | desc:<str> | name:<str> | flags:<str> | annotation:<str> | epregistered:<str> | ...)"/>

<aside id="InterfacePane" class="SmallBorder">
<table class="GenericTable">
<tr>
Expand All @@ -75,7 +106,7 @@
<th class="InterfaceColumn">Annotation</th>
<th class="InterfaceColumn">EpRegistred</th>
</tr>
<tr v-if="selectedProcess" v-for="intf in selectedProcess.rpc_info.interface_infos" @contextmenu.prevent.stop="interfaceClick($event, intf)"
<tr v-if="selectedProcess && applyFilter(interfaceFilter, intf)" v-for="intf in selectedProcess.rpc_info.interface_infos" @contextmenu.prevent.stop="interfaceClick($event, intf)"
:class="{ Selected: (selectedInterface && selectedInterface.id == intf.id), Rpc: intf.typ == 'rpc',
Dcom: intf.typ == 'dcom', Hybrid: intf.typ == 'hybrid' }" @click='selectRow(intf)'>
<td class="InterfaceColumn">{{ intf.typ.toUpperCase() }}</td>
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/stores/processStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ var refreshOngoing = false;
var selectedPane = null;
var selectedProcess = null;
var selectedInterface = null;

var processFilter = null;
var interfaceFilter = null;

export const processStore = defineStore(
{
Expand All @@ -29,6 +31,7 @@ export const processStore = defineStore(
selectedProcess,
selectedInterface,
processFilter,
interfaceFilter,
}),

actions:
Expand Down

0 comments on commit ded128d

Please sign in to comment.