mirror of
https://github.com/gotson/komga.git
synced 2026-05-08 21:00:16 +02:00
feat(webui): display library name in book/series screen, empty all trash
adds a button in 'Server Settings > Server' to empty trash for all libraries display the library name next to Series name on Book and Series details screen Co-authored-by: Gauthier Roebroeck <gauthier.roebroeck@gmail.com>
This commit is contained in:
parent
164dae5764
commit
1d3f4e4247
4 changed files with 65 additions and 11 deletions
|
|
@ -172,6 +172,7 @@
|
||||||
"title": "{name} collection"
|
"title": "{name} collection"
|
||||||
},
|
},
|
||||||
"common": {
|
"common": {
|
||||||
|
"library": "Library",
|
||||||
"all_libraries": "All Libraries",
|
"all_libraries": "All Libraries",
|
||||||
"books": "Books",
|
"books": "Books",
|
||||||
"books_n": "No book | 1 book | {count} books",
|
"books_n": "No book | 1 book | {count} books",
|
||||||
|
|
@ -628,6 +629,7 @@
|
||||||
},
|
},
|
||||||
"server": {
|
"server": {
|
||||||
"server_management": {
|
"server_management": {
|
||||||
|
"button_empty_trash": "Empty trash for all libraries",
|
||||||
"button_shutdown": "Shut down",
|
"button_shutdown": "Shut down",
|
||||||
"section_title": "Server Management"
|
"section_title": "Server Management"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -101,8 +101,18 @@
|
||||||
<v-container>
|
<v-container>
|
||||||
<v-row>
|
<v-row>
|
||||||
<v-col class="py-1">
|
<v-col class="py-1">
|
||||||
<router-link :to="{name:'browse-series', params: {seriesId: book.seriesId}}" class="link-underline">
|
<router-link
|
||||||
<span class="text-h5" v-if="!$_.isEmpty(series)">{{ series.metadata.title }}</span>
|
v-if="!$_.isEmpty(series)"
|
||||||
|
:to="{name:'browse-series', params: {seriesId: book.seriesId}}"
|
||||||
|
class="link-underline text-h5"
|
||||||
|
>{{ series.metadata.title }}
|
||||||
|
</router-link>
|
||||||
|
<router-link
|
||||||
|
class="caption link-underline"
|
||||||
|
:class="$vuetify.breakpoint.smAndUp ? 'mx-1' : ''"
|
||||||
|
:style="$vuetify.breakpoint.xsOnly ? 'display: block' : ''"
|
||||||
|
:to="{name:'browse-libraries', params: {libraryId: book.libraryId }}"
|
||||||
|
>{{ $t('searchbox.in_library', {library: getLibraryName(book)}) }}
|
||||||
</router-link>
|
</router-link>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
|
|
@ -127,13 +137,17 @@
|
||||||
}}
|
}}
|
||||||
</v-col>
|
</v-col>
|
||||||
|
|
||||||
<v-col :class="'py-1 ' + ($vuetify.rtl ? 'pl-0' : 'pr-0')" cols="auto" v-if="book.media.status === MediaStatus.OUTDATED">
|
<v-col :class="'py-1 ' + ($vuetify.rtl ? 'pl-0' : 'pr-0')"
|
||||||
|
cols="auto"
|
||||||
|
v-if="book.media.status === MediaStatus.OUTDATED">
|
||||||
<v-tooltip bottom :disabled="!isAdmin">
|
<v-tooltip bottom :disabled="!isAdmin">
|
||||||
<template v-slot:activator="{ on }">
|
<template v-slot:activator="{ on }">
|
||||||
<v-chip label small color="warning" v-on="on">
|
<v-chip label small color="warning" v-on="on">
|
||||||
{{ $t('common.outdated') }}
|
{{ $t('common.outdated') }}
|
||||||
</v-chip>
|
</v-chip>
|
||||||
</template>{{ $t('browse_book.outdated_tooltip') }}</v-tooltip>
|
</template>
|
||||||
|
{{ $t('browse_book.outdated_tooltip') }}
|
||||||
|
</v-tooltip>
|
||||||
</v-col>
|
</v-col>
|
||||||
|
|
||||||
<v-col :class="'py-1 ' + ($vuetify.rtl ? 'pl-0' : 'pr-0')" cols="auto" v-if="unavailable">
|
<v-col :class="'py-1 ' + ($vuetify.rtl ? 'pl-0' : 'pr-0')" cols="auto" v-if="unavailable">
|
||||||
|
|
@ -480,6 +494,9 @@ export default Vue.extend({
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getLibraryName(item: BookDto): string {
|
||||||
|
return this.$store.getters.getLibraryById(item.libraryId).name
|
||||||
|
},
|
||||||
libraryDeleted(event: LibrarySseDto) {
|
libraryDeleted(event: LibrarySseDto) {
|
||||||
if (event.libraryId === this.book.libraryId) {
|
if (event.libraryId === this.book.libraryId) {
|
||||||
this.$router.push({name: 'home'})
|
this.$router.push({name: 'home'})
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,6 @@
|
||||||
<series-actions-menu v-if="series"
|
<series-actions-menu v-if="series"
|
||||||
:series="series"
|
:series="series"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<v-toolbar-title>
|
<v-toolbar-title>
|
||||||
<span v-if="$_.get(series, 'metadata.title')">{{ series.metadata.title }}</span>
|
<span v-if="$_.get(series, 'metadata.title')">{{ series.metadata.title }}</span>
|
||||||
<v-chip label class="mx-4" v-if="totalElements">
|
<v-chip label class="mx-4" v-if="totalElements">
|
||||||
|
|
@ -96,7 +95,14 @@
|
||||||
<v-container>
|
<v-container>
|
||||||
<v-row>
|
<v-row>
|
||||||
<v-col class="py-1">
|
<v-col class="py-1">
|
||||||
<div class="text-h5" v-if="$_.get(series, 'metadata.title')">{{ series.metadata.title }}</div>
|
<span class="text-h5" v-if="$_.get(series, 'metadata.title')">{{ series.metadata.title }}</span>
|
||||||
|
<router-link
|
||||||
|
class="caption link-underline"
|
||||||
|
:class="$vuetify.breakpoint.smAndUp ? 'mx-2' : ''"
|
||||||
|
:style="$vuetify.breakpoint.xsOnly ? 'display: block' : ''"
|
||||||
|
:to="{name:'browse-libraries', params: {libraryId: series.libraryId }}"
|
||||||
|
>{{ $t('searchbox.in_library', {library: getLibraryName(series)}) }}
|
||||||
|
</router-link>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
|
|
||||||
|
|
@ -648,6 +654,9 @@ export default Vue.extend({
|
||||||
next()
|
next()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getLibraryName(item: SeriesDto): string {
|
||||||
|
return this.$store.getters.getLibraryById(item.libraryId).name
|
||||||
|
},
|
||||||
resetSortAndFilters() {
|
resetSortAndFilters() {
|
||||||
this.drawer = false
|
this.drawer = false
|
||||||
for (const prop in this.filters) {
|
for (const prop in this.filters) {
|
||||||
|
|
|
||||||
|
|
@ -5,12 +5,26 @@
|
||||||
</v-row>
|
</v-row>
|
||||||
<v-row>
|
<v-row>
|
||||||
<v-col>
|
<v-col>
|
||||||
|
<v-btn @click="confirmEmptyTrash = true"
|
||||||
|
style="margin-right: 15px"
|
||||||
|
color="error"
|
||||||
|
>{{ $t('server.server_management.button_empty_trash') }}
|
||||||
|
</v-btn>
|
||||||
<v-btn @click="modalStopServer = true"
|
<v-btn @click="modalStopServer = true"
|
||||||
color="error"
|
color="error"
|
||||||
>{{ $t('server.server_management.button_shutdown') }}</v-btn>
|
>{{ $t('server.server_management.button_shutdown') }}
|
||||||
|
</v-btn>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
|
|
||||||
|
<confirmation-dialog
|
||||||
|
v-model="confirmEmptyTrash"
|
||||||
|
:title="$t('dialog.empty_trash.title')"
|
||||||
|
:body="$t('dialog.empty_trash.body')"
|
||||||
|
:button-confirm="$t('dialog.empty_trash.button_confirm')"
|
||||||
|
@confirm="emptyTrash"
|
||||||
|
/>
|
||||||
|
|
||||||
<confirmation-dialog
|
<confirmation-dialog
|
||||||
v-model="modalStopServer"
|
v-model="modalStopServer"
|
||||||
:title="$t('dialog.server_stop.dialog_title')"
|
:title="$t('dialog.server_stop.dialog_title')"
|
||||||
|
|
@ -27,14 +41,26 @@
|
||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
import ConfirmationDialog from '@/components/dialogs/ConfirmationDialog.vue'
|
import ConfirmationDialog from '@/components/dialogs/ConfirmationDialog.vue'
|
||||||
import {ERROR} from '@/types/events'
|
import {ERROR} from '@/types/events'
|
||||||
|
import {LibraryDto} from '@/types/komga-libraries'
|
||||||
|
|
||||||
export default Vue.extend({
|
export default Vue.extend({
|
||||||
name: 'SettingsServer',
|
name: 'SettingsServer',
|
||||||
components: {ConfirmationDialog},
|
components: {ConfirmationDialog},
|
||||||
data: () => ({
|
data: () => ({
|
||||||
modalStopServer: false,
|
modalStopServer: false,
|
||||||
|
confirmEmptyTrash: false,
|
||||||
}),
|
}),
|
||||||
|
computed: {
|
||||||
|
libraries(): LibraryDto[] {
|
||||||
|
return this.$store.state.komgaLibraries.libraries
|
||||||
|
},
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
emptyTrash() {
|
||||||
|
this.libraries.forEach(library => {
|
||||||
|
this.$komgaLibraries.emptyTrash(library)
|
||||||
|
})
|
||||||
|
},
|
||||||
async stopServer() {
|
async stopServer() {
|
||||||
try {
|
try {
|
||||||
await this.$actuator.shutdown()
|
await this.$actuator.shutdown()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue