Files
service-finder/frontend_admin/.nuxt/dist/server/_nuxt/parameters-Clxz_NnY.js
2026-06-30 08:56:55 +00:00

130 lines
11 KiB
JavaScript

import { defineComponent, ref, computed, unref, useSSRContext } from "vue";
import { ssrRenderAttrs, ssrInterpolate, ssrRenderList, ssrRenderAttr, ssrRenderClass, ssrIncludeBooleanAttr } from "vue/server-renderer";
import "/app/node_modules/hookable/dist/index.mjs";
import "/app/node_modules/klona/dist/index.mjs";
import { a as useI18n } from "../server.mjs";
import { _ as _export_sfc } from "./_plugin-vue_export-helper-1tPrXgE0.js";
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 "/app/node_modules/defu/dist/defu.mjs";
import "vue-router";
import "/app/node_modules/ufo/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: "parameters",
__ssrInlineRender: true,
setup(__props) {
const { t } = useI18n();
const loading = ref(true);
const error = ref(false);
const saving = ref(false);
const params = ref([]);
const showModal = ref(false);
const editingParam = ref(null);
const editValue = ref("");
const formError = ref("");
const toast = ref("");
const isJsonValue = computed(() => {
if (!editValue.value) return false;
const trimmed = editValue.value.trim();
return trimmed.startsWith("{") && trimmed.endsWith("}") || trimmed.startsWith("[") && trimmed.endsWith("]");
});
function formatValue(value) {
if (value === null || value === void 0) return "—";
if (typeof value === "object") {
try {
return JSON.stringify(value);
} catch {
return String(value);
}
}
return String(value);
}
function truncateValue(val, maxLen) {
if (val.length <= maxLen) return val;
return val.substring(0, maxLen) + "...";
}
function scopeBadgeClass(scope) {
switch (scope?.toLowerCase()) {
case "global":
return "bg-emerald-500/10 text-emerald-400";
case "country":
return "bg-blue-500/10 text-blue-400";
case "region":
return "bg-violet-500/10 text-violet-400";
case "user":
return "bg-amber-500/10 text-amber-400";
default:
return "bg-slate-500/10 text-slate-400";
}
}
return (_ctx, _push, _parent, _attrs) => {
_push(`<div${ssrRenderAttrs(_attrs)} data-v-8222d5f7><div class="mb-8" data-v-8222d5f7><h1 class="text-2xl font-bold text-white" data-v-8222d5f7>${ssrInterpolate(unref(t)("gamification.params.title"))}</h1><p class="text-slate-400 mt-1" data-v-8222d5f7>${ssrInterpolate(unref(t)("gamification.params.subtitle"))}</p></div>`);
if (unref(loading)) {
_push(`<div class="flex items-center justify-center py-20" data-v-8222d5f7><div class="text-slate-400 flex items-center gap-3" data-v-8222d5f7><svg class="w-5 h-5 animate-spin" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-8222d5f7><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" data-v-8222d5f7></path></svg><span data-v-8222d5f7>${ssrInterpolate(unref(t)("gamification.params.loading"))}</span></div></div>`);
} else if (unref(error)) {
_push(`<div class="bg-rose-500/10 border border-rose-500/30 rounded-xl p-6 mb-8" data-v-8222d5f7><p class="text-rose-400" data-v-8222d5f7>${ssrInterpolate(unref(t)("gamification.params.load_error"))}</p><button class="mt-3 text-sm text-rose-300 hover:text-rose-200 underline" data-v-8222d5f7>${ssrInterpolate(unref(t)("gamification.params.retry"))}</button></div>`);
} else {
_push(`<div class="bg-slate-800 rounded-xl border border-slate-700 overflow-hidden" data-v-8222d5f7><table class="w-full" data-v-8222d5f7><thead data-v-8222d5f7><tr class="border-b border-slate-700" data-v-8222d5f7><th class="text-left px-6 py-4 text-xs font-medium text-slate-400 uppercase tracking-wider" data-v-8222d5f7>${ssrInterpolate(unref(t)("gamification.params.col_key"))}</th><th class="text-left px-6 py-4 text-xs font-medium text-slate-400 uppercase tracking-wider" data-v-8222d5f7>${ssrInterpolate(unref(t)("gamification.params.col_value"))}</th><th class="text-left px-6 py-4 text-xs font-medium text-slate-400 uppercase tracking-wider" data-v-8222d5f7>${ssrInterpolate(unref(t)("gamification.params.col_category"))}</th><th class="text-left px-6 py-4 text-xs font-medium text-slate-400 uppercase tracking-wider" data-v-8222d5f7>${ssrInterpolate(unref(t)("gamification.params.col_scope"))}</th><th class="text-left px-6 py-4 text-xs font-medium text-slate-400 uppercase tracking-wider" data-v-8222d5f7>${ssrInterpolate(unref(t)("gamification.params.col_scope_id"))}</th><th class="text-right px-6 py-4 text-xs font-medium text-slate-400 uppercase tracking-wider" data-v-8222d5f7>${ssrInterpolate(unref(t)("gamification.params.col_actions"))}</th></tr></thead><tbody class="divide-y divide-slate-700/50" data-v-8222d5f7><!--[-->`);
ssrRenderList(unref(params), (param) => {
_push(`<tr class="hover:bg-slate-700/30 transition" data-v-8222d5f7><td class="px-6 py-4" data-v-8222d5f7><code class="text-sm font-mono text-amber-300 bg-amber-500/10 px-2 py-0.5 rounded" data-v-8222d5f7>${ssrInterpolate(param.key)}</code></td><td class="px-6 py-4" data-v-8222d5f7><span class="text-sm text-slate-300 max-w-xs truncate block font-mono"${ssrRenderAttr("title", formatValue(param.value))} data-v-8222d5f7>${ssrInterpolate(truncateValue(formatValue(param.value), 60))}</span></td><td class="px-6 py-4" data-v-8222d5f7><span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-slate-500/10 text-slate-400" data-v-8222d5f7>${ssrInterpolate(param.category || "—")}</span></td><td class="px-6 py-4" data-v-8222d5f7><span class="${ssrRenderClass([scopeBadgeClass(param.scope_level), "inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium"])}" data-v-8222d5f7>${ssrInterpolate(param.scope_level)}</span></td><td class="px-6 py-4 text-sm text-slate-400" data-v-8222d5f7>${ssrInterpolate(param.scope_id || "—")}</td><td class="px-6 py-4 text-right" data-v-8222d5f7><button class="p-1.5 rounded-lg text-slate-400 hover:text-white hover:bg-slate-700 transition"${ssrRenderAttr("title", unref(t)("gamification.params.edit"))} data-v-8222d5f7><svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-8222d5f7><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z" data-v-8222d5f7></path></svg></button></td></tr>`);
});
_push(`<!--]-->`);
if (unref(params).length === 0) {
_push(`<tr data-v-8222d5f7><td colspan="6" class="px-6 py-12 text-center text-sm text-slate-500" data-v-8222d5f7>${ssrInterpolate(unref(t)("gamification.params.empty"))}</td></tr>`);
} else {
_push(`<!---->`);
}
_push(`</tbody></table></div>`);
}
if (unref(showModal)) {
_push(`<div class="fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm" data-v-8222d5f7><div class="bg-slate-800 rounded-xl border border-slate-700 p-6 w-full max-w-lg mx-4 shadow-2xl" data-v-8222d5f7><h2 class="text-lg font-semibold text-white mb-2" data-v-8222d5f7>${ssrInterpolate(unref(t)("gamification.params.edit_title"))}</h2><p class="text-sm text-slate-400 mb-6" data-v-8222d5f7><code class="text-amber-300 font-mono text-xs" data-v-8222d5f7>${ssrInterpolate(unref(editingParam)?.key)}</code></p><form class="space-y-4" data-v-8222d5f7><div data-v-8222d5f7><label class="block text-sm font-medium text-slate-300 mb-1" data-v-8222d5f7>${ssrInterpolate(unref(t)("gamification.params.value_label"))}</label><textarea rows="6" class="w-full px-3 py-2 bg-slate-700 border border-slate-600 rounded-lg text-white font-mono text-sm placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-amber-500/50 focus:border-amber-500 resize-none" spellcheck="false"${ssrRenderAttr("placeholder", unref(t)("gamification.params.value_placeholder"))} data-v-8222d5f7>${ssrInterpolate(unref(editValue))}</textarea>`);
if (unref(isJsonValue)) {
_push(`<p class="mt-1 text-xs text-emerald-400" data-v-8222d5f7>${ssrInterpolate(unref(t)("gamification.params.json_detected"))}</p>`);
} else {
_push(`<p class="mt-1 text-xs text-slate-500" data-v-8222d5f7>${ssrInterpolate(unref(t)("gamification.params.text_value"))}</p>`);
}
_push(`</div>`);
if (unref(formError)) {
_push(`<div class="bg-rose-500/10 border border-rose-500/30 rounded-lg p-3" data-v-8222d5f7><p class="text-sm text-rose-400" data-v-8222d5f7>${ssrInterpolate(unref(formError))}</p></div>`);
} else {
_push(`<!---->`);
}
_push(`<div class="flex justify-end gap-3 pt-2" data-v-8222d5f7><button type="button" class="px-4 py-2 text-sm text-slate-400 hover:text-white transition" data-v-8222d5f7>${ssrInterpolate(unref(t)("gamification.params.cancel"))}</button><button type="submit"${ssrIncludeBooleanAttr(unref(saving)) ? " disabled" : ""} class="px-4 py-2 bg-amber-600 hover:bg-amber-500 disabled:bg-amber-600/50 text-white rounded-lg text-sm font-medium transition flex items-center gap-2" data-v-8222d5f7>`);
if (unref(saving)) {
_push(`<svg class="w-4 h-4 animate-spin" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-8222d5f7><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" data-v-8222d5f7></path></svg>`);
} else {
_push(`<!---->`);
}
_push(` ${ssrInterpolate(unref(saving) ? unref(t)("gamification.params.saving") : unref(t)("gamification.params.save"))}</button></div></form></div></div>`);
} else {
_push(`<!---->`);
}
if (unref(toast)) {
_push(`<div class="fixed bottom-6 right-6 z-50 bg-emerald-600 text-white px-4 py-3 rounded-lg shadow-lg text-sm flex items-center gap-2 animate-slide-up" data-v-8222d5f7><svg class="w-4 h-4 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-8222d5f7><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" data-v-8222d5f7></path></svg> ${ssrInterpolate(unref(toast))}</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/gamification/parameters.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
const parameters = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-8222d5f7"]]);
export {
parameters as default
};
//# sourceMappingURL=parameters-Clxz_NnY.js.map