dsql-admin/dsql-app/.local_dist/static/chunks/9799-abc615966398fac4.js

1 line
9.7 KiB
JavaScript
Raw Permalink Normal View History

2024-12-09 09:39:09 +00:00
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9799],{4709:(e,s,a)=>{a.d(s,{A:()=>n});var l=a(4848),t=a(6540);function n(e){var s,a,n;let{confirmedDelegetedUser:i,linksArray:r,user:c}=e;null==i||i.delegated,null==i||null===(s=i.priviledges)||void 0===s||s.match(/Edit Tables/i),null==i||null===(a=i.priviledges)||void 0===a||a.match(/Delete Tables/i),null==i||null===(n=i.priviledges)||void 0===n||n.match(/Create Tables/i);let[d,o]=t.useState(r||null);return(t.useEffect(()=>{var e;if(r)return;let s=window.location.pathname,a=s.split("/"),l=[];l.push({title:"Home",path:s.match(/admin/)?"/admin":"/"}),null===(e=window.location.search)||void 0===e||e.match(/delegated=true/),a.forEach((e,s,a)=>{!(null==e?void 0:e.match(/./))||1==s||e.match(/^\d+$/)&&c&&!l.find(e=>!!e.title.match(/^entries$|^users$/))||l.push({title:e,path:(()=>{let e="";for(let l=0;l<a.length;l++){let t=a[l];!(l>s)&&t.match(/./)&&(e+="/".concat(t))}return e})()})}),o(l)},[]),d&&d[1])?(0,l.jsx)("div",{className:"text-sm mt-2 flex-wrap",children:d.map((e,s,a)=>s===d.length-1?(0,l.jsx)("a",{href:e.path,className:"text-slate-400 dark:text-slate-500 pointer-events-none",children:e.title},s):(0,l.jsxs)(t.Fragment,{children:[(0,l.jsx)("a",{href:e.path,className:"query-url",children:e.title}),(0,l.jsx)("span",{className:"opacity-20",children:"|"})]},s))}):(0,l.jsx)(t.Fragment,{})}},1238:(e,s,a)=>{a.d(s,{A:()=>x});var l=a(4848),t=a(6540),n=a(3698),i=a(7531),r=a(620),c=a(9753),d=a(7273),o=a(7216);function x(e){let[s,a]=t.useState(!0),[x,h]=t.useState(0),[u,m]=t.useState(0);return(t.useEffect(()=>{x||(0,n.A)("/api/getDiskUsage").then(e=>{(null==e?void 0:e.total)&&(h(e.total),localStorage.setItem("disk_usage",e.total)),a(!1)})},[]),s)?(0,l.jsx)("div",{className:"button ghost small-text",style:{height:"30px"},children:(0,l.jsx)(r.A,{width:"15px",position:"relative"})}):(0,l.jsx)(t.Fragment,{children:x?(0,l.jsxs)("div",{className:"button ghost small-text normal-weight p-0",style:{height:"30px",padding:0},onClick:e=>{a(!0),(0,i.A)().then(()=>{m(e=>e+1),a(!1)})},children:[s&&(0,l.jsx)(r.A,{width:"15px"}),(0,l.jsx)(c.A,{size:20,className:"text-slate-400 mr-[3px]"}),(0,l.jsx)("span",{className:"font-bold text-slate-700 dark:text-white",children:x&&x.toFixed(2)}),(0,l.jsx)("span",{className:"text-slate-500",children:"mb"}),(0,l.jsx)(d.A,{size:17,className:"text-slate-400",strokeWidth:2})]}):(0,l.jsxs)("span",{className:"text-sm info gray font-normal w-auto",children:[(0,l.jsx)(o.A,{}),(0,l.jsx)("span",{children:"No Disk Usage Data Available Yet"})]})})}},7531:(e,s,a)=>{a.d(s,{A:()=>t});var l=a(3698);async function t(){let e=await (0,l.A)("/api/getDiskUsage");localStorage.setItem("disk_usage",e.total)}},6086:(e,s,a)=>{var l=a(7836);e.exports=function(e,s){return s?(null==e?void 0:e.id)&&String(null==e?void 0:e.id)==(l.env.DSQL_SU_USER_ID||"1")&&"true":(null==e?void 0:e.id)&&"1"==String(null==e?void 0:e.id)&&"true"}},1187:(e,s,a)=>{a.d(s,{A:()=>A});var l=a(4848),t=a(6540),n=a(3368),i=a.n(n);a(3980);var r=a(7869),c=a(8631),d=a(9140),o=a(1915),x=a(4909),h=a(5014),u=a(2894),m=a(9508),j=a(5922),p=a(6086),g=a.n(p);function f(e){let{user:s}=e,[a,n]=t.useState(!0);return(0,l.jsxs)("aside",{className:"aside"+(a?" mobile-collapsed":" mobile-expanded"),children:[(0,l.jsx)(r.A,{adminAside:!0,collapseAsideMobile:a,setCollapseAsideMobile:n}),(0,l.jsx)("hr",{className:"opacity-0 mt-4"}),(0,l.jsxs)("div",{className:"main-links"+(a?" hidden lg:flex":" "),children:[(0,l.jsxs)("a",{href:"/admin","data-currentlink":"/admin","data-strictlink":"true",children:[(0,l.jsx)(c.A,{size:20}),(0,l.jsx)("span",{children:"Dashboard"})]}),(0,l.jsxs)("a",{href:"/admin/".concat(null==s?void 0:s.id,"/databases"),"data-currentlink":"/admin/".concat(null==s?void 0:s.id,"/databases"),children:[(0,l.jsx)(d.A,{size:20}),(0,l.jsx)("span",{children:"Databases"})]}),(0,l.jsxs)("a",{href:"/admin/".concat(null==s?void 0:s.id,"/media"),"data-currentlink":"/admin/".concat(null==s?void 0:s.id,"/media"),children:[(0,l.jsx)(o.A,{size:20}),(0,l.jsx)("span",{children:"Media"})]}),(0,l.jsxs)("a",{href:"/admin/