1 line
11 KiB
JavaScript
1 line
11 KiB
JavaScript
|
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8264],{58264:function(e,a,l){l.d(a,{Z:function(){return c},w:function(){return o}});var n=l(85893),t=l(67294),s=l(46734),i=l(94986);function c(e){var a,l,c,r=e.database,d=e.tables,u=e.setTargetTable,f=e.confirmedDelegetedUser,m=e.query,p=e.user;null===f||void 0===f||f.delegated,null===f||void 0===f||null===(a=f.priviledges)||void 0===a||a.match(/Edit Tables/i),null===f||void 0===f||null===(l=f.priviledges)||void 0===l||l.match(/Delete Tables/i),null===f||void 0===f||null===(c=f.priviledges)||void 0===c||c.match(/Create Tables/i);return(0,n.jsxs)(t.Fragment,{children:[r.active_clone&&p?(0,n.jsx)(i.Z,{database:r,user:p}):(0,n.jsx)(n.Fragment,{}),r.remote_connected?(0,n.jsx)(o,{database:r}):(0,n.jsx)(n.Fragment,{}),(0,n.jsxs)("section",{className:"paper gray",children:[d&&d[0]?(0,n.jsxs)("div",{className:"flex-wrap gap-4 justify-between w-full",children:[(0,n.jsx)("h2",{className:"text-xl m-0",children:"Tables"}),(0,n.jsx)("a",{href:"/admin/".concat(null===p||void 0===p?void 0:p.id,"/databases/").concat(r.db_slug,"/tables"),className:"button outlined gray small-text",children:"See All Tables"})]}):(0,n.jsx)("h2",{className:"text-xl m-0",children:"This Database is empty"}),(0,n.jsx)("hr",{}),p?(0,n.jsx)(s.Z,{database:r,tables:d,setTargetTable:u,confirmedDelegetedUser:f,query:m,user:p}):null]})]})}function o(e){var a,l=e.database;return(0,n.jsx)("div",{className:"info green",children:(0,n.jsxs)("span",{className:"text font-normal",children:["This database is an active clone of"," ",(0,n.jsx)("b",{children:null===(a=l.remote_db_full_name)||void 0===a?void 0:a.replace(/datasquirel_user_\d+_/,"")})," ","on"," ",(0,n.jsx)("a",{className:"font-bold text-inherit",href:l.remote_connection_host,target:"_blank",children:l.remote_connection_host})," ","Host"]})})}},46734:function(e,a,l){l.d(a,{Z:function(){return w}});var n=l(85893),t=l(67294),s=l(79230),i=l(25472),c=l(45449),o=l(80173),r=l(64998);function d(e){var a,l,d,u,f=e.table,m=e.setTargetTable,p=e.database,h=e.confirmedDelegetedUser,v=(e.query,e.icons,e.user),b=null===h||void 0===h?void 0:h.delegated,x=null===h||void 0===h||null===(a=h.priviledges)||void 0===a?void 0:a.match(/Edit Tables/i),g=null===h||void 0===h||null===(l=h.priviledges)||void 0===l?void 0:l.match(/Delete Tables/i),j=(null===h||void 0===h||null===(d=h.priviledges)||void 0===d||d.match(/Create Table/i),p.active_clone,p.active_clone_parent_db),N=p.remote_connected;return(0,n.jsxs)("a",{href:"/admin/".concat(null===v||void 0===v?void 0:v.id,"/databases/").concat(p.db_slug,"/tables/").concat(f.table_slug),className:"card w-full items-center justify-between py-4"+((null===f||void 0===f?void 0:f.child_table)?" green":""),onClick:function(e){e.target.closest(".db-list-item-actions-block")&&e.preventDefault()},children:[(0,n.jsxs)("div",{className:"flex-wrap items-center flex",children:[(0,n.jsx)(o.Z,{fontSize:"small",className:"opacity-50",color:"action"}),(0,n.jsx)("span",{className:"title",style:{fontSize:"16px"},children:f.table_name}),(0,n.jsxs)("span",{className:"text-sm text-slate-400",children:["Created: ",null===(u=f.date_created)||void 0===u?void 0:u.substring(0,21)]})]}),(0,n.jsxs)("div",{className:"flex-wrap",children:[(0,n.jsx)("div",{className:"db-list-item-actions-block flex-wrap",children:(0,n.jsxs)(c.Z,{children:[(0,n.jsx)(s.Z,{slugText:f.table_slug||"",outlined:!0}),(!b||b&&x)&&!j&&!N&&(0,n.jsx)(t.Fragment,{children:(0,n.jsx)("div",{className:"button outlined light-gray small-text",onClick:function(e){window.location.pathname="/admin/".concat(null===v||void 0===v?void 0:v.id,"/databases/").concat(p.db_slug,"/tables/").concat(f.table_slug,"/edit-table")},children:(0,n.jsx)("span",{children:"Edit"})})}),!j&&!f.child_table&&(0,n.jsx)("div",{className:"button outlined light-gray small-text",onClick:function(e){window.location.href="/admin/".concat(null===v||void 0===v?void 0:v.id,"/databases/").concat(p.db_slug,"/tables/add-table?clone=true&clone_db=").concat(p.db_slug,"&clone_table=").concat(f.table_slug)},children:(0,n.jsx)("span",{
|