diff --git a/komga-webui/src/plugins/komga-sse.plugin.ts b/komga-webui/src/plugins/komga-sse.plugin.ts index 12e33c318..91c05db22 100644 --- a/komga-webui/src/plugins/komga-sse.plugin.ts +++ b/komga-webui/src/plugins/komga-sse.plugin.ts @@ -5,10 +5,12 @@ import {Module} from "vuex"; const vuexModule: Module = { 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 }, }, } diff --git a/komga-webui/src/services/komga-sse.service.ts b/komga-webui/src/services/komga-sse.service.ts index 416eb345a..c0bbf5507 100644 --- a/komga-webui/src/services/komga-sse.service.ts +++ b/komga-webui/src/services/komga-sse.service.ts @@ -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) } } diff --git a/komga-webui/src/types/komga-sse.ts b/komga-webui/src/types/komga-sse.ts index 90b8d9603..1a58a8f9d 100644 --- a/komga-webui/src/types/komga-sse.ts +++ b/komga-webui/src/types/komga-sse.ts @@ -44,6 +44,7 @@ export interface ThumbnailSeriesSseDto { export interface TaskQueueSseDto { count: number, + countByType: { [key: string]: number } } export interface BookImportSseDto { diff --git a/komga-webui/src/views/Home.vue b/komga-webui/src/views/Home.vue index 7c85b3098..5802e0751 100644 --- a/komga-webui/src/views/Home.vue +++ b/komga-webui/src/views/Home.vue @@ -42,7 +42,11 @@ v-on="on" /> - {{ $tc('common.pending_tasks', taskCount) }} +
{{ $tc('common.pending_tasks', taskCount) }}
+
{{ taskType }}: {{ taskCountByType[taskType] }} +
@@ -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 },