dsql-admin/dsql-app/.local_dist/static/chunks/7391-b72414be460cf0f0.js

1 line
9.3 KiB
JavaScript
Raw Normal View History

2025-01-13 08:00:21 +00:00
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7391],{3647:(e,s,a)=>{a.d(s,{A:()=>n});var t=a(4848),l=a(6540);function n(e){let{confirmedDelegetedUser:s,linksArray:a,user:n}=e,[i,r]=l.useState(a||null);return(l.useEffect(()=>{var e;if(a)return;let s=window.location.pathname,t=s.split("/"),l=[];l.push({title:"Home",path:s.match(/admin/)?"/admin":"/"}),null===(e=window.location.search)||void 0===e||e.match(/delegated=true/),t.forEach((e,s,a)=>{!(null==e?void 0:e.match(/./))||1==s||e.match(/^\d+$/)&&n&&!l.find(e=>!!e.title.match(/^entries$|^users$/))||l.push({title:e,path:(()=>{let e="";for(let t=0;t<a.length;t++){let l=a[t];!(t>s)&&l.match(/./)&&(e+="/".concat(l))}return e})()})}),r(l)},[]),i&&i[1])?(0,t.jsx)("div",{className:"text-sm mt-2 flex-wrap",children:i.map((e,s,a)=>s===i.length-1?(0,t.jsx)("a",{href:e.path,className:"text-slate-400 dark:text-slate-500 pointer-events-none",children:e.title},s):(0,t.jsxs)(l.Fragment,{children:[(0,t.jsx)("a",{href:e.path,className:"query-url",children:e.title}),(0,t.jsx)("span",{className:"opacity-20",children:"|"})]},s))}):(0,t.jsx)(l.Fragment,{})}},4839:(e,s,a)=>{a.d(s,{A:()=>x});var t=a(4848),l=a(6540),n=a(9020),i=a(65),r=a(1710),c=a(9753),d=a(7273),o=a(7216);function x(){let[e,s]=l.useState(!0),[a,x]=l.useState(0),[h,m]=l.useState(0);return(l.useEffect(()=>{a||(0,n.A)("/api/getDiskUsage").then(e=>{(null==e?void 0:e.total)&&(x(e.total),localStorage.setItem("disk_usage",e.total)),s(!1)})},[]),e)?(0,t.jsx)("div",{className:"button ghost small-text",style:{height:"30px"},children:(0,t.jsx)(r.A,{width:"15px",position:"relative"})}):(0,t.jsx)(l.Fragment,{children:a?(0,t.jsxs)("div",{className:"button ghost small-text normal-weight p-0",style:{height:"30px",padding:0},onClick:e=>{s(!0),(0,i.A)().then(()=>{m(e=>e+1),s(!1)})},children:[e&&(0,t.jsx)(r.A,{width:"15px"}),(0,t.jsx)(c.A,{size:20,className:"text-slate-400 mr-[3px]"}),(0,t.jsx)("span",{className:"font-bold text-slate-700 dark:text-white",children:a&&a.toFixed(2)}),(0,t.jsx)("span",{className:"text-slate-500",children:"mb"}),(0,t.jsx)(d.A,{size:17,className:"text-slate-400",strokeWidth:2})]}):(0,t.jsxs)("span",{className:"text-sm info gray font-normal w-auto",children:[(0,t.jsx)(o.A,{}),(0,t.jsx)("span",{children:"No Disk Usage Data Available Yet"})]})})}},65:(e,s,a)=>{a.d(s,{A:()=>l});var t=a(9020);async function l(){let e=await (0,t.A)("/api/getDiskUsage");localStorage.setItem("disk_usage",e.total)}},8181:(e,s,a)=>{a.d(s,{A:()=>k});var t=a(4848),l=a(6540),n=a(3368),i=a.n(n),r=a(6232),c=a(8631),d=a(9140),o=a(1915),x=a(4909),h=a(5014),m=a(2894),u=a(9508),j=a(5922);function p(e){let{user:s}=e,[a,n]=l.useState(!0);return(0,t.jsxs)("aside",{className:"aside"+(a?" mobile-collapsed":" mobile-expanded"),children:[(0,t.jsx)(r.A,{adminAside:!0,collapseAsideMobile:a,setCollapseAsideMobile:n}),(0,t.jsx)("hr",{className:"opacity-0 mt-4"}),(0,t.jsxs)("div",{className:"main-links"+(a?" hidden lg:flex":" "),children:[(0,t.jsxs)("a",{href:"/admin","data-currentlink":"/admin","data-strictlink":"true",children:[(0,t.jsx)(c.A,{size:20}),(0,t.jsx)("span",{children:"Dashboard"})]}),(0,t.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,t.jsx)(d.A,{size:20}),(0,t.jsx)("span",{children:"Databases"})]}),(0,t.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,t.jsx)(o.A,{size:20}),(0,t.jsx)("span",{children:"Media"})]}),(0,t.jsxs)("a",{href:"/admin/".concat(null==s?void 0:s.id,"/users"),"data-currentlink":"/admin/".concat(null==s?void 0:s.id,"/users"),children:[(0,t.jsx)(x.A,{size:20}),(0,t.jsx)("span",{children:"Users"})]}),(0,t.jsxs)("a",{href:"/admin/".concat(null==s?void 0:s.id,"/schema"),"data-currentlink":"/admin/".concat(null==s?void 0:s.id,"/schema"),children:[(0,t.jsx)(h.A,{size:20}),(0,t.jsx)("span",{children:"Schema"})]}),(0,t.jsxs)("a",{href:"/admin/".concat(null==s?void 0:s.id,"/api-keys"),"data-currentlink":"/admin/".concat(null