PageSourceSearch

https://puneruralpolice.gov.in/_next/static/chunks/pages/control-p…/dashboard/zone-efe33cc9570c1d07.js

js puneruralpolice.gov.in collected 2026-10-09 02:00:27 UTC 11,790 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2363],{52136:function(e,t,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/control-panel-41A3xB/dashboard/zone",function(){return a(59986)}])},59986:function(e,t,a){"use strict";a.r(t);var s=a(85893),l=a(67294),r=a(9008),o=a.n(r),i=a(669),n=a(35898);a(37677);var c=a(22920),d=a(28540),x=a(94050),m=a(13246);a(41664),a(4641);var b=a(31190),p=a(38837),u=a(31955),h=a(22424);t.default=()=>{let[e,t]=(0,l.useState)(""),[a,r]=(0,l.useState)(""),[j,y]=(0,l.useState)(""),[g,f]=(0,l.useState)(""),[N,v]=(0,l.useState)(""),[w,C]=(0,l.useState)(!1),[k,S]=(0,l.useState)(!1),[_,Z]=(0,l.useState)([]),[z,O]=(0,l.useState)(""),[P,F]=(0,l.useState)(!1),A=e=>{O(e),F(!0)},D=()=>{O(""),F(!1)},[E,B]=(0,l.useState)(!1),[T,R]=(0,l.useState)(""),[H,M]=(0,l.useState)(""),[L,W]=(0,l.useState)(""),[I,J]=(0,l.useState)(""),[U,X]=(0,l.useState)(""),[q,G]=(0,l.useState)(""),[Q,K]=(0,l.useState)(""),[V,Y]=(0,l.useState)(!1),$=(e,t,a,s,l,r,o)=>{R(h.Z.sanitize(e)),M(h.Z.sanitize(t)),W(h.Z.sanitize(a)),J(h.Z.sanitize(s)),X(h.Z.sanitize(l)),G(h.Z.sanitize(r)),K(h.Z.sanitize(o)),B(!0)};(0,l.useEffect)(()=>{eo()},[]);let ee=()=>{t(""),r("")},et=()=>{c.Am.success("new record created successfully!",{position:"top-right",autoClose:2e3,hideProgressBar:!1,closeOnClick:!0,pauseOnHover:!0,draggable:!1,progress:void 0})},ea=()=>{c.Am.success("Record Updated successfully!",{position:"top-right",autoClose:2e3,hideProgressBar:!1,closeOnClick:!0,pauseOnHover:!0,draggable:!1,progress:void 0})},es=()=>{c.Am.warn("oops something went wrong!",{position:"top-right",autoClose:3e3,hideProgressBar:!1,closeOnClick:!0,pauseOnHover:!0,draggable:!0,progress:void 0,theme:"dark"})},el=()=>{c.Am.success("Record Deleted successfully!",{position:"top-right",autoClose:3e3,hideProgressBar:!1,closeOnClick:!0,pauseOnHover:!0,draggable:!0,progress:void 0,theme:"dark"})},er=()=>{c.Am.warn("Fields are required!",{position:"top-right",autoClose:3e3,hideProgressBar:!1,closeOnClick:!0,pauseOnHover:!0,draggable:!0,progress:void 0,theme:"dark"})},eo=async()=>{try{let e=await fetch("".concat("https://puneruralapi.dreamcaredevelopers.com","/api/get-zone"),{method:"GET"}),t=await e.json();t?Z(t.zones):es()}catch(e){es()}},ei=async e=>{D();let t=u.Z.get("token");try{let a=await fetch("".concat("https://puneruralapi.dreamcaredevelopers.com","/api/delete-zone?Id=").concat(e),{method:"DELETE",headers:{Authorization:"Bearer ".concat(t)}}),s=await a.json();!0===s.success?(el(),eo()):es()}catch(e){es()}},en=async t=>{if(!e||!a){er();return}C(!0),S(!1),t.preventDefault();let s=u.Z.get("token"),l={name:h.Z.sanitize(e),name_in_marathi:h.Z.sanitize(a),dcp_name:h.Z.sanitize(j),dcp_name_in_marathi:h.Z.sanitize(g),dcp_contact:h.Z.sanitize(N)};try{let e=await fetch("".concat("https://puneruralapi.dreamcaredevelopers.com","/api/add-zone"),{method:"POST",body:JSON.stringify(l),headers:{Authorization:"Bearer ".concat(s),"Content-Type":"application/json"}});(await e.json()).success?(eo(),C(!1),et(),ee()):(es(),C(!1)),S(!0)}catch(e){es(),C(!1),S(!0)}},ec=async e=>{if(!T||!H){er();return}e.preventDefault(),Y(!0);let t=u.Z.get("token");try{let e=await fetch("".concat("https://puneruralapi.dreamcaredevelopers.com","/api/update-zone?Id=").concat(Q),{method:"PATCH",body:JSON.stringify({name:T,name_in_marathi:H,sr_no:q,dcp_name:L,dcp_name_in_marathi:I,dcp_contact:U}),headers:{Authorization:"Bearer ".concat(t),"Content-Type":"application/json"}});(await e.json()).success?(eo(),Y(!1),ea()):(es(),Y(!1)),B(!1)}catch(e){es(),Y(!1),B(!1)}};return(0,s.jsx)(p.Z,{children:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o(),{children:(0,s.jsx)("title",{children:"Zone | Admin Dashboard"})}),(0,s.jsxs)("main",{className:"bg-gray-100",children:[(0,s.jsx)(i.Z,{}),(0,s.jsx)(c.Ix,{autoClose:2e3}),(0,s.jsxs)("div",{className:"flex flex-row",children:[(0,s.jsx)(n.Z,{}),(0,s.jsx)("div",{className:"hidden lg:block w-1/5"}),(0,s.jsxs)("div",{className:"w-full lg:w-4/5 mt-20 mx-5 bg-white shadow p-5",children:[(0,s.jsxs)("div",{className:"flex flex-row space-x-2 border-b pb-5",children:[(0,s.jsx)("button",{onClick:()=>S(!0),className:"bg-blue-500 text-white px-3 py-1 rounded-md hover:bg-blue-600",children:"Add Record"}),(0,s.jsx)("button",{onClick:ee,className:"bg-blue-500 text-white px-3 py-1 rounded-md hover:bg-blue-600",children:"Reset"}),(0,s.jsx)("button",{onClick:()=>{S(!1),ee()},className:"bg-blue-500 text-white px-3 py-1 rounded-md hover:bg-blue-600",children:"Cancel"})]}
1),k&&(0,s.jsxs)("div",{className:"mt-5",children:[(0,s.jsxs)("div",{className:"flex flex-col mx-3 my-1 space-y-1 mb-5",children:[(0,s.jsx)("label",{htmlFor:"title",className:"mb-1 text-base text-gray-800",children:"* Name"}),(0,s.jsx)("input",{type:"text",id:"title",name:"title",className:"text-base border-b border-b-black px-3 py-2  outline-none focus:border-purple-700",placeholder:"",value:e,onChange:e=>t(e.target.value)})]}),(0,s.jsxs)("div",{className:"flex flex-col mx-3 my-1 space-y-1 mb-5",children:[(0,s.jsx)("label",{htmlFor:"title",className:"mb-1 text-base text-gray-800",children:"* Name in Marathi"}),(0,s.jsx)("input",{type:"text",id:"title",name:"title",className:"text-base border-b border-b-black px-3 py-2  outline-none focus:border-purple-700",placeholder:"",value:a,onChange:e=>r(e.target.value)})]}),(0,s.jsxs)("div",{className:"flex flex-col mx-3 my-1 space-y-1 mb-5",children:[(0,s.jsx)("label",{htmlFor:"title",className:"mb-1 text-base text-gray-800",children:"DCP Name"}),(0,s.jsx)("input",{type:"text",id:"title",name:"title",className:"text-base border-b border-b-black px-3 py-2  outline-none focus:border-purple-700",placeholder:"",value:j,onChange:e=>y(e.target.value)})]}),(0,s.jsxs)("div",{className:"flex flex-col mx-3 my-1 space-y-1 mb-5",children:[(0,s.jsx)("label",{htmlFor:"title",className:"mb-1 text-base text-gray-800",children:"DCP Name in Marathi"}),(0,s.jsx)("input",{type:"text",id:"title",name:"title",className:"text-base border-b border-b-black px-3 py-2  outline-none focus:border-purple-700",placeholder:"",value:g,onChange:e=>f(e.target.value)})]}),(0,s.jsxs)("div",{className:"flex flex-col mx-3 my-1 space-y-1 mb-5",children:[(0,s.jsx)("label",{htmlFor:"title",className:"mb-1 text-base text-gray-800",children:"DCP Contact"}),(0,s.jsx)("input",{type:"number",id:"title",name:"title",className:"text-base border-b border-b-black px-3 py-2  outline-none focus:border-purple-700",placeholder:"",value:N,onChange:e=>v(e.target.value)})]}),(0,s.jsx)("div",{children:(0,s.jsx)("button",{onClick:en,className:"bg-blue-500 text-white px-3 py-1 rounded-md hover:bg-blue-600",children:"Submit"})})]}),w&&(0,s.jsx)("div",{className:"flex justify-center items-center h-80",children:(0,s.jsx)(d.iT,{height:80,width:80,color:"#3B82F6",wrapperStyle:{},wrapperClass:"",visible:!0,ariaLabel:"oval-loading",secondaryColor:"#b5d1ff",strokeWidth:3,strokeWidthSecondary:3})}),(0,s.jsxs)("div",{className:"mb-52 w-full bg-white",children:[(0,s.jsx)("h1",{className:"font-semibold text-xl mt-10",children:"Zone Records"}),(0,s.jsx)("div",{className:"overflow-x-auto max-w-full",children:(0,s.jsxs)("table",{className:"w-full min-w-[800px] mx-auto mt-5 text-left",children:[(0,s.jsxs)("tr",{className:"border flex flex-row justify-between bg-gray-100",children:[(0,s.jsx)("th",{className:"p-2 w-1/12 border-r",children:"Delete"}),(0,s.jsx)("th",{className:"p-2 w-1/12 border-r",children:"Edit"}),(0,s.jsx)("th",{className:"p-2 w-5/12 border-r",children:"Zone Name"}),(0,s.jsx)("th",{className:"p-2 w-5/12 border-r",children:"Zone Name in Marathi"})]}),_.map(e=>{let{name:t,name_in_marathi:a,dcp_name:l,dcp_name_in_marathi:r,dcp_contact:o,sr_no:i,_id:n}=e;return(0,s.jsxs)("tr",{className:"border flex flex-row justify-between",children:[(0,s.jsx)("td",{className:"p-1 w-1/12 border-r",children:(0,s.jsx)("button",{className:"bg-red-600 text-white p-3 rounded",onClick:()=>A(n),children:(0,s.jsx)(x.uaR,{})})}),(0,s.jsx)("td",{className:"p-1 w-1/12 border-r",children:(0,s.jsx)("button",{className:"bg-yellow-600 text-white p-3 rounded",onClick:()=>$(t,a,l,r,o,i,n),children:(0,s.jsx)(m.QML,{})})}),(0,s.jsx)("td",{className:"p-2 w-5/12 border-r",children:t}),(0,s.jsx)("td",{className:"p-2 w-5/12 border-r",children:a})]},n)})]})}),(0,s.jsx)(b.u,{open:P,onClose:D,center:!0,children:(0,s.jsxs)("div",{className:"px-5 pt-5",children:[(0,s.jsx)("p",{children:"Are you sure to delete the record ?"}),(0,s.jsxs)("div",{className:"flex flex-row justify-between mt-5",children:[(0,s.jsx)("div",{children:(0,s.jsx)("button",{className:"px-3 py-1 bg-white border rounded",onClick:D,children:"Cancel"})}),(0,s.jsx)("div",{children:(0,s.jsx)("button",{className:"px-3 py-1 bg-red-600 font-semibold text-white border rounded",onClick:()=>ei(z),children:"Delete"})})]})]})}),(0,s.jsx)(b.u,{open:E,onClose:()=>{B(!1)},center:!0,children:(0,s.jsxs)("div",{className:"pt-10 px-5 w-[500px]",children:[(0,s.jsxs)("div",{className:"flex flex-col mx-3 my-1 space-y-1 mb-5",children:[(0,s.jsx)("label",{htmlFor:"title",className:"mb-1 text-base text-gray-800",children:"* Name"}),(0,s.jsx)("input",{type:"text",id:"title",name:"title",className:"text-base border-b border-b-black px-3 py-2  outline-none focus:border-purple-700",placeholder:"",value:T,onChange:e=>R(e.target.value)})]}),(0,s.jsxs)("div",{className:"flex flex-col mx-3 my-1 space-y-1 mb-5",children:[(0,s.jsx)("label",{htmlFor:"title",className:"mb-1 text-base text-gray-800",children:"* Name in Marathi"}),(0,s.jsx)("input",{type:"text",id:"title",name:"title",className:"text-base border-b border-b-black px-3 py-2  outline-none focus:border-purple-700",placeholder:"",value:H,onChange:e=>M(e.target.value)})]}),(0,s.jsxs)("div",{className:"flex flex-col mx-3 my-1 space-y-1 mb-5",children:[(0,s.jsx)("label",{htmlFor:"title",className:"mb-1 text-base text-gray-800",children:"DCP Name"}),(0,s.jsx)("input",{type:"text",id:"title",name:"title",className:"text-base border-b border-b-black px-3 py-2  outline-none focus:border-purple-700",placeholder:"",value:L,onChange:e=>W(e.target.value)})]}),(0,s.jsxs)("div",{className:"flex flex-col mx-3 my-1 space-y-1 mb-5",children:[(0,s.jsx)("label",{htmlFor:"title",className:"mb-1 text-base text-gray-800",children:"DCP Name in Marathi"}),(0,s.jsx)("input",{type:"text",id:"title",name:"title",className:"text-base border-b border-b-black px-3 py-2  outline-none focus:border-purple-700",placeholder:"",value:I,onChange:e=>J(e.target.value)})]}),(0,s.jsxs)("div",{className:"flex flex-col mx-3 my-1 space-y-1 mb-5",children:[(0,s.jsx)("label",{htmlFor:"title",className:"mb-1 text-base text-gray-800",children:"DCP Contact"}),(0,s.jsx)("input",{type:"text",id:"title",name:"title",className:"text-base border-b border-b-black px-3 py-2  outline-none focus:border-purple-700",placeholder:"",value:U,onChange:e=>X(e.target.value)})]}),(0,s.jsxs)("div",{className:"flex flex-col mx-3 my-1 space-y-1 mb-5",children:[(0,s.jsx)("label",{htmlFor:"title",className:"mb-1 text-base text-gray-800",children:"SR No"}),(0,s.jsx)("input",{type:"number",id:"title",name:"title",className:"text-base border-b border-b-black px-3 py-2  outline-none focus:border-purple-700",placeholder:"",value:q,onChange:e=>G(e.target.value)})]}),(0,s.jsx)("div",{children:(0,s.jsxs)("button",{onClick:ec,className:"bg-blue-500 flex justify-center items-center  text-white px-3 py-1 rounded-md hover:bg-blue-600",children:["Update Record",V&&(0,s.jsx)("div",{className:"ml-2",children:(0,s.jsx)(d.iT,{height:25,width:25,color:"#ffffff",wrapperStyle:{},wrapperClass:"",visible:!0,ariaLabel:"oval-loading",secondaryColor:"#b5d1ff",strokeWidth:5,strokeWidthSecondary:5})})]})})]})})]})]})]})]})]})})}}},function(e){e.O(0,[3996,4141,3920,8540,2424,3362,2888,9774,179],function(){return e(e.s=52136)}),_N_E=e.O()}]);

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.