import{d as y,eB as b,eM as C,f as g,o as _,c as h,u as w,eN as I}from"./vue-router.74c693f1.js";import{b as k}from"./index.0791082e.js";import"./gateway.707771fc.js";import{C as i}from"./connector.b2e8c919.js";import{a as x}from"./asyncComputed.7b5c3427.js";import{G as E}from"./PhPencil.vue.184a28bf.js";import{C as D}from"./CrudView.f360b43c.js";import"./record.0d85e3b6.js";import"./string.b1ebfabb.js";import"./popupNotifcation.d39bbf9b.js";import"./router.77dea3d2.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.97a16843.js";import"./BookOutlined.7a96a9c1.js";import"./url.8b7ee03b.js";import"./index.ad2af8a3.js";import"./index.33768c38.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]="6e0bc9b9-faa2-435f-90df-fe07517b9b16",o._sentryDebugIdIdentifier="sentry-dbid-6e0bc9b9-faa2-435f-90df-fe07517b9b16")}catch{}})();const H=y({__name:"Connectors",setup(o){const r=b(),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:l,result:m,refetch:d}=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:f}){a.push({name:"connectorEditor",params:{connectorId:f}})}},{icon:I,label:"Delete",dangerous:!0,async onClick(){await n.delete(),d()}}]}]})))!=null?t:[]}});return(e,t)=>(_(),h(D,{"entity-name":"connector",loading:w(l),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{H as default};
//# sourceMappingURL=Connectors.c493f31f.js.map
