PageSourceSearch

https://inanctur.com.tr/_nuxt/LqavcpGs.js

js inanctur.com.tr collected 2026-09-24 10:20:07 UTC 6,091 bytes, 1 lines download raw bytes

1import{r as p,o as A,e as r,g as e,j as k,k as v,v as b,t as d,F as V,D as I,Y as g,l as y,c as K,f as c}from"./8EhAlHkq.js";const R={class:"max-w-6xl mx-auto p-4"},S={class:"bg-white p-4 rounded shadow mb-4"},M={class:"grid grid-cols-1 md:grid-cols-3 gap-3"},U={class:"flex items-center space-x-2"},j={key:0,class:"mt-3 p-3 bg-amber-50 border border-amber-200 rounded"},F={class:"mt-2 font-mono text-sm bg-white p-2 rounded flex justify-between items-center"},L={class:"truncate"},O={class:"flex items-center space-x-2"},Y={class:"bg-white p-4 rounded shadow mb-4"},E={key:0,class:"text-sm text-slate-500"},H={key:1,class:"w-full text-sm"},N={class:"py-2 font-mono"},P={class:"py-2"},q={class:"py-2"},G={class:"py-2"},J={class:"py-2"},Q={class:"py-2 text-right"},W=["onClick"],X=["onClick"],Z={class:"bg-white p-4 rounded shadow"},ee={class:"grid grid-cols-1 md:grid-cols-3 gap-3"},te={class:"flex items-center space-x-2"},se={key:0,class:"mt-3 p-3 bg-emerald-50 border border-emerald-200 rounded"},le={class:"mt-2 font-mono text-sm bg-white p-2 rounded flex justify-between items-center"},ne={class:"truncate"},ie={__name:"clients",setup(oe){const m=K(),o=p({name:"",scopes:"tours:read"}),h=p([]),_=p(!1),a=p(null),i=p({client_id:"",client_secret:""}),u=p(null),C=l=>{try{return l?new Date(l).toLocaleString():""}catch{return l}},x=async()=>{var l;_.value=!0;try{const t=(l=g())==null?void 0:l.value,s=await y.get(`${m.public.apiBase}/microapi/clients`,{headers:t,withCredentials:!0});h.value=s.data||[]}catch(t){console.error("getClients",t)}finally{_.value=!1}},f=async()=>{var l,t,s;try{const n=(l=g())==null?void 0:l.value,z=await y.post(`${m.public.apiBase}/microapi/clients`,{name:o.value.name,scopes:o.value.scopes},{headers:n,withCredentials:!0});a.value=z.data,await x()}catch(n){console.error("createClient",n),alert("Client oluşturulurken hata: "+(((s=(t=n==null?void 0:n.response)==null?void 0:t.data)==null?void 0:s.message)||n.message))}},w=async l=>{var t;if(confirm("Bu clienti iptal etmek istediğinize emin misiniz?"))try{const s=(t=g())==null?void 0:t.value;await y.post(`${m.public.apiBase}/microapi/clients/${l.client_id}/revoke`,{},{headers:s,withCredentials:!0}),await x()}catch(s){console.error("revokeClient",s),alert("Revoke sırasında hata")}},T=async()=>{if(a.value)try{await navigator.clipboard.writeText(`${a.value.client_id}:${a.value.client_secret}`),alert("Kopyalandı")}catch(l){console.error(l)}},$=async l=>{try{await navigator.clipboard.writeText(l),alert("Client ID kopyalandı")}catch{}},B=async()=>{var l,t;try{u.value=null;const s=await y.post(`${m.public.apiBase}/microapi/token`,{client_id:i.value.client_id,client_secret:i.value.client_secret});u.value=s.data}catch(s){console.error("getClientToken",s),alert("Token alınamadı: "+(((t=(l=s==null?void 0:s.response)==null?void 0:l.data)==null?void 0:t.message)||s.message))}},D=async()=>{var l;if((l=u.value)!=null&&l.token)try{await navigator.clipboard.writeText(u.value.token),alert("Token kopyalandı")}catch{}};return A(()=>{x()}),(l,t)=>(c(),r("div",R,[t[13]||(t[13]=e("h2",{class:"text-lg font-semibold mb-4"},"Micro-API Clients",-1)),e("div",S,[t[8]||(t[8]=e("h3",{class:"font-medium mb-2"},"Yeni Client Oluştur",-1)),e("div",M,[v(e("input",{"onUpdate:modelValue":t[0]||(t[0]=s=>o.value.name=s),placeholder:"Client adı",class:"border p-2 rounded"},null,512),[[b,o.value.name]]),v(e("input",{"onUpdate:modelValue":t[1]||(t[1]=s=>o.value.scopes=s),placeholder:"scopes (örn: tours:read)",class:"border p-2 rounded"},null,512),[[b,o.value.scopes]]),e("div",U,[e("button",{onClick:f,class:"px-3 py-2 bg-sky-600 text-white rounded"},"Oluştur"),e("button",{onClick:t[2]||(t[2]=s=>{o.value.name="",o.value.scopes=""}),class:"px-3 py-2 bg-slate-100 rounded"},"Temizle")])]),a.value?(c(),r("div",j,[t[7]||(t[7]=e("div",{class:"text-sm"},"Client oluşturuldu. Lütfen secret'ı güvenli bir yerde saklayın — bu değer yalnızca bir kez gösterilir.",-1)),e("div",F,[e("div",L,d(a.value.client_id)+" — "+d(a.value.client_secret),1),e("div",O,[e("button",{onClick:T,class:"px-2 py-1 bg-slate-100 rounded text-sm"},"Kopyala"),e("button",{onClick:t[3]||(t[3]=s=>a.value=null),class:"px-2 py-1 bg-red-100 rounded text-sm"},"Kapat")])])])):k("",!0)]),e("div",Y,[t[10]||(t[10]=e("h3",{class:"font-medium mb-2"},"Mevcut Clients",-1)),_.value?(c(),r("div",E,"Yükleniyor...")):(c(),r("table",H,[t[9]||(t[9]=e("thead",{class:"text-left text-xs text-slate-500"}
1,[e("tr",null,[e("th",null,"Client ID"),e("th",null,"Ad"),e("th",null,"Scopes"),e("th",null,"Revoked"),e("th",null,"Oluşturulma"),e("th")])],-1)),e("tbody",null,[(c(!0),r(V,null,I(h.value,s=>(c(),r("tr",{key:s.client_id,class:"border-t"},[e("td",N,d(s.client_id),1),e("td",P,d(s.name),1),e("td",q,d(s.scopes),1),e("td",G,d(s.revoked?"Evet":"Hayır"),1),e("td",J,d(s.createdAt?C(s.createdAt):""),1),e("td",Q,[s.revoked?k("",!0):(c(),r("button",{key:0,onClick:n=>w(s),class:"px-2 py-1 bg-red-100 rounded text-xs"},"Revoke",8,W)),e("button",{onClick:n=>$(s.client_id),class:"px-2 py-1 bg-slate-100 rounded text-xs"},"Kopya ID",8,X)])]))),128))])]))]),e("div",Z,[t[12]||(t[12]=e("h3",{class:"font-medium mb-2"},"Client Credentials ile Token Al",-1)),e("div",ee,[v(e("input",{"onUpdate:modelValue":t[4]||(t[4]=s=>i.value.client_id=s),placeholder:"client_id",class:"border p-2 rounded"},null,512),[[b,i.value.client_id]]),v(e("input",{"onUpdate:modelValue":t[5]||(t[5]=s=>i.value.client_secret=s),placeholder:"client_secret",class:"border p-2 rounded"},null,512),[[b,i.value.client_secret]]),e("div",te,[e("button",{onClick:B,class:"px-3 py-2 bg-green-600 text-white rounded"},"Token Al"),e("button",{onClick:t[6]||(t[6]=s=>{i.value.client_id="",i.value.client_secret="",u.value=null}),class:"px-3 py-2 bg-slate-100 rounded"},"Temizle")])]),u.value?(c(),r("div",se,[t[11]||(t[11]=e("div",{class:"text-sm"},"Token (24h):",-1)),e("div",le,[e("div",ne,d(u.value.token),1),e("div",{class:"flex items-center space-x-2"},[e("button",{onClick:D,class:"px-2 py-1 bg-slate-100 rounded text-sm"},"Kopyala")])])])):k("",!0)])]))}};export{ie as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.