dsql-admin/dsql-app/.local_dist/static/chunks/304-2b6b4eb0adbbac90.js

1 line
7.4 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([[304],{9862:(e,a,t)=>{t.d(a,{A:()=>n});var l=t(4848),s=t(7216);function n(){return(0,l.jsx)("button",{className:"outlined gray p-2 w-9 h-9 flex items-center justify-center rounded-full",onClick:e=>{window.history.back()},children:(0,l.jsx)(s.A,{})})}t(6540)},7121:(e,a,t)=>{t.d(a,{A:()=>d});var l=t(4848);t(6540);var s=t(7220),n=t(856);function d(e){let{slugText:a,justIcon:t,noIcon:d,title:i,outlined:o,extraClasses:r}=e;return(0,l.jsxs)("div",{className:(0,n.QP)("button small-text hover:!bg-transparent",o?" outlined gray bg-white":" ghost light-gray",r),onClick:e=>{navigator.clipboard.writeText(a).then(()=>{alert('Copied: "'.concat(a,'"'))})},style:o?void 0:{padding:0},children:[!d&&(0,l.jsx)(s.A,{size:o?15:20}),!t&&(0,l.jsx)("span",{className:"text-slate-500 dark:text-slate-300",children:i||"Copy Slug"})]})}},5897:(e,a,t)=>{t.d(a,{A:()=>x});var l=t(4848),s=t(6540),n=t(7121),d=t(1238),i=t(8152),o=t(3698),r=t(620),c=t(2027),m=t(8432),u=t(3419),h=t(4266),b=t(7290);function x(e){var a,t;let{database:i,query:o,confirmedDelegetedUser:r,user:u}=e,{active_clone:h,active_clone_parent_db:b}=i,x=null==r?void 0:r.delegated;null==r||null===(a=r.priviledges)||void 0===a||a.match(/Edit Tables/i),null==r||null===(t=r.priviledges)||void 0===t||t.match(/Delete Tables/i);let[p,f]=s.useState(null);return(0,l.jsxs)("div",{className:"flex-wrap justify-center gap-4",children:[(0,l.jsxs)("div",{className:"dropdown-wrapper gap-4",children:[(0,l.jsxs)("div",{className:"relative",children:[(0,l.jsxs)("div",{className:"w-8 h-8 relative",children:[(0,l.jsx)("img",{src:i.db_image,alt:"Database Image",width:20,className:"w-full h-full rounded-full object-cover"}),(null==r?void 0:r.delegated)&&(0,l.jsxs)("div",{className:" absolute -bottom-2 left-5 gap-1",children:[(0,l.jsx)("img",{src:r.rootUserImage,alt:"Root User Image",className:"w-5 h-5 rounded-full object-cover border-2 border-white dark:border-slate-800 border-solid"}),(0,l.jsx)("span",{className:"text-xs",children:r.rootUserEmail})]})]}),(0,l.jsx)("span",{className:"font-semibold text-base"+((null==r?void 0:r.delegated)?" -mt-3":""),children:i.db_name})]}),(0,l.jsx)(c.A,{size:20}),(0,l.jsxs)("div",{className:"dropdown p-0",children:[(0,l.jsx)("hr",{className:"m-0"}),(0,l.jsx)("a",{href:"/admin/".concat(null==u?void 0:u.id,"/databases/").concat(i.db_slug,"/edit-database"),className:"button plain-text more-padding normal-weight",children:"Edit Database"}),(0,l.jsx)("hr",{className:"m-0"}),!h&&(0,l.jsxs)(s.Fragment,{children:[(0,l.jsx)("a",{href:"/admin/".concat(null==u?void 0:u.id,"/databases/add-database?duplicate=").concat(i.db_full_name),className:"button plain-text more-padding normal-weight",children:"Duplicate Database"}),(0,l.jsx)("hr",{className:"m-0"})]}),(0,l.jsx)("a",{href:"/admin/".concat(null==u?void 0:u.id,"/databases/").concat(i.db_slug,"/schema"),className:"button plain-text more-padding normal-weight",children:"Schema"}),(0,l.jsx)("hr",{className:"m-0"}),(0,l.jsx)("a",{href:"/admin/".concat(null==u?void 0:u.id,"/databases/").concat(i.db_slug,"/users"),className:"button plain-text more-padding normal-weight",children:"Database Users"}),!x&&(0,l.jsx)(g,{database:i,user:u})]})]}),(0,l.jsx)("hr",{className:"vertical"}),(0,l.jsx)(n.A,{slugText:i.db_slug,title:"Db Slug"}),(0,l.jsx)("div",{className:"-mt-1 gap-1",children:(0,l.jsx)(n.A,{slugText:i.db_full_name,title:"Full DB Name"})}),!x&&(0,l.jsxs)(s.Fragment,{children:[(0,l.jsx)("hr",{className:"vertical"}),(0,l.jsxs)("a",{href:"/admin/".concat(null==u?void 0:u.id,"/databases/").concat(i.db_slug,"/shell"),className:"button ghost small-text",style:{height:"30px",padding:0},children:[(0,l.jsx)(m.A,{size:20}),(0,l.jsx)("span",{className:"text-sm font-semibold",children:"Shell"})]})]}),(0,l.jsx)("hr",{className:"vertical"}),(0,l.jsx)(d.A,{})]})}function g(e){let{database:a,user:t}=e,[n,d]=s.useState(!1),c=s.useRef();return(0,l.jsxs)(s.Fragment,{children:[n&&(0,l.jsx)(r.A,{width:"20px"}),(0,l.jsx)("hr",{className:"m-0"}),(0,l.jsx)("a",{href:"/admin/".concat(null==t?void 0