perf: Add active filter (#868)

This commit is contained in:
Rémi Marseault 2023-06-23 09:27:03 +02:00 committed by GitHub
parent 09828cb9ab
commit e007289b48
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 159 additions and 107 deletions

View file

@ -99,14 +99,14 @@ export default {
options() {
return [
{ value: null, name: this.$t('all') },
{ value: 'downloading', name: this.$t('downloading') },
{ value: 'seeding', name: this.$t('seeding') },
{ value: 'completed', name: this.$t('completed') },
{ value: 'resumed', name: this.$t('resumed') },
{ value: 'paused', name: this.$t('paused') },
{ value: 'active', name: this.$t('active') },
{ value: 'inactive', name: this.$t('inactive') },
{ value: 'stalled', name: this.$t('stalled') },
{ value: 'downloading', name: this.$t('navbar.filters.downloading') },
{ value: 'seeding', name: this.$t('navbar.filters.seeding') },
{ value: 'completed', name: this.$t('navbar.filters.completed') },
{ value: 'resumed', name: this.$t('navbar.filters.resumed') },
{ value: 'paused', name: this.$t('navbar.filters.paused') },
{ value: 'active', name: this.$t('navbar.filters.active') },
{ value: 'inactive', name: this.$t('navbar.filters.inactive') },
{ value: 'stalled', name: this.$t('navbar.filters.stalled') },
{
value: 'stalled_uploading',
name: this.$t('navbar.filters.stalled_uploading')
@ -117,7 +117,7 @@ export default {
},
{ value: 'checking', name: this.$t('navbar.filters.checking') },
{ value: 'moving', name: this.$t('navbar.filters.moving') },
{ value: 'errored', name: this.$t('errored') }
{ value: 'errored', name: this.$t('navbar.filters.errored') }
]
},
availableCategories() {

View file

@ -7,10 +7,46 @@
<span class="font-weight-light">qBit</span>
<span>torrent</span>
</v-toolbar-title>
<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>
</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="sort_options.filter !== null" small :class="`torrent-${sort_options.filter}`" class="white--text caption">{{$t(`navbar.filters.${sort_options.filter}`)}}</v-chip>
</template>
<span>{{ $t('status') }}</span>
</v-tooltip>
<v-tooltip bottom open-delay="400">
<template #activator="{ on }">
<v-chip v-if="sort_options.category !== null" small class="category white--text caption">{{sort_options.category === '' ? $t('navbar.filters.uncategorized') : sort_options.category}}</v-chip>
</template>
<span>{{ $t('category') }}</span>
</v-tooltip>
<v-tooltip bottom open-delay="400">
<template #activator="{ on }">
<v-chip v-if="sort_options.tag !== null" small class="tags white--text caption">{{sort_options.tag === '' ? $t('navbar.filters.untagged') : sort_options.tag}}</v-chip>
</template>
<span>{{ $t('tags') }}</span>
</v-tooltip>
<v-tooltip bottom open-delay="400">
<template #activator="{ on }">
<v-chip v-if="sort_options.tracker !== null" small class="tracker white--text caption">{{sort_options.tracker === '' ? $t('navbar.filters.not_working') : sort_options.tracker}}</v-chip>
</template>
<span>{{ $t('tracker') }}</span>
</v-tooltip>
</div>
</v-speed-dial>
</v-slide-x-transition>
<v-spacer />
<TopMenu />
</v-app-bar>
<!--navigation drawer itself -->
<v-navigation-drawer v-model="drawer" app class="primary drawer" style="position: fixed" width="256" height="100%" disable-resize-watcher :right="webuiSettings.rightDrawer">
<v-card v-if="status" style="display: flex; flex-direction: column" class="pt-3 primary" flat>
@ -38,8 +74,8 @@
</nav>
</template>
<script>
import { mapGetters } from 'vuex'
<script lang="ts">
import { mapGetters, mapState } from 'vuex'
import { BottomActions, TopMenu, SpeedGraph, FreeSpace, TransferStats, CurrentSpeed, FilterSelect } from './index'
export default {
@ -55,11 +91,13 @@ export default {
},
data() {
return {
drawer: this.$vuetify.breakpoint.mdAndUp
drawer: this.$vuetify.breakpoint.mdAndUp,
filters_fab: false
}
},
computed: {
...mapGetters(['getWebuiSettings', 'getStatus', 'getTorrentCountString']),
...mapState(['sort_options']),
webuiSettings() {
return this.getWebuiSettings()
},
@ -68,6 +106,9 @@ export default {
},
torrentCountString() {
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)
}
},
created() {

View file

@ -82,7 +82,9 @@ import { mdiSort, mdiCog, mdiCheckboxBlankOutline, mdiCheckboxMarked, mdiSearchW
export default {
name: 'TopActions',
mixins: [General],
props: ['mobile'],
props: {
mobile: () => false
},
data() {
return {
fab: false,

View file

@ -19,7 +19,7 @@
</v-icon>
</v-btn>
</template>
<TopActions :mobile="true" />
<TopActions mobile />
</v-speed-dial>
</div>
</template>

View file

@ -24,9 +24,3 @@ export default defineComponent({
}
})
</script>
<style>
.tags {
background-color: #048b9a !important;
}
</style>

View file

@ -169,7 +169,4 @@ export default {
.spangap {
gap: 4px;
}
.tags {
background-color: #048b9a !important;
}
</style>

View file

@ -16,15 +16,6 @@
"unknown": "Unknown",
"status": "Status",
"all": "All",
"downloading": "Downloading",
"seeding": "Seeding",
"completed": "Completed",
"resumed": "Resumed",
"paused": "Paused",
"active": "Active",
"inactive": "Inactive",
"stalled": "Stalled",
"errored": "Errored",
"login": "Log in",
"logout": "Log out",
"shutdownApp": "Shutdown Application",
@ -131,13 +122,25 @@
"tooltip": "Since the last time qBittorrent was restarted"
},
"filters": {
"downloading": "Downloading",
"seeding": "Seeding",
"completed": "Completed",
"resumed": "Resumed",
"paused": "Paused",
"active": "Active",
"inactive": "Inactive",
"stalled": "Stalled",
"errored": "Errored",
"stalled_uploading": "Stalled Uploading",
"stalled_downloading": "Stalled Downloading",
"checking": "Checking",
"moving": "Moving",
"uncategorized": "Uncategorized",
"untagged": "Untagged",
"not_working": "Not Working"
"uncategorized": "(Uncategorized)",
"untagged": "(Untagged)",
"not_working": "(Not Working)"
},
"active_tooltip": {
"btn_label": "Filters active: $0"
},
"action": {
"altSpeed": "Alt Speeds",

View file

@ -15,15 +15,6 @@
"unknown": "Inconnu",
"status": "Statut",
"all": "Tout",
"downloading": "Téléchargement",
"seeding": "Seeding",
"completed": "Complété",
"resumed": "A Repris",
"paused": "En Pause",
"active": "Actif",
"inactive": "Inactif",
"stalled": "Bloqué",
"errored": "Erreur",
"login": "Se Connecter",
"logout": "Se Déconnecter",
"shutdownApp": "Eteindre l'Appli",
@ -95,6 +86,15 @@
"tooltip": "Depuis le dernier redémarrage de qBittorrent"
},
"filters": {
"downloading": "Téléchargement",
"seeding": "Seeding",
"completed": "Complété",
"resumed": "A Repris",
"paused": "En Pause",
"active": "Actif",
"inactive": "Inactif",
"stalled": "Bloqué",
"errored": "Erreur",
"stalled_uploading": "Téléversement bloqué",
"stalled_downloading": "Téléchargement bloqué",
"uncategorized": "Non catégorisé",

View file

@ -15,15 +15,6 @@
"unknown": "tidak diketahui",
"status": "Status",
"all": "Semua",
"downloading": "Mengunduh",
"seeding": "Seeding",
"completed": "Selesai",
"resumed": "Dilanjutkan",
"paused": "Terjeda",
"active": "Aktif",
"inactive": "Tidak Aktif",
"stalled": "Ter-stall",
"errored": "Bermasalah",
"login": "Masuk",
"logout": "Keluar",
"downloaded": "Terunduh",
@ -73,6 +64,15 @@
"tooltip": "Sejak terakhir kali qBittorrent dijalankan ulang"
},
"filters": {
"downloading": "Mengunduh",
"seeding": "Seeding",
"completed": "Selesai",
"resumed": "Dilanjutkan",
"paused": "Terjeda",
"active": "Aktif",
"inactive": "Tidak Aktif",
"stalled": "Ter-stall",
"errored": "Bermasalah",
"stalled_uploading": "Unggahan ter-stall",
"stalled_downloading": "Unduhan ter-stall"
},

View file

@ -15,15 +15,6 @@
"unknown": "不明",
"status": "ステータス",
"all": "All",
"downloading": "ダウンロード中",
"seeding": "シード中",
"completed": "完了",
"resumed": "再開",
"paused": "一時停止",
"active": "稼働中",
"inactive": "非稼働中",
"stalled": "停滞中",
"errored": "エラー",
"login": "ログイン",
"logout": "ログアウト",
"downloaded": "ダウンロード済み",
@ -72,6 +63,15 @@
"tooltip": "最後の再起動からの時間"
},
"filters": {
"downloading": "ダウンロード中",
"seeding": "シード中",
"completed": "完了",
"resumed": "再開",
"paused": "一時停止",
"active": "稼働中",
"inactive": "非稼働中",
"stalled": "停滞中",
"errored": "エラー",
"stalled_uploading": "停滞中アップロード",
"stalled_downloading": "停滞中ダウンロード"
},

View file

@ -16,15 +16,6 @@
"unknown": "Неизвестный",
"status": "Статус",
"all": "Все",
"downloading": "Загружаются",
"seeding": "Раздаются",
"completed": "Завершены",
"resumed": "Возобновлены",
"paused": "Остановлены",
"active": "Активны",
"inactive": "Неактивны",
"stalled": "Простаивают",
"errored": "Ошибка",
"login": "Войти",
"logout": "Выйти",
"shutdownApp": "Закрыть приложение",
@ -125,6 +116,15 @@
"tooltip": "С момента последнего перезапуска qBittorrent"
},
"filters": {
"downloading": "Загружаются",
"seeding": "Раздаются",
"completed": "Завершены",
"resumed": "Возобновлены",
"paused": "Остановлены",
"active": "Активны",
"inactive": "Неактивны",
"stalled": "Простаивают",
"errored": "Ошибка",
"stalled_uploading": "Отдача стоит",
"stalled_downloading": "Загрузка стоит",
"checking": "Проверка",

View file

@ -16,15 +16,6 @@
"unknown": "Невідомий",
"status": "Стан",
"all": "Все",
"downloading": "Завантажуються",
"seeding": "Роздаються",
"completed": "Виконані",
"resumed": "Поновлені",
"paused": "Призупинені",
"active": "Активні",
"inactive": "Неактивні",
"stalled": "Залипли",
"errored": "З помилками",
"login": "Увійти",
"logout": "Вийти",
"shutdownApp": "Закрити застосунок",
@ -124,6 +115,15 @@
"tooltip": "З моменту останнього перезапуску qBittorrent"
},
"filters": {
"downloading": "Завантажуються",
"seeding": "Роздаються",
"completed": "Виконані",
"resumed": "Поновлені",
"paused": "Призупинені",
"active": "Активні",
"inactive": "Неактивні",
"stalled": "Залипли",
"errored": "З помилками",
"stalled_uploading": "Залиплі віддачі",
"stalled_downloading": "Залиплі завантаження",
"checking": "Перевіряються",

View file

@ -15,15 +15,6 @@
"unknown": "Không xác định",
"status": "Tình trạng",
"all": "Tất cả",
"downloading": "Đang tải xuống",
"seeding": "Đang chia sẻ",
"completed": "Hoàn thành",
"resumed": "Tiếp tục",
"paused": "Tạm dừng",
"active": "Hoạt động",
"inactive": "Không hoạt động",
"stalled": "Bị đình trệ",
"errored": "Bị lỗi",
"login": "Đăng nhập",
"logout": "Đăng xuất",
"download": "Tải xuống",
@ -92,6 +83,15 @@
"tooltip": "Kể từ lần cuối qBittorrent được khởi động lại"
},
"filters": {
"downloading": "Đang tải xuống",
"seeding": "Đang chia sẻ",
"completed": "Hoàn thành",
"resumed": "Tiếp tục",
"paused": "Tạm dừng",
"active": "Hoạt động",
"inactive": "Không hoạt động",
"stalled": "Bị đình trệ",
"errored": "Bị lỗi",
"stalled_uploading": "Tải lên bị đình trệ",
"stalled_downloading": "Tải xuống bị đình trệ",
"uncategorized": "Chưa phân loại",

View file

@ -16,15 +16,6 @@
"unknown": "未知",
"status": "状态",
"all": "所有",
"downloading": "下载中",
"seeding": "做种中",
"completed": "已完成",
"resumed": "已恢复",
"paused": "已暂停",
"active": "活动中",
"inactive": "空闲中",
"stalled": "已限速",
"errored": "错误",
"login": "登录",
"logout": "登出",
"shutdownApp": "关闭qBittorrent",
@ -132,6 +123,15 @@
"tooltip": "自 qBittorrent 启动以来"
},
"filters": {
"downloading": "下载中",
"seeding": "做种中",
"completed": "已完成",
"resumed": "已恢复",
"paused": "已暂停",
"active": "活动中",
"inactive": "空闲中",
"stalled": "已限速",
"errored": "错误",
"stalled_uploading": "上传限速",
"stalled_downloading": "下载限速",
"checking": "正在检查",

View file

@ -16,15 +16,6 @@
"unknown": "未知",
"status": "狀態",
"all": "所有",
"downloading": "下載中",
"seeding": "做種中",
"completed": "已完成",
"resumed": "繼續",
"paused": "暫停",
"active": "活躍",
"inactive": "不活躍",
"stalled": "停止",
"errored": "錯誤",
"login": "登入",
"logout": "登出",
"shutdownApp": "結束應用程式",
@ -131,6 +122,15 @@
"tooltip": "自 qBittorrent 上次重新啟動以來"
},
"filters": {
"downloading": "下載中",
"seeding": "做種中",
"completed": "已完成",
"resumed": "繼續",
"paused": "暫停",
"active": "活躍",
"inactive": "不活躍",
"stalled": "停止",
"errored": "錯誤",
"stalled_uploading": "停止上傳",
"stalled_downloading": "停止下載",
"checking": "正在檢查",

View file

@ -20,10 +20,15 @@ const variables = {
download: '#64CEAA',
upload: '#00b3fa',
ratio: '#00b2f8',
state: '#1e9367',
category: '#04669a',
tags: '#048b9a',
tracker: '#1eb9ac',
// Torrent status colors
'torrent-done': '#16573e',
'torrent-downloading': '#5bb974',
'torrent-fail': '#f83e70',
'torrent-errored': '#f83e70',
'torrent-paused': '#9CA3AF',
'torrent-queued': '#2e5eaa',
'torrent-seeding': '#4ecde6',

View file

@ -4,10 +4,15 @@ $secondary: #3e556d;
$download: #64ceaa;
$upload: #00b3fa;
$ratio: #00b2f8;
$state: #1e9367;
$category: #04669a;
$tags: #048b9a;
$tracker: #1eb9ac;
// Torrent status colors
$torrent-done: #16573e;
$torrent-downloading: #5bb974;
$torrent-fail: #f83e70;
$torrent-errored: $torrent-fail;
$torrent-paused: #9ca3af;
$torrent-queued: #2e5eaa;
$torrent-seeding: #4ecde6;
@ -23,10 +28,15 @@ $torrent-unknown: #000000;
download: $download;
upload: $upload;
ratio: $ratio;
state: $state;
category: $category;
tags: $tags;
tracker: $tracker;
torrent-done-color: $torrent-done;
torrent-downloading-color: $torrent-downloading;
torrent-fail-color: $torrent-fail;
torrent-errored-color: $torrent-errored;
torrent-paused-color: $torrent-paused;
torrent-queued-color: $torrent-queued;
torrent-seeding-color: $torrent-seeding;