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:()=>l});var a=t(8732),n=t(82015),r=t.n(n);function l({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[n,l]=r().useState(s||null);return n&&n[1]?(0,a.jsx)("div",{className:"text-sm mt-2 flex-wrap",children:n.map((e,s,t)=>s===n.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)(r().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)(r().Fragment,{})}},36605:(e,s,t)=>{t.d(s,{A:()=>x});var a=t(8732),n=t(82015),r=t.n(n);t(63715);var l=t(86152),i=t(32415),c=t(26406),o=t(66916),d=t(66918);function x(e){let[s,t]=r().useState(!0),[n,x]=r().useState(0),[m,h]=r().useState(0);return s?(0,a.jsx)("div",{className:"button ghost small-text",style:{height:"30px"},children:(0,a.jsx)(i.A,{width:"15px",position:"relative"})}):(0,a.jsx)(r().Fragment,{children:n?(0,a.jsxs)("div",{className:"button ghost small-text normal-weight p-0",style:{height:"30px",padding:0},onClick:e=>{t(!0),(0,l.A)().then(()=>{h(e=>e+1),t(!1)})},children:[s&&(0,a.jsx)(i.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:n&&n.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),n=t(83007),r=t(29021);async function l(e,s,t,l){if(!e.cookies?.datasquirelAuthKey?.match(/./))return null;let i=n(e.cookies.datasquirelAuthKey);if(!i)return null;let c=JSON.parse(i);if(!c.csrf_k||t&&!e.headers["x-csrf-auth"]?.match(RegExp(`${c.csrf_k}`)))return null;let o=process.env.DSQL_USER_LOGIN_KEYS_PATH;if(!o)return console.log("DSQL_USER_LOGIN_KEYS_PATH env variable not found. Please set this variable."),null;if(t&&!r.existsSync(`${o}/${c.csrf_k}`))return null;if(0==c.verification_status&&!t){let e=await a(`SELECT verification_status FROM users WHERE id='${c.id}'`);e&&e[0]&&1==e[0].verification_status&&s.setHeader("Set-Cookie",["user_refresh=1"])}return c?.date&&Date.now()-c.date>6048e5?null:c}e.exports=l},86152:(e,s,t)=>{t.d(s,{A:()=>n});var a=t(63715);async function n(){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:()=>w});var a=t(8732),n=t(82015),r=t.n(n),l=t(27912),i=t.n(l);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]=r().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?.id}/users`,"data-currentlink":`/admin/$
|