254 lines
16 KiB
JavaScript
254 lines
16 KiB
JavaScript
import { _ as __nuxt_component_0 } from "./nuxt-link-DNVrgHUL.js";
|
|
import { defineComponent, ref, computed, mergeProps, withCtx, createVNode, toDisplayString, withDirectives, vShow, openBlock, createBlock, createTextVNode, useSSRContext } from "vue";
|
|
import { ssrRenderAttrs, ssrRenderClass, ssrRenderAttr, ssrRenderList, ssrInterpolate, ssrRenderStyle, ssrRenderComponent, ssrRenderSlot } from "vue/server-renderer";
|
|
import { u as useAuthStore, _ as _imports_0 } from "./auth-CRAMW6e4.js";
|
|
import { useRoute } from "vue-router";
|
|
import { u as useRouter } from "../server.mjs";
|
|
import "/app/node_modules/ufo/dist/index.mjs";
|
|
import "/app/node_modules/defu/dist/defu.mjs";
|
|
import "#internal/nuxt/paths";
|
|
import "pinia";
|
|
import "./cookie-CWIsZYm7.js";
|
|
import "/app/node_modules/cookie-es/dist/index.mjs";
|
|
import "/app/node_modules/h3/dist/index.mjs";
|
|
import "/app/node_modules/destr/dist/index.mjs";
|
|
import "/app/node_modules/ohash/dist/index.mjs";
|
|
import "/app/node_modules/klona/dist/index.mjs";
|
|
import "/app/node_modules/ofetch/dist/node.mjs";
|
|
import "/app/node_modules/hookable/dist/index.mjs";
|
|
import "/app/node_modules/unctx/dist/index.mjs";
|
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
__name: "default",
|
|
__ssrInlineRender: true,
|
|
setup(__props) {
|
|
const route = useRoute();
|
|
useRouter();
|
|
const authStore = useAuthStore();
|
|
const sidebarOpen = ref(false);
|
|
const sidebarCollapsed = ref(false);
|
|
const dropdownOpen = ref(false);
|
|
ref(null);
|
|
const expandedGroups = ref(/* @__PURE__ */ new Set(["Központ"]));
|
|
const userEmail = computed(() => authStore.userEmail || "admin@servicefinder.hu");
|
|
const userInitials = computed(() => {
|
|
const email = authStore.userEmail;
|
|
if (!email) return "AD";
|
|
return email.split("@")[0].split(".").map((s) => s[0]).join("").toUpperCase().slice(0, 2);
|
|
});
|
|
const menuGroups = [
|
|
{
|
|
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>'
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
];
|
|
const pageTitle = computed(() => {
|
|
if (route.path === "/") return "Dashboard";
|
|
if (route.path.startsWith("/permissions")) return "Jogosultság Kezelés";
|
|
if (route.path.startsWith("/garages")) return "Garázsok";
|
|
if (route.path.startsWith("/users")) return "Felhasználók";
|
|
if (route.path.startsWith("/logs")) return "Rendszernaplók";
|
|
return "Admin Panel";
|
|
});
|
|
function isActive(path) {
|
|
if (path === "/") return route.path === "/";
|
|
return route.path.startsWith(path);
|
|
}
|
|
function isGroupActive(item) {
|
|
if (!item.children) return false;
|
|
return item.children.some((child) => isActive(child.path));
|
|
}
|
|
return (_ctx, _push, _parent, _attrs) => {
|
|
const _component_NuxtLink = __nuxt_component_0;
|
|
_push(`<div${ssrRenderAttrs(mergeProps({ class: "min-h-screen bg-slate-900 text-white flex" }, _attrs))}>`);
|
|
if (sidebarOpen.value) {
|
|
_push(`<div class="fixed inset-0 bg-black/50 z-20 lg:hidden"></div>`);
|
|
} else {
|
|
_push(`<!---->`);
|
|
}
|
|
_push(`<aside class="${ssrRenderClass([
|
|
"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",
|
|
sidebarOpen.value ? "w-64 translate-x-0" : "-translate-x-full lg:translate-x-0 lg:w-20"
|
|
])}"><div class="flex items-center h-16 px-4 border-b border-slate-700">`);
|
|
if (sidebarOpen.value || !sidebarCollapsed.value) {
|
|
_push(`<div class="flex items-center gap-3"><img${ssrRenderAttr("src", _imports_0)} class="h-8 w-auto" alt="SF Logo"><span class="text-lg font-bold text-white whitespace-nowrap">Admin Panel</span></div>`);
|
|
} else {
|
|
_push(`<div class="mx-auto"><img${ssrRenderAttr("src", _imports_0)} class="h-8 w-auto" alt="SF Logo"></div>`);
|
|
}
|
|
_push(`</div><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"><svg class="${ssrRenderClass([{ "rotate-180": sidebarCollapsed.value }, "w-5 h-5 transition-transform duration-300"])}" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 19l-7-7 7-7m8 14l-7-7 7-7"></path></svg></button><nav class="flex-1 px-2 py-4 space-y-2 overflow-y-auto"><!--[-->`);
|
|
ssrRenderList(menuGroups, (group) => {
|
|
_push(`<!--[-->`);
|
|
if (!sidebarCollapsed.value || sidebarOpen.value) {
|
|
_push(`<div class="px-3 py-1 text-xs font-semibold uppercase tracking-wider text-slate-500">${ssrInterpolate(group.title)}</div>`);
|
|
} else {
|
|
_push(`<!---->`);
|
|
}
|
|
_push(`<!--[-->`);
|
|
ssrRenderList(group.items, (item) => {
|
|
_push(`<!--[-->`);
|
|
if (item.children) {
|
|
_push(`<div><button class="${ssrRenderClass([isGroupActive(item) ? "bg-indigo-600/20 text-indigo-300" : "text-slate-300 hover:bg-slate-700 hover:text-white", "flex items-center w-full gap-3 px-3 py-2.5 rounded-lg text-sm font-medium transition"])}"><span class="flex-shrink-0 w-5 h-5">${item.icon ?? ""}</span><span class="flex-1 text-left whitespace-nowrap" style="${ssrRenderStyle(!sidebarCollapsed.value || sidebarOpen.value ? null : { display: "none" })}">${ssrInterpolate(item.label)}</span><svg class="${ssrRenderClass([{ "rotate-90": expandedGroups.value.has(item.label) }, "w-4 h-4 transition-transform duration-200"])}" fill="none" stroke="currentColor" viewBox="0 0 24 24" style="${ssrRenderStyle(!sidebarCollapsed.value || sidebarOpen.value ? null : { display: "none" })}"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"></path></svg></button><div class="ml-2 mt-1 space-y-1 overflow-hidden transition-all duration-200" style="${ssrRenderStyle(expandedGroups.value.has(item.label) && (!sidebarCollapsed.value || sidebarOpen.value) ? null : { display: "none" })}"><!--[-->`);
|
|
ssrRenderList(item.children, (child) => {
|
|
_push(ssrRenderComponent(_component_NuxtLink, {
|
|
key: child.path,
|
|
to: child.path,
|
|
class: ["flex items-center gap-3 px-3 py-2 rounded-lg text-sm font-medium transition", isActive(child.path) ? "bg-indigo-600 text-white" : "text-slate-400 hover:bg-slate-700 hover:text-white"],
|
|
onClick: ($event) => sidebarOpen.value = false
|
|
}, {
|
|
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
if (_push2) {
|
|
_push2(`<span class="flex-shrink-0 w-4 h-4"${_scopeId}>${child.icon ?? ""}</span><span class="whitespace-nowrap"${_scopeId}>${ssrInterpolate(child.label)}</span>`);
|
|
} else {
|
|
return [
|
|
createVNode("span", {
|
|
class: "flex-shrink-0 w-4 h-4",
|
|
innerHTML: child.icon
|
|
}, null, 8, ["innerHTML"]),
|
|
createVNode("span", { class: "whitespace-nowrap" }, toDisplayString(child.label), 1)
|
|
];
|
|
}
|
|
}),
|
|
_: 2
|
|
}, _parent));
|
|
});
|
|
_push(`<!--]--></div></div>`);
|
|
} else {
|
|
_push(ssrRenderComponent(_component_NuxtLink, {
|
|
to: item.path,
|
|
class: ["flex items-center gap-3 px-3 py-2.5 rounded-lg text-sm font-medium transition", isActive(item.path) ? "bg-indigo-600 text-white" : "text-slate-300 hover:bg-slate-700 hover:text-white"],
|
|
onClick: ($event) => sidebarOpen.value = false
|
|
}, {
|
|
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
if (_push2) {
|
|
_push2(`<span class="flex-shrink-0 w-5 h-5"${_scopeId}>${item.icon ?? ""}</span><span class="whitespace-nowrap" style="${ssrRenderStyle(!sidebarCollapsed.value || sidebarOpen.value ? null : { display: "none" })}"${_scopeId}>${ssrInterpolate(item.label)}</span>`);
|
|
} else {
|
|
return [
|
|
createVNode("span", {
|
|
class: "flex-shrink-0 w-5 h-5",
|
|
innerHTML: item.icon
|
|
}, null, 8, ["innerHTML"]),
|
|
withDirectives(createVNode("span", { class: "whitespace-nowrap" }, toDisplayString(item.label), 513), [
|
|
[vShow, !sidebarCollapsed.value || sidebarOpen.value]
|
|
])
|
|
];
|
|
}
|
|
}),
|
|
_: 2
|
|
}, _parent));
|
|
}
|
|
_push(`<!--]-->`);
|
|
});
|
|
_push(`<!--]--><!--]-->`);
|
|
});
|
|
_push(`<!--]--></nav><div class="p-4 border-t border-slate-700">`);
|
|
if (!sidebarCollapsed.value || sidebarOpen.value) {
|
|
_push(`<div class="text-xs text-slate-500"> ServiceFinder v2.0 </div>`);
|
|
} else {
|
|
_push(`<!---->`);
|
|
}
|
|
_push(`</div></aside><div class="flex-1 flex flex-col min-w-0"><header class="sticky top-0 z-10 bg-slate-800/95 backdrop-blur-sm border-b border-slate-700"><div class="flex items-center justify-between h-16 px-4 lg:px-6"><div class="flex items-center gap-3"><button class="lg:hidden p-2 rounded-lg text-slate-400 hover:text-white hover:bg-slate-700 transition"><svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16"></path></svg></button><h1 class="text-lg font-semibold text-white truncate">${ssrInterpolate(pageTitle.value)}</h1></div><div class="relative"><button class="flex items-center gap-2 p-1.5 rounded-lg hover:bg-slate-700 transition"><div class="w-8 h-8 rounded-full bg-indigo-600 flex items-center justify-center text-sm font-bold text-white">${ssrInterpolate(userInitials.value)}</div><span class="hidden sm:block text-sm text-slate-300">${ssrInterpolate(userEmail.value)}</span><svg class="w-4 h-4 text-slate-400" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path></svg></button>`);
|
|
if (dropdownOpen.value) {
|
|
_push(`<div class="absolute right-0 mt-2 w-56 bg-slate-800 border border-slate-700 rounded-xl shadow-xl py-1 z-50"><div class="px-4 py-3 border-b border-slate-700"><p class="text-sm font-medium text-white">${ssrInterpolate(userEmail.value)}</p><p class="text-xs text-slate-400 mt-0.5">Administrator</p></div>`);
|
|
_push(ssrRenderComponent(_component_NuxtLink, {
|
|
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: ($event) => dropdownOpen.value = false
|
|
}, {
|
|
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
if (_push2) {
|
|
_push2(`<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"${_scopeId}><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"${_scopeId}></path></svg> Profile Settings `);
|
|
} else {
|
|
return [
|
|
(openBlock(), createBlock("svg", {
|
|
class: "w-4 h-4",
|
|
fill: "none",
|
|
stroke: "currentColor",
|
|
viewBox: "0 0 24 24"
|
|
}, [
|
|
createVNode("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"
|
|
})
|
|
])),
|
|
createTextVNode(" Profile Settings ")
|
|
];
|
|
}
|
|
}),
|
|
_: 1
|
|
}, _parent));
|
|
_push(`<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"><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="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"></path></svg> Sign Out </button></div>`);
|
|
} else {
|
|
_push(`<!---->`);
|
|
}
|
|
_push(`</div></div></header><main class="flex-1 p-4 lg:p-6 overflow-auto">`);
|
|
ssrRenderSlot(_ctx.$slots, "default", {}, null, _push, _parent);
|
|
_push(`</main></div></div>`);
|
|
};
|
|
}
|
|
});
|
|
const _sfc_setup = _sfc_main.setup;
|
|
_sfc_main.setup = (props, ctx) => {
|
|
const ssrContext = useSSRContext();
|
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("layouts/default.vue");
|
|
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
|
|
};
|
|
export {
|
|
_sfc_main as default
|
|
};
|
|
//# sourceMappingURL=default-DbJQlxCD.js.map
|