"use strict";(()=>{var e={};e.id=1984,e.ids=[1984],e.modules={47984:(e,t,r)=>{r.r(t),r.d(t,{config:()=>M,default:()=>f,getServerSideProps:()=>w,getStaticPaths:()=>P,getStaticProps:()=>k,reportWebVitals:()=>A,routeModule:()=>B,unstable_getServerProps:()=>q,unstable_getServerSideProps:()=>C,unstable_getStaticParams:()=>N,unstable_getStaticPaths:()=>y,unstable_getStaticProps:()=>_});var s={};r.r(s),r.d(s,{default:()=>b,getServerSideProps:()=>v});var a=r(63865),n=r(9455),i=r(30671),l=r(49407),u=r(89600),o=r(8732),c=r(82015),p=r.n(c),d=r(93615),x=r.n(d),h=r(49888);r(19262);var m=r(63715),g=r(32415),j=r(47338);function S(e){let[t,r]=p().useState(!1),[s,a]=p().useState([]),[n,i]=p().useState(0);return(0,o.jsxs)(p().Fragment,{children:[t&&(0,o.jsx)(g.A,{}),(0,o.jsxs)("div",{className:"w-full justify-between",children:[(0,o.jsx)("h2",{className:"text-xl m-0",children:"Backups"}),(0,o.jsx)("div",{children:(0,o.jsx)("button",{onClick:e=>{window.confirm("Create new backup?")&&(r(!0),(0,m.A)("/api/admin/createNewBackup").then(e=>{i(e=>e+1),setTimeout(()=>{r(!1)},2e3)}))},className:"relative",children:"Create New Backup"})})]}),(0,o.jsxs)("section",{className:s&&s[0]?"p-0 gap-4":"paper",children:[!s&&(0,o.jsx)(g.A,{}),s&&s[0]&&s.sort((e,t)=>parseInt(e)>parseInt(t)?-1:1).map((e,t)=>{let r=new Date(parseInt(e));return(0,o.jsxs)("a",{href:`/su/backups/${e}`,className:"card w-full items-center",children:[(0,o.jsx)(j.A,{}),(0,o.jsx)("b",{children:"Backup:"}),(0,o.jsx)("span",{children:r.toString()})]},e)}),s&&!s[0]&&(0,o.jsx)("span",{children:"No Backups Yet"})]})]})}function b({user:e,data:t}){let r=(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("title",{children:"Backups | Datasquirel"}),(0,o.jsx)("meta",{name:"description",content:"Databases backups"})]});return(0,o.jsx)(h.A,{head:r,user:e,children:(0,o.jsx)(S,{})})}async function v({req:e,res:t,query:r}){let s=await x()(e);return s?.logged_in_status?{props:{user:s}}:{redirect:{destination:"/su/login",permanent:!1}}}let f=(0,i.M)(s,"default"),k=(0,i.M)(s,"getStaticProps"),P=(0,i.M)(s,"getStaticPaths"),w=(0,i.M)(s,"getServerSideProps"),M=(0,i.M)(s,"config"),A=(0,i.M)(s,"reportWebVitals"),_=(0,i.M)(s,"unstable_getStaticProps"),y=(0,i.M)(s,"unstable_getStaticPaths"),N=(0,i.M)(s,"unstable_getStaticParams"),q=(0,i.M)(s,"unstable_getServerProps"),C=(0,i.M)(s,"unstable_getServerSideProps"),B=new a.PagesRouteModule({definition:{kind:n.A.PAGES,page:"/su/backups",pathname:"/su/backups",bundlePath:"",filename:""},components:{App:u.default,Document:l.default},userland:s})},19262:(e,t,r)=>{r.d(t,{A:()=>u});var s=r(8732),a=r(82015),n=r.n(a),i=r(63715),l=r(32415);function u(e){let[t,r]=n().useState(null),[a,u]=n().useState(!1),[o,c]=n().useState(0);return(0,s.jsxs)(n().Fragment,{children:[(0,s.jsxs)("div",{className:"w-full justify-between",children:[(0,s.jsx)("h2",{className:"text-xl m-0",children:"Error Logs"}),(0,s.jsx)("div",{children:(0,s.jsxs)("button",{onClick:e=>{window.confirm("Clear Error Logs?")&&(u(!0),(0,i.A)("/api/admin/clearErrorLogs","post").then(e=>{console.log(e),c(e=>e+1)}),setTimeout(()=>{u(!1)},2e3))},className:"outlined gray relative",children:[a&&(0,s.jsx)(l.A,{width:"20px"}),"Clear Error Log"]})})]}),(0,s.jsxs)("section",{className:"paper",children:[t&&(0,s.jsx)("p",{dangerouslySetInnerHTML:{__html:t||"No Log"}}),!t&&(0,s.jsx)(l.A,{position:"relative",width:"25px"})]})]})}},47338:(e,t,r)=>{r.d(t,{A:()=>s});let s=(0,r(82544).A)("FolderSync",[["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v.5",key:"1dkoa9"}],["path",{d:"M12 10v4h4",key:"1czhmt"}],["path",{d:"m12 14 1.535-1.605a5 5 0 0 1 8 1.5",key:"lvuxfi"}],["path",{d:"M22 22v-4h-4",key:"1ewp4q"}],["path",{d:"m22 18-1.535 1.605a5 5 0 0 1-8-1.5",key:"14ync0"}]])},40361:e=>{e.exports=require("next/dist/compiled/next-server/pages.runtime.prod.js")},27912:e=>{e.exports=require("next/head")},82015:e=>{e.exports=require("react")},22326:e=>{e.exports=require("react-dom")},8732:e=>{e.exports=require("react/jsx-runtime")},79428:e=>{e.exports=require("buffer")},55511:e=>{e.exports=require("crypto")},81630:e=>{e.exports=require("http")},33873:e=>{e.exports=require("path")}};var t=require("../../webpack-runtime.js");t.C(e);var r=e=>t(t.s=e),s=t.X(0,[883,9821,9600,3932],()=>r(47984));module.exports=s})();