Submit
Path:
~
/
/
snap
/
lxd
/
current
/
share
/
lxd-ui
/
assets
/
File Content:
StorageVolumeForm-228515f8.js
import{r as _,j as s,d as a,f as x,q as f,ba as j,L as V,bu as w,bC as q,aI as h,l as I,m as R,A as E,G as y,bD as o}from"./index-13b2882d.js";import{u as L}from"./updateMaxHeight-325b3cd4.js";import{S as Z,M,a as N,F as O,Z as T}from"./StorageVolumeFormMenu-e90b9f5c.js";import{g as P,C as g}from"./ConfigurationTable-1a9d4d6f.js";import{D as A}from"./DiskSizeSelector-dd5e138a.js";const D=[{label:"minute",value:"* * * * *"},{label:"hour",value:"@hourly"},{label:"day",value:"@daily"},{label:"week",value:"@weekly"},{label:"month",value:"@monthly"},{label:"year",value:"@yearly"}],B=({value:e,setValue:t})=>{const[l,r]=_.useState(!(e!=null&&e.startsWith("@")));return s.jsxs("div",{children:[s.jsxs("div",{className:"snapshot-schedule",children:[s.jsx(a.RadioInput,{label:"Cron syntax",checked:l,onChange:()=>{r(!0),t("")}}),s.jsx(a.RadioInput,{label:"Choose interval",checked:!l,onChange:()=>{r(!1),t("@daily")}})]}),l?s.jsx(a.Input,{id:"snapshots_schedule",name:"snapshots_schedule",label:"Cron expression",placeholder:"Enter cron expression",help:"<minute> <hour> <dom> <month> <dow>, a comma-separated list of schedule aliases (@hourly, @daily, @midnight, @weekly, @monthly, @annually, @yearly), or empty to disable automatic snapshots (the default)",type:"text",value:e,onChange:u=>t(u.target.value)}):s.jsx(a.Select,{id:"snapshots_schedule",name:"snapshots_schedule",label:"Every",value:e,onChange:u=>t(u.target.value),options:D})]})},K=({project:e,value:t,setValue:l,selectProps:r})=>{const u=a.useNotify(),{data:d=[],error:c,isLoading:m}=x({queryKey:[f.storage],queryFn:()=>j(e)});if(_.useEffect(()=>{!t&&d.length>0&&l(d[0].name)},[t,d]),m)return s.jsx(V,{text:"Loading storage pools..."});c&&u.failure("Loading storage pools failed",c);const b=()=>{const i=d.map(p=>({label:p.name,value:p.name,disabled:!1}));return i.unshift({label:d.length===0?"No storage pool available":"Select option",value:"",disabled:!0}),i};return s.jsx(a.Select,{id:"storage-pool-selector",name:"pool",options:b(),onChange:i=>l(i.target.value),value:t,...r})},n=({formik:e,name:t,label:l,children:r,defaultValue:u,disabled:d=!1,disabledReason:c,help:m})=>{const i=e.values[t],p=i!==void 0,{data:v}=x({queryKey:[f.storage,e.values.pool,e.values.project],queryFn:()=>w(e.values.pool,e.values.project),enabled:e.values.isCreating}),[F,z]=q(t,v),C=e.values.isReadOnly;return P({formik:e,name:t,label:l,children:r,defaultValue:u,disabled:d,disabledReason:c,help:m,isOverridden:p,inheritedValue:F,inheritSource:z,isReadOnly:C,value:i,overrideValue:i===""?"-":i})},H=({formik:e,project:t})=>s.jsxs(s.Fragment,{children:[s.jsx(a.Row,{children:s.jsxs(a.Col,{size:8,children:[e.values.isCreating&&s.jsxs(s.Fragment,{children:[s.jsx(a.Label,{forId:"storage-pool-selector",required:!0,children:"Storage pool"}),s.jsx(K,{project:t,value:e.values.pool,setValue:l=>void e.setFieldValue("pool",l)})]}),s.jsx(a.Input,{...S(e,"name"),type:"text",label:"Name",disabled:e.values.isReadOnly||!e.values.isCreating,required:e.values.isCreating,help:e.values.isCreating?void 0:"Click the name in the header to rename the volume"}),s.jsx(A,{label:"Size",value:e.values.size,help:e.values.type==="custom"?"Size of storage volume. If empty, volume will not have a size limit within its storage pool.":"Size is immutable for non-custom volumes.",setMemoryLimit:l=>void e.setFieldValue("size",l),disabled:e.values.isReadOnly||e.values.type!=="custom"}),s.jsx(a.Select,{...S(e,"content_type"),options:[{label:"filesystem",value:"filesystem"},{label:"block",value:"block"}],label:"Content type",help:e.values.isCreating?"Type filesystem is ready to mount and write files to. Type block can only be attached to VMs, and is treated like an empty block device.":"Content type is immutable after creation.",onChange:l=>{l.target.value==="block"&&(e.setFieldValue("block_filesystem",void 0),e.setFieldValue("block_mount_options",void 0),e.setFieldValue("security_shifted",void 0),e.setFieldValue("security_unmapped",void 0)),e.setFieldValue("content_type",l.target.value)},disabled:e.values.isReadOnly||!e.values.isCreating})]})}),e.values.content_type==="filesystem"&&s.jsx(g,{rows:[n({formik:e,label:"Security shifted",name:"security_shifted",defaultValue:"",help:"Enable id shifting overlay (allows attach to multiple isolated instances)",disabled:e.values.security_unmapped==="true",disabledReason:"This setting can't be changed while security unmapped is set to true",children:s.jsx(a.Select,{options:h})}),n({formik:e,label:"Security unmapped",name:"security_unmapped",defaultValue:"",help:"Disable id mapping for the volume",disabled:e.values.security_shifted==="true",disabledReason:"This setting can't be changed while security shifted is set to true",children:s.jsx(a.Select,{options:h})})]})]}),U=({formik:e})=>{const t=I();return s.jsx(g,{rows:[n({formik:e,label:"Snapshot name pattern",name:"snapshots_pattern",defaultValue:"",children:s.jsx(a.Input,{placeholder:"Enter name pattern",help:s.jsxs(s.Fragment,{children:["Pongo2 template string that represents the snapshot name (used for scheduled snapshots and unnamed snapshots), see"," ",s.jsx("a",{href:`${t}/reference/instance_options/#instance-options-snapshots-names`,target:"_blank",rel:"noreferrer",children:"Automatic snapshot names"})]}),type:"text"})}),n({formik:e,label:"Expire after",name:"snapshots_expiry",help:"Controls when snapshots are to be deleted",defaultValue:"",children:s.jsx(a.Input,{placeholder:"Enter expiry expression",type:"text",help:"Expects an expression like 1M 2H 3d 4w 5m 6y"})}),n({formik:e,label:"Schedule",name:"snapshots_schedule",defaultValue:"",children:s.jsx(B,{value:e.values.snapshots_schedule,setValue:l=>void e.setFieldValue("snapshots_schedule",l)})})]})},G=({formik:e})=>s.jsx(g,{rows:[n({formik:e,label:"Block filesystem",name:"block_filesystem",defaultValue:"",help:"Filesystem of the storage volume",children:s.jsx(a.Select,{options:[{label:"auto",value:""},{label:"btrfs",value:"btrfs"},{label:"ext4",value:"ext4"},{label:"xfs",value:"xfs"}]})}),n({formik:e,label:"Block mount options",name:"block_mount_options",defaultValue:"",help:"Mount options for block devices",children:s.jsx(a.Input,{type:"text",help:s.jsxs(s.Fragment,{children:["For a list of available options visit"," ",s.jsx("a",{target:"_blank",rel:"noreferrer",href:"https://manpages.ubuntu.com/manpages/jammy/en/man8/mount.8.html#filesystem-independent%20mount%20options",children:"mount manpages"})]})})})]}),W=({formik:e})=>s.jsx(g,{rows:[n({formik:e,label:"ZFS blocksize",name:"zfs_blocksize",defaultValue:"",help:"Size of the ZFS blocks",children:s.jsx(a.Select,{options:[{label:"default",value:""},{label:"512",value:"512"},{label:"1024",value:"1024"},{label:"2048",value:"2048"},{label:"4096",value:"4096"},{label:"8192",value:"8192"},{label:"16384",value:"16384"}]})}),n({formik:e,label:"ZFS block mode",name:"zfs_block_mode",defaultValue:"",help:"Whether to use a formatted zvol rather than a dataset (zfs.block_mode can be set only for custom storage volumes; use volume.zfs.block_mode to enable ZFS block mode for all storage volumes in the pool, including instance volumes)",children:s.jsx(a.Select,{options:h})}),n({formik:e,label:"ZFS delegate",name:"zfs_delegate",defaultValue:"",help:"Controls whether to delegate the ZFS dataset and anything underneath it to the container(s) using it. Allows the use of the zfs command in the container.",children:s.jsx(a.Select,{options:h})}),n({formik:e,label:"ZFS remove snapshots",name:"zfs_remove_snapshots",defaultValue:"",help:"Remove snapshots as needed",children:s.jsx(a.Select,{options:h})}),n({formik:e,label:"ZFS use refquota",name:"zfs_use_refquota",defaultValue:"",help:"Use refquota instead of quota for space",children:s.jsx(a.Select,{options:h})}),n({formik:e,label:"ZFS reserve space",name:"zfs_reserve_space",defaultValue:"",help:"Use reservation/refreservation along with quota/refquota",children:s.jsx(a.Select,{options:h})})]}),ee=(e,t)=>{var r;const l=(r=e.size)==null?void 0:r.match(/^\d/);return{name:e.name,config:{size:l?e.size:void 0,[o("security_shifted")]:e.security_shifted,[o("security_unmapped")]:e.security_unmapped,[o("snapshots_expiry")]:e.snapshots_expiry,[o("snapshots_pattern")]:e.snapshots_pattern,[o("snapshots_schedule")]:e.snapshots_schedule,[o("block_filesystem")]:e.block_filesystem,[o("block_mount_options")]:e.block_mount_options,[o("zfs_blocksize")]:e.zfs_blocksize,[o("zfs_block_mode")]:e.zfs_block_mode,[o("zfs_delegate")]:e.zfs_delegate,[o("zfs_remove_snapshots")]:e.zfs_remove_snapshots,[o("zfs_use_refquota")]:e.zfs_use_refquota,[o("zfs_reserve_space")]:e.zfs_reserve_space},project:t,type:e.type,content_type:e.content_type,description:"",location:"",created_at:"",pool:e.pool}},S=(e,t)=>({id:t,name:t,onBlur:e.handleBlur,onChange:e.handleChange,value:e.values[t]??"",error:e.touched[t]?e.errors[t]:null,stacked:!0,placeholder:`Enter ${t.replaceAll("_"," ")}`}),se=({formik:e,section:t,setSection:l})=>{var i,p;const r=a.useNotify(),{project:u}=R();if(!u)return s.jsx(s.Fragment,{children:"Missing project"});const{data:d=[],error:c}=x({queryKey:[f.storage],queryFn:()=>j(u)});c&&r.failure("Loading storage pools failed",c);const m=()=>{L("form","p-bottom-controls")};_.useEffect(m,[(i=r.notification)==null?void 0:i.message]),E("resize",m);const b=((p=d.find(v=>v.name===e.values.pool))==null?void 0:p.driver)??"";return s.jsxs(a.Form,{onSubmit:e.handleSubmit,stacked:!0,className:"form",children:[s.jsx(a.Input,{type:"submit",hidden:!0}),s.jsx(Z,{active:t,setActive:l,formik:e,poolDriver:b,contentType:e.values.content_type,isCreating:e.values.isCreating}),s.jsx(a.Row,{className:"form-contents",children:s.jsxs(a.Col,{size:12,children:[t===y(M)&&s.jsx(H,{formik:e,project:u}),t===y(N)&&s.jsx(U,{formik:e}),t===y(O)&&s.jsx(G,{formik:e}),t===y(T)&&s.jsx(W,{formik:e})]})})]})};export{B as S,K as a,H as b,se as c,ee as v};
Submit
FILE
FOLDER
INFO
Name
Size
Permission
Action
data
---
0755
img
---
0755
AutoExpandingTextArea-3a779a81.js
352 bytes
0644
CancelOperationBtn-5e4a9f41.js
1454 bytes
0644
CertificateAdd-5762bbdd.js
2423 bytes
0644
CertificateGenerate-67a1d99d.js
9813 bytes
0644
ClusterGroupForm-f258bb5e.js
3146 bytes
0644
ClusterList-13b65a6c.js
4834 bytes
0644
ConfigFieldDescription-00c1a193.js
3588 bytes
0644
ConfigurationTable-1a9d4d6f.js
2213 bytes
0644
CreateClusterGroup-3b03283b.js
329 bytes
0644
CreateInstance-2dc2e316.js
15924 bytes
0644
CreateNetwork-9059effd.js
2293 bytes
0644
CreateProfile-fa64def5.js
3354 bytes
0644
CreateProject-3768bb7f.js
1942 bytes
0644
CreateStoragePool-e2d089cb.js
1809 bytes
0644
DiskSizeSelector-dd5e138a.js
1843 bytes
0644
EditClusterGroup-08d77b61.js
622 bytes
0644
FormMenuItem-c8a1a121.js
504 bytes
0644
Images-40cc8e59.js
4475 bytes
0644
InstanceDetail-ee6a9c3e.js
497285 bytes
0644
InstanceFormMenu-dff7cf6c.js
1710 bytes
0644
InstanceList-23508fa8.js
15982 bytes
0644
Login-a15594e3.js
1504 bytes
0644
NetworkDetail-c85f81d1.js
10357 bytes
0644
NetworkDevicesForm-bcf4be77.js
28882 bytes
0644
NetworkForm-ffe61c80.js
11091 bytes
0644
NetworkList-45862bf6.js
2938 bytes
0644
NetworkMap-30a0e19e.js
393598 bytes
0644
OperationList-b576a26c.js
3103 bytes
0644
ProfileDetail-1a7135fe.js
9972 bytes
0644
ProfileDetailsForm-809e7c02.js
856 bytes
0644
ProfileFormMenu-3458e77a.js
1542 bytes
0644
ProfileList-3777bd96.js
3396 bytes
0644
ProfileSelector-b579b8c7.js
1770 bytes
0644
ProjectConfiguration-e5324f11.js
7224 bytes
0644
ProjectForm-55619b78.js
14396 bytes
0644
ProtectedRoute-49eddddb.js
209 bytes
0644
RenameHeader-c74d9adb.js
1641 bytes
0644
SelectableMainTable-5a3f3fef.js
1514 bytes
0644
Settings-2fc8ab81.js
6119 bytes
0644
StoragePoolDetail-5cad7e82.js
5661 bytes
0644
StorageUsedBy-2e98cb1b.js
2208 bytes
0644
StorageVolumeCreate-76138e07.js
1794 bytes
0644
StorageVolumeDetail-513f1051.js
6918 bytes
0644
StorageVolumeForm-228515f8.js
9860 bytes
0644
StorageVolumeFormMenu-e90b9f5c.js
1378 bytes
0644
WarningList-74e9b259.js
1899 bytes
0644
certificate-3aff5cf1.js
283833 bytes
0644
clusterGroups-3fc1789d.js
3402 bytes
0644
formFields-fc140429.js
4724 bytes
0644
images-2ea813f2.js
702 bytes
0644
index-13b2882d.js
600882 bytes
0644
index-205b9caf.css
493180 bytes
0644
index.esm-82c30f37.js
70743 bytes
0644
instanceConfigInheritance-fbf987f8.js
1414 bytes
0644
instanceDelete-e714bd59.js
1559 bytes
0644
instanceEdit-cf20bafe.js
5416 bytes
0644
instanceValidation-26160179.css
52045 bytes
0644
instanceValidation-45cfba9a.js
2195634 bytes
0644
networks-5caac489.js
1747 bytes
0644
operations-beb03b33.js
433 bytes
0644
settings-c23f9009.js
183 bytes
0644
updateMaxHeight-325b3cd4.js
861 bytes
0644
useClusterMembers-dbf45674.js
3396 bytes
0644
N4ST4R_ID | Naxtarrr