dsql-admin/dsql-app/.local_dist/server/pages/su/backups.js
Benjamin Toby 7a06e83a46 Updates
2024-12-08 20:56:57 +01:00

1 line
8.8 KiB
JavaScript

"use strict";(()=>{var e={};e.id=1984,e.ids=[636,1984],e.modules={30671:(e,t)=>{Object.defineProperty(t,"M",{enumerable:!0,get:function(){return function e(t,r){return r in t?t[r]:"then"in t&&"function"==typeof t.then?t.then(t=>e(t,r)):"function"==typeof t&&"default"===r?t:void 0}}})},47984:(e,t,r)=>{r.r(t),r.d(t,{config:()=>S,default:()=>f,getServerSideProps:()=>v,getStaticPaths:()=>j,getStaticProps:()=>P,reportWebVitals:()=>M,routeModule:()=>N,unstable_getServerProps:()=>_,unstable_getServerSideProps:()=>C,unstable_getStaticParams:()=>E,unstable_getStaticPaths:()=>w,unstable_getStaticProps:()=>b});var s={};r.r(s),r.d(s,{default:()=>q,getServerSideProps:()=>A});var i=r(63865),a=r(9455),u=r(30671),o=r(49407),n=r(68268),l=r(8732),p=r(82015),c=r.n(p),d=r(93615),x=r.n(d),m=r(64987);r(19262);var h=r(63715),y=r(32415),g=r(94081);function k(e){let[t,r]=c().useState(!1),[s,i]=c().useState([]),[a,u]=c().useState(0);return(0,l.jsxs)(c().Fragment,{children:[t&&(0,l.jsx)(y.A,{}),(0,l.jsxs)("div",{className:"w-full justify-between",children:[(0,l.jsx)("h2",{className:"text-xl m-0",children:"Backups"}),(0,l.jsx)("div",{children:(0,l.jsx)("button",{onClick:e=>{window.confirm("Create new backup?")&&(r(!0),(0,h.A)("/api/admin/createNewBackup").then(e=>{u(e=>e+1),setTimeout(()=>{r(!1)},2e3)}))},className:"relative",children:"Create New Backup"})})]}),(0,l.jsxs)("section",{className:s&&s[0]?"p-0 gap-4":"paper",children:[!s&&(0,l.jsx)(y.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,l.jsxs)("a",{href:`/su/backups/${e}`,className:"card w-full items-center",children:[(0,l.jsx)(g.A,{color:"inherit",className:"opacity-40 text-slate-500"}),(0,l.jsx)("b",{children:"Backup:"}),(0,l.jsx)("span",{children:r.toString()})]},e)}),s&&!s[0]&&(0,l.jsx)("span",{children:"No Backups Yet"})]})]})}function q({user:e,data:t}){let r=(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("title",{children:"Backups | Datasquirel"}),(0,l.jsx)("meta",{name:"description",content:"Databases backups"})]});return(0,l.jsx)(m.A,{head:r,user:e,children:(0,l.jsx)(k,{})})}async function A({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,u.M)(s,"default"),P=(0,u.M)(s,"getStaticProps"),j=(0,u.M)(s,"getStaticPaths"),v=(0,u.M)(s,"getServerSideProps"),S=(0,u.M)(s,"config"),M=(0,u.M)(s,"reportWebVitals"),b=(0,u.M)(s,"unstable_getStaticProps"),w=(0,u.M)(s,"unstable_getStaticPaths"),E=(0,u.M)(s,"unstable_getStaticParams"),_=(0,u.M)(s,"unstable_getServerProps"),C=(0,u.M)(s,"unstable_getServerSideProps"),N=new i.PagesRouteModule({definition:{kind:a.A.PAGES,page:"/su/backups",pathname:"/su/backups",bundlePath:"",filename:""},components:{App:n.default,Document:o.default},userland:s})},19262:(e,t,r)=>{r.d(t,{A:()=>n});var s=r(8732),i=r(82015),a=r.n(i),u=r(63715),o=r(32415);function n(e){let[t,r]=a().useState(null),[i,n]=a().useState(!1),[l,p]=a().useState(0);return(0,s.jsxs)(a().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?")&&(n(!0),(0,u.A)("/api/admin/clearErrorLogs","post").then(e=>{console.log(e),p(e=>e+1)}),setTimeout(()=>{n(!1)},2e3))},className:"outlined gray relative",children:[i&&(0,s.jsx)(o.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)(o.A,{position:"relative",width:"25px"})]})]})}},94081:(e,t,r)=>{var s=r(24994);t.A=void 0;var i=s(r(30887)),a=r(8732);t.A=(0,i.default)([(0,a.jsx)("path",{d:"M15.22 4.75 7.87 7.79l4.96 11.96 7.35-3.05zM11 10c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1",opacity:".3"},"0"),(0,a.jsx)("path",{d:"m3.87 11.18-2.43 5.86c-.41 1.02.08 2.19 1.09 2.61l1.34.56zm18.16 4.77L17.07 3.98c-.31-.75-1.04-1.21-1.81-1.23-.26 0-.53.04-.79.15L7.1 5.95c-.75.31-1.21 1.03-1.23 1.8-.01.27.04.54.15.8l4.96 11.97c.31.76 1.05 1.22 1.83 1.23.26 0 .52-.05.77-.15l7.36-3.05c1.02-.42 1.51-1.59 1.09-2.6m-9.2 3.8L7.87 7.79l7.35-3.04h.01l4.95 11.95z"},"1"),(0,a.jsx)("circle",{cx:"11",cy:"9",r:"1"},"2"),(0,a.jsx)("path",{d:"m9.33 21.75-3.45-8.34v6.34c0 1.1.9 2 2 2z"},"3")],"StyleTwoTone")},67105:(e,t,r)=>{r.d(t,{A:()=>s});let s=(0,r(82544).A)("CloudUpload",[["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"M12 12v9",key:"192myk"}],["path",{d:"m16 16-4-4-4 4",key:"119tzi"}]])},26628:(e,t,r)=>{r.d(t,{A:()=>s});let s=(0,r(82544).A)("DatabaseBackup",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 12a9 3 0 0 0 5 2.69",key:"1ui2ym"}],["path",{d:"M21 9.3V5",key:"6k6cib"}],["path",{d:"M3 5v14a9 3 0 0 0 6.47 2.88",key:"i62tjy"}],["path",{d:"M12 12v4h4",key:"1bxaet"}],["path",{d:"M13 20a5 5 0 0 0 9-3 4.5 4.5 0 0 0-4.5-4.5c-1.33 0-2.54.54-3.41 1.41L12 16",key:"1f4ei9"}]])},34479:(e,t,r)=>{r.d(t,{A:()=>s});let s=(0,r(82544).A)("FileWarning",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},20427:(e,t,r)=>{r.d(t,{A:()=>s});let s=(0,r(82544).A)("Home",[["path",{d:"m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"y5dka4"}],["polyline",{points:"9 22 9 12 15 12 15 22",key:"e2us08"}]])},62011:(e,t,r)=>{r.d(t,{A:()=>s});let s=(0,r(82544).A)("LockKeyhole",[["circle",{cx:"12",cy:"16",r:"1",key:"1au0dj"}],["rect",{x:"3",y:"10",width:"18",height:"12",rx:"2",key:"6s8ecr"}],["path",{d:"M7 10V7a5 5 0 0 1 10 0v3",key:"1pqi11"}]])},2459:(e,t,r)=>{r.d(t,{A:()=>s});let s=(0,r(82544).A)("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]])},80006:(e,t,r)=>{r.d(t,{A:()=>s});let s=(0,r(82544).A)("SquareChevronRight",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"m10 8 4 4-4 4",key:"1wy4r4"}]])},25294:(e,t,r)=>{r.d(t,{A:()=>s});let s=(0,r(82544).A)("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]])},9455:(e,t)=>{var r;Object.defineProperty(t,"A",{enumerable:!0,get:function(){return r}}),function(e){e.PAGES="PAGES",e.PAGES_API="PAGES_API",e.APP_PAGE="APP_PAGE",e.APP_ROUTE="APP_ROUTE",e.IMAGE="IMAGE"}(r||(r={}))},66099:e=>{e.exports=require("@mui/system")},37616:e=>{e.exports=require("@mui/system/DefaultPropsProvider")},24509:e=>{e.exports=require("@mui/system/InitColorSchemeScript")},84781:e=>{e.exports=require("@mui/system/colorManipulator")},18215:e=>{e.exports=require("@mui/system/createStyled")},59989:e=>{e.exports=require("@mui/system/createTheme")},16670:e=>{e.exports=require("@mui/system/styleFunctionSx")},88698:e=>{e.exports=require("@mui/system/useThemeProps")},76831:e=>{e.exports=require("@mui/utils")},28578:e=>{e.exports=require("@mui/utils/capitalize")},14036:e=>{e.exports=require("@mui/utils/composeClasses")},31112:e=>{e.exports=require("@mui/utils/createChainedFunction")},21763:e=>{e.exports=require("@mui/utils/debounce")},7546:e=>{e.exports=require("@mui/utils/deepmerge")},5928:e=>{e.exports=require("@mui/utils/deprecatedPropType")},20985:e=>{e.exports=require("@mui/utils/formatMuiErrorMessage")},61119:e=>{e.exports=require("@mui/utils/generateUtilityClass")},81699:e=>{e.exports=require("@mui/utils/generateUtilityClasses")},29823:e=>{e.exports=require("@mui/utils/isMuiElement")},55402:e=>{e.exports=require("@mui/utils/ownerDocument")},46875:e=>{e.exports=require("@mui/utils/ownerWindow")},48080:e=>{e.exports=require("@mui/utils/requirePropFactory")},39597:e=>{e.exports=require("@mui/utils/setRef")},88190:e=>{e.exports=require("@mui/utils/unsupportedProp")},83889:e=>{e.exports=require("@mui/utils/useControlled")},21956:e=>{e.exports=require("@mui/utils/useEnhancedEffect")},4926:e=>{e.exports=require("@mui/utils/useEventCallback")},7376:e=>{e.exports=require("@mui/utils/useForkRef")},63310:e=>{e.exports=require("@mui/utils/useId")},10977:e=>{e.exports=require("@mui/utils/useIsFocusVisible")},74956:e=>{e.exports=require("clsx")},40361:e=>{e.exports=require("next/dist/compiled/next-server/pages.runtime.prod.js")},27912:e=>{e.exports=require("next/head")},29825:e=>{e.exports=require("prop-types")},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,[9764,883,8268,615],()=>r(47984));module.exports=s})();