import{d as y,eG as f,eM as C,D as g,b as _,c as h,u as w,eS as I}from"./outputWidgets.e5f9ffc6.js";import{b as k}from"./index.889e1616.js";import"./router.dd631582.js";import{C as i}from"./connector.2ddd5671.js";import{a as x}from"./asyncComputed.2210bd1a.js";import{G as D}from"./PhPencil.vue.155bd1a7.js";import{C as E}from"./CrudView.542c4e4e.js";import"./record.3c5b5204.js";import"./pubsub.75396d00.js";import"./Form.b45c0335.js";import"./hasIn.54609e4a.js";import"./popupNotifcation.9671db62.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.670b5628.js";import"./BookOutlined.7d01e6a5.js";import"./url.c11ddd9f.js";import"./Paragraph.1cbc8077.js";import"./Base.d0d329e2.js";import"./Modal.e18542c5.js";import"./index.2570caf9.js";import"./Title.f988141d.js";import"./Text.e6c27a3b.js";import"./index.f056a823.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]="a8d1b8b8-53b1-40f6-86ad-0fbf236b5498",o._sentryDebugIdIdentifier="sentry-dbid-a8d1b8b8-53b1-40f6-86ad-0fbf236b5498")}catch{}})();const Q=y({__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:l,refetch:d}=x(()=>i.list(c)),u=g(()=>{var e,t;return{columns:[{name:"Name"},{name:"Type"},{name:"",align:"right"}],rows:(t=(e=l.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:b}){a.push({name:"connectorEditor",params:{connectorId:b}})}},{icon:I,label:"Delete",dangerous:!0,async onClick(){await n.delete(),d()}}]}]})))!=null?t:[]}});return(e,t)=>(_(),h(E,{"entity-name":"connector",loading:w(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.cee7710b.js.map
