diff --git a/app/components/dashboard/AdminDashboard.vue b/app/components/dashboard/AdminDashboard.vue index f1e07b3..fa6889a 100644 --- a/app/components/dashboard/AdminDashboard.vue +++ b/app/components/dashboard/AdminDashboard.vue @@ -2,97 +2,243 @@ const { getOverviewStats } = useAdmin() const { data: statsRes, pending } = useAsyncData('admin-stats', () => getOverviewStats()) + +const totalReports = computed(() => + statsRes.value?.reports_by_status?.reduce((sum, item) => sum + Number(item.total), 0) || 0 +) + +const reportCountByStatus = (status: string) => + statsRes.value?.reports_by_status?.find(item => item.status === status)?.total ?? 0 + +const quickLinks = [ + { + to: '/admin/reports', + icon: 'it-files', + title: 'Overview segnalazioni', + text: 'Vista completa, sola lettura, con stato e distribuzione.', + tone: 'primary' + }, + { + to: '/admin/catalog', + icon: 'it-list', + title: 'Categorie e team', + text: 'Gestione riferimento operativo e gruppi esterni.', + tone: 'primary' + }, + { + to: '/admin/areas', + icon: 'it-map-marker', + title: 'Aree', + text: 'Confini e copertura territoriale.', + tone: 'primary' + }, + { + to: '/admin/users', + icon: 'it-user', + title: 'Utenti', + text: 'Ruoli, stato account, ban.', + tone: 'primary' + }, + { + to: '/admin/moderation', + icon: 'it-warning', + title: 'Moderazione abusi', + text: 'Gestione flag e contenuti segnalati.', + tone: 'danger' + } +] + + diff --git a/app/composables/useReports.ts b/app/composables/useReports.ts index 57ebc23..d83aa98 100644 --- a/app/composables/useReports.ts +++ b/app/composables/useReports.ts @@ -9,7 +9,7 @@ import type { } from "~/types/api"; export const useReports = () => { - const getReports = (query?: { area_id?: number; category_id?: number; status?: string }) => + const getReports = (query?: { area_id?: number; category_id?: number; status?: string; page?: number; per_page?: number }) => useApiFetch('/api/v1/reports', { method: 'GET', query }) const getCategories = () => diff --git a/app/pages/admin/reports.vue b/app/pages/admin/reports.vue new file mode 100644 index 0000000..47c1e31 --- /dev/null +++ b/app/pages/admin/reports.vue @@ -0,0 +1,290 @@ + + + + + diff --git a/footer.png b/footer.png deleted file mode 100644 index dc3fc09..0000000 Binary files a/footer.png and /dev/null differ