Submit
Path:
~
/
/
snap
/
lxd
/
31333
/
share
/
lxd-ui
/
assets
/
File Content:
StorageVolumeDetail-513f1051.js
import{e as x,d as o,r as y,bd as z,bv as V,j as e,c as F,bw as $,A as C,bx as R,bc as k,W as v,by as q,i as L,m as u,bz as T,q as p,G as f,f as w,L as D,b as O,ap as M,bA as E}from"./index-13b2882d.js";import{R as B}from"./RenameHeader-c74d9adb.js";import{c as b,a as S,u as N}from"./index.esm-82c30f37.js";import{S as I}from"./StorageUsedBy-2e98cb1b.js";import{u as U,S as A}from"./updateMaxHeight-325b3cd4.js";import{v as G,c as H}from"./StorageVolumeForm-228515f8.js";import{M as j}from"./StorageVolumeFormMenu-e90b9f5c.js";import"./ConfigurationTable-1a9d4d6f.js";import"./ConfigFieldDescription-00c1a193.js";import"./DiskSizeSelector-dd5e138a.js";import"./FormMenuItem-c8a1a121.js";const K=({volume:s,project:t})=>{var a;const i=x(),n=o.useNotify(),l=y.useState(null),c=b().shape({name:S().test(...z(t,s.type,l,s.name)).required("This field is required")}),r=N({initialValues:{name:s.name,isRenaming:!1,pool:s.pool},validationSchema:c,onSubmit:d=>{if(s.name===d.name){r.setFieldValue("isRenaming",!1),r.setSubmitting(!1);return}V(t,s,d.name).then(()=>{i(`/ui/project/${t}/storage/detail/${s.pool}/${s.type}/${d.name}`,n.queue(n.success("Storage volume renamed."))),r.setFieldValue("isRenaming",!1)}).catch(h=>{n.failure("Renaming failed",h)}).finally(()=>{r.setSubmitting(!1)})}});return e.jsx(B,{name:s.name,parentItems:[e.jsx(F,{to:`/ui/project/${t}/storage/volumes`,children:"Storage volumes"},1)],controls:e.jsx($,{label:"Delete volume",volume:s,project:t,appearance:"",hasIcon:!1,onFinish:()=>{i(`/ui/project/${t}/storage/volumes`,n.queue(n.success(`Storage volume ${s.name} deleted.`)))}}),isLoaded:!0,formik:r,renameDisabledReason:(((a=s.used_by)==null?void 0:a.length)??0)>0?"Can not rename, volume is currently in use.":void 0})},Q=({project:s,volume:t})=>{var n;const i=()=>{U("storage-overview-tab")};return y.useEffect(i,[t]),C("resize",i),e.jsxs("div",{className:"storage-overview-tab",children:[e.jsxs(o.Row,{className:"section",children:[e.jsx(o.Col,{size:3,children:e.jsx("h2",{className:"p-heading--5",children:"General"})}),e.jsx(o.Col,{size:7,children:e.jsx("table",{children:e.jsxs("tbody",{children:[e.jsxs("tr",{children:[e.jsx("th",{className:"p-muted-heading",children:"Name"}),e.jsx("td",{children:t.name})]}),e.jsxs("tr",{children:[e.jsx("th",{className:"p-muted-heading",children:"Type"}),e.jsx("td",{children:R(t)})]}),e.jsxs("tr",{children:[e.jsx("th",{className:"p-muted-heading",children:"Content type"}),e.jsx("td",{children:k(t)})]}),e.jsxs("tr",{children:[e.jsx("th",{className:"p-muted-heading",children:"Description"}),e.jsx("td",{children:t.description?t.description:"-"})]}),e.jsxs("tr",{children:[e.jsx("th",{className:"p-muted-heading",children:"Location"}),e.jsx("td",{children:t.location})]}),e.jsxs("tr",{children:[e.jsx("th",{className:"p-muted-heading",children:"Date created"}),e.jsx("td",{children:v(t.created_at)})]}),e.jsxs("tr",{children:[e.jsx("th",{className:"p-muted-heading",children:"Size"}),e.jsx("td",{children:e.jsx(q,{volume:t})})]}),e.jsxs("tr",{children:[e.jsx("th",{className:"p-muted-heading",children:"Custom config"}),e.jsx("td",{children:Object.entries(t.config).length===0?"-":e.jsx("table",{children:e.jsx("tbody",{children:Object.entries(t.config).map(([l,c],r)=>e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:l}),e.jsx("td",{children:c})]},r))})})})]})]})})})]}),e.jsxs(o.Row,{className:"section",children:[e.jsx(o.Col,{size:3,children:e.jsxs("h2",{className:"p-heading--5",children:["Used by (",((n=t.used_by)==null?void 0:n.length)??0,")"]})}),e.jsx(o.Col,{size:7,children:e.jsx(I,{storage:t,project:s})})]})]})},g=s=>({name:s.name,project:s.project,pool:s.pool,size:s.config.size??"GiB",content_type:s.content_type,type:s.type,security_shifted:s.config["security.shifted"],security_unmapped:s.config["security.unmapped"],snapshots_expiry:s.config["snapshots.expiry"],snapshots_pattern:s.config["snapshots.pattern"],snapshots_schedule:s.config["snapshots.schedule"],block_filesystem:s.config["block.filesystem"],block_mount_options:s.config["block.mount_options"],zfs_blocksize:s.config["zfs.blocksize"],zfs_block_mode:s.config["zfs.block_mode"],zfs_delegate:s.config["zfs.delegate"],zfs_remove_snapshots:s.config["zfs.remove_snapshots"],zfs_use_refquota:s.config["zfs.use_refquota"],zfs_reserve_space:s.config["zfs.reserve_space"],isReadOnly:!0,isCreating:!1}),P=({volume:s})=>{const t=x(),i=o.useNotify(),n=L(),{activeSection:l}=u(),{project:c}=u();if(!c)return e.jsx(e.Fragment,{children:"Missing project"});const r=b().shape({name:S().required("This field is required")}),a=N({initialValues:g(s),validationSchema:r,onSubmit:h=>{const m=G(h,c);T(h.pool,c,{...m,etag:s.etag}).then(()=>{a.setValues(g(m)),n.invalidateQueries({queryKey:[p.storage]}),n.invalidateQueries({queryKey:[p.storage,s.pool,c,m.type,m.name]}),i.success("Storage volume updated.")}).catch(_=>{i.failure("Storage volume update failed",_)}).finally(()=>a.setSubmitting(!1))}}),d=h=>{const m=`/ui/project/${c}/storage/detail/${s.pool}/${s.type}/${s.name}/configuration`;t(h===j?m:`${m}/${f(h)}`)};return e.jsxs("div",{className:"storage-volume-form",children:[e.jsx(H,{formik:a,section:l??f(j),setSection:d}),e.jsxs("div",{className:"l-footer--sticky p-bottom-controls",children:[e.jsx("hr",{}),e.jsx(o.Row,{className:"u-align--right",children:e.jsx(o.Col,{size:12,children:a.values.isReadOnly?e.jsx(o.Button,{appearance:"positive",onClick:()=>void a.setFieldValue("isReadOnly",!1),children:"Edit volume"}):e.jsxs(e.Fragment,{children:[e.jsx(o.Button,{appearance:"base",onClick:()=>a.setValues(g(s)),children:"Cancel"}),e.jsx(A,{isSubmitting:a.isSubmitting,isDisabled:!a.isValid||!a.values.name,buttonLabel:"Save changes",onClick:()=>void a.submitForm()})]})})})]})]})},W=["Overview","Configuration"],oe=()=>{const s=o.useNotify(),{pool:t,project:i,activeTab:n,type:l,volume:c}=u();if(!t)return e.jsx(e.Fragment,{children:"Missing storage pool"});if(!i)return e.jsx(e.Fragment,{children:"Missing project"});if(!l)return e.jsx(e.Fragment,{children:"Missing type"});if(!c)return e.jsx(e.Fragment,{children:"Missing volume"});const{data:r,error:a,isLoading:d}=w({queryKey:[p.storage,t,i,l,c],queryFn:()=>E(t,i,l,c)});return a&&s.failure("Loading storage volume failed",a),d?e.jsx(D,{text:"Loading storage volume..."}):r?e.jsx("main",{className:"l-main",children:e.jsxs("div",{className:"p-panel",children:[e.jsx(K,{volume:r,project:i}),e.jsxs("div",{className:"p-panel__content storage-volume-form",children:[e.jsx(O,{}),e.jsxs(o.Row,{children:[e.jsx(M,{tabs:W,activeTab:n,tabUrl:`/ui/project/${i}/storage/detail/${t}/${l}/${r.name}`}),!n&&e.jsx("div",{role:"tabpanel","aria-labelledby":"overview",children:e.jsx(Q,{volume:r,project:i})}),n==="configuration"&&e.jsx("div",{role:"tabpanel","aria-labelledby":"configuration",children:e.jsx(P,{volume:r})})]})]})]})}):e.jsx(e.Fragment,{children:"Loading storage volume failed"})};export{oe as default};
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