2 lines
10 KiB
JavaScript
2 lines
10 KiB
JavaScript
import{_ as E}from"./QKJPEFuj.js";import{g as D,A as N,k as W,B as O,C as P,o as s,c as l,m as k,a as e,n as v,F as x,r as y,t as d,q as m,D as g,E as H,w as M,b as K,d as L,G as J,x as f,H as z}from"./C3Ck-LNv.js";import{u as U,_ as S}from"./ByPKVH1D.js";import"./BoAo7BJa.js";const q={class:"min-h-screen bg-slate-900 text-white flex"},I={class:"flex items-center h-16 px-4 border-b border-slate-700"},Q={key:0,class:"flex items-center gap-3"},X={key:1,class:"mx-auto"},Y={class:"flex-1 px-2 py-4 space-y-2 overflow-y-auto"},Z={key:0,class:"px-3 py-1 text-xs font-semibold uppercase tracking-wider text-slate-500"},ee={key:0},te=["onClick"],se=["innerHTML"],oe={class:"ml-2 mt-1 space-y-1 overflow-hidden transition-all duration-200"},le=["innerHTML"],ne={class:"whitespace-nowrap"},ae=["innerHTML"],re={class:"p-4 border-t border-slate-700"},ie={key:0,class:"text-xs text-slate-500"},de={class:"flex-1 flex flex-col min-w-0"},ue={class:"sticky top-0 z-10 bg-slate-800/95 backdrop-blur-sm border-b border-slate-700"},he={class:"flex items-center justify-between h-16 px-4 lg:px-6"},ce={class:"flex items-center gap-3"},ve={class:"text-lg font-semibold text-white truncate"},pe={class:"w-8 h-8 rounded-full bg-indigo-600 flex items-center justify-center text-sm font-bold text-white"},xe={class:"hidden sm:block text-sm text-slate-300"},fe={key:0,class:"absolute right-0 mt-2 w-56 bg-slate-800 border border-slate-700 rounded-xl shadow-xl py-1 z-50"},ke={class:"px-4 py-3 border-b border-slate-700"},me={class:"text-sm font-medium text-white"},ge={class:"flex-1 p-4 lg:p-6 overflow-auto"},ze=D({__name:"default",setup(we){const u=N(),V=W(),w=U(),n=f(!1),r=f(!1),c=f(!1),b=f(null),p=f(new Set(["Központ"])),j=z(()=>w.userEmail||"admin@servicefinder.hu"),F=z(()=>{const o=w.userEmail;return o?o.split("@")[0].split(".").map(t=>t[0]).join("").toUpperCase().slice(0,2):"AD"}),$=[{title:"Központ",items:[{path:"/",label:"Dashboard",icon:'<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" /></svg>'}]},{title:"Felhasználók & Partnerek",items:[{label:"Garázsok",icon:'<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><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" /></svg>',children:[{path:"/garages",label:"Garázsok listája",icon:'<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16" /></svg>'}]},{label:"Felhasználók",icon:'<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><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.5 2.5 0 11-5 0 2.5 2.5 0 015 0z" /></svg>',children:[{path:"/users",label:"Felhasználók listája",icon:'<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><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.5 2.5 0 11-5 0 2.5 2.5 0 015 0z" /></svg>'}]}]},{title:"Rendszer",items:[{path:"/permissions",label:"Jogosultságok",icon:'<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z" /></svg>'},{label:"Rendszernaplók",icon:'<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /></svg>',children:[{path:"/logs",label:"Rendszernaplók",icon:'<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /></svg>'}]}]}],A=z(()=>u.path==="/"?"Dashboard":u.path.startsWith("/permissions")?"Jogosultság Kezelés":u.path.startsWith("/garages")?"Garázsok":u.path.startsWith("/users")?"Felhasználók":u.path.startsWith("/logs")?"Rendszernaplók":"Admin Panel");function _(o){return o==="/"?u.path==="/":u.path.startsWith(o)}function G(o){return o.children?o.children.some(t=>_(t.path)):!1}function R(o){p.value.has(o.label)?p.value.delete(o.label):p.value.add(o.label)}function T(){w.logout(),c.value=!1,V.push("/login")}function B(o){b.value&&!b.value.contains(o.target)&&(c.value=!1)}return O(()=>{document.addEventListener("click",B)}),P(()=>{document.removeEventListener("click",B)}),(o,t)=>{const C=E;return s(),l("div",q,[n.value?(s(),l("div",{key:0,class:"fixed inset-0 bg-black/50 z-20 lg:hidden",onClick:t[0]||(t[0]=i=>n.value=!1)})):k("",!0),e("aside",{class:v(["fixed lg:static inset-y-0 left-0 z-30 flex flex-col bg-slate-800 border-r border-slate-700 transition-all duration-300",n.value?"w-64 translate-x-0":"-translate-x-full lg:translate-x-0 lg:w-20"])},[e("div",I,[n.value||!r.value?(s(),l("div",Q,[...t[7]||(t[7]=[e("img",{src:S,class:"h-8 w-auto",alt:"SF Logo"},null,-1),e("span",{class:"text-lg font-bold text-white whitespace-nowrap"},"Admin Panel",-1)])])):(s(),l("div",X,[...t[8]||(t[8]=[e("img",{src:S,class:"h-8 w-auto",alt:"SF Logo"},null,-1)])]))]),e("button",{class:"hidden lg:flex items-center justify-center h-10 mx-2 mt-2 rounded-lg text-slate-400 hover:text-white hover:bg-slate-700 transition",onClick:t[1]||(t[1]=i=>r.value=!r.value)},[(s(),l("svg",{class:v(["w-5 h-5 transition-transform duration-300",{"rotate-180":r.value}]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...t[9]||(t[9]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M11 19l-7-7 7-7m8 14l-7-7 7-7"},null,-1)])],2))]),e("nav",Y,[(s(),l(x,null,y($,i=>(s(),l(x,{key:i.title},[!r.value||n.value?(s(),l("div",Z,d(i.title),1)):k("",!0),(s(!0),l(x,null,y(i.items,a=>(s(),l(x,{key:a.label},[a.children?(s(),l("div",ee,[e("button",{class:v(["flex items-center w-full gap-3 px-3 py-2.5 rounded-lg text-sm font-medium transition",G(a)?"bg-indigo-600/20 text-indigo-300":"text-slate-300 hover:bg-slate-700 hover:text-white"]),onClick:h=>R(a)},[e("span",{class:"flex-shrink-0 w-5 h-5",innerHTML:a.icon},null,8,se),m(e("span",{class:"flex-1 text-left whitespace-nowrap"},d(a.label),513),[[g,!r.value||n.value]]),m((s(),l("svg",{class:v(["w-4 h-4 transition-transform duration-200",{"rotate-90":p.value.has(a.label)}]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...t[10]||(t[10]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"},null,-1)])],2)),[[g,!r.value||n.value]])],10,te),m(e("div",oe,[(s(!0),l(x,null,y(a.children,h=>(s(),H(C,{key:h.path,to:h.path,class:v(["flex items-center gap-3 px-3 py-2 rounded-lg text-sm font-medium transition",_(h.path)?"bg-indigo-600 text-white":"text-slate-400 hover:bg-slate-700 hover:text-white"]),onClick:t[2]||(t[2]=be=>n.value=!1)},{default:M(()=>[e("span",{class:"flex-shrink-0 w-4 h-4",innerHTML:h.icon},null,8,le),e("span",ne,d(h.label),1)]),_:2},1032,["to","class"]))),128))],512),[[g,p.value.has(a.label)&&(!r.value||n.value)]])])):(s(),H(C,{key:1,to:a.path,class:v(["flex items-center gap-3 px-3 py-2.5 rounded-lg text-sm font-medium transition",_(a.path)?"bg-indigo-600 text-white":"text-slate-300 hover:bg-slate-700 hover:text-white"]),onClick:t[3]||(t[3]=h=>n.value=!1)},{default:M(()=>[e("span",{class:"flex-shrink-0 w-5 h-5",innerHTML:a.icon},null,8,ae),m(e("span",{class:"whitespace-nowrap"},d(a.label),513),[[g,!r.value||n.value]])]),_:2},1032,["to","class"]))],64))),128))],64))),64))]),e("div",re,[!r.value||n.value?(s(),l("div",ie," ServiceFinder v2.0 ")):k("",!0)])],2),e("div",de,[e("header",ue,[e("div",he,[e("div",ce,[e("button",{class:"lg:hidden p-2 rounded-lg text-slate-400 hover:text-white hover:bg-slate-700 transition",onClick:t[4]||(t[4]=i=>n.value=!0)},[...t[11]||(t[11]=[e("svg",{class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 6h16M4 12h16M4 18h16"})],-1)])]),e("h1",ve,d(A.value),1)]),e("div",{class:"relative",ref_key:"dropdownRef",ref:b},[e("button",{class:"flex items-center gap-2 p-1.5 rounded-lg hover:bg-slate-700 transition",onClick:t[5]||(t[5]=i=>c.value=!c.value)},[e("div",pe,d(F.value),1),e("span",xe,d(j.value),1),t[12]||(t[12]=e("svg",{class:"w-4 h-4 text-slate-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"})],-1))]),c.value?(s(),l("div",fe,[e("div",ke,[e("p",me,d(j.value),1),t[13]||(t[13]=e("p",{class:"text-xs text-slate-400 mt-0.5"},"Administrator",-1))]),K(C,{to:"/profile",class:"flex items-center gap-3 px-4 py-2.5 text-sm text-slate-300 hover:bg-slate-700 hover:text-white transition",onClick:t[6]||(t[6]=i=>c.value=!1)},{default:M(()=>[...t[14]||(t[14]=[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:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"})],-1),L(" Profile Settings ",-1)])]),_:1}),e("button",{class:"flex items-center gap-3 w-full px-4 py-2.5 text-sm text-red-400 hover:bg-slate-700 hover:text-red-300 transition",onClick:T},[...t[15]||(t[15]=[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:"M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1"})],-1),L(" Sign Out ",-1)])])])):k("",!0)],512)])]),e("main",ge,[J(o.$slots,"default")])])])}}});export{ze as default};
|