show multiple active filter

This commit is contained in:
Peter Olu 2022-05-07 15:53:59 +01:00
parent 61622936f5
commit 2b1ad1feaa

View File

@ -309,9 +309,15 @@ async function getInstances(id?: string) {
} }
state.instance = logStore.instances[0]; state.instance = logStore.instances[0];
} }
function searchLogs() { function addToActiveTerms(){
activeTerms.value.push(currentSearchTerm.value); activeTerms.value.push(currentSearchTerm.value);
console.log(activeTerms.value); }
function removeFromActiveTerms(){
activeTerms.value = activeTerms.value.filter(term => term !== currentSearchTerm.value );
}
function searchLogs() {
addToActiveTerms()
currentSearchTerm.value = ""
let endpoint = "", let endpoint = "",
instance = ""; instance = "";
if (dashboardStore.entity === EntityType[2].value) { if (dashboardStore.entity === EntityType[2].value) {
@ -398,6 +404,7 @@ function setSearchTerm(term: string) {
currentSearchTerm.value = term; currentSearchTerm.value = term;
} }
function cancelSearchTerm() { function cancelSearchTerm() {
removeFromActiveTerms()
currentSearchTerm.value = ""; currentSearchTerm.value = "";
} }
watch( watch(