perf(rss-rules): Add Select All / None buttons (#849)

This commit is contained in:
Rémi Marseault 2023-06-04 22:03:12 +02:00 committed by GitHub
parent 471e73c69c
commit e9a0ad72ff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 5 deletions

View file

@ -39,7 +39,7 @@
<v-divider />
<v-row no-gutters class="my-2 flex-gap">
<v-row class="my-2 flex-gap">
<v-col>
<div class="d-flex flex-column align-center">
<p class="subtitle-1 mb-1">{{ $t('modals.newRule.def.addPaused.title') }}</p>
@ -57,6 +57,16 @@
<v-subheader class="pa-0">
{{ $t('modals.newRule.def.affectedFeeds') }}
</v-subheader>
<v-row>
<v-col cols="6" class="d-flex align-center justify-center">
<v-btn color="accent" @click="selectAll">{{ $t('selectAll') }}</v-btn>
</v-col>
<v-col cols="6" class="d-flex align-center justify-center">
<v-btn color="primary" @click="selectNone">{{ $t('selectNone') }}</v-btn>
</v-col>
</v-row>
<v-checkbox v-for="(item, index) in availableFeeds" :key="index" v-model="rule.affectedFeeds" hide-details :label="item.name" :value="item.url" />
</v-container>
</v-form>
@ -81,7 +91,7 @@
<v-btn class="accent white--text elevation-0 px-4" @click="setRule">
{{ $t('save') }}
</v-btn>
<v-btn class="white--text elevation-0 px-4" @click="close">
<v-btn color="primary" class="white--text elevation-0 px-4" @click="close">
{{ $t('close') }}
</v-btn>
</v-card-actions>
@ -98,7 +108,7 @@ import { Modal } from '@/mixins'
import { mdiClose, mdiContentSave } from '@mdi/js'
import i18n from '@/plugins/i18n'
import { AppPreferences } from '@/enums/qbit'
import { Category } from '@/types/vuetorrent'
import {Category, Feed} from '@/types/vuetorrent'
type FormattedArticle = { type: string; value?: string }
@ -210,6 +220,12 @@ export default defineComponent({
this.matchingArticles = formattedArticles
this.loading = false
},
selectNone() {
this.rule.affectedFeeds = []
},
selectAll() {
this.rule.affectedFeeds = this.availableFeeds.map((feed: Feed) => feed.url)
},
close() {
this.dialog = false
},

View file

@ -52,12 +52,13 @@
"filter": "Filter",
"close": "Close",
"useGlobalSettings": "Use Global Settings",
"selectAll": "Select All",
"selectNone": "Select None",
"dashboard": {
"tooltips": {
"toggleSearch": "Toggle Search Filter",
"toggleSelect": "Toggle Select Mode",
"toggleSort": "Sort Torrents",
"selectAll": "Select All",
"selectAllCaption": "Select / Release All (Ctrl + A)"
},
"emptyTorrentList": "Nothing to see here!",

View file

@ -94,7 +94,7 @@
</v-icon>
</v-btn>
</template>
<span>{{ $t('dashboard.tooltips.selectAll') }}</span>
<span>{{ $t('selectAll') }}</span>
</v-tooltip>
<span class="grey--text">{{ $t('dashboard.tooltips.selectAllCaption') }}</span>
</v-card>