dsql-admin/dsql-app/.local_dist/static/chunks/675-2004f134d2d9f02a.js

1 line
8.4 KiB
JavaScript
Raw Normal View History

2025-02-16 16:12:40 +00:00
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[675],{5844:(e,a,t)=>{t.d(a,{A:()=>s});var l=t(4848),n=t(7216);function s(){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)(n.A,{})})}t(6540)},3647:(e,a,t)=>{t.d(a,{A:()=>s});var l=t(4848),n=t(6540);function s(e){let{confirmedDelegetedUser:a,linksArray:t,user:s}=e,[i,d]=n.useState(t||null);return(n.useEffect(()=>{var e;if(t)return;let a=window.location.pathname,l=a.split("/"),n=[];n.push({title:"Home",path:a.match(/admin/)?"/admin":"/"}),null===(e=window.location.search)||void 0===e||e.match(/delegated=true/),l.forEach((e,a,t)=>{!(null==e?void 0:e.match(/./))||1==a||e.match(/^\d+$/)&&s&&!n.find(e=>!!e.title.match(/^entries$|^users$/))||n.push({title:e,path:(()=>{let e="";for(let l=0;l<t.length;l++){let n=t[l];!(l>a)&&n.match(/./)&&(e+="/".concat(n))}return e})()})}),d(n)},[]),i&&i[1])?(0,l.jsx)("div",{className:"text-sm mt-2 flex-wrap",children:i.map((e,a,t)=>a===i.length-1?(0,l.jsx)("a",{href:e.path,className:"text-slate-400 dark:text-slate-500 pointer-events-none",children:e.title},a):(0,l.jsxs)(n.Fragment,{children:[(0,l.jsx)("a",{href:e.path,className:"query-url",children:e.title}),(0,l.jsx)("span",{className:"opacity-20",children:"|"})]},a))}):(0,l.jsx)(n.Fragment,{})}},5139:(e,a,t)=>{t.d(a,{A:()=>i});var l=t(4848);t(6540);var n=t(7220),s=t(856);function i(e){let{slugText:a,justIcon:t,noIcon:i,title:d,outlined:r,extraClasses:o}=e;return(0,l.jsxs)("div",{className:(0,s.QP)("button small-text hover:!bg-transparent",r?" outlined gray bg-white":" ghost light-gray",o),onClick:e=>{navigator.clipboard.writeText(a).then(()=>{alert('Copied: "'.concat(a,'"'))})},style:r?void 0:{padding:0},children:[!i&&(0,l.jsx)(n.A,{size:r?15:20}),!t&&(0,l.jsx)("span",{className:"text-slate-500 dark:text-slate-300",children:d||"Copy Slug"})]})}},1990:(e,a,t)=>{t.d(a,{A:()=>b});var l=t(4848),n=t(6540),s=t(5139),i=t(4839),d=t(5974),r=t(9020),o=t(1710),c=t(2027),m=t(6051),h=t(3419),u=t(4266),x=t(7290);function b(e){var a,t;let{database:d,query:r,confirmedDelegetedUser:o,user:h}=e,{active_clone:u,active_clone_parent_db:x}=d,b=null==o?void 0:o.delegated;null==o||null===(a=o.priviledges)||void 0===a||a.match(/Edit Tables/i),null==o||null===(t=o.priviledges)||void 0===t||t.match(/Delete Tables/i);let[g,f]=n.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:d.db_image,alt:"Database Image",width:20,className:"w-full h-full rounded-full object-cover"}),(null==o?void 0:o.delegated)&&(0,l.jsxs)("div",{className:" absolute -bottom-2 left-5 gap-1",children:[(0,l.jsx)("img",{src:o.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:o.rootUserEmail})]})]}),(0,l.jsx)("span",{className:"font-semibold text-base"+((null==o?void 0:o.delegated)?" -mt-3":""),children:d.db_name})]}),(0,l.jsx)(c.A,{size:17}),(0,l.jsxs)("div",{className:"dropdown p-0",children:[(0,l.jsx)("hr",{className:"m-0"}),(0,l.jsx)("a",{href:"/admin/".concat(null==h?void 0:h.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)(n.Fragment,{children:[(0,l.jsx)("a",{href:"/admin/".concat(null==h?void 0:h.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==h?void 0:h.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:"/admi