PageSourceSearch

https://xn--gbrsm-n4acb.com/assets/AdminIslandContents-BTg-w-BO.js

js xn--gbrsm-n4acb.com collected 2026-10-02 01:51:04 UTC 9,748 bytes, 5 lines download raw bytes

1import{r as p,j as e}from"./index-DM59o3_m.js";import{A as W}from"./AdminLayout-DNjwivFt.js";import{t as S,A as u,g as w}from"./config-RRW9jshC.js";/* empty css              */const h=()=>({title:"",subtitle:"",summary:"",body:"",slug:"",coverImageUrl:"",seoTitle:"",seoDescription:"",titleTr:"",titleEn:"",subtitleTr:"",subtitleEn:"",summaryTr:"",summaryEn:"",bodyTr:"",bodyEn:"",isPublished:!0,isFeatured:!1,sortOrder:0});function q(){const[b,B]=p.useState([]),[I,k]=p.useState(!0),[g,x]=p.useState({open:!1,data:h()}),c={Authorization:`Bearer ${localStorage.getItem("accessToken")}`},f=async()=>{k(!0);const t=await fetch(`${u}/api/admin/island-contents`,{headers:c});t.ok&&B(await t.json()),k(!1)};p.useEffect(()=>{f()},[]);const A=async t=>{const l=await fetch(`${u}/api/admin/island-contents/${t}`,{headers:c});l.ok&&x({open:!0,data:await l.json(),id:t})},U=async()=>{const{id:t,data:l}=g,s=t?`${u}/api/admin/island-contents/${t}`:`${u}/api/admin/island-contents`;await fetch(s,{method:t?"PUT":"POST",headers:{"Content-Type":"application/json",...c},body:JSON.stringify(l)}),x({open:!1,data:h()}),f()},F=async t=>{confirm("İçerik silinsin mi?")&&(await fetch(`${u}/api/admin/island-contents/${t}`,{method:"DELETE",headers:c}),f())},n=g.data,i=(t,l)=>x(s=>({...s,data:{...s.data,[t]:l}})),[T,C]=p.useState(!1),[m,z]=p.useState({}),$=async t=>{const l=t.target.files?.[0];if(!(!l||!l.type.startsWith("image/"))){C(!0);try{const s=new FormData;s.append("file",l);const v=await(await fetch(w(),{method:"POST",headers:c,body:s})).json().catch(()=>({}));v?.url&&i("coverImageUrl",S(v.url))}finally{C(!1),t.target.value=""}}},j=async(t,l)=>{const s=l.target.files?.[0];if(!(!s||!s.type.startsWith("image/"))){z(a=>({...a,[t]:!0}));try{const a=new FormData;a.append("file",s);const E=await(await fetch(w(),{method:"POST",headers:c,body:a})).json().catch(()=>({}));if(E?.url){const O=S(E.url),P=String(g.data[t]??""),D=`
2
3![Gorsel](${O})
4
5`;i(t,P+D)}}finally{z(a=>({...a,[t]:!1})),l.target.value=""}}};return e.jsxs(W,{children:[e.jsxs("div",{style:{padding:24},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:20},children:[e.jsx("h2",{style:{color:"#f1f5f9",margin:0},children:"Ada Hakkında İçerikleri"}),e.jsx("button",{onClick:()=>x({open:!0,data:h()}),style:r("#0ea5e9"),children:"+ Yeni İçerik"})]}),I?e.jsx("p",{style:{color:"#94a3b8"},children:"Yükleniyor..."}):e.jsxs("table",{style:Y,children:[e.jsx("thead",{children:e.jsx("tr",{style:{background:"#1e293b"},children:["Başlık","Slug","Sıra","Yayında","Öne Çıkan","İşlem"].map(t=>e.jsx("th",{style:G,children:t},t))})}),e.jsx("tbody",{children:b.map(t=>e.jsxs("tr",{style:{borderBottom:"1px solid #334155"},children:[e.jsxs("td",{style:y,children:[e.jsx("div",{style:{color:"#f1f5f9"},children:t.title}),t.subtitle&&e.jsx("div",{style:{color:"#64748b",fontSize:12},children:t.subtitle})]}),e.jsx("td",{style:y,children:e.jsx("code",{style:{color:"#64748b",fontSize:12},children:t.slug})}),e.jsx("td",{style:y,children:t.sortOrder}),e.jsx("td",{style:y,children:e.jsx("span",{style:{color:t.isPublished?"#22c55e":"#ef4444"},children:t.isPublished?"✓ Yayında":"✗ Taslak"})}),e.jsx("td",{style:y,children:e.jsx("span",{style:{color:t.isFeatured?"#f59e0b":"#64748b"},children:t.isFeatured?"★":"–"})}),e.jsxs("td",{style:y,children:[e.jsx("button",{onClick:()=>A(t.id),style:{...r("#334155"),marginRight:4,fontSize:12},children:"Düzenle"}),e.jsx("button",{onClick:()=>F(t.id),style:{...r("#ef4444"),fontSize:12},children:"Sil"})]})]},t.id))})]})]}),g.open&&e.jsx("div",{style:H,children:e.jsxs("div",{style:R,children:[e.jsx("h3",{style:{color:"#f1f5f9",marginTop:0},children:g.id?"İçerik Düzenle":"Yeni İçerik"}),[{label:"Başlık *",key:"title",type:"text"},{label:"Alt Başlık",key:"subtitle",type:"text"}].map(({label:t,key:l,type:s})=>e.jsxs("div",{style:{marginBottom:10},children:[e.jsx("label",{style:d,children:t}),s==="textarea"?e.jsxs(e.Fragment,{children:[e.jsx("textarea",{value:n[l]??"",onChange:a=>i(l,a.target.value),style:{...o,minHeight:80}}),e.jsxs("div",{style:{marginTop:8},children:[e.jsxs("label",{style:{...r("#334155"),margin:0,cursor:"pointer",display:"inline-block",fontSize:12},children:[e.jsx("input",{type:"file",accept:"image/*",onChange:a=>{j(l,a)},disabled:!!m[l],style:{display:"none"}}),m[l]?"Görsel yükleniyor...":"İçeriğe görsel ekle"]}),e.jsxs("div",{style:{color:"#64748b",fontSize:11,marginTop:6},children:["Görsel metne markdown olarak eklenir: ",e.jsx("code",{children:"![Gorsel](...)"})]})]})]}):e.jsx("input",{type:s,value:n[l]??"",onChange:a=>i(l,s==="number"?Number(a.target.value):a.target.value),style:o})]},l)),e.jsxs("div",{style:{marginBottom:10},children:[e.jsx("label",{style:d,children:"Kapak Görseli (URL veya dosyadan yükle)"}),e.jsxs("div",{style:{display:"flex",gap:8,flexWrap:"wrap",alignItems:"center"},children:[e.jsx("input",{type:"text",value:n.coverImageUrl??"",onChange:t=>i("coverImageUrl",t.target.value),placeholder:"https://...",style:{...o,flex:1,minWidth:200}}),e.jsxs("label",{style:{...r("#334155"),margin:0,cursor:"pointer",display:"inline-block"},children:[e.jsx("input",{type:"file",accept:"image/*",onChange:$,disabled:T,style:{display:"none"}}),T?"Yükleniyor...":"Dosya seç"]})]})]}),n.coverImageUrl&&(()=>{const t=n.coverImageUrl??"",l=S(t);return e.jsx("div",{style:{marginBottom:12},children:e.jsx("img",{src:l,alt:"Kapak önizleme",style:{width:"100%",borderRadius:8,maxHeight:140,objectFit:"cover"}})})})(),e.jsx("div",{style:{marginTop:20,marginBottom:8,color:"#f1f5f9",fontSize:15,fontWeight:700},children:"Türkçe / İngilizce (mobilde dil seçimine göre gösterilir)"}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:16,marginBottom:16},children:[e.jsxs("div",{children:[e.jsx("div",{style:{...d,color:"#0ea5e9",marginBottom:8},children:"Türkçe"}),["titleTr","subtitleTr","summaryTr","bodyTr"].map(t=>{const l=t==="bodyTr"||t==="summaryTr"?"textarea":"text",s=t==="titleTr"?"Başlık":t==="subtitleTr"?"Alt başlık":t==="summaryTr"?"Özet":"İçerik";return e.jsxs("div",{style:{marginBottom:10},children:[e.jsx("label",{style:d,children:s}),l==="textarea"?e.jsxs(e.Fragment,{children:[e.jsx("textarea",{value:n[t]??"",onChange:a=>i(t,a.target.value),style:{...o,minHeight:60}}),e.jsx("div",{style:{marginTop:8},children:e.jsxs("label",{style:{...r("#334155"),margin:0,cursor:"pointer",display:"inline-block",fontSize:12},children:[e.jsx("input",{type:"file",accept:"image/*",onChange:a=>{j(t,a)},disabled:!!m[t],style:{display:"none"}}),m[t]?"Görsel yükleniyor...":"İçeriğe görsel ekle"]})})]}):e.jsx("input",{type:"text",value:n[t]??"",onChange:a=>i(t,a.target.value),style:o})]},t)})]}),e.jsxs("div",{children:[e.jsx("div",{style:{...d,color:"#0ea5e9",marginBottom:8},children:"İngilizce"}),["titleEn","subtitleEn","summaryEn","bodyEn"].map(t=>{const l=t==="bodyEn"||t==="summaryEn"?"textarea":"text",s=t==="titleEn"?"Başlık":t==="subtitleEn"?"Alt başlık":t==="summaryEn"?"Özet":"İçerik";return e.jsxs("div",{style:{marginBottom:10},children:[e.jsx("label",{style:d,children:s}),l==="textarea"?e.jsxs(e.Fragment,{children:[e.jsx("textarea",{value:n[t]??"",onChange:a=>i(t,a.target.value),style:{...o,minHeight:60}}),e.jsx("div",{style:{marginTop:8},children:e.jsxs("label",{style:{...r("#334155"),margin:0,cursor:"pointer",display:"inline-block",fontSize:12},children:[e.jsx("input",{type:"file",accept:"image/*",onChange:a=>{j(t,a)},disabled:!!m[t],style:{display:"none"}}),m[t]?"Görsel yükleniyor...":"İçeriğe görsel ekle"]})})]}):e.jsx("input",{type:"text",value:n[t]??"",onChange:a=>i(t,a.target.value),style:o})]},t)})]})]}),[{label:"Slug *",key:"slug",type:"text"},{label:"Özet (varsayılan)",key:"summary",type:"textarea"},{label:"İçerik (varsayılan)",key:"body",type:"textarea"},{label:"SEO Başlık",key:"seoTitle",type:"text"},{label:"SEO Açıklama",key:"seoDescription",type:"text"},{label:"Sıra",key:"sortOrder",type:"number"}].map(({label:t,key:l,type:s})=>e.jsxs("div",{style:{marginBottom:10},children:[e.jsx("label",{style:d,children:t}),s==="textarea"?e.jsx("textarea",{value:n[l]??"",onChange:a=>i(l,a.target.value),style:{...o,minHeight:80}}):e.jsx("input",{type:s,value:n[l]??"",onChange:a=>i(l,s==="number"?Number(a.target.value):a.target.value),style:o})]},l)),e.jsx("div",{style:{display:"flex",gap:16,marginBottom:16},children:[{label:"Yayında",key:"isPublished"},{label:"Öne Çıkan",key:"isFeatured"}].map(({label:t,key:l})=>e.jsxs("label",{style:{color:"#94a3b8",fontSize:13,display:"flex",alignItems:"center",gap:8},children:[e.jsx("input",{type:"checkbox",checked:!!n[l],onChange:s=>i(l,s.target.checked)})," ",t]},l))}),e.jsxs("div",{style:{display:"flex",gap:8,justifyContent:"flex-end"},children:[e.jsx("button",{onClick:()=>x({open:!1,data:h()}),style:r("#334155"),children:"İptal"}),e.jsx("button",{onClick:U,style:r("#0ea5e9"),children:"Kaydet"})]})]})})]})}const Y={width:"100%",borderCollapse:"collapse",color:"#f1f5f9",fontSize:14},G={padding:"10px 12px",textAlign:"left",color:"#94a3b8",fontWeight:600},y={padding:"10px 12px"},r=b=>({background:b,color:"#fff",border:"none",borderRadius:8,padding:"8px 14px",cursor:"pointer",fontWeight:600}),o={width:"100%",background:"#334155",border:"none",borderRadius:8,padding:"10px 12px",color:"#f1f5f9",fontSize:14,boxSizing:"border-box"},d={color:"#94a3b8",fontSize:13,display:"block",marginBottom:4},H={position:"fixed",inset:0,background:"rgba(0,0,0,0.6)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3},R={background:"#1e293b",borderRadius:16,padding:24,width:540,maxWidth:"90vw",maxHeight:"90vh",overflowY:"auto"};export{q 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.