mirror of
https://github.com/gotson/komga.git
synced 2025-12-20 15:34:17 +01:00
feat(webui): display task count by type in activity bar tooltip
This commit is contained in:
parent
eda767aeb5
commit
6b690bcdfb
4 changed files with 14 additions and 4 deletions
|
|
@ -5,10 +5,12 @@ import {Module} from "vuex";
|
|||
const vuexModule: Module<any, any> = {
|
||||
state: {
|
||||
taskCount: 0,
|
||||
taskCountByType: {} as { [key: string]: number },
|
||||
},
|
||||
mutations: {
|
||||
setTaskCount (state, val) {
|
||||
state.taskCount = val
|
||||
setTaskCount (state, event) {
|
||||
state.taskCount = event.count
|
||||
state.taskCountByType = event.countByType
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -98,6 +98,6 @@ export default class KomgaSseService {
|
|||
|
||||
private updateTaskCount(event: any) {
|
||||
const data = JSON.parse(event.data) as TaskQueueSseDto
|
||||
this.store.commit('setTaskCount', data.count)
|
||||
this.store.commit('setTaskCount', data)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@ export interface ThumbnailSeriesSseDto {
|
|||
|
||||
export interface TaskQueueSseDto {
|
||||
count: number,
|
||||
countByType: { [key: string]: number }
|
||||
}
|
||||
|
||||
export interface BookImportSseDto {
|
||||
|
|
|
|||
|
|
@ -42,7 +42,11 @@
|
|||
v-on="on"
|
||||
/>
|
||||
</template>
|
||||
<span>{{ $tc('common.pending_tasks', taskCount) }}</span>
|
||||
<div class="mb-2">{{ $tc('common.pending_tasks', taskCount) }}</div>
|
||||
<div v-for="taskType in Object.keys(taskCountByType)"
|
||||
:key="taskType"
|
||||
>{{ taskType }}: {{ taskCountByType[taskType] }}
|
||||
</div>
|
||||
</v-tooltip>
|
||||
</v-list-item>
|
||||
|
||||
|
|
@ -213,6 +217,9 @@ export default Vue.extend({
|
|||
taskCount(): number {
|
||||
return this.$store.state.komgaSse.taskCount
|
||||
},
|
||||
taskCountByType(): { [key: string]: number } {
|
||||
return this.$store.state.komgaSse.taskCountByType
|
||||
},
|
||||
libraries(): LibraryDto[] {
|
||||
return this.$store.state.komgaLibraries.libraries
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue