admin_users_personels
This commit is contained in:
266
frontend_admin/.nuxt/dist/server/_nuxt/index-CemkpUgu.js
vendored
Normal file
266
frontend_admin/.nuxt/dist/server/_nuxt/index-CemkpUgu.js
vendored
Normal file
@@ -0,0 +1,266 @@
|
||||
import { _ as __nuxt_component_0 } from "./nuxt-link-Ci8vU-Yt.js";
|
||||
import { defineComponent, ref, watch, computed, withCtx, createTextVNode, toDisplayString, useSSRContext } from "vue";
|
||||
import { ssrRenderAttrs, ssrInterpolate, ssrRenderAttr, ssrIncludeBooleanAttr, ssrLooseContain, ssrLooseEqual, ssrRenderList, ssrRenderClass, ssrRenderComponent } from "vue/server-renderer";
|
||||
import "/app/node_modules/hookable/dist/index.mjs";
|
||||
import { d as useCookie } from "../server.mjs";
|
||||
import "/app/node_modules/ufo/dist/index.mjs";
|
||||
import "/app/node_modules/defu/dist/defu.mjs";
|
||||
import "/app/node_modules/ofetch/dist/node.mjs";
|
||||
import "#internal/nuxt/paths";
|
||||
import "/app/node_modules/unctx/dist/index.mjs";
|
||||
import "/app/node_modules/h3/dist/index.mjs";
|
||||
import "pinia";
|
||||
import "vue-router";
|
||||
import "/app/node_modules/klona/dist/index.mjs";
|
||||
import "/app/node_modules/cookie-es/dist/index.mjs";
|
||||
import "/app/node_modules/destr/dist/index.mjs";
|
||||
import "/app/node_modules/ohash/dist/index.mjs";
|
||||
import "/app/node_modules/@unhead/vue/dist/index.mjs";
|
||||
import "@vue/devtools-api";
|
||||
const _sfc_main = /* @__PURE__ */ defineComponent({
|
||||
__name: "index",
|
||||
__ssrInlineRender: true,
|
||||
setup(__props) {
|
||||
const loading = ref(true);
|
||||
const error = ref(null);
|
||||
const garages = ref([]);
|
||||
const availableTiers = ref([]);
|
||||
const searchQuery = ref("");
|
||||
const filterType = ref("all");
|
||||
const selectedPackage = ref("all");
|
||||
const availableTierNames = ref([]);
|
||||
const showSubscriptionModal = ref(false);
|
||||
const selectedGarage = ref(null);
|
||||
const selectedTierId = ref("");
|
||||
const customExpiresAt = ref("");
|
||||
const saving = ref(false);
|
||||
const saveError = ref(null);
|
||||
const saveNotification = ref(null);
|
||||
let searchDebounceTimer = null;
|
||||
function debouncedFetchGarages() {
|
||||
if (searchDebounceTimer) {
|
||||
clearTimeout(searchDebounceTimer);
|
||||
}
|
||||
searchDebounceTimer = setTimeout(() => {
|
||||
fetchGarages();
|
||||
}, 400);
|
||||
}
|
||||
watch(searchQuery, () => {
|
||||
debouncedFetchGarages();
|
||||
});
|
||||
watch(filterType, () => {
|
||||
fetchGarages();
|
||||
});
|
||||
watch(selectedPackage, () => {
|
||||
fetchGarages();
|
||||
});
|
||||
const globalTotalCount = ref(0);
|
||||
const globalIndividualCount = ref(0);
|
||||
const globalCorporateCount = ref(0);
|
||||
const isFilterActive = computed(() => {
|
||||
return searchQuery.value !== "" || filterType.value !== "all" || selectedPackage.value !== "all";
|
||||
});
|
||||
watch(garages, (newGarages) => {
|
||||
const currentSet = new Set(availableTierNames.value);
|
||||
for (const g of newGarages) {
|
||||
if (g.subscription_tier_name) {
|
||||
currentSet.add(g.subscription_tier_name);
|
||||
}
|
||||
}
|
||||
availableTierNames.value = Array.from(currentSet).sort();
|
||||
}, { immediate: true, deep: true });
|
||||
const filteredGarages = computed(() => garages.value);
|
||||
function getAuthHeaders() {
|
||||
const tokenCookie = useCookie("access_token");
|
||||
const token = tokenCookie.value;
|
||||
return token ? { Authorization: `Bearer ${token}` } : {};
|
||||
}
|
||||
async function fetchGarages() {
|
||||
loading.value = true;
|
||||
error.value = null;
|
||||
try {
|
||||
const params = { limit: 200 };
|
||||
if (searchQuery.value) {
|
||||
params.search_term = searchQuery.value;
|
||||
}
|
||||
if (filterType.value !== "all") {
|
||||
params.org_type_filter = filterType.value;
|
||||
}
|
||||
if (selectedPackage.value !== "all") {
|
||||
params.tier_name_filter = selectedPackage.value;
|
||||
}
|
||||
const response = await $fetch("/api/v1/admin/organizations", {
|
||||
params,
|
||||
headers: getAuthHeaders()
|
||||
});
|
||||
garages.value = response.garages;
|
||||
if (!isFilterActive.value) {
|
||||
globalTotalCount.value = response.total;
|
||||
globalIndividualCount.value = garages.value.filter((g) => g.org_type === "individual").length;
|
||||
globalCorporateCount.value = garages.value.filter((g) => g.org_type !== "individual").length;
|
||||
}
|
||||
} catch (err) {
|
||||
console.error("[Garages] Failed to fetch garages:", err);
|
||||
error.value = err?.data?.detail || err?.message || "Failed to load garages";
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
}
|
||||
function garageDisplayName(garage) {
|
||||
return garage.display_name || garage.name || garage.full_name;
|
||||
}
|
||||
function getInitials(name) {
|
||||
return name.split(" ").map((w) => w.charAt(0)).join("").toUpperCase().slice(0, 2);
|
||||
}
|
||||
function getInitialsColor(name) {
|
||||
const colors = [
|
||||
"bg-amber-600",
|
||||
"bg-purple-600",
|
||||
"bg-slate-600",
|
||||
"bg-indigo-600",
|
||||
"bg-emerald-600",
|
||||
"bg-rose-600",
|
||||
"bg-cyan-600",
|
||||
"bg-orange-600",
|
||||
"bg-teal-600"
|
||||
];
|
||||
let hash = 0;
|
||||
for (let i = 0; i < name.length; i++) {
|
||||
hash = name.charCodeAt(i) + ((hash << 5) - hash);
|
||||
}
|
||||
return colors[Math.abs(hash) % colors.length];
|
||||
}
|
||||
function statusBadgeClass(status) {
|
||||
if (status === "active") return "bg-emerald-500/10 text-emerald-400";
|
||||
if (status === "suspended") return "bg-red-500/10 text-red-400";
|
||||
if (status === "pending_verification") return "bg-amber-500/10 text-amber-400";
|
||||
return "bg-slate-500/10 text-slate-400";
|
||||
}
|
||||
function statusDotClass(status) {
|
||||
if (status === "active") return "bg-emerald-400";
|
||||
if (status === "suspended") return "bg-red-400";
|
||||
if (status === "pending_verification") return "bg-amber-400";
|
||||
return "bg-slate-400";
|
||||
}
|
||||
function statusLabel(status) {
|
||||
if (status === "active") return "Aktív";
|
||||
if (status === "suspended") return "Felfüggesztve";
|
||||
if (status === "pending_verification") return "Függőben";
|
||||
return "Inaktív";
|
||||
}
|
||||
function tierBadgeClass(tierName) {
|
||||
const name = tierName.toLowerCase();
|
||||
if (name.includes("enterprise") || name.includes("vip") || name.includes("corp")) return "bg-purple-500/20 text-purple-300";
|
||||
if (name.includes("premium") || name.includes("pro")) return "bg-amber-500/20 text-amber-300";
|
||||
return "bg-slate-500/20 text-slate-300";
|
||||
}
|
||||
function formatDate(dateStr) {
|
||||
try {
|
||||
const d = new Date(dateStr);
|
||||
return d.toLocaleDateString("hu-HU", {
|
||||
year: "numeric",
|
||||
month: "short",
|
||||
day: "numeric"
|
||||
});
|
||||
} catch {
|
||||
return dateStr;
|
||||
}
|
||||
}
|
||||
return (_ctx, _push, _parent, _attrs) => {
|
||||
const _component_NuxtLink = __nuxt_component_0;
|
||||
_push(`<div${ssrRenderAttrs(_attrs)}><div class="mb-8"><h1 class="text-2xl font-bold text-white">${ssrInterpolate(_ctx.$t("garages.title"))}</h1><p class="text-slate-400 mt-1">${ssrInterpolate(_ctx.$t("garages.subtitle"))}</p></div><div class="flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4 mb-6"><div class="relative flex-1 max-w-md"><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"><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"></path></svg><input${ssrRenderAttr("value", searchQuery.value)} type="text"${ssrRenderAttr("placeholder", _ctx.$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"></div><div class="flex items-center gap-2"><select 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"><option value="all"${ssrIncludeBooleanAttr(Array.isArray(filterType.value) ? ssrLooseContain(filterType.value, "all") : ssrLooseEqual(filterType.value, "all")) ? " selected" : ""}>${ssrInterpolate(_ctx.$t("garages.all_types"))}</option><option value="individual"${ssrIncludeBooleanAttr(Array.isArray(filterType.value) ? ssrLooseContain(filterType.value, "individual") : ssrLooseEqual(filterType.value, "individual")) ? " selected" : ""}>${ssrInterpolate(_ctx.$t("garages.type_individual"))}</option><option value="corporate"${ssrIncludeBooleanAttr(Array.isArray(filterType.value) ? ssrLooseContain(filterType.value, "corporate") : ssrLooseEqual(filterType.value, "corporate")) ? " selected" : ""}>${ssrInterpolate(_ctx.$t("garages.type_corporate"))}</option></select><select 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"><option value="all"${ssrIncludeBooleanAttr(Array.isArray(selectedPackage.value) ? ssrLooseContain(selectedPackage.value, "all") : ssrLooseEqual(selectedPackage.value, "all")) ? " selected" : ""}>${ssrInterpolate(_ctx.$t("garages.all_tiers"))}</option><!--[-->`);
|
||||
ssrRenderList(availableTierNames.value, (tier) => {
|
||||
_push(`<option${ssrRenderAttr("value", tier)}${ssrIncludeBooleanAttr(Array.isArray(selectedPackage.value) ? ssrLooseContain(selectedPackage.value, tier) : ssrLooseEqual(selectedPackage.value, tier)) ? " selected" : ""}>${ssrInterpolate(tier)}</option>`);
|
||||
});
|
||||
_push(`<!--]--></select></div></div>`);
|
||||
if (loading.value) {
|
||||
_push(`<div class="flex items-center justify-center py-20"><div class="flex flex-col items-center gap-3"><svg class="w-8 h-8 text-indigo-400 animate-spin" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"></path></svg><p class="text-slate-400 text-sm">${ssrInterpolate(_ctx.$t("garages.loading"))}</p></div></div>`);
|
||||
} else if (error.value) {
|
||||
_push(`<div class="flex flex-col items-center justify-center py-20 text-center"><svg class="w-12 h-12 text-red-500 mb-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z"></path></svg><p class="text-red-400 text-sm mb-2">${ssrInterpolate(error.value)}</p><button class="px-4 py-2 text-sm bg-indigo-600/20 text-indigo-300 hover:bg-indigo-600/30 rounded-lg transition">${ssrInterpolate(_ctx.$t("garages.retry"))}</button></div>`);
|
||||
} else {
|
||||
_push(`<!--[--><div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4 mb-8"><div class="bg-slate-800 rounded-xl border border-slate-700 p-4"><div class="flex items-center gap-3"><div class="p-2 rounded-lg bg-indigo-500/10 text-indigo-400"><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"></path></svg></div><div><p class="text-xs text-slate-400 uppercase tracking-wider">${ssrInterpolate(_ctx.$t("garages.total_garages"))}</p><p class="text-2xl font-bold text-white">${ssrInterpolate(globalTotalCount.value)}</p></div></div></div><div class="bg-slate-800 rounded-xl border border-slate-700 p-4"><div class="flex items-center gap-3"><div class="p-2 rounded-lg bg-emerald-500/10 text-emerald-400"><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="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"></path></svg></div><div><p class="text-xs text-slate-400 uppercase tracking-wider">${ssrInterpolate(_ctx.$t("garages.private_garages"))}</p><p class="text-2xl font-bold text-emerald-400">${ssrInterpolate(globalIndividualCount.value)}</p></div></div></div><div class="bg-slate-800 rounded-xl border border-slate-700 p-4"><div class="flex items-center gap-3"><div class="p-2 rounded-lg bg-amber-500/10 text-amber-400"><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"></path></svg></div><div><p class="text-xs text-slate-400 uppercase tracking-wider">${ssrInterpolate(_ctx.$t("garages.corporate_garages"))}</p><p class="text-2xl font-bold text-amber-400">${ssrInterpolate(globalCorporateCount.value)}</p></div></div></div></div>`);
|
||||
if (isFilterActive.value) {
|
||||
_push(`<div class="mb-4 text-xs text-slate-500"> Szűrt találat: <span class="text-slate-300 font-semibold">${ssrInterpolate(garages.value.length)}</span> db </div>`);
|
||||
} else {
|
||||
_push(`<!---->`);
|
||||
}
|
||||
_push(`<div class="bg-slate-800/50 border border-slate-700 rounded-xl overflow-hidden"><div class="overflow-x-auto"><table class="w-full text-sm"><thead><tr class="border-b border-slate-700 bg-slate-800/80"><th class="text-left py-3.5 px-4 text-xs font-semibold uppercase tracking-wider text-slate-400">ID</th><th class="text-left py-3.5 px-4 text-xs font-semibold uppercase tracking-wider text-slate-400">${ssrInterpolate(_ctx.$t("garages.company_name"))}</th><th class="text-left py-3.5 px-4 text-xs font-semibold uppercase tracking-wider text-slate-400">${ssrInterpolate(_ctx.$t("garages.status"))}</th><th class="text-left py-3.5 px-4 text-xs font-semibold uppercase tracking-wider text-slate-400">${ssrInterpolate(_ctx.$t("garages.current_package"))}</th><th class="text-left py-3.5 px-4 text-xs font-semibold uppercase tracking-wider text-slate-400">${ssrInterpolate(_ctx.$t("garages.expiration_date"))}</th><th class="text-left py-3.5 px-4 text-xs font-semibold uppercase tracking-wider text-slate-400">${ssrInterpolate(_ctx.$t("garages.actions"))}</th></tr></thead><tbody><!--[-->`);
|
||||
ssrRenderList(filteredGarages.value, (garage) => {
|
||||
_push(`<tr class="border-b border-slate-700/50 hover:bg-slate-700/30 transition"><td class="py-3.5 px-4 text-slate-400 font-mono text-xs">${ssrInterpolate(garage.id)}</td><td class="py-3.5 px-4"><div class="flex items-center gap-3"><div class="${ssrRenderClass([getInitialsColor(garageDisplayName(garage)), "w-8 h-8 rounded-lg flex items-center justify-center text-sm font-bold text-white"])}">${ssrInterpolate(getInitials(garageDisplayName(garage)))}</div><div>`);
|
||||
_push(ssrRenderComponent(_component_NuxtLink, {
|
||||
to: "/garages/" + garage.id,
|
||||
class: "text-sm font-medium text-white hover:underline cursor-pointer hover:text-indigo-400 transition-colors"
|
||||
}, {
|
||||
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
||||
if (_push2) {
|
||||
_push2(`${ssrInterpolate(garageDisplayName(garage))}`);
|
||||
} else {
|
||||
return [
|
||||
createTextVNode(toDisplayString(garageDisplayName(garage)), 1)
|
||||
];
|
||||
}
|
||||
}),
|
||||
_: 2
|
||||
}, _parent));
|
||||
_push(`<p class="text-xs text-slate-500">${ssrInterpolate(garage.city || "—")} · ${ssrInterpolate(garage.member_count)} ${ssrInterpolate(_ctx.$t("garages.members"))}</p></div></div></td><td class="py-3.5 px-4"><span class="${ssrRenderClass([statusBadgeClass(garage.status), "inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium"])}"><span class="${ssrRenderClass([statusDotClass(garage.status), "w-1.5 h-1.5 rounded-full mr-1.5"])}"></span> ${ssrInterpolate(statusLabel(garage.status))}</span></td><td class="py-3.5 px-4"><span class="${ssrRenderClass([tierBadgeClass(garage.subscription_tier_name), "px-2.5 py-0.5 rounded-full text-xs font-medium"])}">${ssrInterpolate(garage.subscription_tier_name)}</span></td><td class="py-3.5 px-4">`);
|
||||
if (garage.subscription_expires_at) {
|
||||
_push(`<span class="text-slate-300 text-xs">${ssrInterpolate(formatDate(garage.subscription_expires_at))}</span>`);
|
||||
} else {
|
||||
_push(`<span class="text-slate-500 text-xs italic">${ssrInterpolate(_ctx.$t("garages.indefinite"))}</span>`);
|
||||
}
|
||||
_push(`</td><td class="py-3.5 px-4"><div class="flex items-center gap-2"><button class="px-3 py-1.5 text-xs font-medium bg-slate-600/20 text-slate-300 hover:bg-slate-600/30 rounded-lg transition"${ssrRenderAttr("title", _ctx.$t("garages.view_details"))}>${ssrInterpolate(_ctx.$t("garages.view_details"))}</button><button 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">${ssrInterpolate(_ctx.$t("garages.manage_subscription"))}</button><button class="${ssrRenderClass([garage.is_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", "px-3 py-1.5 text-xs font-medium rounded-lg transition"])}">${ssrInterpolate(garage.is_active ? _ctx.$t("garages.deactivate") : _ctx.$t("garages.activate"))}</button></div></td></tr>`);
|
||||
});
|
||||
_push(`<!--]--></tbody></table></div>`);
|
||||
if (filteredGarages.value.length === 0 && !loading.value) {
|
||||
_push(`<div class="flex flex-col items-center justify-center py-16 text-center"><svg class="w-12 h-12 text-slate-600 mb-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><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"></path></svg><p class="text-slate-400 text-sm">${ssrInterpolate(_ctx.$t("garages.no_results"))}</p></div>`);
|
||||
} else {
|
||||
_push(`<!---->`);
|
||||
}
|
||||
_push(`</div><!--]-->`);
|
||||
}
|
||||
if (showSubscriptionModal.value) {
|
||||
_push(`<div class="fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm"><div class="bg-slate-800 border border-slate-700 rounded-2xl shadow-2xl w-full max-w-lg mx-4 overflow-hidden"><div class="px-6 py-4 border-b border-slate-700 flex items-center justify-between"><div><h3 class="text-lg font-semibold text-white">${ssrInterpolate(_ctx.$t("garages.manage_subscription"))}</h3><p class="text-sm text-slate-400 mt-0.5">${ssrInterpolate(selectedGarage.value ? garageDisplayName(selectedGarage.value) : "")}</p></div><button class="p-1.5 rounded-lg text-slate-400 hover:text-white hover:bg-slate-700 transition"><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="M6 18L18 6M6 6l12 12"></path></svg></button></div><div class="px-6 py-5 space-y-5"><div class="bg-slate-900/50 rounded-xl p-4 border border-slate-700/50"><p class="text-xs text-slate-500 uppercase tracking-wider mb-1">${ssrInterpolate(_ctx.$t("garages.current_package"))}</p><p class="text-sm font-medium text-white">${ssrInterpolate(selectedGarage.value?.subscription_tier_name || _ctx.$t("garages.free_fallback"))}</p>`);
|
||||
if (selectedGarage.value?.subscription_expires_at) {
|
||||
_push(`<p class="text-xs text-slate-400 mt-1">${ssrInterpolate(_ctx.$t("garages.expires"))}: ${ssrInterpolate(formatDate(selectedGarage.value.subscription_expires_at))}</p>`);
|
||||
} else {
|
||||
_push(`<!---->`);
|
||||
}
|
||||
_push(`</div><div><label class="block text-sm font-medium text-slate-300 mb-2">${ssrInterpolate(_ctx.$t("garages.select_package"))}</label><select class="w-full px-3 py-2.5 bg-slate-900 border border-slate-700 rounded-lg text-sm text-white focus:outline-none focus:ring-2 focus:ring-indigo-500/50 transition"><option value="" disabled${ssrIncludeBooleanAttr(Array.isArray(selectedTierId.value) ? ssrLooseContain(selectedTierId.value, "") : ssrLooseEqual(selectedTierId.value, "")) ? " selected" : ""}>${ssrInterpolate(_ctx.$t("garages.select_package_placeholder"))}</option><!--[-->`);
|
||||
ssrRenderList(availableTiers.value, (tier) => {
|
||||
_push(`<option${ssrRenderAttr("value", tier.id)}${ssrIncludeBooleanAttr(Array.isArray(selectedTierId.value) ? ssrLooseContain(selectedTierId.value, tier.id) : ssrLooseEqual(selectedTierId.value, tier.id)) ? " selected" : ""}>${ssrInterpolate(tier.name)} (Level ${ssrInterpolate(tier.tier_level)}) </option>`);
|
||||
});
|
||||
_push(`<!--]--></select></div><div><label class="block text-sm font-medium text-slate-300 mb-2">${ssrInterpolate(_ctx.$t("garages.custom_expiration"))} <span class="text-xs text-slate-500 ml-1">(${ssrInterpolate(_ctx.$t("garages.optional"))})</span></label><input${ssrRenderAttr("value", customExpiresAt.value)} type="datetime-local" class="w-full px-3 py-2.5 bg-slate-900 border border-slate-700 rounded-lg text-sm text-white focus:outline-none focus:ring-2 focus:ring-indigo-500/50 transition"><p class="text-xs text-slate-500 mt-1.5">${ssrInterpolate(_ctx.$t("garages.custom_expiration_hint"))}</p></div>`);
|
||||
if (saveError.value) {
|
||||
_push(`<div class="bg-red-500/10 border border-red-500/20 rounded-lg px-4 py-3"><p class="text-sm text-red-400">${ssrInterpolate(saveError.value)}</p></div>`);
|
||||
} else {
|
||||
_push(`<!---->`);
|
||||
}
|
||||
_push(`</div><div class="px-6 py-4 border-t border-slate-700 flex items-center justify-end gap-3"><button class="px-4 py-2 text-sm font-medium text-slate-300 hover:text-white transition">${ssrInterpolate(_ctx.$t("garages.cancel"))}</button><button${ssrIncludeBooleanAttr(saving.value || !selectedTierId.value) ? " disabled" : ""} class="${ssrRenderClass([saving.value ? "bg-indigo-600/50 text-indigo-200 cursor-wait" : "bg-indigo-600 text-white hover:bg-indigo-500", "px-5 py-2 text-sm font-medium rounded-lg transition disabled:opacity-50 disabled:cursor-not-allowed"])}">`);
|
||||
if (saving.value) {
|
||||
_push(`<span class="flex items-center gap-2"><svg class="w-4 h-4 animate-spin" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"></path></svg> ${ssrInterpolate(_ctx.$t("garages.saving"))}</span>`);
|
||||
} else {
|
||||
_push(`<span>${ssrInterpolate(_ctx.$t("garages.save"))}</span>`);
|
||||
}
|
||||
_push(`</button></div></div></div>`);
|
||||
} else {
|
||||
_push(`<!---->`);
|
||||
}
|
||||
if (saveNotification.value) {
|
||||
_push(`<div class="${ssrRenderClass([saveNotification.value.type === "success" ? "bg-emerald-600 text-white" : "bg-red-600 text-white", "fixed bottom-6 right-6 px-5 py-3 rounded-xl shadow-xl text-sm font-medium z-50"])}">${ssrInterpolate(saveNotification.value.message)}</div>`);
|
||||
} else {
|
||||
_push(`<!---->`);
|
||||
}
|
||||
_push(`</div>`);
|
||||
};
|
||||
}
|
||||
});
|
||||
const _sfc_setup = _sfc_main.setup;
|
||||
_sfc_main.setup = (props, ctx) => {
|
||||
const ssrContext = useSSRContext();
|
||||
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("pages/garages/index.vue");
|
||||
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
|
||||
};
|
||||
export {
|
||||
_sfc_main as default
|
||||
};
|
||||
//# sourceMappingURL=index-CemkpUgu.js.map
|
||||
Reference in New Issue
Block a user