Skip to content

Commit

Permalink
add search/filter in query parameters + add clear search input button
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Labarussias <issif+github@gadz.org>
  • Loading branch information
Issif authored and poiana committed Mar 31, 2023
1 parent 695b502 commit 397c2be
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion frontend/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
class="blue darken-2 text-no-wrap" dark
>
<span>
2022 - <a href="https://github.com/falcosecurity/falcosidekick-ui">Falco Authors</a>
2023 - <a href="https://github.com/falcosecurity/falcosidekick-ui">Falco Authors</a>
</span>
<v-spacer/>
<span v-if="$store.state.username && $store.state.password">
Expand Down
12 changes: 12 additions & 0 deletions frontend/src/components/filters.vue
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,12 @@
hide-details
append-icon="search"
></v-text-field>
<v-card-actions style="padding-top: 20px; padding-bottom: 0px;">
<v-spacer></v-spacer>
<v-icon @click="next">
mdi-close-circle-outline
</v-icon>
</v-card-actions>
<v-spacer></v-spacer>
<Counters
:filters="filters"
Expand Down Expand Up @@ -285,6 +291,9 @@ export default {
if (this.filters.tags !== []) {
this.$router.push({ query: { ...this.$route.query, tags: this.filters.tags } });
}
if (this.filters.search !== []) {
this.$router.push({ query: { ...this.$route.query, filter: this.filters.search } });
}
this.$emit('send-filters', this.filters);
},
deep: true,
Expand Down Expand Up @@ -408,6 +417,9 @@ export default {
break;
}
},
next() {
this.filters.search = '';
},
},
created() {
if (typeof this.$route.query.source !== 'undefined') {
Expand Down

0 comments on commit 397c2be

Please sign in to comment.