diff --git a/frontend/src/components/Dashboard.vue b/frontend/src/components/Dashboard.vue index c19f3ce..7411719 100644 --- a/frontend/src/components/Dashboard.vue +++ b/frontend/src/components/Dashboard.vue @@ -60,19 +60,21 @@ ].filter((s) => s.tasks.length > 0), ) -// Сводка по статусам (открытые + стек на детализацию) +// Сводка: объём и результативность. Стек/в работе не дублируем — они и так +// видны в секциях дашборда и шапке страницы. const overviewRows = computed(() => { const all = props.tasks + const monthAgo = new Date() + monthAgo.setDate(monthAgo.getDate() - 30) + const doneTasks = all.filter((task) => task.status === 'done') + const doneMonth = doneTasks.filter( + (task) => task.done_at && new Date(task.done_at) >= monthAgo, + ).length const open = all.filter((task) => task.status !== 'done' && task.status !== 'cancelled') const rows: { key: string; icon: string; term: string; value: number; warn?: boolean }[] = [ - { - key: 'stack', - icon: 'ph-tray', - term: t('nav.stack'), - value: all.filter((task) => task.detail_state === 'raw').length, - }, - { key: 'inProgress', icon: 'ph-circle-half', term: t('home.inProgress'), value: inProgress.value.length }, - { key: 'toDo', icon: 'ph-square', term: t('home.next'), value: next.value.length }, + { key: 'total', icon: 'ph-stack', term: t('home.totalTasks'), value: all.length }, + { key: 'doneMonth', icon: 'ph-check-circle', term: t('home.doneMonth'), value: doneMonth }, + { key: 'doneAll', icon: 'ph-trophy', term: t('home.doneAll'), value: doneTasks.length }, { key: 'deferred', icon: 'ph-pause-circle', diff --git a/frontend/src/locales/en.ts b/frontend/src/locales/en.ts index 6ddd80f..8c92109 100644 --- a/frontend/src/locales/en.ts +++ b/frontend/src/locales/en.ts @@ -51,6 +51,9 @@ next: 'Up next', overview: 'Overview', projects: 'Active projects', + totalTasks: 'Total tasks', + doneMonth: 'Done this month', + doneAll: 'Done all time', clearTitle: 'All clear', clearText: 'No active tasks — a good moment to work through the stack.', }, diff --git a/frontend/src/locales/ru.ts b/frontend/src/locales/ru.ts index e903211..b120fa4 100644 --- a/frontend/src/locales/ru.ts +++ b/frontend/src/locales/ru.ts @@ -52,6 +52,9 @@ next: 'Следующие', overview: 'Обзор', projects: 'Активные проекты', + totalTasks: 'Всего задач', + doneMonth: 'Выполнено за месяц', + doneAll: 'Выполнено всего', clearTitle: 'Всё спокойно', clearText: 'Нет активных задач — самое время закрыть что-то из стека.', }, diff --git a/frontend/src/locales/uk.ts b/frontend/src/locales/uk.ts index 8bf567b..4c38cfe 100644 --- a/frontend/src/locales/uk.ts +++ b/frontend/src/locales/uk.ts @@ -51,6 +51,9 @@ next: 'Наступні', overview: 'Огляд', projects: 'Активні проєкти', + totalTasks: 'Усього завдань', + doneMonth: 'Виконано за місяць', + doneAll: 'Виконано загалом', clearTitle: 'Усе спокійно', clearText: 'Немає активних завдань — гарний момент розібрати стек.', },