Files
service-finder/frontend_admin/.output/public/_nuxt/zPyClsoP.js

2 lines
13 KiB
JavaScript

import{e as G,c as i,a as e,t as a,k as _,v as H,q as K,F as k,r as w,i as g,n as r,m as v,s as T,x as h,o as n,d as y}from"./CqYPuxVf.js";const V={class:"mb-8"},F={class:"text-2xl font-bold text-white"},L={class:"text-slate-400 mt-1"},D={class:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 mb-8"},P={class:"bg-slate-800 rounded-xl border border-slate-700 p-4"},U={class:"flex items-center gap-3"},q={class:"text-xs text-slate-400 uppercase tracking-wider"},E={class:"text-2xl font-bold text-white"},Z={class:"bg-slate-800 rounded-xl border border-slate-700 p-4"},Q={class:"flex items-center gap-3"},R={class:"text-xs text-slate-400 uppercase tracking-wider"},I={class:"text-2xl font-bold text-emerald-400"},J={class:"bg-slate-800 rounded-xl border border-slate-700 p-4"},O={class:"flex items-center gap-3"},W={class:"text-xs text-slate-400 uppercase tracking-wider"},X={class:"text-2xl font-bold text-amber-400"},Y={class:"bg-slate-800 rounded-xl border border-slate-700 p-4"},ee={class:"flex items-center gap-3"},te={class:"text-xs text-slate-400 uppercase tracking-wider"},se={class:"text-2xl font-bold text-purple-400"},oe={class:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4 mb-6"},ae={class:"relative flex-1 max-w-md"},le=["placeholder"],ie={class:"flex items-center gap-2"},re={value:"all"},ne={class:"bg-slate-800/50 border border-slate-700 rounded-xl overflow-hidden"},de={class:"overflow-x-auto"},ce={class:"w-full text-sm"},ue={class:"border-b border-slate-700 bg-slate-800/80"},pe={class:"text-left py-3.5 px-4 text-xs font-semibold uppercase tracking-wider text-slate-400"},me={class:"text-left py-3.5 px-4 text-xs font-semibold uppercase tracking-wider text-slate-400"},ge={class:"text-left py-3.5 px-4 text-xs font-semibold uppercase tracking-wider text-slate-400"},ve={class:"text-left py-3.5 px-4 text-xs font-semibold uppercase tracking-wider text-slate-400"},he={class:"text-left py-3.5 px-4 text-xs font-semibold uppercase tracking-wider text-slate-400"},xe={class:"py-3.5 px-4 text-slate-400 font-mono text-xs"},fe={class:"py-3.5 px-4"},be={class:"flex items-center gap-3"},_e={class:"text-sm font-medium text-white"},ke={class:"text-xs text-slate-500"},we={class:"py-3.5 px-4 text-slate-300"},ye={class:"py-3.5 px-4"},Ce={class:"py-3.5 px-4"},$e={class:"flex items-center gap-2"},Ne=["onClick","title"],ze={key:0,class:"absolute right-0 mt-1 w-44 bg-slate-800 border border-slate-700 rounded-lg shadow-xl py-1 z-40"},Me=["onClick"],je={key:0,class:"ml-auto"},Be={class:"py-3.5 px-4"},Se={class:"flex items-center gap-2"},Ae=["onClick"],Ge=["onClick"],He={key:0,class:"flex flex-col items-center justify-center py-16 text-center"},Ke={class:"text-slate-400 text-sm"},Fe=G({__name:"index",setup(Te){const u=v(""),p=v("all"),m=v(null),c=v(null),C=["free","premium","enterprise"],d=T([{id:1,companyName:"Kovács Autószerviz",contactName:"Kovács István",email:"kovacs@autoserviz.hu",status:"active",tier:"premium",initials:"KA",colorClass:"bg-amber-600"},{id:2,companyName:"Nagy Gépjárműjavító Kft.",contactName:"Nagy Péter",email:"info@nagygepjarmu.hu",status:"active",tier:"enterprise",initials:"NG",colorClass:"bg-purple-600"},{id:3,companyName:"Tóth Autó és Motorgarázs",contactName:"Tóth Gábor",email:"toth@garazs.hu",status:"active",tier:"free",initials:"TA",colorClass:"bg-slate-600"},{id:4,companyName:"Szabó Flottakezelő Kft.",contactName:"Szabó Márta",email:"szabo@flotta.hu",status:"inactive",tier:"premium",initials:"SZ",colorClass:"bg-amber-600"},{id:5,companyName:"Horváth Autótechnika",contactName:"Horváth László",email:"horvath@autotechnika.hu",status:"suspended",tier:"free",initials:"HA",colorClass:"bg-slate-600"},{id:6,companyName:"Kiss & Társa Szerviz",contactName:"Kiss Anna",email:"kiss@szerviz.hu",status:"active",tier:"enterprise",initials:"KT",colorClass:"bg-purple-600"},{id:7,companyName:"Molnár Autóház Kft.",contactName:"Molnár Zoltán",email:"molnar@autohaz.hu",status:"active",tier:"premium",initials:"MA",colorClass:"bg-amber-600"},{id:8,companyName:"Farkas Gépjármű Szerviz",contactName:"Farkas Béla",email:"farkas@gepjarmu.hu",status:"inactive",tier:"free",initials:"FG",colorClass:"bg-slate-600"}]),$=h(()=>d.filter(t=>t.status==="active").length),N=h(()=>d.filter(t=>t.tier==="premium").length),z=h(()=>d.filter(t=>t.tier==="enterprise").length),x=h(()=>d.filter(t=>{if(u.value){const s=u.value.toLowerCase();if(!(t.companyName.toLowerCase().includes(s)||t.contactName.toLowerCase().includes(s)||t.email.toLowerCase().includes(s)))return!1}return!(p.value!=="all"&&t.tier!==p.value)}));function M(t){return t==="enterprise"?"bg-purple-500/20 text-purple-300":t==="premium"?"bg-amber-500/20 text-amber-300":"bg-slate-500/20 text-slate-300"}function j(t){m.value=m.value===t?null:t}function B(t,s){const o=d.find(b=>b.id===t);if(!o)return;const l=o.tier;o.tier=s,m.value=null,f("success",`"${o.companyName}" csomag módosítva: ${l}${s}`),console.log(`[Garages] Package changed: garage=${t}, from=${l}, to=${s}`)}function S(t){console.log(`[Garages] View garage: ${t}`)}function A(t){const s=d.find(o=>o.id===t);s&&(s.status=s.status==="active"?"inactive":"active",f("success",`"${s.companyName}" státusz módosítva: ${s.status}`),console.log(`[Garages] Status toggled: garage=${t}, newStatus=${s.status}`))}function f(t,s){c.value={type:t,message:s},setTimeout(()=>{c.value=null},4e3)}return(t,s)=>(n(),i("div",null,[e("div",V,[e("h1",F,a(t.$t("garages.title")),1),e("p",L,a(t.$t("garages.subtitle")),1)]),e("div",D,[e("div",P,[e("div",U,[s[2]||(s[2]=e("div",{class:"p-2 rounded-lg bg-indigo-500/10 text-indigo-400"},[e("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4"})])],-1)),e("div",null,[e("p",q,a(t.$t("garages.total_garages")),1),e("p",E,a(d.length),1)])])]),e("div",Z,[e("div",Q,[s[3]||(s[3]=e("div",{class:"p-2 rounded-lg bg-emerald-500/10 text-emerald-400"},[e("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})])],-1)),e("div",null,[e("p",R,a(t.$t("garages.active_garages")),1),e("p",I,a($.value),1)])])]),e("div",J,[e("div",O,[s[4]||(s[4]=e("div",{class:"p-2 rounded-lg bg-amber-500/10 text-amber-400"},[e("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})])],-1)),e("div",null,[e("p",W,a(t.$t("garages.premium_garages")),1),e("p",X,a(N.value),1)])])]),e("div",Y,[e("div",ee,[s[5]||(s[5]=e("div",{class:"p-2 rounded-lg bg-purple-500/10 text-purple-400"},[e("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z"})])],-1)),e("div",null,[e("p",te,a(t.$t("garages.enterprise_garages")),1),e("p",se,a(z.value),1)])])])]),e("div",oe,[e("div",ae,[s[6]||(s[6]=e("svg",{class:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-slate-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})],-1)),_(e("input",{"onUpdate:modelValue":s[0]||(s[0]=o=>u.value=o),type:"text",placeholder:t.$t("garages.search_placeholder"),class:"w-full pl-10 pr-4 py-2.5 bg-slate-800 border border-slate-700 rounded-lg text-sm text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500 transition"},null,8,le),[[H,u.value]])]),e("div",ie,[_(e("select",{"onUpdate:modelValue":s[1]||(s[1]=o=>p.value=o),class:"px-3 py-2.5 bg-slate-800 border border-slate-700 rounded-lg text-sm text-slate-300 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 transition"},[e("option",re,a(t.$t("garages.all_tiers")),1),s[7]||(s[7]=e("option",{value:"free"},"Free",-1)),s[8]||(s[8]=e("option",{value:"premium"},"Premium",-1)),s[9]||(s[9]=e("option",{value:"enterprise"},"Enterprise",-1))],512),[[K,p.value]])])]),e("div",ne,[e("div",de,[e("table",ce,[e("thead",null,[e("tr",ue,[s[10]||(s[10]=e("th",{class:"text-left py-3.5 px-4 text-xs font-semibold uppercase tracking-wider text-slate-400"},"ID",-1)),e("th",pe,a(t.$t("garages.company_name")),1),e("th",me,a(t.$t("garages.email")),1),e("th",ge,a(t.$t("garages.status")),1),e("th",ve,a(t.$t("garages.current_package")),1),e("th",he,a(t.$t("garages.actions")),1)])]),e("tbody",null,[(n(!0),i(k,null,w(x.value,o=>(n(),i("tr",{key:o.id,class:"border-b border-slate-700/50 hover:bg-slate-700/30 transition"},[e("td",xe,a(o.id),1),e("td",fe,[e("div",be,[e("div",{class:r(["w-8 h-8 rounded-lg flex items-center justify-center text-sm font-bold text-white",o.colorClass])},a(o.initials),3),e("div",null,[e("p",_e,a(o.companyName),1),e("p",ke,a(o.contactName),1)])])]),e("td",we,a(o.email),1),e("td",ye,[e("span",{class:r(["inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium",o.status==="active"?"bg-emerald-500/10 text-emerald-400":o.status==="suspended"?"bg-red-500/10 text-red-400":"bg-slate-500/10 text-slate-400"])},[e("span",{class:r(["w-1.5 h-1.5 rounded-full mr-1.5",o.status==="active"?"bg-emerald-400":o.status==="suspended"?"bg-red-400":"bg-slate-400"])},null,2),y(" "+a(o.status==="active"?t.$t("garages.active"):o.status==="suspended"?t.$t("garages.suspended"):t.$t("garages.inactive")),1)],2)]),e("td",Ce,[e("div",$e,[e("span",{class:r(["px-2.5 py-0.5 rounded-full text-xs font-medium",M(o.tier)])},a(o.tier),3),e("div",{class:"relative",ref_for:!0,ref:"dropdownRefs"},[e("button",{onClick:l=>j(o.id),class:"p-1.5 rounded-lg text-slate-400 hover:text-white hover:bg-slate-700 transition",title:t.$t("garages.change_package")},[...s[11]||(s[11]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.066 2.573c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.573 1.066c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.066-2.573c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})],-1)])],8,Ne),m.value===o.id?(n(),i("div",ze,[(n(),i(k,null,w(C,l=>e("button",{key:l,onClick:b=>B(o.id,l),class:r(["flex items-center gap-2 w-full px-3 py-2 text-sm text-left transition",o.tier===l?"text-indigo-400 bg-indigo-500/10":"text-slate-300 hover:bg-slate-700 hover:text-white"])},[e("span",{class:r(["w-2 h-2 rounded-full",l==="free"?"bg-slate-400":l==="premium"?"bg-amber-400":"bg-purple-400"])},null,2),y(" "+a(l.charAt(0).toUpperCase()+l.slice(1))+" ",1),o.tier===l?(n(),i("span",je,[...s[12]||(s[12]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"})],-1)])])):g("",!0)],10,Me)),64))])):g("",!0)],512)])]),e("td",Be,[e("div",Se,[e("button",{onClick:l=>S(o.id),class:"px-3 py-1.5 text-xs font-medium bg-indigo-600/20 text-indigo-300 hover:bg-indigo-600/30 rounded-lg transition"},a(t.$t("garages.view")),9,Ae),e("button",{onClick:l=>A(o.id),class:r(["px-3 py-1.5 text-xs font-medium rounded-lg transition",o.status==="active"?"bg-red-500/10 text-red-300 hover:bg-red-500/20":"bg-emerald-500/10 text-emerald-300 hover:bg-emerald-500/20"])},a(o.status==="active"?t.$t("garages.deactivate"):t.$t("garages.activate")),11,Ge)])])]))),128))])])]),x.value.length===0?(n(),i("div",He,[s[13]||(s[13]=e("svg",{class:"w-12 h-12 text-slate-600 mb-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4"})],-1)),e("p",Ke,a(t.$t("garages.no_results")),1)])):g("",!0)]),c.value?(n(),i("div",{key:0,class:r(["fixed bottom-6 right-6 px-5 py-3 rounded-xl shadow-xl text-sm font-medium z-50",c.value.type==="success"?"bg-emerald-600 text-white":"bg-red-600 text-white"])},a(c.value.message),3)):g("",!0)]))}});export{Fe as default};