import{d as b,eD as f,eJ as C,I as g,b as _,c as I,u as h,eR as w}from"./outputWidgets.0112c29a.js";import{b as k}from"./index.01d20c53.js";import"./router.baccdf57.js";import{C as i}from"./connector.353bc337.js";import{a as x}from"./asyncComputed.7a4cd8c0.js";import{G as D}from"./PhPencil.vue.d1503007.js";import{C as E}from"./CrudView.24263641.js";import"./record.63beb4c2.js";import"./pubsub.bc9264fd.js";import"./Form.f084c7e0.js";import"./hasIn.9ed92b42.js";import"./popupNotifcation.b5f4e167.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.e7adff9f.js";import"./BookOutlined.cb11abba.js";import"./url.3a6cd3b5.js";import"./Paragraph.a79b7e0d.js";import"./Text.7fd7d6e4.js";import"./Modal.4672b2be.js";import"./index.0b86c71c.js";import"./Title.06b9fc65.js";import"./index.84aac883.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},r=new Error().stack;r&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[r]="2351cd3b-315a-4c2e-b316-1dd0a169ed47",o._sentryDebugIdIdentifier="sentry-dbid-2351cd3b-315a-4c2e-b316-1dd0a169ed47")}catch{}})();const Q=b({__name:"Connectors",setup(o){const r=f(),a=C(),c=r.params.projectId;async function s(e){const t=await i.create(c,e.name,e.type);a.push({name:"connectorEditor",params:{connectorId:t.id}})}const p=[{key:"name",label:"Connector name",type:"text"},{key:"type",label:"Connector type",type:Object.entries(k.schema).map(([e,t])=>({value:e,label:t.label}))}],{loading:m,result:d,refetch:l}=x(()=>i.list(c)),u=g(()=>{var e,t;return{columns:[{name:"Name"},{name:"Type"},{name:"",align:"right"}],rows:(t=(e=d.value)==null?void 0:e.map(n=>({key:n.id,cells:[{type:"link",text:n.name,to:{name:"connectorEditor",params:{connectorId:n.id}}},{type:"text",text:n.type},{type:"actions",actions:[{icon:D,label:"Edit",onClick({key:y}){a.push({name:"connectorEditor",params:{connectorId:y}})}},{icon:w,label:"Delete",dangerous:!0,async onClick(){await n.delete(),l()}}]}]})))!=null?t:[]}});return(e,t)=>(_(),I(E,{"entity-name":"connector",loading:h(m),title:"Connectors",description:"Each connector is a version of your app. You can create a new connector by deploying your app from the local editor.","empty-title":"No connectors here yet",table:u.value,fields:p,"create-button-text":"Create connector",onCreate:s},null,8,["loading","table"]))}});export{Q as default};
//# sourceMappingURL=Connectors.52b14fa5.js.map
