Files
service-finder/frontend_admin/.output/public/_nuxt/DN2UwQHX.js
2026-07-01 02:27:38 +00:00

2 lines
12 KiB
JavaScript

import{e as f,f as w,g as k,h as y,o as i,c as d,a as t,t as e,i as s,d as _,F as m,j as z,r as u,n as C,k as V,l as x,m as M}from"./Duy9QquX.js";const j={class:"mb-8"},H={class:"text-2xl font-bold text-white"},A={class:"text-slate-400 mt-1"},B={key:0,class:"flex items-center justify-center py-20"},N={class:"text-slate-400 flex items-center gap-3"},F={key:1,class:"bg-rose-500/10 border border-rose-500/30 rounded-xl p-6 mb-8"},L={class:"text-rose-400"},I={class:"grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-4 gap-6 mb-8"},P={class:"bg-slate-800 rounded-xl border border-slate-700 p-6 hover:border-indigo-500/50 transition group"},S={class:"flex items-center justify-between mb-4"},q={key:0,class:"text-xs font-medium text-emerald-400 bg-emerald-400/10 px-2 py-1 rounded-full"},D={class:"text-sm font-medium text-slate-400 uppercase tracking-wider"},T={class:"text-3xl font-bold text-white mt-2"},$={class:"text-xs text-slate-500 mt-1"},E={class:"bg-slate-800 rounded-xl border border-slate-700 p-6 hover:border-cyan-500/50 transition group"},G={class:"text-sm font-medium text-slate-400 uppercase tracking-wider"},X={class:"text-3xl font-bold text-white mt-2"},Y={class:"bg-slate-800 rounded-xl border border-slate-700 p-6 hover:border-emerald-500/50 transition group"},Z={class:"text-sm font-medium text-slate-400 uppercase tracking-wider"},J={class:"text-3xl font-bold text-white mt-2"},K={class:"text-xs text-slate-500 mt-1"},O={class:"bg-slate-800 rounded-xl border border-slate-700 p-6 hover:border-violet-500/50 transition group"},Q={class:"text-sm font-medium text-slate-400 uppercase tracking-wider"},R={class:"text-3xl font-bold text-white mt-2"},U={class:"text-xs text-slate-500 mt-1"},W={class:"grid grid-cols-1 lg:grid-cols-3 gap-6 mb-8"},tt={class:"bg-slate-800 rounded-xl border border-slate-700 p-6"},et={class:"text-sm font-medium text-slate-400 uppercase tracking-wider mb-4"},st={class:"space-y-3"},ot={class:"text-sm text-slate-300"},rt={class:"text-sm font-semibold text-white"},at={class:"bg-slate-800 rounded-xl border border-slate-700 p-6"},nt={class:"text-sm font-medium text-slate-400 uppercase tracking-wider mb-4"},it={class:"space-y-3"},dt={class:"text-sm text-slate-300"},lt={class:"text-sm font-semibold text-white"},ct={class:"bg-slate-800 rounded-xl border border-slate-700 p-6"},ht={class:"text-sm font-medium text-slate-400 uppercase tracking-wider mb-4"},mt={class:"space-y-3"},ut={class:"text-sm text-slate-300"},_t={class:"text-sm font-semibold text-white"},xt={class:"bg-slate-800 rounded-xl border border-slate-700 p-6 mb-8"},bt={class:"text-sm font-medium text-slate-400 uppercase tracking-wider mb-4"},pt={class:"flex items-end gap-1 h-32"},gt=["title"],vt={class:"absolute -top-8 left-1/2 -translate-x-1/2 bg-slate-700 text-xs text-white px-2 py-1 rounded opacity-0 group-hover:opacity-100 transition whitespace-nowrap"},ft={class:"grid grid-cols-1 lg:grid-cols-2 gap-6"},wt={class:"bg-slate-800 rounded-xl border border-slate-700 p-6"},kt={class:"text-lg font-semibold text-white mb-4"},yt={class:"space-y-3"},zt={class:"w-full flex items-center gap-3 px-4 py-3 bg-slate-700/50 hover:bg-slate-700 rounded-lg text-sm text-slate-300 hover:text-white transition text-left"},Ct={class:"w-full flex items-center gap-3 px-4 py-3 bg-slate-700/50 hover:bg-slate-700 rounded-lg text-sm text-slate-300 hover:text-white transition text-left"},Vt={class:"w-full flex items-center gap-3 px-4 py-3 bg-slate-700/50 hover:bg-slate-700 rounded-lg text-sm text-slate-300 hover:text-white transition text-left"},Mt={class:"bg-slate-800 rounded-xl border border-slate-700 p-6"},jt={class:"text-lg font-semibold text-white mb-4"},Ht={class:"space-y-4"},At={class:"flex-1 min-w-0"},Bt={class:"text-sm text-slate-300"},Nt={class:"text-xs text-slate-500 mt-0.5"},It=f({__name:"index",setup(Ft){const{t:a}=w(),b=x(!0),p=x(!1),n=x({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:[]}),g=M(()=>{const c=n.value.registration_trend;if(!c.length)return[];const r=Math.max(...c.map(o=>o.count));return c.map(o=>({date:o.date,count:o.count,height:r>0?o.count/r*100:0}))});function h(c){return new Intl.NumberFormat().format(c)}const v=[{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: €120.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 k(async()=>{try{const r=y("access_token").value,o=await $fetch("/api/v1/admin/users/stats",{headers:r?{Authorization:`Bearer ${r}`}:void 0});n.value=o}catch(c){console.error("Failed to load dashboard stats:",c),p.value=!0}finally{b.value=!1}}),(c,r)=>(i(),d("div",null,[t("div",j,[t("h1",H,e(s(a)("dashboard.title")),1),t("p",A,e(s(a)("dashboard.subtitle")),1)]),s(b)?(i(),d("div",B,[t("div",N,[r[0]||(r[0]=t("svg",{class:"w-5 h-5 animate-spin",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})],-1)),_(" "+e(s(a)("dashboard.loading")),1)])])):s(p)?(i(),d("div",F,[t("p",L,e(s(a)("dashboard.error")),1)])):(i(),d(m,{key:2},[t("div",I,[t("div",P,[t("div",S,[r[1]||(r[1]=t("div",{class:"p-2 rounded-lg bg-indigo-500/10 text-indigo-400 group-hover:bg-indigo-500/20 transition"},[t("svg",{class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197m13.5-9a2.25 2.25 0 11-4.5 0 2.25 2.25 0 014.5 0z"})])],-1)),s(n).new_users_this_month>0?(i(),d("span",q,"+"+e(s(n).new_users_this_month),1)):z("",!0)]),t("h3",D,e(s(a)("dashboard.active_users")),1),t("p",T,e(h(s(n).active_users)),1),t("p",$,e(h(s(n).new_users_this_month))+" "+e(s(a)("dashboard.new_this_month")),1)]),t("div",E,[r[2]||(r[2]=t("div",{class:"flex items-center justify-between mb-4"},[t("div",{class:"p-2 rounded-lg bg-cyan-500/10 text-cyan-400 group-hover:bg-cyan-500/20 transition"},[t("svg",{class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13.5 21v-7.5a.75.75 0 01.75-.75h3a.75.75 0 01.75.75V21m-4.5 0H2.36m11.14 0H18m0 0h3.64m-1.39 0V9.349m-16.5 11.65V9.35m0 0a3.001 3.001 0 003.75-.615A2.993 2.993 0 009.75 9.75c.896 0 1.7-.393 2.25-1.016a2.993 2.993 0 002.25 1.016c.896 0 1.7-.393 2.25-1.016a3.001 3.001 0 003.75.614m-16.5 0a3.004 3.004 0 01-.621-4.72L4.318 3.44A1.5 1.5 0 015.378 3h13.243a1.5 1.5 0 011.06.44l1.19 1.189a3 3 0 01-.621 4.72m-13.5 8.65h3.75a.75.75 0 00.75-.75V13.5a.75.75 0 00-.75-.75H6.75a.75.75 0 00-.75.75v3.75c0 .415.336.75.75.75z"})])])],-1)),t("h3",G,e(s(a)("dashboard.total_vehicles")),1),t("p",X,e(h(s(n).total_vehicles)),1)]),t("div",Y,[r[3]||(r[3]=t("div",{class:"flex items-center justify-between mb-4"},[t("div",{class:"p-2 rounded-lg bg-emerald-500/10 text-emerald-400 group-hover:bg-emerald-500/20 transition"},[t("svg",{class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M2.25 21h19.5m-18-18v18m10.5-18v18m6-13.5V21M6.75 6.75h.75m-.75 3h.75m-.75 3h.75m3-6h.75m-.75 3h.75m-.75 3h.75M6.75 21v-3.375c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125V21M3 3h12m-.75 4.5H21m-3.75 3.75h.008v.008h-.008v-.008zm0 3h.008v.008h-.008v-.008zm0 3h.008v.008h-.008v-.008z"})])])],-1)),t("h3",Z,e(s(a)("dashboard.organizations")),1),t("p",J,e(h(s(n).active_organizations_count)),1),t("p",K,e(h(s(n).total_memberships))+" "+e(s(a)("dashboard.memberships")),1)]),t("div",O,[r[4]||(r[4]=t("div",{class:"flex items-center justify-between mb-4"},[t("div",{class:"p-2 rounded-lg bg-violet-500/10 text-violet-400 group-hover:bg-violet-500/20 transition"},[t("svg",{class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M18 18.72a9.094 9.094 0 003.741-.479 3 3 0 00-4.682-2.72m.94 3.198l.001.031c0 .225-.012.447-.037.666A11.944 11.944 0 0112 21c-2.17 0-4.207-.576-5.963-1.584A6.062 6.062 0 016 18.719m12 0a5.971 5.971 0 00-.941-3.197m0 0A5.995 5.995 0 0012 12.75a5.995 5.995 0 00-5.058 2.772m0 0a3 3 0 00-4.681 2.72 8.986 8.986 0 003.74.477m.94-3.197a5.971 5.971 0 00-.94 3.197M15 6.75a3 3 0 11-6 0 3 3 0 016 0zm6 3a2.25 2.25 0 11-4.5 0 2.25 2.25 0 014.5 0zm-13.5 0a2.25 2.25 0 11-4.5 0 2.25 2.25 0 014.5 0z"})])])],-1)),t("h3",Q,e(s(a)("dashboard.new_users")),1),t("p",R,e(h(s(n).new_users_this_month)),1),t("p",U,e(h(s(n).new_users_today))+" "+e(s(a)("dashboard.new_today")),1)])]),t("div",W,[t("div",tt,[t("h3",et,e(s(a)("dashboard.users_by_role")),1),t("div",st,[(i(!0),d(m,null,u(s(n).users_by_role,(o,l)=>(i(),d("div",{key:l,class:"flex items-center justify-between"},[t("span",ot,e(l),1),t("span",rt,e(o),1)]))),128))])]),t("div",at,[t("h3",nt,e(s(a)("dashboard.users_by_plan")),1),t("div",it,[(i(!0),d(m,null,u(s(n).users_by_plan,(o,l)=>(i(),d("div",{key:l,class:"flex items-center justify-between"},[t("span",dt,e(l),1),t("span",lt,e(o),1)]))),128))])]),t("div",ct,[t("h3",ht,e(s(a)("dashboard.users_by_language")),1),t("div",mt,[(i(!0),d(m,null,u(s(n).users_by_language,(o,l)=>(i(),d("div",{key:l,class:"flex items-center justify-between"},[t("span",ut,e(l),1),t("span",_t,e(o),1)]))),128))])])]),t("div",xt,[t("h3",bt,e(s(a)("dashboard.registration_trend")),1),t("div",pt,[(i(!0),d(m,null,u(s(g),(o,l)=>(i(),d("div",{key:l,class:"flex-1 bg-indigo-500/60 hover:bg-indigo-400/80 rounded-t transition-all cursor-pointer relative group",style:C({height:o.height+"%"}),title:o.date+": "+o.count+" users"},[t("div",vt,e(o.date)+": "+e(o.count),1)],12,gt))),128))])]),t("div",ft,[t("div",wt,[t("h2",kt,e(s(a)("dashboard.quick_actions")),1),t("div",yt,[t("button",zt,[r[5]||(r[5]=t("svg",{class:"w-5 h-5 text-indigo-400 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197m13.5-9a2.25 2.25 0 11-4.5 0 2.25 2.25 0 014.5 0z"})],-1)),_(" "+e(s(a)("dashboard.invite_admin")),1)]),t("button",Ct,[r[6]||(r[6]=t("svg",{class:"w-5 h-5 text-cyan-400 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13.5 21v-7.5a.75.75 0 01.75-.75h3a.75.75 0 01.75.75V21m-4.5 0H2.36m11.14 0H18m0 0h3.64m-1.39 0V9.349m-16.5 11.65V9.35m0 0a3.001 3.001 0 003.75-.615A2.993 2.993 0 009.75 9.75c.896 0 1.7-.393 2.25-1.016a2.993 2.993 0 002.25 1.016c.896 0 1.7-.393 2.25-1.016a3.001 3.001 0 003.75.614m-16.5 0a3.004 3.004 0 01-.621-4.72L4.318 3.44A1.5 1.5 0 015.378 3h13.243a1.5 1.5 0 011.06.44l1.19 1.189a3 3 0 01-.621 4.72m-13.5 8.65h3.75a.75.75 0 00.75-.75V13.5a.75.75 0 00-.75-.75H6.75a.75.75 0 00-.75.75v3.75c0 .415.336.75.75.75z"})],-1)),_(" "+e(s(a)("dashboard.add_vehicle")),1)]),t("button",Vt,[r[7]||(r[7]=t("svg",{class:"w-5 h-5 text-emerald-400 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12h3.75M9 15h3.75M9 18h3.75m3 .75H18a2.25 2.25 0 002.25-2.25V6.108c0-1.135-.845-2.098-1.976-2.192a48.424 48.424 0 00-1.123-.08m-5.801 0c-.065.21-.1.433-.1.664 0 .414.336.75.75.75h4.5a.75.75 0 00.75-.75 2.25 2.25 0 00-.1-.664m-5.8 0A2.251 2.251 0 0113.5 2.25H15a2.25 2.25 0 012.15 1.586m-5.8 0c-.376.023-.75.05-1.124.08C9.095 4.01 8.25 4.973 8.25 6.108V8.25m0 0H4.875c-.621 0-1.125.504-1.125 1.125v11.25c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V9.375c0-.621-.504-1.125-1.125-1.125H8.25zM6.75 12h.008v.008H6.75V12zm0 3h.008v.008H6.75V15zm0 3h.008v.008H6.75V18z"})],-1)),_(" "+e(s(a)("dashboard.view_reports")),1)])])]),t("div",Mt,[t("h2",jt,e(s(a)("dashboard.recent_activity")),1),t("div",Ht,[(i(),d(m,null,u(v,(o,l)=>t("div",{key:l,class:"flex items-start gap-3"},[t("div",{class:V(["w-2 h-2 mt-2 rounded-full flex-shrink-0",o.dotColor])},null,2),t("div",At,[t("p",Bt,e(o.text),1),t("p",Nt,e(o.time),1)])])),64))])])])],64))]))}});export{It as default};