import{d as f,eA as b,eI as C,H as g,b as _,c as I,u as h,eP as w}from"./outputWidgets.8f35e76b.js";import{b as k}from"./index.fb4a4209.js";import"./router.eb6cf81e.js";import{C as i}from"./connector.4c0aa150.js";import{a as x}from"./asyncComputed.b2c7682e.js";import{G as E}from"./PhPencil.vue.a25e7075.js";import{C as D}from"./CrudView.4b14d77c.js";import"./index.cf4c23b9.js";import"./record.56272af3.js";import"./pubsub.aac2ae7d.js";import"./Form.357810f8.js";import"./hasIn.38270313.js";import"./popupNotifcation.20f659d9.js";import"./Paragraph.5b35e944.js";import"./Text.cb1b4ad4.js";import"./Modal.3cec70ce.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.7378a41f.js";import"./BookOutlined.b79ac83a.js";import"./url.99f1e379.js";import"./index.30032ec4.js";import"./Title.984d5105.js";import"./index.1d88a799.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]="b19fe295-9c3a-4040-8cb6-0ee7e0152588",o._sentryDebugIdIdentifier="sentry-dbid-b19fe295-9c3a-4040-8cb6-0ee7e0152588")}catch{}})();const S=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:w,label:"Delete",dangerous:!0,async onClick(){await n.delete(),d()}}]}]})))!=null?t:[]}});return(e,t)=>(_(),I(D,{"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{S as default};
//# sourceMappingURL=Connectors.2cf9ee7f.js.map
