dsql-admin/dsql-app/.local_dist/server/chunks/615.js

1 line
9.0 KiB
JavaScript
Raw Normal View History

2024-12-08 19:56:57 +00:00
"use strict";exports.id=615,exports.ids=[615],exports.modules={93615:(e,s,t)=>{let{IncomingMessage:l}=t(81630),a=t(77463),r=t(6505);e.exports=async function(e){let{keyCookieName:s,csrfCookieName:t}=r(),l=`${s}_su`;if(!e.cookies?.[l])return console.log("No auth key cookie found"),null;let n=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}},64987:(e,s,t)=>{t.d(s,{A:()=>y});var l=t(8732),a=t(82015),r=t.n(a),n=t(27912),i=t.n(n),o=t(93353),c=t(20427),d=t(25294),x=t(34479),u=t(2459),h=t(67105),m=t(26628),p=t(80006),g=t(62011);function j(e){let[s,t]=r().useState(!0);return(0,l.jsxs)("aside",{className:"aside"+(s?" mobile-collapsed":" mobile-expanded"),style:{maxWidth:s?"250px":"300px",zIndex:800},children:[(0,l.jsx)(o.A,{adminAside:!0,collapseAsideMobile:s,setCollapseAsideMobile:t}),(0,l.jsx)("hr",{className:"opacity-0 mt-4"}),(0,l.jsxs)("div",{className:"main-links"+(s?" hidden lg:flex":" "),children:[(0,l.jsxs)("a",{href:"/su","data-currentlink":"/su","data-strictlink":"true",children:[(0,l.jsx)(c.A,{size:20}),(0,l.jsx)("span",{children:"Dashboard"})]}),(0,l.jsxs)("a",{href:"/su/users","data-currentlink":"/su/users",children:[(0,l.jsx)(d.A,{size:20}),(0,l.jsx)("span",{children:"Users"})]}),(0,l.jsxs)("a",{href:"/su/error-logs","data-currentlink":"/su/error-logs",children:[(0,l.jsx)(x.A,{size:20}),(0,l.jsx)("span",{children:"Error Logs"})]}),(0,l.jsxs)("a",{href:"/su/servers","data-currentlink":"/su/servers",children:[(0,l.jsx)(u.A,{size:20}),(0,l.jsx)("span",{children:"Servers"})]}),(0,l.jsxs)("a",{href:"/su/load-balancing","data-currentlink":"/su/load-balancing",children:[(0,l.jsx)(h.A,{size:20}),(0,l.jsx)("span",{children:"Load Balancing"})]}),!1,(0,l.jsxs)("a",{href:"/su/backups","data-currentlink":"/su/backups",children:[(0,l.jsx)(m.A,{size:20}),(0,l.jsx)("span",{children:"Backups"})]}),(0,l.jsxs)("a",{href:"/su/console","data-currentlink":"/su/console",children:[(0,l.jsx)(p.A,{size:20}),(0,l.jsx)("span",{children:"Console"})]}),(0,l.jsxs)("a",{href:"/su/envar","data-currentlink":"/su/envar",children:[(0,l.jsx)(g.A,{size:20}),(0,l.jsx)("span",{children:"Env"})]})]})]})}var f=t(34254),b=t(58526);function v({user:e,extraHeaderContent:s}){let[t,a]=r().useState(e||null);return(0,l.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,l.jsxs)("div",{className:"w-full items-center justify-between gap-4 md:gap-8",children:[(0,l.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,l.jsxs)("div",{className:"items-center mb-2 flex xl:hidden",children:[(0,l.jsx)("a",{href:"/",className:"hidden xl:flex",children:(0,l.jsx)("img",{src:"/images/logo-icon-alt-2.png",alt:"Logo Icon",width:37})}),(0,l.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,l.jsx)("span",{className:"font-semibold text-4xl",children:"✕"})})]}),(0,l.jsx)("div",{className:"flex items-center w-full gap-6 grow flex-col xl:flex-row justify-start xl:justify-between",children:(0,l.jsx)("div",{className:"gap-2 flex-col-reverse xl:flex-row gap-y-6 w-full xl:w-auto py-2",children:(0,l.jsxs)("div",{className:"ml-auto dropdown-wrapper",children:[(0,l.jsx)("div",{className:"bg-white rounded-full overflow-hidden",style:{width:"36px",height:"36px"},children:(0,l.jsx)("img",{src:"/images/user-preset-thumbnail.png",alt:"User Image",width:35,className:"w-full h-full object-cover"})}),(0,l.jsx)("span",{children:(0,l.jsx)("b"