Fix filtering of events log.

Closes #22.
This commit is contained in:
D. Berge
2020-09-07 17:23:00 +02:00
parent 2db376e1cc
commit 0a547666e3

View File

@@ -46,9 +46,8 @@
item-key="tstamp"
sort-by="tstamp"
:sort-desc="true"
:x-server-items-length="eventCount"
:x-options.sync="options"
:search="filter"
:custom-filter="searchTable"
:loading="loading"
fixed-header
>
@@ -649,6 +648,19 @@ export default {
},
searchTable (value, search, item) {
if (!value && !search) return true;
const s = search.toLowerCase();
if (typeof value === 'string') {
return value.toLowerCase().includes(s);
} else if (typeof value === 'number') {
return value == search;
} else {
return item.items.some( i => i.remarks.toLowerCase().includes(s) ) ||
item.items.some( i => i.labels.some( l => l.toLowerCase().includes(s) ));
}
},
...mapActions(["api", "showSnack"])
},