perf: Add text filter in active filter tooltip (#915)

This commit is contained in:
Rémi Marseault 2023-06-28 20:52:29 +02:00 committed by GitHub
parent e3e9300a9f
commit b0d7a25752
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 6 deletions

View file

@ -11,9 +11,17 @@
<v-slide-x-transition>
<v-speed-dial v-if="filterCount > 0" v-model="filters_fab" open-on-hover transition="slide-y-transition" direction="bottom" class="ml-5">
<template #activator>
<v-btn color="primary" rounded small v-model="filters_fab">{{ $t('navbar.active_tooltip.btn_label').replace('$0', filterCount) }}</v-btn>
<v-btn color="primary" rounded small v-model="filters_fab">{{ $t('navbar.active_filter.btn_label').replace('$0', filterCount) }}</v-btn>
</template>
<div class="d-flex flex-column align-start" style="width: 100%; row-gap: 8px">
<v-tooltip bottom open-delay="400">
<template #activator="{ on }">
<v-chip v-if="dashboard.searchFilter.length > 0" small class="white--text caption">
{{ $t('navbar.active_filter.search_filter').replace('$0', dashboard.searchFilter) }}
</v-chip>
</template>
<span>{{ $t('status') }}</span>
</v-tooltip>
<v-tooltip bottom open-delay="400">
<template #activator="{ on }">
<v-chip v-if="sort_options.filter !== null" small :class="`torrent-${sort_options.filter}`" class="white--text caption">{{
@ -105,7 +113,7 @@ export default {
},
computed: {
...mapGetters(['getWebuiSettings', 'getStatus', 'getTorrentCountString']),
...mapState(['sort_options']),
...mapState(['dashboard', 'sort_options']),
webuiSettings() {
return this.getWebuiSettings()
},
@ -116,7 +124,7 @@ export default {
return this.getTorrentCountString()
},
filterCount() {
return (this.sort_options.filter !== null) + (this.sort_options.category !== null) + (this.sort_options.tag !== null) + (this.sort_options.tracker !== null)
return (this.dashboard.searchFilter.length > 0) + (this.sort_options.filter !== null) + (this.sort_options.category !== null) + (this.sort_options.tag !== null) + (this.sort_options.tracker !== null)
}
},
created() {

View file

@ -140,8 +140,9 @@
"untagged": "(Untagged)",
"not_working": "(Not Working)"
},
"active_tooltip": {
"btn_label": "Filters active: $0"
"active_filter": {
"btn_label": "Filters active: $0",
"search_filter": "Text filter: $0"
},
"action": {
"altSpeed": "Alt Speeds",

View file

@ -140,7 +140,7 @@
"untagged": "(未標籤)",
"not_working": "(無追蹤者)"
},
"active_tooltip": {
"active_filter": {
"btn_label": "啟用中的過濾器: $0"
},
"action": {