1 line
12 KiB
JavaScript
1 line
12 KiB
JavaScript
"use strict";exports.id=6622,exports.ids=[6622],exports.modules={30671:(e,s)=>{Object.defineProperty(s,"M",{enumerable:!0,get:function(){return function e(s,t){return t in s?s[t]:"then"in s&&"function"==typeof s.then?s.then(s=>e(s,t)):"function"==typeof s&&"default"===t?s:void 0}}})},61197:(e,s,t)=>{t.d(s,{A:()=>l});var r=t(71205),a=t(41939);async function l(e){let{keyCookieName:s,csrfCookieName:t}=(0,a.A)(),l=`${s}_su`;if(!e.cookies?.[l])return console.log("No auth key cookie found"),null;let n=(0,r.A)({encryptedString:e.cookies[l]});if(!n)return console.log("No user payload found"),null;let i=JSON.parse(n);return i.password!==process.env.DSQL_USER_KEY?(console.log("Invalid password"),null):i.authKey!==process.env.DSQL_SPECIAL_KEY?(console.log("Invalid auth key"),null):i}},40778:(e,s,t)=>{t.d(s,{A:()=>b});var r=t(8732),a=t(82015),l=t.n(a),n=t(27912),i=t.n(n),c=t(50139),o=t(82544);let d=(0,o.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"}]]);var u=t(25294);let h=(0,o.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"}]]);var p=t(2459);let x=(0,o.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"}]]),m=(0,o.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"}]]),g=(0,o.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"}]]),y=(0,o.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"}]]);function f(){let[e,s]=l().useState(!0);return(0,r.jsxs)("aside",{className:"aside"+(e?" mobile-collapsed":" mobile-expanded"),style:{maxWidth:e?"250px":"300px",zIndex:800},children:[(0,r.jsx)(c.A,{adminAside:!0,collapseAsideMobile:e,setCollapseAsideMobile:s}),(0,r.jsx)("hr",{className:"opacity-0 mt-4"}),(0,r.jsxs)("div",{className:"main-links"+(e?" hidden lg:flex":" "),children:[(0,r.jsxs)("a",{href:"/su","data-currentlink":"/su","data-strictlink":"true",children:[(0,r.jsx)(d,{size:20}),(0,r.jsx)("span",{children:"Dashboard"})]}),(0,r.jsxs)("a",{href:"/su/users","data-currentlink":"/su/users",children:[(0,r.jsx)(u.A,{size:20}),(0,r.jsx)("span",{children:"Users"})]}),(0,r.jsxs)("a",{href:"/su/error-logs","data-currentlink":"/su/error-logs",children:[(0,r.jsx)(h,{size:20}),(0,r.jsx)("span",{children:"Error Logs"})]}),(0,r.jsxs)("a",{href:"/su/servers","data-currentlink":"/su/servers",children:[(0,r.jsx)(p.A,{size:20}),(0,r.jsx)("span",{children:"Servers"})]}),(0,r.jsxs)("a",{href:"/su/load-balancing","data-currentlink":"/su/load-balancing",children:[(0,r.jsx)(x,{size:20}),(0,r.jsx)("span",{children:"Load Balancing"})]}),!1,(0,r.jsxs)("a",{href:"/su/backups","data-currentlink":"/su/backups",children:[(0,r.jsx)(m,{size:20}),(0,r.jsx)("span",{children:"Backups"})]}),(0,r.jsxs)("a",{href:"/su/console","data-currentlink":"/su/console",children:[(0,r.jsx)(g,{size:20}),(0,r.jsx)("span",{children:"Console"})]}),(0,r.jsxs)("a",{href:"/su/envar","data-currentlink":"/su/envar",children:[(0,r.jsx)(y,{size:20}),(0,r.jsx)("span",{children:"Env"})]})]})]})}var j=t(81868),v=t(58526);function k({user:e,extraHeaderContent:s}){let[t,a]=l().useState(e||null);return(0,r.jsx)("section",{className:"overflow-visible w-full px-0 md:px-8 py-0 flex justify-center bg-white dark:bg-slate-800 shadow-lg gap-4 dark:shadow-black/10 z-50 shadow-slate-900/5",style:{zIndex:700,border:"none"},children:(0,r.jsxs)("div",{className:"w-full items-center justify-between gap-4 md:gap-8",children:[(0,r.jsxs)("div",{className:"hidden xl:flex flex-col items-stretch grow fixed xl:static top-0 right-0 px-4 xl:px-0 shadow-xl xl:shadow-none h-screen xl:h-auto overflow-auto xl:overflow-visible w-screen sl:w-auto bg-white xl:bg-transparent pb-10 xl:pb-0",id:"main-nav-content-wrapper",children:[(0,r.jsxs)("div",{className:"items-center mb-2 flex xl:hidden",children:[(0,r.jsx)("a",{href:"/",className:"hidden xl:flex",children:(0,r.jsx)("img",{src:"/images/logo-icon-alt-2.png",alt:"Logo Icon",width:37})}),(0,r.jsx)("button",{className:"outlined gray ml-auto",onClick:e=>{let s=document.getElementById("main-nav-content-wrapper");s?.classList.toggle("hidden")},style:{border:"none"},children:(0,r.jsx)("span",{className:"font-semibold text-4xl",children:"✕"})})]}),(0,r.jsx)("div",{className:"flex items-center w-full gap-6 grow flex-col xl:flex-row justify-start xl:justify-between",children:(0,r.jsx)("div",{className:"gap-2 flex-col-reverse xl:flex-row gap-y-6 w-full xl:w-auto py-2",children:(0,r.jsxs)("div",{className:"ml-auto dropdown-wrapper",children:[(0,r.jsx)("div",{className:"bg-white rounded-full overflow-hidden",style:{width:"36px",height:"36px"},children:(0,r.jsx)("img",{src:"/images/user-preset-thumbnail.png",alt:"User Image",width:35,className:"w-full h-full object-cover"})}),(0,r.jsx)("span",{children:(0,r.jsx)("b",{children:"Super User"})}),(0,r.jsx)(v.A,{size:20}),(0,r.jsx)("div",{className:"dropdown",children:(0,r.jsx)("a",{href:"/su/logout",children:"Logout"})})]})})})]}),(0,r.jsx)("div",{className:"ml-2",children:(0,r.jsx)(j.A,{})}),(0,r.jsxs)("button",{className:"bg-transparent w-16 p-4 gap-1.5 flex xl:hidden flex-col hover:bg-transparent transition-all ml-auto",onClick:e=>{let s=document.getElementById("main-nav-content-wrapper");s?.classList.toggle("hidden")},style:{minWidth:"50px",backgroundColor:"transparent"},id:"main-header-hamburger-button","aria-label":"Mobile Hambutget Button",children:[(0,r.jsx)("div",{className:"w-full h-1 bg-slate-600 dark:bg-slate-400 rounded-full"}),(0,r.jsx)("div",{className:"w-full h-1 bg-slate-600 dark:bg-slate-400 rounded-full"}),(0,r.jsx)("div",{className:"w-full h-1 bg-slate-600 dark:bg-slate-400 rounded-full"})]})]})})}function b({children:e,head:s,user:t}){return(0,r.jsxs)(l().Fragment,{children:[(0,r.jsxs)(i(),{children:[(0,r.jsx)("link",{rel:"stylesheet",href:"/styles/admin.css"}),s]}),(0,r.jsxs)("div",{className:"admin w-full flex items-start gap-0",children:[(0,r.jsx)(f,{}),(0,r.jsxs)("main",{className:"relative",children:[(0,r.jsx)(k,{user:t}),(0,r.jsx)("div",{className:"flex-col items-start gap-6 px-4 sl:px-8 py-8 bg-slate-50 dark:bg-slate-900",children:e}),(0,r.jsx)("footer",{className:"flex justify-center w-full items-center p-4",children:(0,r.jsxs)("div",{className:"max-w-6xl w-full justify-center flex-wrap",children:[(0,r.jsxs)("a",{href:"/",className:"flex items-center gap-2",children:[(0,r.jsx)("img",{src:"/images/logo-icon-alt-2.png",alt:"Datasquirel Logo",width:30}),(0,r.jsx)("span",{className:"text-lg font-bold",children:"Datasquirel"})]}),(0,r.jsx)("span",{className:"opacity-25",children:"|"}),(0,r.jsxs)("span",{className:"text-sm text-slate-400 dark:text-slate-600 text-center",children:[new Date().getFullYear()," \xa9 Datasquirel. All rights reserved."]}),(0,r.jsx)("span",{className:"opacity-25",children:"|"}),(0,r.jsx)("a",{href:"/docs",children:"Docs"}),(0,r.jsx)("span",{className:"opacity-25",children:"|"}),(0,r.jsx)("a",{href:"/terms",children:"Terms"})]})})]})]})]})}t(27550)},2459:(e,s,t)=>{t.d(s,{A:()=>r});let r=(0,t(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"}]])},25294:(e,s,t)=>{t.d(s,{A:()=>r});let r=(0,t(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"}]])},41939:(e,s,t)=>{t.d(s,{A:()=>r});function r(e){let s=process.env.DSQL_COOKIES_PREFIX||"dsql_",t=process.env.DSQL_COOKIES_KEY_NAME||"key",r=process.env.DSQL_COOKIES_CSRF_NAME||"csrf",a=process.env.DSQL_COOKIES_ONE_TIME_CODE_NAME||"one-time-code",l=e?.database?.replace(/^datasquirel_user_\d+_/,"")||process.env.DSQL_DB_NAME?.replace(/^datasquirel_user_\d+_/,""),n=s;e?.userId&&(n+=`user_${e.userId}_`),l&&(n+=`${l}_`),n+=t;let i=s;e?.userId&&(i+=`user_${e.userId}_`),l&&(i+=`${l}_`),i+=r;let c=s;return e?.userId&&(c+=`user_${e.userId}_`),l&&(c+=`${l}_`),{keyCookieName:n,csrfCookieName:i,oneTimeCodeName:c+=a}}},71205:(e,s,t)=>{t.d(s,{A:()=>n});var r=t(55511),a=t(79428),l=t(48243);function n({encryptedString:e,encryptionKey:s,encryptionSalt:t}){if(!e?.match(/./))return console.log("Encrypted string is invalid"),e;let{key:n,salt:i,keyLen:c,algorithm:o,bufferAllocSize:d}=(0,l.A)({encryptionKey:s});if(!n?.match(/.{8,}/))return console.log("Decrption key is invalid"),e;if(!i?.match(/.{8,}/))return console.log("Decrption salt is invalid"),e;let u=(0,r.scryptSync)(n,i,c),h=a.Buffer.alloc(d,0),p=(0,r.createDecipheriv)(o,u,h);try{let s=p.update(e,"hex","utf8");return s+=p.final("utf8")}catch(s){return console.log("Error in decrypting =>",s.message),e}}},48243:(e,s,t)=>{t.d(s,{A:()=>r});function r(e){return{key:e?.encryptionKey||process.env.DSQL_ENCRYPTION_PASSWORD,keyLen:process.env.DSQL_ENCRYPTION_KEY_LENGTH?Number(process.env.DSQL_ENCRYPTION_KEY_LENGTH):24,salt:e?.encryptionSalt||process.env.DSQL_ENCRYPTION_SALT,apiKey:e?.apiKey||process.env.DSQL_API_KEY,algorithm:e?.algorithm||process.env.DSQL_ENCRYPTION_ALGORITHM||"aes-192-cbc",bufferAllocSize:e?.bufferAllocSize||(process.env.DSQL_ENCRYPTION_BUFFER_ALLOCATION_SIZE?function(e,s){try{let s=Number(e);if("number"!=typeof s||isNaN(s))return 0;return Math.round(s)}catch(e){return console.log(`Numberfy ERROR: ${e.message}`),0}}(process.env.DSQL_ENCRYPTION_BUFFER_ALLOCATION_SIZE):void 0)||16}}},5583:(e,s,t)=>{t.r(s),t.d(s,{default:()=>l});var r=t(8732);t(82015);var a=t(20883);function l(){return(0,r.jsxs)(a.Html,{lang:"en",children:[(0,r.jsxs)(a.Head,{children:[(0,r.jsx)("meta",{name:"author",content:"Datasquirel"}),(0,r.jsx)("meta",{name:"Copyright",content:`Copyright (c) ${new Date().getFullYear()} Datasquirel`}),"dev_dev".match(/dev/)&&(0,r.jsx)("meta",{name:"robots",content:"noindex,nofollow"}),(0,r.jsx)("link",{rel:"preconnect",href:"https://fonts.googleapis.com/",crossOrigin:"anonymous"}),(0,r.jsx)("link",{rel:"preconnect",href:"https://fonts.gstatic.com",crossOrigin:"anonymous"}),(0,r.jsx)("link",{rel:"stylesheet",href:"https://fonts.googleapis.com/css?family=Poppins"}),(0,r.jsx)("link",{rel:"stylesheet",href:"https://fonts.googleapis.com/css?family=Inter"}),(0,r.jsx)("link",{rel:"stylesheet",href:"https://fonts.googleapis.com/css?family=IBM+Plex+Mono"}),(0,r.jsx)("script",{src:"/scripts/themeSelector.js"}),(0,r.jsx)("meta",{httpEquiv:"Content-Type",content:"text/html; charset=UTF-8"}),(0,r.jsx)("meta",{property:"og:site_name",content:"DATASQUIREL"}),(0,r.jsx)("meta",{property:"og:type",content:"website"}),(0,r.jsx)("meta",{name:"twitter:card",content:"summary"}),(0,r.jsx)("meta",{property:"og:image",content:"https://static.datasquirel.com/images/user-images/user-2/email-banner.jpeg"}),(0,r.jsx)("meta",{itemProp:"image",content:"https://static.datasquirel.com/images/user-images/user-2/email-banner.jpeg"}),(0,r.jsx)("meta",{name:"twitter:image",content:"https://static.datasquirel.com/images/user-images/user-2/email-banner.jpeg"}),(0,r.jsx)("link",{rel:"stylesheet",href:"/styles/prism.css"}),(0,r.jsx)("script",{src:"/scripts/prism.js",async:!0}),(0,r.jsx)("script",{dangerouslySetInnerHTML:{__html:"var DSQL = {}"}})]}),(0,r.jsxs)("body",{children:[(0,r.jsx)(a.Main,{}),(0,r.jsx)(a.NextScript,{})]})]})}},9455:(e,s)=>{Object.defineProperty(s,"A",{enumerable:!0,get:function(){return t}});var t=function(e){return e.PAGES="PAGES",e.PAGES_API="PAGES_API",e.APP_PAGE="APP_PAGE",e.APP_ROUTE="APP_ROUTE",e.IMAGE="IMAGE",e}({})}}; |