HEX
Server: Apache
System: Linux vps-cdc32557.vps.ovh.ca 5.15.0-156-generic #166-Ubuntu SMP Sat Aug 9 00:02:46 UTC 2025 x86_64
User: hanode (1017)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: //snap/lxd/35819/share/lxd-ui/assets/CreateProject-e3aa3033.js
import{e as y,d as i,i as h,r as o,z as P,A as S,j as e,B as x,K as b,q as g}from"./index-3c1b2661.js";import{c as C,a as R,u as E}from"./index.esm-7989c879.js";import{S as N,u as k}from"./updateMaxHeight-4e644a5f.js";import{P as q,a as D,c as L,i as B,d as F,n as $,p as w,b as z,r as A}from"./ProjectForm-420f46d7.js";import"./FormMenuItem-c982b037.js";import"./formFields-e7157cb4.js";import"./instanceConfigInheritance-8da60590.js";import"./ConfigurationTable-5663621c.js";import"./ConfigFieldDescription-f8ae8325.js";import"./AutoExpandingTextArea-38ef4775.js";import"./DiskSizeSelector-f5c6feab.js";const _=()=>{var m;const r=y(),a=i.useNotify(),l=h(),d=o.useState(null),[c,u]=o.useState(q),p=C().shape({name:R().test("deduplicate","A project with this name already exists",t=>P(t,"",d,"projects")).required()}),n=()=>{k("form-contents","p-bottom-controls")};o.useEffect(n,[(m=a.notification)==null?void 0:m.message,c]),S("resize",n);const s=E({initialValues:{name:"",restricted:!1,readOnly:!1,type:"project"},validationSchema:p,onSubmit:t=>{const j=t.restricted?{...L(t),...B(t),...F(t),...$(t)}:{};b(JSON.stringify({...w(t),config:{...z(t),...A(t),...j}})).then(()=>{r(`/ui/project/${t.name}/instances`,a.queue(a.success(`Project ${t.name} created.`)))}).catch(f=>{s.setSubmitting(!1),a.failure("Project creation failed",f)}).finally(()=>{l.invalidateQueries({queryKey:[g.projects]})})}});return e.jsxs(x,{title:"Create a project",contentClassName:"create-project",children:[e.jsx(D,{formik:s,section:c,updateSection:u,isEdit:!1}),e.jsxs("div",{className:"p-bottom-controls",id:"form-footer",children:[e.jsx("hr",{}),e.jsx(i.Row,{className:"u-align--right",children:e.jsxs(i.Col,{size:12,children:[e.jsx(i.Button,{appearance:"base",onClick:()=>r(-1),children:"Cancel"}),e.jsx(N,{isSubmitting:s.isSubmitting,isDisabled:!s.isValid||!s.values.name,buttonLabel:"Create",onClick:()=>void s.submitForm()})]})})]})]})};export{_ as default};