import{d as b,f1 as f,f7 as C,y as g,b as _,c as h,u as w,fd as I}from"./outputWidgets.9e7bd3a6.js";import{b as k}from"./index.d38a0669.js";import"./gateway.8fcf86ab.js";import{C as i}from"./connector.5ecd655c.js";import{a as x}from"./asyncComputed.fb556333.js";import{G as E}from"./PhPencil.vue.11d79c01.js";import{C as D}from"./CrudView.6565f625.js";import"./record.dce94ddc.js";import"./pubsub.f3af3eeb.js";import"./string.6d0759d4.js";import"./popupNotifcation.24d18d49.js";import"./router.27283135.js";import"./Form.dfca34ad.js";import"./hasIn.35808092.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.548b5f6c.js";import"./BookOutlined.5c7ce856.js";import"./url.1f5e31bf.js";import"./Modal.41211848.js";import"./index.a28fbaa6.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]="bb799edd-c842-432f-bdde-adbee5ed5e5b",o._sentryDebugIdIdentifier="sentry-dbid-bb799edd-c842-432f-bdde-adbee5ed5e5b")}catch{}})();const L=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 d=[{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:p,result:m,refetch:l}=x(()=>i.list(c)),u=g(()=>{var e,t;return{columns:[{name:"Name"},{name:"Type"},{name:"",align:"right"}],rows:(t=(e=m.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:E,label:"Edit",onClick({key:y}){a.push({name:"connectorEditor",params:{connectorId:y}})}},{icon:I,label:"Delete",dangerous:!0,async onClick(){await n.delete(),l()}}]}]})))!=null?t:[]}});return(e,t)=>(_(),h(D,{"entity-name":"connector",loading:w(p),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:d,"create-button-text":"Create connector",onCreate:s},null,8,["loading","table"]))}});export{L as default};
//# sourceMappingURL=Connectors.599f369a.js.map
