perf(filters): Reorder states

This commit is contained in:
Larsluph 2023-11-02 22:43:00 +01:00 committed by Daan Wijns
parent e2ce2e86f5
commit 197b9d7d02
3 changed files with 64 additions and 64 deletions

View file

@ -12,7 +12,7 @@ const { statusFilter, categoryFilter, tagFilter, trackerFilter } = toRefs(filter
const vueTorrentStore = useVueTorrentStore()
const statuses = computed(() => Object.values(TorrentState).map(state => (
{ title: t(`torrent.state.${ state }`), value: state }
{ title: t(`torrent.state.${ state }`), value: state }
)))
const categories = computed(() => [
{ title: t('navbar.side.filters.uncategorized'), value: '' },
@ -50,8 +50,8 @@ function selectAllTrackers() {
<v-list-item-title class="px-0 text-uppercase white--text ml-1 font-weight-normal text-caption">
{{ t('navbar.side.filters.state') }}
</v-list-item-title>
<v-select v-model="statusFilter" :items="statuses" bg-color="secondary"
:placeholder="t('navbar.side.filters.disabled')"
<v-select v-model="statusFilter" :items="statuses" :placeholder="t('navbar.side.filters.disabled')"
bg-color="secondary"
class="text-accent pt-1" density="compact" hide-details multiple variant="solo">
<template v-slot:prepend-item>
<v-list-item :title="$t('common.disable')" @click="selectAllStatuses" />
@ -71,19 +71,19 @@ function selectAllTrackers() {
<v-list-item-title class="px-0 text-uppercase white--text ml-1 font-weight-light text-subtitle-2">
{{ t('navbar.side.filters.category') }}
</v-list-item-title>
<v-select v-model="categoryFilter" :items="categories" bg-color="secondary"
:placeholder="t('navbar.side.filters.disabled')"
class="text-accent pt-1" density="compact" hide-details multiple variant="solo">
<v-select v-model="categoryFilter" :items="categories" :placeholder="t('navbar.side.filters.disabled')"
bg-color="secondary" class="text-accent pt-1" density="compact" hide-details multiple variant="solo">
<template v-slot:prepend-item>
<v-list-item :title="$t('common.disable')" @click="selectAllCategories" />
<v-divider />
</template>
<template v-slot:selection="{ item, index }">
<span v-if="index === 0 && categoryFilter.length === 1"
class="text-accent">{{ item.props.title }}</span>
<span v-else-if="index === 0" class="text-accent">{{
t('navbar.side.filters.activeFilter', categoryFilter.length)
}}</span>
<span v-if="index === 0 && categoryFilter.length === 1" class="text-accent">
{{ item.props.title }}
</span>
<span v-else-if="index === 0" class="text-accent">
{{ t('navbar.side.filters.activeFilter', categoryFilter.length) }}
</span>
</template>
</v-select>
</v-list-item>
@ -92,19 +92,19 @@ function selectAllTrackers() {
<v-list-item-title class="px-0 text-uppercase white--text ml-1 font-weight-light text-subtitle-2">
{{ t('navbar.side.filters.tag') }}
</v-list-item-title>
<v-select v-model="tagFilter" :items="tags" bg-color="secondary"
:placeholder="t('navbar.side.filters.disabled')"
class="text-accent pt-1" density="compact" hide-details multiple variant="solo">
<v-select v-model="tagFilter" :items="tags" :placeholder="t('navbar.side.filters.disabled')"
bg-color="secondary" class="text-accent pt-1" density="compact" hide-details multiple variant="solo">
<template v-slot:prepend-item>
<v-list-item :title="$t('common.disable')" @click="selectAllTags" />
<v-divider />
</template>
<template v-slot:selection="{ item, index }">
<span v-if="index === 0 && tagFilter.length === 1"
class="text-accent">{{ item.props.title }}</span>
<span v-else-if="index === 0" class="text-accent">{{
t('navbar.side.filters.activeFilter', tagFilter.length)
}}</span>
<span v-if="index === 0 && tagFilter.length === 1" class="text-accent">
{{ item.props.title }}
</span>
<span v-else-if="index === 0" class="text-accent">
{{ t('navbar.side.filters.activeFilter', tagFilter.length) }}
</span>
</template>
</v-select>
</v-list-item>
@ -114,19 +114,19 @@ function selectAllTrackers() {
<v-list-item-title class="px-0 text-uppercase white--text ml-1 font-weight-light text-subtitle-2">
{{ t('navbar.side.filters.tracker') }}
</v-list-item-title>
<v-select v-model="trackerFilter" :items="trackers" bg-color="secondary"
:placeholder="t('navbar.side.filters.disabled')"
class="text-accent pt-1" density="compact" hide-details multiple variant="solo">
<v-select v-model="trackerFilter" :items="trackers" :placeholder="t('navbar.side.filters.disabled')"
bg-color="secondary" class="text-accent pt-1" density="compact" hide-details multiple variant="solo">
<template v-slot:prepend-item>
<v-list-item :title="$t('common.disable')" @click="selectAllTrackers" />
<v-divider />
</template>
<template v-slot:selection="{ item, index }">
<span v-if="index === 0 && trackerFilter.length === 1"
class="text-accent">{{ item.props.title }}</span>
<span v-else-if="index === 0" class="text-accent">{{
t('navbar.side.filters.activeFilter', trackerFilter.length)
}}</span>
<span v-if="index === 0 && trackerFilter.length === 1" class="text-accent">
{{ item.props.title }}
</span>
<span v-else-if="index === 0" class="text-accent">
{{ t('navbar.side.filters.activeFilter', trackerFilter.length) }}
</span>
</template>
</v-select>
</v-list-item>

View file

@ -1,40 +1,40 @@
export enum TorrentState {
/** Some error occurred, applies to paused torrents */
ERROR = 'error',
/** Torrent data files is missing */
MISSING_FILES = 'missingFiles',
/** Torrent is being seeded and data is being transferred */
UPLOADING = 'uploading',
/** Torrent is paused and has finished downloading */
PAUSED_UP = 'pausedUP',
/** Queuing is enabled and torrent is queued for upload */
QUEUED_UP = 'queuedUP',
/** Torrent is being seeded, but no connection were made */
STALLED_UP = 'stalledUP',
/** Torrent has finished downloading and is being checked */
CHECKING_UP = 'checkingUP',
/** Torrent is forced to uploading and ignore queue limit */
FORCED_UP = 'forcedUP',
/** Torrent is allocating disk space for download */
ALLOCATING = 'allocating',
/** Torrent is being downloaded and data is being transferred */
DOWNLOADING = 'downloading',
/** Torrent has just started downloading and is fetching metadata */
META_DL = 'metaDL',
/** Torrent is forced to downloading to ignore queue limit */
FORCED_DL = 'forcedDL',
/** Torrent is being downloaded and data is being transferred */
DOWNLOADING = 'downloading',
/** Torrent is being downloaded, but no connection were made */
STALLED_DL = 'stalledDL',
/** Torrent is paused and has NOT finished downloading */
PAUSED_DL = 'pausedDL',
/** Queuing is enabled and torrent is queued for download */
QUEUED_DL = 'queuedDL',
/** Torrent is being downloaded, but no connection were made */
STALLED_DL = 'stalledDL',
/** Torrent is forced to uploading and ignore queue limit */
FORCED_UP = 'forcedUP',
/** Torrent is being seeded and data is being transferred */
UPLOADING = 'uploading',
/** Torrent is being seeded, but no connection were made */
STALLED_UP = 'stalledUP',
/** Torrent is paused and has finished downloading */
PAUSED_UP = 'pausedUP',
/** Queuing is enabled and torrent is queued for upload */
QUEUED_UP = 'queuedUP',
/** Same as checkingUP, but torrent has NOT finished downloading */
CHECKING_DL = 'checkingDL',
/** Torrent is forced to downloading to ignore queue limit */
FORCED_DL = 'forcedDL',
/** Torrent has finished downloading and is being checked */
CHECKING_UP = 'checkingUP',
/** Checking resume data on qBt startup */
CHECKING_RESUME_DATA = 'checkingResumeData',
/** Torrent is allocating disk space for download */
ALLOCATING = 'allocating',
/** Torrent is moving to another location */
MOVING = 'moving',
/** Torrent data files is missing */
MISSING_FILES = 'missingFiles',
/** Some error occurred, applies to paused torrents */
ERROR = 'error',
/** Unknown status */
UNKNOWN = 'unknown'
}

View file

@ -245,24 +245,24 @@
"uploaded_session": "Uploaded (session)"
},
"state": {
"error": "Error",
"missingFiles": "Missing Files",
"uploading": "Uploading",
"forcedUP": "[F] Uploading",
"pausedUP": "Done",
"queuedUP": "Queued (UP)",
"stalledUP": "Seeding",
"checkingUP": "Checking",
"allocating": "Allocating",
"downloading": "Downloading",
"forcedDL": "[F] Downloading",
"metaDL": "Metadata",
"forcedDL": "[F] Downloading",
"downloading": "Downloading",
"stalledDL": "Stalled",
"pausedDL": "Paused",
"queuedDL": "Queued (DL)",
"stalledDL": "Stalled",
"checkingDL": "Checking",
"forcedUP": "[F] Uploading",
"uploading": "Uploading",
"stalledUP": "Seeding",
"pausedUP": "Done",
"queuedUP": "Queued (UP)",
"checkingDL": "Checking (incomplete)",
"checkingUP": "Checking (finished)",
"checkingResumeData": "Checking resume data",
"allocating": "Allocating",
"moving": "Moving",
"missingFiles": "Missing Files",
"error": "Error",
"unknown": "Unknown"
}
},