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

2 lines
12 KiB
JavaScript

import{_ as $}from"./CuTzR9Y8.js";import{e as T,g as L,c as r,a as t,t as n,i as s,F as z,y as x,z as E,C as f,v as C,k as v,d as h,r as I,j as _,J as U,h as D,l as u,o as i,b as j,w as M,n as H}from"./Duy9QquX.js";import{u as J}from"./iEY_AUwe.js";import{_ as K}from"./DlAUqK2U.js";import"./BmPpcd_L.js";const R={class:"grid grid-cols-2 md:grid-cols-5 gap-4 mb-8"},A={class:"bg-slate-800 rounded-xl border border-slate-700 p-4"},P={class:"text-2xl font-bold text-white mt-1"},O={class:"bg-slate-800 rounded-xl border border-amber-500/30 p-4"},q={class:"text-2xl font-bold text-amber-400 mt-1"},G={class:"bg-slate-800 rounded-xl border border-emerald-500/30 p-4"},Q={class:"text-2xl font-bold text-emerald-400 mt-1"},W={class:"bg-slate-800 rounded-xl border border-rose-500/30 p-4"},X={class:"text-2xl font-bold text-rose-400 mt-1"},Y={class:"bg-slate-800 rounded-xl border border-purple-500/30 p-4"},Z={class:"text-2xl font-bold text-purple-400 mt-1"},tt={key:0,class:"flex items-center justify-center py-20"},et={key:1,class:"bg-rose-500/10 border border-rose-500/30 rounded-xl p-6 mb-8"},st={class:"bg-slate-800 rounded-xl border border-slate-700 p-4 mb-6"},ot={class:"flex flex-wrap items-center gap-4"},at={class:"flex-1 min-w-[200px]"},lt={class:"bg-slate-800 rounded-xl border border-slate-700 overflow-hidden"},nt={class:"w-full"},rt={class:"divide-y divide-slate-700/50"},it={class:"px-6 py-4 text-sm text-slate-400"},dt={class:"px-6 py-4"},pt={class:"px-6 py-4 text-sm text-slate-300 max-w-[200px] truncate"},ct={class:"px-6 py-4"},ut={class:"px-6 py-4"},xt={class:"flex items-center gap-1.5"},gt={class:"text-xs font-mono text-slate-400 bg-slate-700/50 px-2 py-0.5 rounded"},mt={key:0,class:"text-[10px] font-mono text-slate-500 bg-slate-700/30 px-1.5 py-0.5 rounded"},bt={class:"px-6 py-4"},ft={class:"flex items-center gap-2"},vt={class:"w-16 h-1.5 bg-slate-700 rounded-full overflow-hidden"},ht={class:"text-xs text-slate-400"},_t={class:"px-6 py-4 text-sm text-slate-400"},kt={class:"px-6 py-4 text-right"},yt={class:"flex items-center justify-end gap-2"},wt={key:0},zt={class:"flex items-center justify-between mt-6"},Ct={class:"text-sm text-slate-400"},jt={class:"flex items-center gap-2"},Mt=["disabled"],St={class:"text-sm text-slate-400"},Vt=["disabled"],Nt={key:3,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"},Bt=T({__name:"index",setup(Ft){const{formatDate:S}=J(),g=u(!0),m=u(!1),c=u([]),p=u({total:0,pending:0,approved:0,rejected:0,flagged:0,total_validations:0,staging_pending:0}),k=u("");let b=null;const o=U({search:"",status:"",source:"",sort_by:"created_at",sort_order:"desc",skip:0,limit:50});function y(){const e=D("access_token").value;return e?{Authorization:`Bearer ${e}`,"Content-Type":"application/json"}:{"Content-Type":"application/json"}}function V(l){return{pending:"bg-amber-500/10 text-amber-400",approved:"bg-emerald-500/10 text-emerald-400",rejected:"bg-rose-500/10 text-rose-400",flagged:"bg-purple-500/10 text-purple-400"}[l]||"bg-slate-500/10 text-slate-400"}function N(l){return{pending:"Függőben",approved:"Jóváhagyott",rejected:"Elutasított",flagged:"Megjelölt"}[l]||l}function B(){b&&clearTimeout(b),b=setTimeout(()=>{o.skip=0,d()},400)}async function F(){try{const l=await $fetch("/api/v1/admin/providers/stats",{headers:y()});p.value=l}catch(l){console.error("Failed to fetch provider stats:",l)}}async function d(){g.value=!0,m.value=!1;try{const l=new URLSearchParams;l.append("skip",String(o.skip)),l.append("limit",String(o.limit)),l.append("sort_by",o.sort_by),l.append("sort_order",o.sort_order),o.status&&l.append("status",o.status),o.source&&l.append("source",o.source),o.search&&l.append("search",o.search);const e=await $fetch(`/api/v1/admin/providers?${l.toString()}`,{headers:y()});c.value=e}catch(l){console.error("Failed to fetch providers:",l),m.value=!0}finally{g.value=!1}}return L(()=>{F(),d()}),(l,e)=>{const w=$;return i(),r("div",null,[e[22]||(e[22]=t("div",{class:"mb-8"},[t("h1",{class:"text-2xl font-bold text-white"},"Szolgáltatók"),t("p",{class:"text-slate-400 mt-1"},"Szolgáltatók listázása, keresése és moderálása")],-1)),t("div",R,[t("div",A,[e[7]||(e[7]=t("p",{class:"text-xs text-slate-400 uppercase tracking-wider"},"Összes",-1)),t("p",P,n(s(p).total),1)]),t("div",O,[e[8]||(e[8]=t("p",{class:"text-xs text-slate-400 uppercase tracking-wider"},"Függőben",-1)),t("p",q,n(s(p).pending),1)]),t("div",G,[e[9]||(e[9]=t("p",{class:"text-xs text-slate-400 uppercase tracking-wider"},"Jóváhagyott",-1)),t("p",Q,n(s(p).approved),1)]),t("div",W,[e[10]||(e[10]=t("p",{class:"text-xs text-slate-400 uppercase tracking-wider"},"Elutasított",-1)),t("p",X,n(s(p).rejected),1)]),t("div",Y,[e[11]||(e[11]=t("p",{class:"text-xs text-slate-400 uppercase tracking-wider"},"Megjelölt",-1)),t("p",Z,n(s(p).flagged),1)])]),s(g)?(i(),r("div",tt,[...e[12]||(e[12]=[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,"Szolgáltatók betöltése...")],-1)])])):s(m)?(i(),r("div",et,[e[13]||(e[13]=t("p",{class:"text-rose-400"},"Hiba történt a szolgáltatók betöltése közben.",-1)),t("button",{onClick:d,class:"mt-3 text-sm text-rose-300 hover:text-rose-200 underline"},"Újrapróbálkozás")])):(i(),r(z,{key:2},[t("div",st,[t("div",ot,[t("div",at,[x(t("input",{"onUpdate:modelValue":e[0]||(e[0]=a=>s(o).search=a),type:"text",placeholder:"Keresés név alapján...",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-indigo-500/50 focus:border-indigo-500 text-sm",onInput:B},null,544),[[E,s(o).search]])]),x(t("select",{"onUpdate:modelValue":e[1]||(e[1]=a=>s(o).status=a),class:"px-3 py-2 bg-slate-700 border border-slate-600 rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500 text-sm",onChange:d},[...e[14]||(e[14]=[C('<option value="" data-v-c684092a>Minden státusz</option><option value="pending" data-v-c684092a>Függőben</option><option value="approved" data-v-c684092a>Jóváhagyott</option><option value="rejected" data-v-c684092a>Elutasított</option><option value="flagged" data-v-c684092a>Megjelölt</option>',5)])],544),[[f,s(o).status]]),x(t("select",{"onUpdate:modelValue":e[2]||(e[2]=a=>s(o).source=a),class:"px-3 py-2 bg-slate-700 border border-slate-600 rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500 text-sm",onChange:d},[...e[15]||(e[15]=[C('<option value="" data-v-c684092a>Minden forrás</option><option value="manual" data-v-c684092a>Kézi</option><option value="ocr" data-v-c684092a>OCR</option><option value="import" data-v-c684092a>Import</option><option value="bot" data-v-c684092a>Bot (Staging)</option><option value="verified_org" data-v-c684092a>Szervezet</option>',6)])],544),[[f,s(o).source]]),x(t("select",{"onUpdate:modelValue":e[3]||(e[3]=a=>s(o).sort_by=a),class:"px-3 py-2 bg-slate-700 border border-slate-600 rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500 text-sm",onChange:d},[...e[16]||(e[16]=[t("option",{value:"created_at"},"Létrehozás dátuma",-1),t("option",{value:"name"},"Név",-1),t("option",{value:"validation_score"},"Validációs pontszám",-1)])],544),[[f,s(o).sort_by]]),t("button",{onClick:e[4]||(e[4]=a=>{s(o).sort_order=s(o).sort_order==="asc"?"desc":"asc",d()}),class:"px-3 py-2 bg-slate-700 border border-slate-600 rounded-lg text-white hover:bg-slate-600 transition text-sm flex items-center gap-1"},[(i(),r("svg",{class:v(["w-4 h-4",s(o).sort_order==="asc"?"rotate-180":""]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...e[17]||(e[17]=[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"},null,-1)])],2)),h(" "+n(s(o).sort_order==="asc"?"Növekvő":"Csökkenő"),1)])])]),t("div",lt,[t("table",nt,[e[20]||(e[20]=t("thead",null,[t("tr",{class:"border-b border-slate-700"},[t("th",{class:"text-left px-6 py-4 text-xs font-medium text-slate-400 uppercase tracking-wider"},"ID"),t("th",{class:"text-left px-6 py-4 text-xs font-medium text-slate-400 uppercase tracking-wider"},"Név"),t("th",{class:"text-left px-6 py-4 text-xs font-medium text-slate-400 uppercase tracking-wider"},"Cím"),t("th",{class:"text-left px-6 py-4 text-xs font-medium text-slate-400 uppercase tracking-wider"},"Státusz"),t("th",{class:"text-left px-6 py-4 text-xs font-medium text-slate-400 uppercase tracking-wider"},"Forrás"),t("th",{class:"text-left px-6 py-4 text-xs font-medium text-slate-400 uppercase tracking-wider"},"Validáció"),t("th",{class:"text-left px-6 py-4 text-xs font-medium text-slate-400 uppercase tracking-wider"},"Létrehozva"),t("th",{class:"text-right px-6 py-4 text-xs font-medium text-slate-400 uppercase tracking-wider"},"Műveletek")])],-1)),t("tbody",rt,[(i(!0),r(z,null,I(s(c),a=>(i(),r("tr",{key:a.id,class:"hover:bg-slate-700/30 transition"},[t("td",it,n(a.id),1),t("td",dt,[j(w,{to:`/providers/${a.id}`,class:"text-sm font-medium text-indigo-400 hover:text-indigo-300 transition"},{default:M(()=>[h(n(a.name),1)]),_:2},1032,["to"])]),t("td",pt,n(a.address||"—"),1),t("td",ct,[t("span",{class:v(["inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium",V(a.status)])},n(N(a.status)),3)]),t("td",ut,[t("div",xt,[t("code",gt,n(a.source),1),a.source_table?(i(),r("span",mt,n(a.source_table),1)):_("",!0)])]),t("td",bt,[t("div",ft,[t("div",vt,[t("div",{class:v(["h-full rounded-full transition-all",a.validation_score>=50?"bg-emerald-500":a.validation_score>=20?"bg-amber-500":"bg-slate-500"]),style:H({width:Math.min(a.validation_score,100)+"%"})},null,6)]),t("span",ht,n(a.validation_score),1)])]),t("td",_t,n(s(S)(a.created_at)),1),t("td",kt,[t("div",yt,[j(w,{to:`/providers/${a.id}`,class:"p-1.5 rounded-lg text-slate-400 hover:text-white hover:bg-slate-700 transition",title:"Részletek"},{default:M(()=>[...e[18]||(e[18]=[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)])]),_:1},8,["to"])])])]))),128)),s(c).length===0?(i(),r("tr",wt,[...e[19]||(e[19]=[t("td",{colspan:"8",class:"px-6 py-12 text-center text-sm text-slate-500"}," Nincs megjeleníthető szolgáltató. ",-1)])])):_("",!0)])])]),t("div",zt,[t("p",Ct,n(s(c).length)+" találat (összesen: "+n(s(p).total)+") ",1),t("div",jt,[t("button",{disabled:s(o).skip<=0,onClick:e[5]||(e[5]=a=>{s(o).skip=Math.max(0,s(o).skip-s(o).limit),d()}),class:"px-3 py-1.5 bg-slate-700 border border-slate-600 rounded-lg text-white disabled:opacity-50 disabled:cursor-not-allowed hover:bg-slate-600 transition text-sm"}," Előző ",8,Mt),t("span",St,n(Math.floor(s(o).skip/s(o).limit)+1)+". oldal ",1),t("button",{disabled:s(c).length<s(o).limit,onClick:e[6]||(e[6]=a=>{s(o).skip+=s(o).limit,d()}),class:"px-3 py-1.5 bg-slate-700 border border-slate-600 rounded-lg text-white disabled:opacity-50 disabled:cursor-not-allowed hover:bg-slate-600 transition text-sm"}," Következő ",8,Vt)])])],64)),s(k)?(i(),r("div",Nt,[e[21]||(e[21]=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)),h(" "+n(s(k)),1)])):_("",!0)])}}}),Ut=K(Bt,[["__scopeId","data-v-c684092a"]]);export{Ut as default};