import { defineComponent, ref, computed, unref, useSSRContext } from 'vue'; import { ssrRenderAttrs, ssrInterpolate, ssrRenderList, ssrRenderStyle, ssrRenderAttr, ssrRenderClass } from 'vue/server-renderer'; import { a as useI18n } from './server.mjs'; import '../nitro/nitro.mjs'; import 'node:http'; import 'node:https'; import 'node:events'; import 'node:buffer'; import 'node:fs'; import 'node:path'; import 'node:crypto'; import 'vue-router'; import 'node:url'; import 'pinia'; import '../routes/renderer.mjs'; import 'vue-bundle-renderer/runtime'; import 'unhead/server'; import 'devalue'; import 'unhead/utils'; import 'unhead/plugins'; const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "index", __ssrInlineRender: true, setup(__props) { const { t } = useI18n(); const loading = ref(true); const error = ref(false); const stats = ref({ total_users: 0, active_users: 0, deleted_users: 0, banned_users: 0, new_users_today: 0, new_users_this_week: 0, new_users_this_month: 0, users_by_role: {}, users_by_plan: {}, users_by_language: {}, users_with_person: 0, users_without_person: 0, total_vehicles: 0, active_organizations_count: 0, total_memberships: 0, registration_trend: [] }); const registrationTrend = computed(() => { const trend = stats.value.registration_trend; if (!trend.length) return []; const maxCount = Math.max(...trend.map((d) => d.count)); return trend.map((d) => ({ date: d.date, count: d.count, height: maxCount > 0 ? d.count / maxCount * 100 : 0 })); }); function formatNumber(num) { return new Intl.NumberFormat().format(num); } const recentActivities = [ { text: "New user registered: john.doe@example.com", time: "2 minutes ago", dotColor: "bg-emerald-400" }, { text: "Vehicle #V-8842 added to catalog", time: "15 minutes ago", dotColor: "bg-cyan-400" }, { text: "Payment received: \u20AC120.00 from Garage XYZ", time: "1 hour ago", dotColor: "bg-emerald-400" }, { text: "System error: DVLA API timeout on request #4421", time: "2 hours ago", dotColor: "bg-rose-400" }, { text: "Permission updated for user: superadmin@sf.hu", time: "3 hours ago", dotColor: "bg-indigo-400" } ]; return (_ctx, _push, _parent, _attrs) => { _push(`
${ssrInterpolate(unref(t)("dashboard.subtitle"))}
${ssrInterpolate(unref(t)("dashboard.error"))}
${ssrInterpolate(formatNumber(unref(stats).active_users))}
${ssrInterpolate(formatNumber(unref(stats).new_users_this_month))} ${ssrInterpolate(unref(t)("dashboard.new_this_month"))}
${ssrInterpolate(formatNumber(unref(stats).total_vehicles))}
${ssrInterpolate(formatNumber(unref(stats).active_organizations_count))}
${ssrInterpolate(formatNumber(unref(stats).total_memberships))} ${ssrInterpolate(unref(t)("dashboard.memberships"))}
${ssrInterpolate(formatNumber(unref(stats).new_users_this_month))}
${ssrInterpolate(formatNumber(unref(stats).new_users_today))} ${ssrInterpolate(unref(t)("dashboard.new_today"))}
${ssrInterpolate(activity.text)}
${ssrInterpolate(activity.time)}