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

View file

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

View file

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