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/StorageVolumeCreate-c0d80d32.js
import{e as j,d as a,i as v,r as m,G as u,m as b,j as e,bd as h,B as x,b as C,be as N,q as l}from"./index-3c1b2661.js";import{c as q,a as F,u as V}from"./index.esm-7989c879.js";import{S as k}from"./updateMaxHeight-4e644a5f.js";import{c as B,v as R}from"./StorageVolumeForm-754dcb6d.js";import{M as $}from"./StorageVolumeFormMenu-3787a809.js";import"./ConfigurationTable-5663621c.js";import"./ConfigFieldDescription-f8ae8325.js";import"./DiskSizeSelector-f5c6feab.js";import"./FormMenuItem-c982b037.js";const A=()=>{const r=j(),i=a.useNotify(),n=v(),[c,d]=m.useState(u($)),p=m.useState(null),{project:t}=b();if(!t)return e.jsx(e.Fragment,{children:"Missing project"});const g=q().shape({name:F().test(...h(t,"custom",p)).required("This field is required")}),s=V({initialValues:{content_type:"filesystem",type:"custom",name:"",project:t,pool:"",size:"GiB",isReadOnly:!1,isCreating:!0},validationSchema:g,onSubmit:o=>{const S=R(o,t);N(o.pool,t,S).then(()=>{n.invalidateQueries({queryKey:[l.storage]}),n.invalidateQueries({queryKey:[l.projects,t]}),r(`/ui/project/${t}/storage/volumes`,i.queue(i.success(`Storage volume ${o.name} created.`)))}).catch(y=>{s.setSubmitting(!1),i.failure("Storage volume creation failed",y)})}}),f=()=>{s.submitForm()};return e.jsxs(x,{title:"Create volume",contentClassName:"storage-volume-form",children:[e.jsx(C,{}),e.jsx(B,{formik:s,section:c,setSection:o=>d(u(o))}),e.jsxs("div",{className:"l-footer--sticky p-bottom-controls",children:[e.jsx("hr",{}),e.jsx(a.Row,{className:"u-align--right",children:e.jsxs(a.Col,{size:12,children:[e.jsx(a.Button,{appearance:"base",onClick:()=>r(`/ui/project/${t}/storage/volumes`),children:"Cancel"}),e.jsx(k,{isSubmitting:s.isSubmitting,isDisabled:!s.isValid,onClick:f,buttonLabel:"Create"})]})})]})]})};export{A as default};