dsql-admin/dsql-app/.local_dist/static/chunks/194-6fbe0e1d9cd931e6.js

1 line
8.1 KiB
JavaScript
Raw Normal View History

2024-11-06 06:52:57 +00:00
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[194],{61781:function(e,a,t){t.d(a,{Z:function(){return s}});var n=t(85893),l=(t(67294),t(42065));function s(){return(0,n.jsx)("button",{className:"outlined gray p-2 w-9 h-9 flex items-center justify-center rounded-full",onClick:function(e){window.history.back()},children:(0,n.jsx)(l.Z,{color:"inherit",className:"opacity-50 text-black",fontSize:"small"})})}},79230:function(e,a,t){t.d(a,{Z:function(){return s}});var n=t(85893),l=(t(67294),t(76915));function s(e){var a=e.slugText,t=e.justIcon,s=e.title,i=e.outlined;return(0,n.jsxs)("div",{className:"button small-text"+(i?" outlined gray bg-white":" ghost light-gray"),onClick:function(e){navigator.clipboard.writeText(a).then((function(){alert('Copied: "'.concat(a,'"'))}))},style:i?void 0:{padding:0},children:[(0,n.jsx)(l.Z,{size:i?15:20}),!t&&(0,n.jsx)("span",{className:"text-slate-500 dark:text-slate-300",children:s||"Copy Slug"})]})}},4423:function(e,a,t){t.d(a,{Z:function(){return x}});var n=t(828),l=t(85893),s=t(67294),i=t(79230),o=t(96355),d=t(87851),c=t(5467),r=t(57632),u=t(85541),m=t(86729),h=t(95264),f=t(8971),b=t(58261);function x(e){var a,t,d=e.database,c=(e.query,e.confirmedDelegetedUser),r=e.user,u=d.active_clone,m=(d.active_clone_parent_db,null===c||void 0===c?void 0:c.delegated),h=(null===c||void 0===c||null===(a=c.priviledges)||void 0===a||a.match(/Edit Tables/i),null===c||void 0===c||null===(t=c.priviledges)||void 0===t||t.match(/Delete Tables/i),(0,n.Z)(s.useState(null),2));h[0],h[1];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:d.db_image,alt:"Database Image",width:20,className:"w-full h-full rounded-full object-cover"}),(null===c||void 0===c?void 0:c.delegated)&&(0,l.jsxs)("div",{className:" absolute -bottom-2 left-5 gap-1",children:[(0,l.jsx)("img",{src:c.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:c.rootUserEmail})]})]}),(0,l.jsx)("span",{className:"font-semibold text-base"+((null===c||void 0===c?void 0:c.delegated)?" -mt-3":""),children:d.db_name})]}),(0,l.jsx)(f.Z,{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===r||void 0===r?void 0:r.id,"/databases/").concat(d.db_slug,"/edit-database"),className:"button plain-text more-padding normal-weight",children:"Edit Database"}),(0,l.jsx)("hr",{className:"m-0"}),!u&&(0,l.jsxs)(s.Fragment,{children:[(0,l.jsx)("a",{href:"/admin/".concat(null===r||void 0===r?void 0:r.id,"/databases/add-database?duplicate=").concat(d.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===r||void 0===r?void 0:r.id,"/databases/").concat(d.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===r||void 0===r?void 0:r.id,"/databases/").concat(d.db_slug,"/users"),className:"button plain-text more-padding normal-weight",children:"Database Users"}),!m&&(0,l.jsx)(v,{database:d,user:r})]})]}),(0,l.jsx)("hr",{className:"vertical"}),(0,l.jsx)(i.Z,{slugText:d.db_slug,title:"Db Slug"}),(0,l.jsx)("div",{className:"-mt-1 gap-1",children:(0,l.jsx)(i.Z,{slugText:d.db_full_name,title:"Full DB Name"})}),!m&&(0,l.jsxs)(s.Fragment,{children:[(0,l.jsx)("hr",{className:"vertical"}),(0,l.jsxs)("a",{href:"/admin/".concat(null===r||void 0===r?void 0:r.id,"/databases/").concat(d.db_slug,"/shell"),className:"button ghost small-text",style:{height:"30px",padding:0},children:[(0,l.jsx)(b.Z,{size:20}),(0,l.jsx)("span",{className:"text-sm font-semibold",children:"Shell"})]})]}),(0,l.jsx)("hr",{className