1 line
8.2 KiB
JavaScript
1 line
8.2 KiB
JavaScript
"use strict";exports.id=615,exports.ids=[615],exports.modules={93615:(e,s,l)=>{let{IncomingMessage:t}=l(81630),a=l(83007);e.exports=async function(e){if(!e.cookies?.datasquirelSuAdminUserAuthKey)return console.log("No auth key cookie found"),null;let s=a(e.cookies.datasquirelSuAdminUserAuthKey);if(!s)return console.log("No user payload found"),null;let l=JSON.parse(s);return l.password!==process.env.DSQL_USER_KEY?(console.log("Invalid password"),null):l.authKey!==process.env.DSQL_SPECIAL_KEY?(console.log("Invalid auth key"),null):l}},64987:(e,s,l)=>{l.d(s,{A:()=>y});var t=l(8732),a=l(82015),r=l.n(a),n=l(27912),i=l.n(n),o=l(93353),c=l(20427),d=l(25294),x=l(34479),u=l(2459),h=l(67105),m=l(26628),p=l(80006),j=l(62011);function g(e){let[s,l]=r().useState(!0);return(0,t.jsxs)("aside",{className:"aside"+(s?" mobile-collapsed":" mobile-expanded"),style:{maxWidth:s?"250px":"300px",zIndex:800},children:[(0,t.jsx)(o.A,{adminAside:!0,collapseAsideMobile:s,setCollapseAsideMobile:l}),(0,t.jsx)("hr",{className:"opacity-0 mt-4"}),(0,t.jsxs)("div",{className:"main-links"+(s?" hidden lg:flex":" "),children:[(0,t.jsxs)("a",{href:"/su","data-currentlink":"/su","data-strictlink":"true",children:[(0,t.jsx)(c.A,{size:20}),(0,t.jsx)("span",{children:"Dashboard"})]}),(0,t.jsxs)("a",{href:"/su/users","data-currentlink":"/su/users",children:[(0,t.jsx)(d.A,{size:20}),(0,t.jsx)("span",{children:"Users"})]}),(0,t.jsxs)("a",{href:"/su/error-logs","data-currentlink":"/su/error-logs",children:[(0,t.jsx)(x.A,{size:20}),(0,t.jsx)("span",{children:"Error Logs"})]}),(0,t.jsxs)("a",{href:"/su/servers","data-currentlink":"/su/servers",children:[(0,t.jsx)(u.A,{size:20}),(0,t.jsx)("span",{children:"Servers"})]}),(0,t.jsxs)("a",{href:"/su/load-balancing","data-currentlink":"/su/load-balancing",children:[(0,t.jsx)(h.A,{size:20}),(0,t.jsx)("span",{children:"Load Balancing"})]}),!1,(0,t.jsxs)("a",{href:"/su/backups","data-currentlink":"/su/backups",children:[(0,t.jsx)(m.A,{size:20}),(0,t.jsx)("span",{children:"Backups"})]}),(0,t.jsxs)("a",{href:"/su/console","data-currentlink":"/su/console",children:[(0,t.jsx)(p.A,{size:20}),(0,t.jsx)("span",{children:"Console"})]}),(0,t.jsxs)("a",{href:"/su/envar","data-currentlink":"/su/envar",children:[(0,t.jsx)(j.A,{size:20}),(0,t.jsx)("span",{children:"Env"})]})]})]})}var f=l(34254),b=l(58526);function w({user:e,extraHeaderContent:s}){let[l,a]=r().useState(e||null);return(0,t.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,t.jsxs)("div",{className:"w-full items-center justify-between gap-4 md:gap-8",children:[(0,t.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,t.jsxs)("div",{className:"items-center mb-2 flex xl:hidden",children:[(0,t.jsx)("a",{href:"/",className:"hidden xl:flex",children:(0,t.jsx)("img",{src:"/images/logo-icon-alt-2.png",alt:"Logo Icon",width:37})}),(0,t.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,t.jsx)("span",{className:"font-semibold text-4xl",children:"✕"})})]}),(0,t.jsx)("div",{className:"flex items-center w-full gap-6 grow flex-col xl:flex-row justify-start xl:justify-between",children:(0,t.jsx)("div",{className:"gap-2 flex-col-reverse xl:flex-row gap-y-6 w-full xl:w-auto py-2",children:(0,t.jsxs)("div",{className:"ml-auto dropdown-wrapper",children:[(0,t.jsx)("div",{className:"bg-white rounded-full overflow-hidden",style:{width:"36px",height:"36px"},children:(0,t.jsx)("img",{src:"/images/user-preset-thumbnail.png",alt:"User Image",width:35,className:"w-full h-full object-cover"})}),(0,t.jsx)("span",{children:(0,t.jsx)("b",{children:"Super User"})}),(0,t.jsx)(b.A,{size:20}),(0,t.jsx)("div",{className:"dropdown",children:(0,t.jsx)("a",{href:"/su/logout",children:"Logout"})})]})})})]}),(0,t.jsx)("div",{className:"ml-2",children:(0,t.jsx)(f.A,{})}),(0,t.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,t.jsx)("div",{className:"w-full h-1 bg-slate-600 dark:bg-slate-400 rounded-full"}),(0,t.jsx)("div",{className:"w-full h-1 bg-slate-600 dark:bg-slate-400 rounded-full"}),(0,t.jsx)("div",{className:"w-full h-1 bg-slate-600 dark:bg-slate-400 rounded-full"})]})]})})}function y({children:e,head:s,user:l}){return(0,t.jsxs)(r().Fragment,{children:[(0,t.jsxs)(i(),{children:[(0,t.jsx)("link",{rel:"stylesheet",href:"/styles/admin.css"}),s]}),(0,t.jsxs)("div",{className:"admin w-full flex items-start gap-0",children:[(0,t.jsx)(g,{}),(0,t.jsxs)("main",{className:"relative",children:[(0,t.jsx)(w,{user:l}),(0,t.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,t.jsx)("footer",{className:"flex justify-center w-full items-center p-4",children:(0,t.jsxs)("div",{className:"max-w-6xl w-full justify-center flex-wrap",children:[(0,t.jsxs)("a",{href:"/",className:"flex items-center gap-2",children:[(0,t.jsx)("img",{src:"/images/logo-icon-alt-2.png",alt:"Datasquirel Logo",width:30}),(0,t.jsx)("span",{className:"text-lg font-bold",children:"Datasquirel"})]}),(0,t.jsx)("span",{className:"opacity-25",children:"|"}),(0,t.jsxs)("span",{className:"text-sm text-slate-400 dark:text-slate-600 text-center",children:[new Date().getFullYear()," \xa9 Datasquirel. All rights reserved."]}),(0,t.jsx)("span",{className:"opacity-25",children:"|"}),(0,t.jsx)("a",{href:"/docs",children:"Docs"}),(0,t.jsx)("span",{className:"opacity-25",children:"|"}),(0,t.jsx)("a",{href:"/terms",children:"Terms"})]})})]})]})]})}l(54896)},83007:(e,s,l)=>{let{scryptSync:t,createDecipheriv:a}=l(55511),{Buffer:r}=l(79428);e.exports=e=>{let s=a("aes-192-cbc",t(process.env.DSQL_ENCRYPTION_PASSWORD||"",process.env.DSQL_ENCRYPTION_SALT||"",24),r.alloc(16,0));try{let l=s.update(e,"hex","utf8");return l+=s.final("utf8")}catch(e){return null}}},49407:(e,s,l)=>{l.r(s),l.d(s,{default:()=>r});var t=l(8732);l(82015);var a=l(20883);function r(e){return(0,t.jsxs)(a.Html,{lang:"en",children:[(0,t.jsxs)(a.Head,{children:[(0,t.jsx)("meta",{name:"author",content:"Datasquirel"}),(0,t.jsx)("meta",{name:"Copyright",content:`Copyright (c) ${new Date().getFullYear()} Datasquirel`}),"dev_dev".match(/dev/)&&(0,t.jsx)("meta",{name:"robots",content:"noindex,nofollow"}),(0,t.jsx)("link",{rel:"preconnect",href:"https://fonts.googleapis.com/",crossOrigin:"anonymous"}),(0,t.jsx)("link",{rel:"preconnect",href:"https://fonts.gstatic.com",crossOrigin:"anonymous"}),(0,t.jsx)("link",{rel:"stylesheet",href:"https://fonts.googleapis.com/css?family=Poppins"}),(0,t.jsx)("link",{rel:"stylesheet",href:"https://fonts.googleapis.com/css?family=Inter"}),(0,t.jsx)("link",{rel:"stylesheet",href:"https://fonts.googleapis.com/css?family=IBM+Plex+Mono"}),(0,t.jsx)("script",{src:"/scripts/themeSelector.js"}),(0,t.jsx)("meta",{httpEquiv:"Content-Type",content:"text/html; charset=UTF-8"}),(0,t.jsx)("meta",{property:"og:site_name",content:"DATASQUIREL"}),(0,t.jsx)("meta",{property:"og:type",content:"website"}),(0,t.jsx)("meta",{name:"twitter:card",content:"summary"}),(0,t.jsx)("meta",{property:"og:image",content:"https://static.datasquirel.com/images/user-images/user-2/email-banner.jpeg"}),(0,t.jsx)("meta",{itemProp:"image",content:"https://static.datasquirel.com/images/user-images/user-2/email-banner.jpeg"}),(0,t.jsx)("meta",{name:"twitter:image",content:"https://static.datasquirel.com/images/user-images/user-2/email-banner.jpeg"}),(0,t.jsx)("link",{rel:"stylesheet",href:"/styles/prism.css"}),(0,t.jsx)("script",{src:"/scripts/prism.js",async:!0}),(0,t.jsx)("script",{dangerouslySetInnerHTML:{__html:"var DSQL = {}"}})]}),(0,t.jsxs)("body",{children:[(0,t.jsx)(a.Main,{}),(0,t.jsx)(a.NextScript,{})]})]})}}}; |