PageSourceSearch

https://bpip.go.id/build/assets/Application-14390b70.js

js bpip.go.id collected 2026-10-02 10:50:52 UTC 12,978 bytes, 1 lines download raw bytes

1import{r as s,j as e,a as se,b as A}from"./app-e9f383ef.js";import{$ as l}from"./jquery.dataTables-cb765549.js";import{I as c}from"./InputLabel-db8389f3.js";import{A as re}from"./AuthenticatedLayout-24f803c5.js";import{u as le,c as de,I as q,N as ie,H as ne}from"./useDebounceEffect-fcc69a95.js";import"./transition-0e44cea8.js";function oe(m,u,o){return ie(ne({unit:"%",width:90},o,m,u),m,u)}function we(m){const[u,o]=s.useState(!0),[z,D]=s.useState(null),[_,M]=s.useState([]),[v,T]=s.useState(0),[x,V]=s.useState(""),i=s.useRef(null),h=s.useRef(null),[L,g]=s.useState(),[r,F]=s.useState(),[b,ce]=s.useState(1),[f,me]=s.useState(0),[j,pe]=s.useState(1/1);function R(t){if(t.target.files&&t.target.files.length>0){g(void 0);const a=new FileReader;a.addEventListener("load",()=>V(a.result.toString()||"")),a.readAsDataURL(t.target.files[0])}}function E(t){if(j){const{width:a,height:d}=t.currentTarget;g(oe(a,d,j))}}le(async()=>{r!=null&&r.width&&(r!=null&&r.height)&&h.current&&i.current&&de(h.current,i.current,r,b,f)},100,[r,b,f]),s.useEffect(()=>{(async()=>{try{o(!0);const a=await fetch("/adminpanel/application/data");if(!a.ok)throw new z(`This is an HTTP error: The status is ${a.status}`);let d=await a.json();M(d),D(null)}catch(a){D(a.message),M(null)}finally{o(!1)}})()},[v]);const w=s.useRef(null),p=s.useRef(null),G=[{data:null,defaultContent:"",orderable:!1},{data:"logo",render:function(t,a,d,k){return`<img src="/${t}" alt="Logo" width="75" height="75" />`}},{data:"app_name"},{data:"link"},{data:null,render:function(t,a,d){return'<button class="text-success px-1 mx-1 rounded-sm edit-btn"><i class="fas fa-edit"></i></button><button class="delete-btn"><i class="text-danger px-1 mx-1 rounded-sm fas fa-trash"></button>'}}],[n,B]=s.useState({id:"",app_name:"",link:""}),[J,K]=s.useState();s.useEffect(()=>{p.current&&p.current.destroy(),p.current=l(w.current).DataTable({data:_,columns:G,createdRow:function(t,a,d){l(t).find("td").first().text(d+1)}}),l(w.current).on("click",".edit-btn",function(){var t=p.current.row(l(this).parents("tr")).data();l("#editModal").removeClass("hidden"),l("#app_nameDeskripsi").text(t.app_name),B({id:t.id,app_name:t.app_name,link:t.link})}),l(w.current).on("click",".delete-btn",function(){var t=p.current.row(l(this).parents("tr")).data();l("#deskripsiDelete").text(t.app_name),K({id:t.id}),l("#deleteModal").removeClass("hidden")}),l("#editModal .close-btn").on("click",function(){l("#editModal").addClass("hidden")})},[_]);const O=()=>{l("#editModal").addClass("hidden")},$=()=>{l("#deleteModal").addClass("hidden")},I=t=>{B({...n,[t.target.name]:t.target.value})},Q=async t=>{t.preventDefault(),o(!0),console.log(n);try{const a=new FormData;if(i.current){const k=i.current,C=await new Promise(S=>k.toBlob(S,"image/png",1));a.append("logo",C)}a.append("id",n.id),a.append("app_name",n.app_name),a.append("link",n.link),a.append("_method","PUT");const d=await A.post(route("adminpanel.application.update",n.id),a);console.log(d),T(v+1)}catch(a){console.error(a)}window.location.reload(!0),window.location.reload(!0)},[X,P]=s.useState(!1),[Y,y]=s.useState(!1),H=()=>{y(!1)},Z=()=>{y(!0)},[N,W]=s.useState({app_name:"",link:""}),U=t=>{W({...N,[t.target.name]:t.target.value})},[ue,ee]=s.useState(null),te=async t=>{t.preventDefault(),P(!0),o(!0);try{const a=new FormData;if(i.current){const k=i.current,C=await new Promise(S=>k.toBlob(S,"image/png",1));a.append("logo",C)}a.append("app_name",N.app_name),a.append("link",N.link);const d=await A.post(route("adminpanel.application.store"),a);console.log(d),T(v+1)}catch(a){console.error(a),ee(a.response.data.message)}finally{o(!1)}y(!1),P(!1)},ae=async t=>{t.preventDefault();const a=await A.delete(route("adminpanel.application.destroy",J.id));console.log(a),window.location.reload(!0)};return e.jsxs("div",{className:"bg-slate-50 dark:bg-slate-900",children:[e.jsxs(re,{auth:m.auth,errors:m.errors,header:e.jsx("h2",{className:"text-xl font-semibold leading-tight text-gray-800",children:"Dashboard"}),children:[e.jsx(se,{children:e.jsx("title",{children:"Application"})}),e.jsxs("div",{className:"grid grid-cols-3",children:[e.jsx("p",{className:"mx-2 my-auto mt-5 font-bold lg:text-xl dark:text-white",children:"Tabel Aplikasi"}),e.jsx("div",{className:"px-0 mx-auto mt-6 colspan-2 lg:px-4",children:u&&e.jsx("div",{className:"text-slate-900 dark:text-slate-50",children:"Loading..."})})]}),e.jsxs("button",{className:"px-2 py-2 mt-3 text-xs font-semibold text-white rounded-md xl:text-base xl:w-44 bg-accent",onClick:Z,children:[e.jsx("i",{className:"fas fa-plus-circle",children:" "})," Tambah Data"]}),e.jsx("div",{className:"px-0 mx-auto mt-2 overflow-x-scroll bg-gray-200 rounded-md shadow-lg dark:bg-default lg:px-4 ",children:e.jsx("div",{className:"px-4 py-4  mx-auto text-xs 1xl:block 1xl:w-[100%] 2xl:text-base w-[100%]",children:e.jsx("table",{ref:w,className:"overflow-x-auto table datatable table-bordered w-[100%]",children:e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{className:"w-[5%]",children:"#"}),e.jsx("th",{children:"Logo Aplikasi"}),e.jsx("th",{children:"Nama Aplikasi"}),e.jsx("th",{children:"Link"}),e.jsx("th",{className:"w-[15%]",children:"Aksi"})]})})})})})]}),e.jsx("div",{id:"editModal",tabIndex:"-1","aria-hidden":"true",className:"fixed top-0 left-0 right-0 z-50 hidden p-4 md:inset-0 h-modal md:h-full",children:e.jsx("div",{className:"relative w-full h-full max-w-3xl mx-auto top-20 md:top-5 lg:top-28 md:h-auto",children:e.jsxs("div",{className:"relative bg-white border-2 border-gray-200 rounded-lg shadow-lg shadow-slate-900 dark:bg-default",children:[e.jsxs("div",{className:"flex items-start justify-between p-4 border-b roun
1ded-t dark:border-gray-600",children:[e.jsx("div",{className:"flex font-semibold text-gray-900 dark:text-white",children:e.jsx("span",{className:"mr-1",children:"Update Aplikasi"})}),e.jsx("button",{type:"button",onClick:O,className:"close-btn text-gray-400 hover:text-gray-900 rounded-lg p-1.5 ml-auto inline-flex items-center dark:hover:text-white","application-modal-hide":"editModal",children:e.jsx("i",{className:"fas fa-times-circle"})})]}),e.jsx("div",{className:"border-b dark:border-white0 border-1 border-slate-200"}),e.jsx("div",{className:"p-6 space-y-6",children:e.jsxs("form",{onSubmit:Q,encType:"multipart/form-data",children:[e.jsxs("div",{className:"grid grid-cols-4 mt-1 mr-2",children:[e.jsx(c,{htmlFor:"logo",value:"Logo",className:"flex py-1 text-sm text-dark dark:text-white"}),e.jsx("input",{className:"col-span-3 px-2 py-1 bg-white border-2 rounded-md",type:"file",accept:"image/*",onChange:R})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4 mx-48 my-2",children:[!!x&&e.jsx(q,{crop:L,onChange:(t,a)=>g(a),onComplete:t=>F(t),aspect:j,children:e.jsx("img",{ref:h,alt:"Crop me",src:x,style:{transform:`scale(${b}) rotate(${f}deg)`},onLoad:E})}),e.jsx("div",{children:!!r&&e.jsx("canvas",{ref:i,style:{border:"1px solid black",objectFit:"contain",width:r.width,height:r.height}})})]}),e.jsxs("div",{className:"grid grid-cols-4 mt-1 mr-2",children:[e.jsx(c,{htmlFor:"app_name",value:"Nama Aplikasi",className:"flex py-1 text-sm text-dark dark:text-white"}),e.jsx("input",{className:"col-span-3 text-sm border-gray-300 rounded-md shadow-sm focus:border-indigo-500 focus:ring-indigo-500",type:"text",pattern:"[^'$<>\\x22]+",title:"Tidak diperbolehkan karakter khusus",defaultValue:n.app_name,onChange:I,id:"app_name",name:"app_name",required:!0,autoFocus:!0})]}),e.jsxs("div",{className:"grid grid-cols-4 mt-1 mr-2",children:[e.jsx(c,{htmlFor:"link",value:"Link Aplikasi",className:"flex py-1 text-sm text-dark dark:text-white"}),e.jsx("input",{className:"col-span-3 text-sm border-gray-300 rounded-md shadow-sm focus:border-indigo-500 focus:ring-indigo-500",type:"text",pattern:"[^'$<>\\x22]+",title:"Tidak diperbolehkan karakter khusus",onChange:I,defaultValue:n.link,id:"link",name:"link",required:!0})]}),e.jsx("div",{className:"mt-2 border-b dark:border-white0 border-1 border-slate-200"}),e.jsx("div",{className:"grid grid-cols-3 mt-1 mr-2",children:e.jsx("button",{className:"col-start-3 p-2 rounded-lg bg-success hover:bg-green-600",type:"submit",children:"Simpan"})})]})})]})})}),Y&&e.jsx("div",{id:"createModal",tabIndex:"-1","aria-hidden":"true",className:"fixed top-0 left-0 right-0 z-40 p-4 md:inset-0 h-modal md:h-full",children:e.jsx("div",{className:"relative w-full h-full max-w-3xl mx-auto top-20 md:top-5 lg:top-28 md:h-auto",children:e.jsxs("div",{className:"relative bg-white border-2 border-gray-200 rounded-lg shadow-lg shadow-slate-900 dark:bg-default",children:[e.jsxs("div",{className:"flex items-start justify-between p-4 border-b rounded-t dark:border-gray-600",children:[e.jsx("div",{className:"flex font-semibold text-gray-900 dark:text-white",children:e.jsx("span",{className:"mr-1",children:"Tambah Aplikasi "})}),X&&e.jsx("p",{className:"ml-12 text-center dark:text-white",children:"Tunggu sebentar, sedang proses menggunggah..."}),e.jsx("button",{type:"button",onClick:H,className:"close-btn text-gray-400 hover:text-gray-900 rounded-lg p-1.5 ml-auto inline-flex items-center dark:hover:text-white","application-modal-hide":"editModal",children:e.jsx("i",{className:"fas fa-times-circle"})})]}),e.jsx("div",{className:"border-b dark:border-white0 border-1 border-slate-200"}),e.jsx("div",{className:"p-6 space-y-6",children:e.jsxs("form",{onSubmit:te,encType:"multipart/form-data",children:[e.jsxs("div",{className:"grid grid-cols-4 mt-1 mr-2",children:[e.jsx(c,{htmlFor:"picture",value:"Logo Aplikasi",className:"flex py-1 text-sm text-dark dark:text-white"}),e.jsx("input",{className:"col-span-3 px-2 py-1 bg-white border-2 rounded-md",type:"file",accept:"image/*",onChange:R})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4 mx-48 my-2",children:[!!x&&e.jsx(q,{crop:L,onChange:(t,a)=>g(a),onComplete:t=>F(t),aspect:j,children:e.jsx("img",{ref:h,alt:"Crop me",src:x,style:{transform:`scale(${b}) rotate(${f}deg)`},onLoad:E})}),e.jsx("div",{children:!!r&&e.jsx("canvas",{ref:i,style:{border:"1px solid black",objectFit:"contain",width:r.width,height:r.height}})})]}),e.jsxs("div",{className:"grid grid-cols-4 mt-1 mr-2",children:[e.jsx(c,{htmlFor:"app_name",value:"Nama Aplikasi",className:"flex py-1 text-sm text-dark dark:text-white"}),e.jsx("input",{className:"col-span-3 text-sm border-gray-300 rounded-md shadow-sm focus:border-indigo-500 focus:ring-indigo-500",type:"text",onCh
1ange:U,id:"app_name",name:"app_name",required:!0,autoFocus:!0})]}),e.jsxs("div",{className:"grid grid-cols-4 mt-1 mr-2",children:[e.jsx(c,{htmlFor:"link",value:"Link Aplikasi",className:"flex py-1 text-sm text-dark dark:text-white"}),e.jsx("input",{className:"col-span-3 text-sm border-gray-300 rounded-md shadow-sm focus:border-indigo-500 focus:ring-indigo-500",type:"text",onChange:U,id:"link",name:"link",required:!0,autoFocus:!0})]}),e.jsx("div",{className:"mt-2 border-b dark:border-white0 border-1 border-slate-200"}),e.jsxs("div",{className:"flex justify-between mx-2",children:[e.jsx("button",{type:"button",onClick:H,className:"px-8 py-2 mt-2 bg-yellow-500 rounded-md hover:bg-yellow-600 text-dark",children:"Cancel"}),e.jsx("button",{type:"submit",className:"px-8 py-2 mt-2 text-white rounded-md bg-accent hover:bg-red-700",children:"Submit"})]})]})})]})})}),e.jsx("div",{id:"deleteModal",tabIndex:"-1","aria-hidden":"true",className:"fixed top-0 left-0 right-0 z-50 hidden p-4 overflow-x-hidden overflow-y-auto md:inset-0 h-modal md:h-full",children:e.jsx("div",{className:"relative w-full h-full max-w-xl mx-auto top-20 md:h-auto",children:e.jsxs("div",{className:"relative bg-white border-2 border-gray-200 rounded-lg shadow-lg shadow-slate-900 dark:bg-default",children:[e.jsxs("div",{className:"flex items-start justify-between p-4 border-b rounded-t dark:border-gray-600",children:[e.jsx("div",{className:"flex font-semibold text-gray-900 dark:text-white",children:e.jsx("span",{className:"mr-1 text-red-500",children:"Hapus Data "})}),e.jsx("button",{type:"button",onClick:$,className:"close-btn text-gray-400 hover:text-gray-900 rounded-lg p-1.5 ml-auto inline-flex items-center dark:hover:text-white","application-modal-hide":"deleteModal",children:e.jsx("i",{className:"fas fa-times-circle"})})]}),e.jsxs("div",{className:"flex",children:[e.jsx("div",{className:"pl-10 mr-1 dark:text-white",children:"Hapus"}),e.jsx("span",{id:"deskripsiDelete",className:"dark:text-white"})," ?"]}),e.jsx("div",{className:"p-6 space-y-6",children:e.jsxs("form",{onSubmit:ae,encType:"multipart/form-data",children:[e.jsx("div",{className:"mt-2 border-b dark:border-white0 border-1 border-slate-200"}),e.jsxs("div",{className:"grid grid-cols-3 mt-1 mr-2",children:[e.jsx("button",{type:"button",onClick:$,className:"py-2 mt-2 bg-yellow-500 rounded-md text-dark",children:"Batal"}),e.jsx("div",{className:""}),e.jsx("button",{type:"submit",className:"py-2 mt-2 text-white rounded-md bg-accent",children:"HAPUS"})]})]})})]})})})]})}export{we 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.