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

1 line
9.7 KiB
JavaScript
Raw Normal View History

2024-12-05 07:03:33 +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(74848),t=a(96540);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.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,{})}},41238:(e,s,a)=>{a.d(s,{A:()=>x});var l=a(74848),t=a(96540),n=a(23698),i=a(17531),r=a(620),c=a(34181),d=a(79753),o=a(87273);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)(d.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)(o.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)(c.A,{color:"inherit",className:"opacity-50 text-slate-500",fontSize:"small"}),(0,l.jsx)("span",{children:"No Disk Usage Data Available Yet"})]})})}},17531:(e,s,a)=>{a.d(s,{A:()=>t});var l=a(23698);async function t(){let e=await (0,l.A)("/api/getDiskUsage");localStorage.setItem("disk_usage",e.total)}},56086:(e,s,a)=>{var l=a(77836);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"}},51187:(e,s,a)=>{a.d(s,{A:()=>y});var l=a(74848),t=a(96540),n=a(13368),i=a.n(n);a(13980);var r=a(61638),c=a(98631),d=a(59140),o=a(1915),x=a(94909),h=a(45014),u=a(2894),m=a(79508),j=a(5922),p=a(56086),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",{child