Files
service-finder/frontend_admin/.nuxt/dist/client/_nuxt/eAjy9X9S.js
2026-07-01 02:27:38 +00:00

2 lines
9.4 KiB
JavaScript

import{_ as H}from"./CuTzR9Y8.js";import{e as A,g as F,c as l,a as t,i as a,F as T,r as P,j as u,x as j,d as i,t as r,y as V,z as L,A as N,l as d,h as R,o as n,b as S,w as I}from"./Duy9QquX.js";import{u as D}from"./iEY_AUwe.js";import{_ as E}from"./DlAUqK2U.js";import"./BmPpcd_L.js";const q={key:0,class:"flex items-center justify-center py-20"},J={key:1,class:"bg-rose-500/10 border border-rose-500/30 rounded-xl p-6 mb-8"},O={key:2,class:"space-y-4"},K={class:"flex items-start justify-between gap-4"},U={class:"flex-1 min-w-0"},G={class:"flex items-center gap-3 mb-2"},Q={class:"text-lg font-semibold text-white truncate"},W={class:"text-xs font-mono text-slate-400 bg-slate-700/50 px-2 py-0.5 rounded"},X={class:"grid grid-cols-2 gap-x-8 gap-y-2 text-sm"},Y={key:0,class:"text-slate-300"},Z={key:1,class:"text-slate-300"},ee={key:2,class:"text-slate-300"},te={class:"text-slate-300"},se={class:"text-amber-400 font-medium ml-1"},oe={key:3,class:"text-slate-300"},le={class:"flex flex-col gap-2 flex-shrink-0"},ne=["onClick","disabled"],ae={key:0,class:"w-4 h-4 animate-spin",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},ie={key:1,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},re=["onClick","disabled"],de={key:0,class:"bg-slate-800 rounded-xl border border-slate-700 p-12 text-center"},ue={class:"bg-slate-800 rounded-xl border border-slate-700 p-6 w-full max-w-lg mx-4 shadow-2xl"},me={class:"text-sm text-slate-400 mb-6"},ce={class:"text-white"},xe={class:"mb-4"},pe={class:"flex justify-end gap-3"},ve=["disabled"],fe={key:0,class:"w-4 h-4 animate-spin",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},ge={key:4,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"},be=A({__name:"pending",setup(ke){const{formatDate:z}=D(),k=d(!0),h=d(!1),m=d([]),f=d(""),x=d(null),p=d(!1),c=d(null),v=d(""),g=d(!1);function y(){const e=R("access_token").value;return e?{Authorization:`Bearer ${e}`,"Content-Type":"application/json"}:{"Content-Type":"application/json"}}function b(o){f.value=o,setTimeout(()=>{f.value=""},3e3)}async function _(){k.value=!0,h.value=!1;try{const o=await $fetch("/api/v1/admin/providers?status=pending&limit=100&sort_by=created_at&sort_order=asc",{headers:y()});m.value=o}catch(o){console.error("Failed to fetch pending providers:",o),h.value=!0}finally{k.value=!1}}async function C(o){x.value=o.id;try{await $fetch(`/api/v1/admin/providers/${o.id}/approve`,{method:"POST",headers:y(),body:{reason:"Admin approved via pending queue"}}),b(`"${o.name}" sikeresen jóváhagyva`),m.value=m.value.filter(e=>e.id!==o.id)}catch(e){const w=e?.response?._data?.detail||e?.data?.detail||"Ismeretlen hiba";b(`Hiba: ${w}`),console.error("Failed to approve provider:",e)}finally{x.value=null}}function M(o){c.value=o,v.value="",p.value=!0}async function $(){if(c.value){g.value=!0;try{await $fetch(`/api/v1/admin/providers/${c.value.id}/reject`,{method:"POST",headers:y(),body:{reason:v.value||"Admin rejected via pending queue"}}),b(`"${c.value.name}" elutasítva`),m.value=m.value.filter(o=>o.id!==c.value.id),p.value=!1,c.value=null}catch(o){const e=o?.response?._data?.detail||o?.data?.detail||"Ismeretlen hiba";b(`Hiba: ${e}`),console.error("Failed to reject provider:",o)}finally{g.value=!1}}}return F(()=>{_()}),(o,e)=>{const w=H;return n(),l("div",null,[e[24]||(e[24]=t("div",{class:"mb-8"},[t("h1",{class:"text-2xl font-bold text-white"},"Jóváhagyásra váró szolgáltatók"),t("p",{class:"text-slate-400 mt-1"},"A közösség által beküldött szolgáltatók moderációs sora")],-1)),a(k)?(n(),l("div",q,[...e[3]||(e[3]=[t("div",{class:"text-slate-400 flex items-center gap-3"},[t("svg",{class:"w-5 h-5 animate-spin",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("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"})]),t("span",null,"Függőben lévő szolgáltatók betöltése...")],-1)])])):a(h)?(n(),l("div",J,[e[4]||(e[4]=t("p",{class:"text-rose-400"},"Hiba történt a szolgáltatók betöltése közben.",-1)),t("button",{onClick:_,class:"mt-3 text-sm text-rose-300 hover:text-rose-200 underline"},"Újrapróbálkozás")])):(n(),l("div",O,[(n(!0),l(T,null,P(a(m),s=>(n(),l("div",{key:s.id,class:"bg-slate-800 rounded-xl border border-slate-700 p-6 hover:border-amber-500/30 transition"},[t("div",K,[t("div",U,[t("div",G,[t("h3",Q,r(s.name),1),e[5]||(e[5]=t("span",{class:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-amber-500/10 text-amber-400"}," Függőben ",-1)),t("code",W,r(s.source),1)]),t("div",X,[s.address?(n(),l("div",Y,[e[6]||(e[6]=t("span",{class:"text-slate-500"},"Cím:",-1)),i(" "+r(s.address),1)])):u("",!0),s.city?(n(),l("div",Z,[e[7]||(e[7]=t("span",{class:"text-slate-500"},"Város:",-1)),i(" "+r(s.city),1)])):u("",!0),s.category?(n(),l("div",ee,[e[8]||(e[8]=t("span",{class:"text-slate-500"},"Kategória:",-1)),i(" "+r(s.category),1)])):u("",!0),t("div",te,[e[9]||(e[9]=t("span",{class:"text-slate-500"},"Validációs pontszám:",-1)),t("span",se,r(s.validation_score),1)]),s.created_at?(n(),l("div",oe,[e[10]||(e[10]=t("span",{class:"text-slate-500"},"Beküldve:",-1)),i(" "+r(a(z)(s.created_at)),1)])):u("",!0)])]),t("div",le,[t("button",{onClick:B=>C(s),disabled:a(x)===s.id,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"},[a(x)===s.id?(n(),l("svg",ae,[...e[11]||(e[11]=[t("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"},null,-1)])])):(n(),l("svg",ie,[...e[12]||(e[12]=[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"},null,-1)])])),e[13]||(e[13]=i(" Jóváhagyás ",-1))],8,ne),t("button",{onClick:B=>M(s),disabled:a(x)===s.id,class:"px-4 py-2 bg-rose-600/20 hover:bg-rose-600/40 disabled:opacity-50 text-rose-400 rounded-lg text-sm font-medium transition flex items-center gap-2"},[...e[14]||(e[14]=[t("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1),i(" Elutasítás ",-1)])],8,re),S(w,{to:`/providers/${s.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:I(()=>[...e[15]||(e[15]=[t("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),t("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"})],-1),i(" Részletek ",-1)])]),_:1},8,["to"])])])]))),128)),a(m).length===0?(n(),l("div",de,[...e[16]||(e[16]=[t("svg",{class:"w-12 h-12 mx-auto text-slate-600 mb-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("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"})],-1),t("h3",{class:"text-lg font-medium text-slate-400 mb-1"},"Nincs függőben lévő szolgáltató",-1),t("p",{class:"text-sm text-slate-500"},"Minden beküldött szolgáltató fel lett dolgozva.",-1)])])):u("",!0)])),a(p)?(n(),l("div",{key:3,class:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",onClick:e[2]||(e[2]=j(s=>p.value=!1,["self"]))},[t("div",ue,[e[22]||(e[22]=t("h2",{class:"text-lg font-semibold text-white mb-2"},"Szolgáltató elutasítása",-1)),t("p",me,[e[17]||(e[17]=i(" Biztosan elutasítod a(z) ",-1)),t("strong",ce,r(a(c)?.name),1),e[18]||(e[18]=i(" szolgáltatót? ",-1))]),t("form",{onSubmit:j($,["prevent"])},[t("div",xe,[e[19]||(e[19]=t("label",{class:"block text-sm font-medium text-slate-300 mb-1"},"Indoklás (opcionális)",-1)),V(t("textarea",{"onUpdate:modelValue":e[0]||(e[0]=s=>N(v)?v.value=s:null),rows:"3",placeholder:"Add meg az elutasítás okát...",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-rose-500/50 focus:border-rose-500 text-sm resize-none"},null,512),[[L,a(v)]])]),t("div",pe,[t("button",{type:"button",onClick:e[1]||(e[1]=s=>p.value=!1),class:"px-4 py-2 text-sm text-slate-400 hover:text-white transition"},"Mégse"),t("button",{type:"submit",disabled:a(g),class:"px-4 py-2 bg-rose-600 hover:bg-rose-500 disabled:bg-rose-600/50 text-white rounded-lg text-sm font-medium transition flex items-center gap-2"},[a(g)?(n(),l("svg",fe,[...e[20]||(e[20]=[t("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"},null,-1)])])):u("",!0),e[21]||(e[21]=i(" Elutasítás ",-1))],8,ve)])],32)])])):u("",!0),a(f)?(n(),l("div",ge,[e[23]||(e[23]=t("svg",{class:"w-4 h-4 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("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"})],-1)),i(" "+r(a(f)),1)])):u("",!0)])}}}),ze=E(be,[["__scopeId","data-v-9dff1238"]]);export{ze as default};