import{d as f,Z as y,a0 as b,J as v,o as _,c as g,w as r,eP as k,b as i,u as s,bG as w,ar as d}from"./vue-router.6b399b0b.js";import{E as l,W as C}from"./workspaces.77c090b1.js";import{C as x}from"./ContentLayout.a837d946.js";import{C as h}from"./CrudView.30543074.js";import{A as E}from"./index.80a69b0e.js";import"./asyncComputed.c7982027.js";import"./runnerData.3191407d.js";import"./url.2f4a4260.js";import"./record.f5201a57.js";import"./router.ab3f179a.js";import"./gateway.34f2a318.js";import"./popupNotifcation.17b9c327.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.e21048fc.js";import"./BookOutlined.7993dbf1.js";import"./index.57cdc892.js";import"./index.2e72b67b.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},o=new Error().stack;o&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[o]="9a637e8f-e54f-4dfb-8a54-003e351b4cf5",a._sentryDebugIdIdentifier="sentry-dbid-9a637e8f-e54f-4dfb-8a54-003e351b4cf5")}catch{}})();const P=f({__name:"EnvVarsEditor",setup(a){let o=null;y(()=>{o=setInterval(l.listComputed.refetch,2e3)}),b(()=>{o&&clearInterval(o)});function u(){var e;(e=C.computed.result.value)==null||e.openFile(".env")}const m=[{label:"Variable name",key:"key"},{label:"Variable value",key:"value",type:"multiline-text"}],p=v(()=>{var e,t;return{columns:[{name:"Key"},{name:"Value"},{name:""}],rows:(t=(e=l.listComputed.result.value)==null?void 0:e.map(n=>({key:n.key,cells:[{type:"text",text:n.key},{text:n.value,type:"secret"},{type:"actions",actions:[{icon:k,label:"Delete",onClick:()=>n.delete(),dangerous:!0}]}]})))!=null?t:[]}});async function c({key:e,value:t}){await l.create(e,t)}return(e,t)=>(_(),g(x,null,{default:r(()=>[i(h,{"entity-name":"Env var",loading:s(l).listComputed.loading.value,title:"Environment Variables",description:"Set environment variables for your project.","empty-title":"No environment variables set",table:p.value,"create-button-text":"Add Environment Variable",fields:m,live:"",onCreate:c},{secondary:r(()=>[i(s(w),{onClick:t[0]||(t[0]=n=>u())},{default:r(()=>[d("Open .env")]),_:1})]),extra:r(()=>[i(s(E),{"show-icon":"",style:{"margin-top":"20px"}},{message:r(()=>[d(" This is simply a helper to manage your environment variables locally. The variables set here will not be deployed to Cloud with your project. ")]),_:1})]),_:1},8,["loading","table"])]),_:1}))}});export{P as default};
//# sourceMappingURL=EnvVarsEditor.1ad496b8.js.map
