import{d as f,eG as b,eM as C,y as g,b as _,c as h,u as w,eS as I}from"./outputWidgets.52571dac.js";import{b as k}from"./index.803d0576.js";import"./gateway.9b472f57.js";import{C as i}from"./connector.61dd6894.js";import{a as x}from"./asyncComputed.2a2a1288.js";import{G as E}from"./PhPencil.vue.0fcd0798.js";import{C as D}from"./CrudView.6cb8ad38.js";import"./record.2a93f29c.js";import"./pubsub.be7004e9.js";import"./popupNotifcation.e85fac74.js";import"./router.0ae1ef4a.js";import"./Form.9e43a28b.js";import"./hasIn.f1c353ba.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.a5567333.js";import"./BookOutlined.7e4ac738.js";import"./url.5cc70021.js";import"./Paragraph.7aa2ce32.js";import"./Base.e64db743.js";import"./Modal.514213ca.js";import"./index.89edc4ba.js";import"./Title.8fbc2e7d.js";import"./Text.0586c869.js";import"./index.f3e1df2a.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]="c1f5a225-62f4-4ead-8699-70ca609c79dc",o._sentryDebugIdIdentifier="sentry-dbid-c1f5a225-62f4-4ead-8699-70ca609c79dc")}catch{}})();const U=f({__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: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:E,label:"Edit",onClick({key:y}){a.push({name:"connectorEditor",params:{connectorId:y}})}},{icon:I,label:"Delete",dangerous:!0,async onClick(){await n.delete(),d()}}]}]})))!=null?t:[]}});return(e,t)=>(_(),h(D,{"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{U as default};
//# sourceMappingURL=Connectors.8f262d19.js.map
