dsql-admin/dsql-app/.local_dist/server/chunks/5134.js

1 line
7.2 KiB
JavaScript
Raw Normal View History

2024-12-08 19:56:57 +00:00
"use strict";exports.id=5134,exports.ids=[5134],exports.modules={46437:(e,a,t)=>{t.d(a,{A:()=>n});var s=t(8732);t(82015);var l=t(42178);function n(){return(0,s.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,s.jsx)(l.A,{color:"inherit",className:"opacity-50 text-black",fontSize:"small"})})}},94010:(e,a,t)=>{t.a(e,async(e,s)=>{try{t.d(a,{A:()=>d});var l=t(8732);t(82015);var n=t(96089),i=t(75979),r=e([i]);function d({slugText:e,justIcon:a,noIcon:t,title:s,outlined:r,extraClasses:d}){return(0,l.jsxs)("div",{className:(0,i.twMerge)("button small-text",r?" outlined gray bg-white":" ghost light-gray",d),onClick:a=>{navigator.clipboard.writeText(e).then(()=>{alert(`Copied: "${e}"`)})},style:r?void 0:{padding:0},children:[!t&&(0,l.jsx)(n.A,{size:r?15:20}),!a&&(0,l.jsx)("span",{className:"text-slate-500 dark:text-slate-300",children:s||"Copy Slug"})]})}i=(r.then?(await r)():r)[0],s()}catch(e){s(e)}})},64098:(e,a,t)=>{t.a(e,async(e,s)=>{try{t.d(a,{A:()=>f});var l=t(8732),n=t(82015),i=t.n(n),r=t(94010),d=t(36605),o=t(22603),c=t(48987),m=t(42125),h=t(50993),u=t(63715),x=t(32415),b=t(58526),g=t(98136),p=e([r]);function f({database:e,query:a,confirmedDelegetedUser:t,user:s}){let{active_clone:n,active_clone_parent_db:o}=e,c=t?.delegated;t?.priviledges?.match(/Edit Tables/i),t?.priviledges?.match(/Delete Tables/i);let[m,h]=i().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:e.db_image,alt:"Database Image",width:20,className:"w-full h-full rounded-full object-cover"}),t?.delegated&&(0,l.jsxs)("div",{className:" absolute -bottom-2 left-5 gap-1",children:[(0,l.jsx)("img",{src:t.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:t.rootUserEmail})]})]}),(0,l.jsx)("span",{className:"font-semibold text-base"+(t?.delegated?" -mt-3":""),children:e.db_name})]}),(0,l.jsx)(b.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/${s?.id}/databases/${e.db_slug}/edit-database`,className:"button plain-text more-padding normal-weight",children:"Edit Database"}),(0,l.jsx)("hr",{className:"m-0"}),!n&&(0,l.jsxs)(i().Fragment,{children:[(0,l.jsx)("a",{href:`/admin/${s?.id}/databases/add-database?duplicate=${e.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/${s?.id}/databases/${e.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/${s?.id}/databases/${e.db_slug}/users`,className:"button plain-text more-padding normal-weight",children:"Database Users"}),!c&&(0,l.jsx)(j,{database:e,user:s})]})]}),(0,l.jsx)("hr",{className:"vertical"}),(0,l.jsx)(r.A,{slugText:e.db_slug,title:"Db Slug"}),(0,l.jsx)("div",{className:"-mt-1 gap-1",children:(0,l.jsx)(r.A,{slugText:e.db_full_name,title:"Full DB Name"})}),!c&&(0,l.jsxs)(i().Fragment,{children:[(0,l.jsx)("hr",{className:"vertical"}),(0,l.jsxs)("a",{href:`/admin/${s?.id}/databases/${e.db_slug}/shell`,className:"button ghost small-text",style:{height:"30px",padding:0},children:[(0,l.jsx)(g.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 j({database:e,user:a}){let[t,s]=i().useState(!1),n=i().useRef();return(0,l.jsxs)(i().Fragment,{children:[t&&(0,l.jsx)(x.A,{width:"20px"}),(0,l.jsx)("hr",{className:"m-0"}),(0,l.jsx)("a",{href:`/admin/${a?.id}/databases/${e.db_slug}/shell`,className:"button plain-text more-padding normal-weight",children:"Shell"}),(0,l.jsx)("h