161 lines
13 KiB
JavaScript
161 lines
13 KiB
JavaScript
import { _ as __nuxt_component_0 } from './nuxt-link-1NBbHb-h.mjs';
|
|
import { defineComponent, ref, unref, withCtx, openBlock, createBlock, createVNode, createTextVNode, toDisplayString, useSSRContext } from 'vue';
|
|
import { ssrRenderAttrs, ssrInterpolate, ssrRenderList, ssrIncludeBooleanAttr, ssrRenderComponent, ssrRenderAttr } from 'vue/server-renderer';
|
|
import { u as useFormatter } from './useFormatter-hycy3urM.mjs';
|
|
import { a as useI18n } from './server.mjs';
|
|
import { _ as _export_sfc } from './_plugin-vue_export-helper-1tPrXgE0.mjs';
|
|
import '../nitro/nitro.mjs';
|
|
import 'node:http';
|
|
import 'node:https';
|
|
import 'node:events';
|
|
import 'node:buffer';
|
|
import 'node:fs';
|
|
import 'node:path';
|
|
import 'node:crypto';
|
|
import 'vue-router';
|
|
import 'node:url';
|
|
import './region-0mvXqaMM.mjs';
|
|
import 'pinia';
|
|
import '../routes/renderer.mjs';
|
|
import 'vue-bundle-renderer/runtime';
|
|
import 'unhead/server';
|
|
import 'devalue';
|
|
import 'unhead/utils';
|
|
import 'unhead/plugins';
|
|
|
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
__name: "rejected",
|
|
__ssrInlineRender: true,
|
|
setup(__props) {
|
|
const { t } = useI18n();
|
|
const { formatDate } = useFormatter();
|
|
const loading = ref(true);
|
|
const error = ref(false);
|
|
const providers = ref([]);
|
|
const toast = ref("");
|
|
const actionLoading = ref(null);
|
|
const showRestoreModal = ref(false);
|
|
const restoringProvider = ref(null);
|
|
const restoreReason = ref("");
|
|
const restoreLoading = ref(false);
|
|
return (_ctx, _push, _parent, _attrs) => {
|
|
var _a;
|
|
const _component_NuxtLink = __nuxt_component_0;
|
|
_push(`<div${ssrRenderAttrs(_attrs)} data-v-4522f6a1><div class="mb-8" data-v-4522f6a1><h1 class="text-2xl font-bold text-white" data-v-4522f6a1>${ssrInterpolate(_ctx.$t("providers.rejected_title"))}</h1><p class="text-slate-400 mt-1" data-v-4522f6a1>${ssrInterpolate(_ctx.$t("providers.rejected_subtitle"))}</p></div>`);
|
|
if (unref(loading)) {
|
|
_push(`<div class="flex items-center justify-center py-20" data-v-4522f6a1><div class="text-slate-400 flex items-center gap-3" data-v-4522f6a1><svg class="w-5 h-5 animate-spin" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-4522f6a1><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-4522f6a1></path></svg><span data-v-4522f6a1>${ssrInterpolate(_ctx.$t("providers.rejected_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-4522f6a1><p class="text-rose-400" data-v-4522f6a1>${ssrInterpolate(_ctx.$t("providers.error"))}</p><button class="mt-3 text-sm text-rose-300 hover:text-rose-200 underline" data-v-4522f6a1>${ssrInterpolate(_ctx.$t("providers.retry"))}</button></div>`);
|
|
} else {
|
|
_push(`<div class="space-y-4" data-v-4522f6a1><!--[-->`);
|
|
ssrRenderList(unref(providers), (provider) => {
|
|
_push(`<div class="bg-slate-800 rounded-xl border border-slate-700 p-6 hover:border-rose-500/30 transition" data-v-4522f6a1><div class="flex items-start justify-between gap-4" data-v-4522f6a1><div class="flex-1 min-w-0" data-v-4522f6a1><div class="flex items-center gap-3 mb-2" data-v-4522f6a1><h3 class="text-lg font-semibold text-white truncate" data-v-4522f6a1>${ssrInterpolate(provider.name)}</h3><span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-rose-500/10 text-rose-400" data-v-4522f6a1>${ssrInterpolate(_ctx.$t("providers.status_rejected"))}</span><code class="text-xs font-mono text-slate-400 bg-slate-700/50 px-2 py-0.5 rounded" data-v-4522f6a1>${ssrInterpolate(provider.source)}</code>`);
|
|
if (provider.source_table) {
|
|
_push(`<span class="inline-flex items-center px-2 py-0.5 rounded text-xs font-mono bg-slate-700/50 text-slate-400" data-v-4522f6a1>${ssrInterpolate(provider.source_table)}</span>`);
|
|
} else {
|
|
_push(`<!---->`);
|
|
}
|
|
_push(`</div><div class="grid grid-cols-2 gap-x-8 gap-y-2 text-sm" data-v-4522f6a1>`);
|
|
if (provider.address) {
|
|
_push(`<div class="text-slate-300" data-v-4522f6a1><span class="text-slate-500" data-v-4522f6a1>${ssrInterpolate(_ctx.$t("providers.label_address"))}</span> ${ssrInterpolate(provider.address)}</div>`);
|
|
} else {
|
|
_push(`<!---->`);
|
|
}
|
|
if (provider.city) {
|
|
_push(`<div class="text-slate-300" data-v-4522f6a1><span class="text-slate-500" data-v-4522f6a1>${ssrInterpolate(_ctx.$t("providers.label_city"))}</span> ${ssrInterpolate(provider.city)}</div>`);
|
|
} else {
|
|
_push(`<!---->`);
|
|
}
|
|
if (provider.category) {
|
|
_push(`<div class="text-slate-300" data-v-4522f6a1><span class="text-slate-500" data-v-4522f6a1>${ssrInterpolate(_ctx.$t("providers.label_category"))}</span> ${ssrInterpolate(provider.category)}</div>`);
|
|
} else {
|
|
_push(`<!---->`);
|
|
}
|
|
_push(`<div class="text-slate-300" data-v-4522f6a1><span class="text-slate-500" data-v-4522f6a1>${ssrInterpolate(_ctx.$t("providers.label_validation_score"))}</span><span class="text-rose-400 font-medium ml-1" data-v-4522f6a1>${ssrInterpolate(provider.validation_score)}</span></div>`);
|
|
if (provider.created_at) {
|
|
_push(`<div class="text-slate-300" data-v-4522f6a1><span class="text-slate-500" data-v-4522f6a1>${ssrInterpolate(_ctx.$t("providers.label_created"))}</span> ${ssrInterpolate(unref(formatDate)(provider.created_at))}</div>`);
|
|
} else {
|
|
_push(`<!---->`);
|
|
}
|
|
_push(`</div></div><div class="flex flex-col gap-2 flex-shrink-0" data-v-4522f6a1><button${ssrIncludeBooleanAttr(unref(actionLoading) === provider.id) ? " disabled" : ""} class="px-4 py-2 bg-emerald-600 hover:bg-emerald-500 disabled:bg-emerald-600/50 text-white rounded-lg text-sm font-medium transition flex items-center gap-2" data-v-4522f6a1>`);
|
|
if (unref(actionLoading) === provider.id) {
|
|
_push(`<svg class="w-4 h-4 animate-spin" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-4522f6a1><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-4522f6a1></path></svg>`);
|
|
} else {
|
|
_push(`<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-4522f6a1><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-4522f6a1></path></svg>`);
|
|
}
|
|
_push(` ${ssrInterpolate(_ctx.$t("providers.restore"))}</button>`);
|
|
_push(ssrRenderComponent(_component_NuxtLink, {
|
|
to: `/providers/${provider.id}`,
|
|
class: "px-4 py-2 bg-slate-700 hover:bg-slate-600 text-slate-300 rounded-lg text-sm font-medium transition flex items-center gap-2 text-center"
|
|
}, {
|
|
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
if (_push2) {
|
|
_push2(`<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-4522f6a1${_scopeId}><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" data-v-4522f6a1${_scopeId}></path><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z" data-v-4522f6a1${_scopeId}></path></svg> ${ssrInterpolate(_ctx.$t("providers.details"))}`);
|
|
} 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: "M15 12a3 3 0 11-6 0 3 3 0 016 0z"
|
|
}),
|
|
createVNode("path", {
|
|
"stroke-linecap": "round",
|
|
"stroke-linejoin": "round",
|
|
"stroke-width": "2",
|
|
d: "M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"
|
|
})
|
|
])),
|
|
createTextVNode(" " + toDisplayString(_ctx.$t("providers.details")), 1)
|
|
];
|
|
}
|
|
}),
|
|
_: 2
|
|
}, _parent));
|
|
_push(`</div></div></div>`);
|
|
});
|
|
_push(`<!--]-->`);
|
|
if (unref(providers).length === 0) {
|
|
_push(`<div class="bg-slate-800 rounded-xl border border-slate-700 p-12 text-center" data-v-4522f6a1><svg class="w-12 h-12 mx-auto text-slate-600 mb-4" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-4522f6a1><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-4522f6a1></path></svg><h3 class="text-lg font-medium text-slate-400 mb-1" data-v-4522f6a1>${ssrInterpolate(_ctx.$t("providers.no_rejected"))}</h3><p class="text-sm text-slate-500" data-v-4522f6a1>${ssrInterpolate(_ctx.$t("providers.no_rejected_subtitle"))}</p></div>`);
|
|
} else {
|
|
_push(`<!---->`);
|
|
}
|
|
_push(`</div>`);
|
|
}
|
|
if (unref(showRestoreModal)) {
|
|
_push(`<div class="fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm" data-v-4522f6a1><div class="bg-slate-800 rounded-xl border border-slate-700 p-6 w-full max-w-lg mx-4 shadow-2xl" data-v-4522f6a1><h2 class="text-lg font-semibold text-white mb-2" data-v-4522f6a1>${ssrInterpolate(_ctx.$t("providers.restore_modal_title"))}</h2><p class="text-sm text-slate-400 mb-6" data-v-4522f6a1>${ssrInterpolate(_ctx.$t("providers.restore_modal_body", { name: (_a = unref(restoringProvider)) == null ? void 0 : _a.name }))}</p><form data-v-4522f6a1><div class="mb-4" data-v-4522f6a1><label class="block text-sm font-medium text-slate-300 mb-1" data-v-4522f6a1>${ssrInterpolate(_ctx.$t("providers.restore_reason_label"))}</label><textarea rows="3"${ssrRenderAttr("placeholder", _ctx.$t("providers.restore_reason_placeholder"))} class="w-full px-3 py-2 bg-slate-700 border border-slate-600 rounded-lg text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-emerald-500/50 focus:border-emerald-500 text-sm resize-none" data-v-4522f6a1>${ssrInterpolate(unref(restoreReason))}</textarea></div><div class="flex justify-end gap-3" data-v-4522f6a1><button type="button" class="px-4 py-2 text-sm text-slate-400 hover:text-white transition" data-v-4522f6a1>${ssrInterpolate(_ctx.$t("common.cancel"))}</button><button type="submit"${ssrIncludeBooleanAttr(unref(restoreLoading)) ? " disabled" : ""} class="px-4 py-2 bg-emerald-600 hover:bg-emerald-500 disabled:bg-emerald-600/50 text-white rounded-lg text-sm font-medium transition flex items-center gap-2" data-v-4522f6a1>`);
|
|
if (unref(restoreLoading)) {
|
|
_push(`<svg class="w-4 h-4 animate-spin" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-4522f6a1><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-4522f6a1></path></svg>`);
|
|
} else {
|
|
_push(`<!---->`);
|
|
}
|
|
_push(` ${ssrInterpolate(_ctx.$t("providers.restore"))}</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-4522f6a1><svg class="w-4 h-4 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-4522f6a1><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-4522f6a1></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/providers/rejected.vue");
|
|
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
|
|
};
|
|
const rejected = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-4522f6a1"]]);
|
|
|
|
export { rejected as default };
|
|
//# sourceMappingURL=rejected-CxbqOYAs.mjs.map
|