1 line
8.2 KiB
JavaScript
1 line
8.2 KiB
JavaScript
|
"use strict";exports.id=7769,exports.ids=[7769],exports.modules={59023:(e,a,s)=>{s.d(a,{A:()=>r});var t=s(8732),n=s(23293);function r(){return(0,t.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,t.jsx)(n.A,{})})}s(82015)},73872:(e,a,s)=>{s.a(e,async(e,t)=>{try{s.d(a,{A:()=>o});var n=s(8732);s(82015);var r=s(96089),l=s(75979),i=e([l]);function o({slugText:e,justIcon:a,noIcon:s,title:t,outlined:i,extraClasses:o}){return(0,n.jsxs)("div",{className:(0,l.twMerge)("button small-text hover:!bg-transparent",i?" outlined gray bg-white":" ghost light-gray",o),onClick:a=>{navigator.clipboard.writeText(e).then(()=>{alert(`Copied: "${e}"`)})},style:i?void 0:{padding:0},children:[!s&&(0,n.jsx)(r.A,{size:i?15:20}),!a&&(0,n.jsx)("span",{className:"text-slate-500 dark:text-slate-300",children:t||"Copy Slug"})]})}l=(i.then?(await i)():i)[0],t()}catch(e){t(e)}})},55880:(e,a,s)=>{s.a(e,async(e,t)=>{try{s.d(a,{A:()=>f});var n=s(8732),r=s(82015),l=s.n(r),i=s(73872),o=s(87639),d=s(63025),c=s(46169),m=s(16757),h=s(58526),u=s(98136),b=s(71296),p=s(72935),x=s(25088),g=e([i]);function f({database:e,query:a,confirmedDelegetedUser:s,user:t}){let{active_clone:r,active_clone_parent_db:d}=e,c=s?.delegated;s?.priviledges?.match(/Edit Tables/i),s?.priviledges?.match(/Delete Tables/i);let[m,b]=l().useState(null);return(0,n.jsxs)("div",{className:"flex-wrap justify-center gap-4",children:[(0,n.jsxs)("div",{className:"dropdown-wrapper gap-4",children:[(0,n.jsxs)("div",{className:"relative",children:[(0,n.jsxs)("div",{className:"w-8 h-8 relative",children:[(0,n.jsx)("img",{src:e.db_image,alt:"Database Image",width:20,className:"w-full h-full rounded-full object-cover"}),s?.delegated&&(0,n.jsxs)("div",{className:" absolute -bottom-2 left-5 gap-1",children:[(0,n.jsx)("img",{src:s.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,n.jsx)("span",{className:"text-xs",children:s.rootUserEmail})]})]}),(0,n.jsx)("span",{className:"font-semibold text-base"+(s?.delegated?" -mt-3":""),children:e.db_name})]}),(0,n.jsx)(h.A,{size:20}),(0,n.jsxs)("div",{className:"dropdown p-0",children:[(0,n.jsx)("hr",{className:"m-0"}),(0,n.jsx)("a",{href:`/admin/${t?.id}/databases/${e.db_slug}/edit-database`,className:"button plain-text more-padding normal-weight",children:"Edit Database"}),(0,n.jsx)("hr",{className:"m-0"}),!r&&(0,n.jsxs)(l().Fragment,{children:[(0,n.jsx)("a",{href:`/admin/${t?.id}/databases/add-database?duplicate=${e.db_full_name}`,className:"button plain-text more-padding normal-weight",children:"Duplicate Database"}),(0,n.jsx)("hr",{className:"m-0"})]}),(0,n.jsx)("a",{href:`/admin/${t?.id}/databases/${e.db_slug}/schema`,className:"button plain-text more-padding normal-weight",children:"Schema"}),(0,n.jsx)("hr",{className:"m-0"}),(0,n.jsx)("a",{href:`/admin/${t?.id}/databases/${e.db_slug}/users`,className:"button plain-text more-padding normal-weight",children:"Database Users"}),!c&&(0,n.jsx)(_,{database:e,user:t})]})]}),(0,n.jsx)("hr",{className:"vertical"}),(0,n.jsx)(i.A,{slugText:e.db_slug,title:"Db Slug"}),(0,n.jsx)("div",{className:"-mt-1 gap-1",children:(0,n.jsx)(i.A,{slugText:e.db_full_name,title:"Full DB Name"})}),!c&&(0,n.jsxs)(l().Fragment,{children:[(0,n.jsx)("hr",{className:"vertical"}),(0,n.jsxs)("a",{href:`/admin/${t?.id}/databases/${e.db_slug}/shell`,className:"button ghost small-text",style:{height:"30px",padding:0},children:[(0,n.jsx)(u.A,{size:20}),(0,n.jsx)("span",{className:"text-sm font-semibold",children:"Shell"})]})]}),(0,n.jsx)("hr",{className:"vertical"}),(0,n.jsx)(o.A,{})]})}function _({database:e,user:a}){let[s,t]=l().useState(!1),r=l().useRef();return(0,n.jsxs)(l().Fragment,{children:[s&&(0,n.jsx)(m.A,{width:"20px"}),(0,n.jsx)("hr",{className:"m-0"}),(0,n.jsx)("a",{href:`/admin/${a?.id}/databases/${e.db_slug}/shell`,className:"button plain-text more-padding normal-weight",children:"Shell"}),(0,n.jsx)("hr",{className:"m-0"}),e?.remote_connected==1?(0,n
|