1import{u as E,r as u,R as e,H as y,c}from"./app-7KgZdLvB.js";import{L as h}from"./Layout-DMoSPRoj.js";import{T as s}from"./TextInput-CvwkqlLT.js";import{L as x}from"./LoadingButton-BboAabvL.js";import"./index-BvCrh6qf.js";import"./Button-evrIg-lJ.js";const S=()=>{const{site:l,daemon:t,errors:a}=E().props,[d,o]=u.useState(!1),[n,i]=u.useState({name:t?t.name:null,command:t?t.command:null,directory:t?t.directory:l.directoryPath+"/current",username:t?t.username:l.slug,processes:t?t.processes:"1"});function m(r){const f=r.target.name,b=r.target.value;i(g=>({...g,[f]:b}))}function p(r){r.preventDefault(),o(!0),t?c.put(route("sites.daemons.update",{site:l.uuid,daemon:t.uuid}),n).then(()=>o(!1)):c.post(route("sites.daemons.store",{site:l.uuid}),n).then(()=>o(!1))}return e.createElement(e.Fragment,null,e.createElement(y,null,e.createElement("title",null,`${n.name} - Daemons - ${l.name} [${l.environment}]`)),e.createElement(h,null,e.createElement("h1",{className:"mb-8 font-bold text-3xl"},t?"Update Daemon":"Create Daemon"),e.createElement("div",{className:"bg-white rounded border-2 max-w-3xl"},e.createElement("form",{onSubmit:p},e.createElement("div",{className:"p-8 -mr-6 -mb-8 flex flex-wrap"},e.createElement(s,{className:"pr-6 pb-8 w-full",label:"Name",name:"name",errors:a==null?void 0:a.name,defaultValue:n.name,onChange:m}),e.createElement(s,{className:"pr-6 pb-8 w-full",label:"Command",name:"command",errors:a==null?void 0:a.command,defaultValue:n.command,onChange:m}),e.createElement(s,{className:"pr-6 pb-8 w-full",label:"Directory",name:"directory",errors:a==null?void 0:a.directory,defaultValue:n.directory,onChange:m}),e.createElement(s,{className:"pr-6 pb-8 w-full",label:"Username",name:"username",errors:a==null?void 0:a.username,defaultValue:n.username,onChange:m}),e.createElement(s,{className:"pr-6 pb-8 w-full",label:"Processes",name:"processes",errors:a==null?void 0:a.processes,defaultValue:n.processes,onChange:m})),e.createElement("div",{className:"px-8 py-4 bg-gray-50 border-t border-gray-200 flex justify-end items-center"},e.createElement(x,{loading:d,type:"submit"},t?"Update Daemon":"Create Daemon"))))))};export{S as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.