1 line
12 KiB
JavaScript
1 line
12 KiB
JavaScript
|
"use strict";exports.id=7070,exports.ids=[7070],exports.modules={58548:(e,s,t)=>{t.d(s,{A:()=>i});var a=t(8732),r=t(82015),n=t.n(r);function i({confirmedDelegetedUser:e,linksArray:s,user:t}){e?.delegated,e?.priviledges?.match(/Edit Tables/i),e?.priviledges?.match(/Delete Tables/i),e?.priviledges?.match(/Create Tables/i);let[r,i]=n().useState(s||null);return r&&r[1]?(0,a.jsx)("div",{className:"text-sm mt-2 flex-wrap",children:r.map((e,s,t)=>s===r.length-1?(0,a.jsx)("a",{href:e.path,className:"text-slate-400 dark:text-slate-500 pointer-events-none",children:e.title},s):(0,a.jsxs)(n().Fragment,{children:[(0,a.jsx)("a",{href:e.path,className:"query-url",children:e.title}),(0,a.jsx)("span",{className:"opacity-20",children:"|"})]},s))}):(0,a.jsx)(n().Fragment,{})}},36605:(e,s,t)=>{t.d(s,{A:()=>x});var a=t(8732),r=t(82015),n=t.n(r);t(63715);var i=t(86152),l=t(32415),c=t(26406),o=t(66916),d=t(66918);function x(e){let[s,t]=n().useState(!0),[r,x]=n().useState(0),[m,h]=n().useState(0);return s?(0,a.jsx)("div",{className:"button ghost small-text",style:{height:"30px"},children:(0,a.jsx)(l.A,{width:"15px",position:"relative"})}):(0,a.jsx)(n().Fragment,{children:r?(0,a.jsxs)("div",{className:"button ghost small-text normal-weight p-0",style:{height:"30px",padding:0},onClick:e=>{t(!0),(0,i.A)().then(()=>{h(e=>e+1),t(!1)})},children:[s&&(0,a.jsx)(l.A,{width:"15px"}),(0,a.jsx)(o.A,{size:20,className:"text-slate-400 mr-[3px]"}),(0,a.jsx)("span",{className:"font-bold text-slate-700 dark:text-white",children:r&&r.toFixed(2)}),(0,a.jsx)("span",{className:"text-slate-500",children:"mb"}),(0,a.jsx)(d.A,{size:17,className:"text-slate-400",strokeWidth:2})]}):(0,a.jsxs)("span",{className:"text-sm info gray font-normal w-auto",children:[(0,a.jsx)(c.A,{color:"inherit",className:"opacity-50 text-slate-500",fontSize:"small"}),(0,a.jsx)("span",{children:"No Disk Usage Data Available Yet"})]})})}},20048:(e,s,t)=>{t(81630);let a=t(67216),r=t(77463),n=t(29021),i=t(6505);async function l(e,s,t,l){let{keyCookieName:c,csrfCookieName:o}=i();if(!e.cookies?.[c]?.match(/./))return null;let d=r({encryptedString:e.cookies[c]});if(!d)return null;let x=JSON.parse(d);if(!x.csrf_k||t&&!e.headers["x-csrf-auth"]?.match(RegExp(`${x.csrf_k}`)))return null;let m=process.env.DSQL_USER_LOGIN_KEYS_PATH;if(!m)return console.log("DSQL_USER_LOGIN_KEYS_PATH env variable not found. Please set this variable."),null;if(t&&!n.existsSync(`${m}/${x.csrf_k}`))return null;if(0==x.verification_status&&!t){let e=await a(`SELECT verification_status FROM users WHERE id='${x.id}'`);e&&e[0]&&1==e[0].verification_status&&s.setHeader("Set-Cookie",["user_refresh=1"])}return x?.date&&Date.now()-x.date>6048e5?null:x}e.exports=l},86152:(e,s,t)=>{t.d(s,{A:()=>r});var a=t(63715);async function r(){let e=await (0,a.A)("/api/getDiskUsage");localStorage.setItem("disk_usage",e.total)}},72377:e=>{e.exports=function(e,s){return s?e?.id&&String(e?.id)==(process.env.DSQL_SU_USER_ID||"1")&&"true":e?.id&&"1"==String(e?.id)&&"true"}},95222:(e,s,t)=>{t.d(s,{A:()=>N});var a=t(8732),r=t(82015),n=t.n(r),i=t(27912),l=t.n(i);t(64699);var c=t(93353),o=t(52070),d=t(34637),x=t(83158),m=t(25294),h=t(92441),u=t(29743),p=t(10643),j=t(10321),g=t(72377),f=t.n(g);function v({user:e}){let[s,t]=n().useState(!0);return(0,a.jsxs)("aside",{className:"aside"+(s?" mobile-collapsed":" mobile-expanded"),children:[(0,a.jsx)(c.A,{adminAside:!0,collapseAsideMobile:s,setCollapseAsideMobile:t}),(0,a.jsx)("hr",{className:"opacity-0 mt-4"}),(0,a.jsxs)("div",{className:"main-links"+(s?" hidden lg:flex":" "),children:[(0,a.jsxs)("a",{href:"/admin","data-currentlink":"/admin","data-strictlink":"true",children:[(0,a.jsx)(o.A,{size:20}),(0,a.jsx)("span",{children:"Dashboard"})]}),(0,a.jsxs)("a",{href:`/admin/${e?.id}/databases`,"data-currentlink":`/admin/${e?.id}/databases`,children:[(0,a.jsx)(d.A,{size:20}),(0,a.jsx)("span",{children:"Databases"})]}),(0,a.jsxs)("a",{href:`/admin/${e?.id}/media`,"data-currentlink":`/admin/${e?.id}/media`,children:[(0,a.jsx)(x.A,{size:20}),(0,a.jsx)("span",{children:"Media"})]}),(0,a.jsxs)("a",{href:`/admin/${e?.
|