Linux ip-172-26-2-223 5.4.0-1018-aws #18-Ubuntu SMP Wed Jun 24 01:15:00 UTC 2020 x86_64
Apache
: 172.26.2.223 | : 18.116.239.11
Cant Read [ /etc/named.conf ]
8.1.13
www
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
BLACK DEFEND!
README
+ Create Folder
+ Create File
/
snap /
lxd /
33085 /
share /
lxd-ui /
assets /
[ HOME SHELL ]
Name
Size
Permission
Action
font
[ DIR ]
drwxr-xr-x
img
[ DIR ]
drwxr-xr-x
js
[ DIR ]
drwxr-xr-x
scripts
[ DIR ]
drwxr-xr-x
AutoExpandingTextArea-BXFyAEiG...
151
B
-rw-r--r--
BaseLayout-CiF2D8RH.js
280
B
-rw-r--r--
BulkDeleteButton-B-fvVwh0.js
1.08
KB
-rw-r--r--
CancelOperationBtn-BW2TAzI_.js
1.08
KB
-rw-r--r--
CertificateAdd-BGVwf-VB.js
2.84
KB
-rw-r--r--
CertificateGenerate-bNGS6BFl.j...
9.87
KB
-rw-r--r--
ClusterGroupForm-BiXmM-NU.js
3.25
KB
-rw-r--r--
ClusterList-CZFDB46f.js
5.17
KB
-rw-r--r--
ClusterMemberSelector-B2lzDpCI...
3.71
KB
-rw-r--r--
ClusterSpecificInput-BdiLVA9B....
1.97
KB
-rw-r--r--
ClusterSpecificSelect-DrKUzNev...
2.2
KB
-rw-r--r--
ConfigFieldDescription-BnRkdbo...
335
B
-rw-r--r--
CreateClusterGroup-C6s3qbZf.js
463
B
-rw-r--r--
CreateInstance-BXX4Xa4W.js
27.97
KB
-rw-r--r--
CreateInstanceFromImageBtn-BiE...
527
B
-rw-r--r--
CreateNetwork-BQw2A27w.js
2.88
KB
-rw-r--r--
CreateNetworkForward-BgZF8duA....
1.71
KB
-rw-r--r--
CreateProfile-CCJYKSCK.js
4.04
KB
-rw-r--r--
CreateProject-DTBqJzUb.js
2.83
KB
-rw-r--r--
CreateStoragePool-CuOutvs3.js
2.46
KB
-rw-r--r--
CreateStorageVolume-B0HvyGnH.j...
2.47
KB
-rw-r--r--
CustomIsoList-CQVv4whx.js
5.48
KB
-rw-r--r--
DeleteStoragePoolBtn-BeXLuEnA....
1.62
KB
-rw-r--r--
DeleteStorageVolumeBtn-DIIVYGa...
1.88
KB
-rw-r--r--
DiskSizeSelector-IT5APek6.js
1010
B
-rw-r--r--
EditClusterGroup-DiNIL0Lx.js
761
B
-rw-r--r--
EditNetworkForward-DtcWepYC.js
1.99
KB
-rw-r--r--
ExpandableList-EDeaeb6c.js
323
B
-rw-r--r--
FormEditButton-Cs2eW7Js.js
278
B
-rw-r--r--
FormFooterLayout-B3kcadYt.js
738
B
-rw-r--r--
FormLink-BaU-zsbe.js
879
B
-rw-r--r--
FormMenuItem-ChXfQsFA.js
2.23
MB
-rw-r--r--
FormMenuItem-DyX1CsEw.css
66.66
KB
-rw-r--r--
GroupOrIdentityChangesTable-DQ...
5.11
KB
-rw-r--r--
GroupSelectionActions-Dq47oQd-...
3.18
KB
-rw-r--r--
HelpLink-4LTOsqZO.js
294
B
-rw-r--r--
ImageList-yKBGTFZU.js
11.7
KB
-rw-r--r--
InstanceDetail-BV9hr65t.js
481.49
KB
-rw-r--r--
InstanceDetail-Beg8tuEN.css
3.88
KB
-rw-r--r--
InstanceLinkChip-DfVC8U01.js
4.24
KB
-rw-r--r--
InstanceList-CTEYE5e7.js
24.67
KB
-rw-r--r--
ItemName-DSOx0T0r.js
185
B
-rw-r--r--
Login-CsUYa7ns.js
1.41
KB
-rw-r--r--
Meter-BsdJ73XW.js
487
B
-rw-r--r--
NetworkDetail-RgSS_6Vw.js
12.8
KB
-rw-r--r--
NetworkForwardForm-C18aehvo.js
6.49
KB
-rw-r--r--
NetworkList-B4gWmGGm.js
6.32
KB
-rw-r--r--
NetworkListTable-Ba2LzF-J.js
3.31
KB
-rw-r--r--
NotificationRow-CotZPNAQ.js
157
B
-rw-r--r--
OperationList-D4--05cO.js
3.35
KB
-rw-r--r--
PageHeader-CExPjRLH.js
549
B
-rw-r--r--
PermissionGroups-CkGxgQmn.js
30.89
KB
-rw-r--r--
PermissionIdentities-DDmb7V-C....
12.93
KB
-rw-r--r--
PermissionIdpGroups-yggiVbcG.j...
13.38
KB
-rw-r--r--
ProfileDetail-CQHhNWwW.js
10.94
KB
-rw-r--r--
ProfileDetailsForm-C-rMcUGO.js
2.45
KB
-rw-r--r--
ProfileInstances-DeravO8Q.js
1.46
KB
-rw-r--r--
ProfileList-C7yC3g6E.js
7.11
KB
-rw-r--r--
ProgressBar-CQ2HKUqQ.js
170
B
-rw-r--r--
ProjectConfiguration-rKP8dZtz....
9.04
KB
-rw-r--r--
ProjectForm-GhClr0iv.js
15.12
KB
-rw-r--r--
ProtectedRoute-DYKGChU3.js
214
B
-rw-r--r--
ProxyDeviceForm-B5UDgi1V.js
38.9
KB
-rw-r--r--
RenameHeader-fmgiouA6.js
13.29
KB
-rw-r--r--
ResourceIcon-DZQOrBLA.js
532
B
-rw-r--r--
ResourceLabel-PzB_6v5p.js
317
B
-rw-r--r--
ResourceLink-CS7mH0C3.js
302
B
-rw-r--r--
ScrollableContainer-MJpEXCww.j...
646
B
-rw-r--r--
ScrollableTable-DWT33Lms.js
561
B
-rw-r--r--
SelectableMainTable-C8l8QdDe.j...
2.21
KB
-rw-r--r--
SelectedTableNotification-2DZb...
974
B
-rw-r--r--
Settings-BYi8qROs.js
9.75
KB
-rw-r--r--
SidePanel-DNeaRMst.js
2.84
KB
-rw-r--r--
SnapshotForm-DF9sGEzn.js
1.49
KB
-rw-r--r--
StoragePoolDetail-DT58PBIr.js
6.45
KB
-rw-r--r--
StoragePoolForm-Z62B6Fuh.js
17.07
KB
-rw-r--r--
StoragePoolSelectTable-CXuxJSN...
1.61
KB
-rw-r--r--
StoragePoolSelector-DEvMjaMu.j...
1.48
KB
-rw-r--r--
StoragePoolSize-DyBNKBKy.js
467
B
-rw-r--r--
StoragePools-DK0Gkjq9.js
3.99
KB
-rw-r--r--
StorageUsedBy-sdKGRlgM.js
2.12
KB
-rw-r--r--
StorageVolumeDetail-fQzbPWNW.j...
24.87
KB
-rw-r--r--
StorageVolumeForm-ZPfwK39D.js
8.42
KB
-rw-r--r--
StorageVolumes-DPotlIN6.js
7.26
KB
-rw-r--r--
StorageVolumesFilter-B7pR3OeF....
1.01
KB
-rw-r--r--
TabLinks-BIG_Rdvk.js
360
B
-rw-r--r--
UploadCustomIso-DG12FhN0.js
2.83
KB
-rw-r--r--
UsedByItem-VHA3kVFG.js
945
B
-rw-r--r--
VolumeAddSnapshotBtn-8Qz9xFE-....
4.87
KB
-rw-r--r--
WarningList-DZNTQSpg.js
1.99
KB
-rw-r--r--
YamlNotification-BnmI52ws.js
634
B
-rw-r--r--
YamlSwitch-BXLuxWUh.js
40.62
KB
-rw-r--r--
certificate-kcThcTS9.js
279.99
KB
-rw-r--r--
clusterGroups-BWQNdGSD.js
3.63
KB
-rw-r--r--
images-Du2fhDUO.js
1.22
KB
-rw-r--r--
index-BeIaaTgz.css
661.94
KB
-rw-r--r--
index-BkTFFYvy.js
690.52
KB
-rw-r--r--
index-DW_MHI2K.js
34.19
KB
-rw-r--r--
index.esm-auJ3G_FM.js
38.36
KB
-rw-r--r--
instanceDelete-Bn3xn_NE.js
12.2
KB
-rw-r--r--
instanceOptions-BuFjjn-P.js
1.19
KB
-rw-r--r--
network-forwards-B-h1Yzp9.js
856
B
-rw-r--r--
operations-DIvBacJG.js
757
B
-rw-r--r--
projects-CvA2zMPN.js
789
B
-rw-r--r--
scroll-DPmbgfny.js
26.97
KB
-rw-r--r--
searchAndFilter-DtC_P-vv.js
361
B
-rw-r--r--
snapshots-CEDJtMaf.js
670
B
-rw-r--r--
storage-volumes-tfXkh9eB.js
2.46
KB
-rw-r--r--
useGroups-CCX3qCzO.js
2.91
KB
-rw-r--r--
useImages-LgCYWVgs.js
1.64
KB
-rw-r--r--
useNetworks-D3nHf8AE.js
3.63
KB
-rw-r--r--
useSmallScreen-BvsjT919.js
169
B
-rw-r--r--
useSortTableData-BoXaK1oA.js
393
B
-rw-r--r--
useVolumes-BvpfNVaA.js
1.27
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : StorageVolumeDetail-fQzbPWNW.js
import{r as F,j as e,d as a,x as P,k as w,l as D,f as K,q as S,ah as te,M as se,c as q,an as ae,u as ne,aU as oe,e as ie,B as X,p as re,bl as le,aT as ce,a8 as E,H as de,o as O,I as U,af as me,ag as ue,y as pe,a5 as B,a6 as he,n as ge,bi as H,w as je,g as xe,L as Y,C as fe}from"./index-BkTFFYvy.js";import{N as ye}from"./NotificationRow-CotZPNAQ.js";import{R as be,F as Se}from"./RenameHeader-fmgiouA6.js";import{c as A,a as T}from"./index.esm-auJ3G_FM.js";import{D as Ne}from"./DeleteStorageVolumeBtn-DIIVYGaR.js";import{S as Ce}from"./StoragePoolSelectTable-CXuxJSN9.js";import{R as I}from"./ResourceLabel-PzB_6v5p.js";import{R as k}from"./ResourceLink-CS7mH0C3.js";import{m as Fe,d as $e,r as ke,u as Z}from"./storage-volumes-tfXkh9eB.js";import{S as _e}from"./StoragePoolSelector-DEvMjaMu.js";import{a as ve,c as we}from"./useVolumes-BvpfNVaA.js";import{S as Ve}from"./StorageUsedBy-sdKGRlgM.js";import{S as De,g as Le,u as Be,a as R,r as Te,b as Pe,d as qe,c as Ee,V as G,f as ze}from"./VolumeAddSnapshotBtn-8Qz9xFE-.js";import{v as ee,a as Re,M as W,b as Me}from"./StorageVolumeForm-ZPfwK39D.js";import{F as Ke}from"./FormFooterLayout-B3kcadYt.js";import{T as Ie}from"./TabLinks-BIG_Rdvk.js";import{I as M}from"./ItemName-DSOx0T0r.js";import{S as Qe}from"./SnapshotForm-DF9sGEzn.js";import{g as Oe,i as Ae}from"./snapshots-CEDJtMaf.js";import{S as Ue}from"./SelectableMainTable-C8l8QdDe.js";import{S as He}from"./ScrollableTable-DWT33Lms.js";import{S as Ge}from"./SelectedTableNotification-2DZbBMZx.js";import{B as We}from"./BulkDeleteButton-B-fvVwh0.js";import{u as Je}from"./useSortTableData-BoXaK1oA.js";import"./StoragePoolSize-DyBNKBKy.js";import"./Meter-BsdJ73XW.js";import"./ResourceIcon-DZQOrBLA.js";import"./index-DW_MHI2K.js";import"./images-Du2fhDUO.js";import"./ExpandableList-EDeaeb6c.js";import"./UsedByItem-VHA3kVFG.js";import"./useImages-LgCYWVgs.js";import"./operations-DIvBacJG.js";import"./FormMenuItem-ChXfQsFA.js";import"./instanceOptions-BuFjjn-P.js";import"./ConfigFieldDescription-BnRkdboG.js";import"./AutoExpandingTextArea-BXFyAEiG.js";import"./DiskSizeSelector-IT5APek6.js";import"./ScrollableContainer-MJpEXCww.js";const Xe=({close:t,migrate:s,storageVolume:l})=>{const[c,i]=F.useState(""),n=h=>{h.key==="Escape"&&t()},d=()=>{if(c){i("");return}t()},u=c?"Confirm migration":`Choose storage pool for volume ${l.name}`,m=e.jsx("div",{className:"migrate-instance-summary",children:e.jsxs("p",{children:["This will migrate volume ",e.jsx("strong",{children:l.name})," to storage pool ",e.jsx("b",{children:c}),"."]})});return e.jsx(a.Modal,{close:t,className:"migrate-instance-modal",title:u,buttonRow:e.jsxs("div",{id:"migrate-instance-actions",children:[e.jsx(a.Button,{className:"u-no-margin--bottom",type:"button","aria-label":"cancel migrate",appearance:"base",onClick:d,children:"Cancel"}),e.jsx(a.ActionButton,{appearance:"positive",className:"u-no-margin--bottom",onClick:()=>{s(c)},disabled:!c,children:"Migrate"})]}),onKeyDown:n,children:c?m:e.jsx(Ce,{onSelect:i,disablePool:{name:l.pool,reason:"Volume is already in this pool"}})})},Ye=({storageVolume:t,project:s,classname:l,onClose:c})=>{const i=P(),n=w(),{openPortal:d,closePortal:u,isOpen:m,Portal:h}=a.usePortal(),x=D(),p=K(),[y,o]=F.useState(!1),r=(C,f)=>{const _=`/ui/project/${f.project}/storage/pool/${f.pool}/volumes/${f.type}/${f.name}`,L=`/ui/project/${f.project}/storage/pool/${C}/volumes/${f.type}/${f.name}`,j=e.jsx(k,{type:"volume",value:f.name,to:L}),V=e.jsx(k,{type:"pool",value:C,to:`/ui/project/${f.project}/storage/pool/${C}`});n.success(e.jsxs(e.Fragment,{children:["Volume ",j," successfully migrated to pool ",V]})),window.location.pathname.startsWith(_)&&p(L)},g=(C,f,_)=>{o(!1),n.failure(`Migration failed for volume ${f} to pool ${_}`,C,e.jsx(k,{type:"volume",value:f,to:`/ui/project/${s}/storage/pool/${t.pool}/volumes/${t.type}/${f}`}))},N=(C,f,_)=>{g(new Error(C),f,_)},b=()=>{x.invalidateQueries({queryKey:[S.storage,t.name]}),o(!1)},$=C=>{o(!0),Fe(t,C,t.project).then(f=>{i.set(f.metadata.id,()=>{r(C,t)},j=>{N(j,t.name,C)},b);const _=e.jsx(I,{bold:!0,type:"volume",value:t.name}),L=e.jsx(k,{type:"pool",value:C,to:`/ui/project/${t.project}/storage/pool/${C}`});n.info(e.jsxs(e.Fragment,{children:["Migration started for volume ",_," to pool ",L]})),x.invalidateQueries({queryKey:[S.storage,t.name,s]}),v()}).catch(f=>{g(f,t.name,C)})},v=()=>{u(),c==null||c()};return e.jsxs(e.Fragment,{children:[m&&e.jsx(h,{children:e.jsx(Xe,{close:v,migrate:$,storageVolume:t})}),e.jsxs(a.ActionButton,{onClick:d,type:"button",className:l,loading:y,disabled:y,title:"Migrate volume",children:[e.jsx(a.Icon,{name:"machines"}),e.jsx("span",{children:"Migrate"})]})]})},Ze=({volume:t,close:s})=>{const l=w(),c=F.useState(null),i=K(),n=P(),{data:d=[],isLoading:u}=te(),{data:m=[],isLoading:h}=ve(t.project),x=(r,g,N)=>{const b=`/ui/project/${g}/storage/pool/${N}/volumes/custom/${r}`,$=e.jsxs(e.Fragment,{children:["Created volume"," ",e.jsx(k,{type:"volume",value:r,to:b}),"."]}),v=[{label:"Configure",onClick:async()=>i(`${b}/configuration`)}];l.success($,v)},p=r=>{const g=r.name+"-duplicate";return ae(g,m)},y=A().shape({name:T().required("Volume name is required"),project:T().required(),pool:T().required()}).test("deduplicate","",async function(r){const{name:g,project:N,pool:b}=r;return await se(g,N||"default",c,`storage-pools/${b}/volumes/custom`)?!0:this.createError({path:"name",message:"A volume with this name already exist in the target project and storage pool"})}),o=q({initialValues:{name:p(t),project:t.project,copySnapshots:!0,pool:t.pool},enableReinitialize:!0,validationSchema:y,onSubmit:r=>{const g={name:r.name,type:"custom",config:t.config,description:t.description,content_type:t.content_type,source:{name:t.name,type:"copy",pool:t.pool,volume_only:!r.copySnapshots,project:r.project!==t.project?t.project:void 0,location:t.location}},N=e.jsx(k,{type:"volume",value:t.name,to:`/ui/project/${t.project}/storage/pool/${t.pool}/volumes/custom/${t.name}`}),b=r.project===o.initialValues.project?"":r.project;$e(g,r.pool,b).then($=>{l.info(e.jsxs(e.Fragment,{children:["Duplication of volume ",N," started."]})),n.set($.metadata.id,()=>{x(r.name,r.project,r.pool)},v=>l.failure("Volume duplication failed.",new Error(v),N)),s()}).catch($=>{l.failure("Volume duplication failed.",$,N)})}});return e.jsx(a.Modal,{close:s,className:"duplicate-instances-modal",title:"Duplicate volume",buttonRow:e.jsxs(e.Fragment,{children:[e.jsx(a.Button,{appearance:"base",className:"u-no-margin--bottom",type:"button",onClick:s,children:"Cancel"}),e.jsx(a.ActionButton,{appearance:"positive",className:"u-no-margin--bottom",loading:o.isSubmitting,disabled:!o.isValid||u||h,onClick:()=>void o.submitForm(),children:"Duplicate"})]}),children:e.jsxs(a.Form,{onSubmit:o.handleSubmit,children:[e.jsx(a.Input,{...o.getFieldProps("name"),type:"text",label:"New volume name",error:o.touched.name?o.errors.name:null}),e.jsx(_e,{value:o.values.pool,setValue:r=>void o.setFieldValue("pool",r),selectProps:{id:"pool",label:"Storage pool"}}),e.jsx(a.Select,{...o.getFieldProps("project"),id:"project",label:"Target project",options:d.map(r=>({label:r.name,value:r.name}))}),e.jsx(a.Input,{...o.getFieldProps("copySnapshots"),type:"checkbox",label:"Copy with snapshots",checked:o.values.copySnapshots,error:o.touched.copySnapshots?o.errors.copySnapshots:null}),e.jsx(a.Input,{type:"submit",hidden:!0,value:"Hidden input"})]})})},et=({volume:t,className:s,onClose:l})=>{const{openPortal:c,closePortal:i,isOpen:n,Portal:d}=a.usePortal(),u=()=>{i(),l==null||l()};return e.jsxs(e.Fragment,{children:[n&&e.jsx(d,{children:e.jsx(Ze,{close:u,volume:t})}),e.jsxs(a.Button,{appearance:"default","aria-label":"Duplicate volume",className:s,onClick:c,title:"Duplicate volume",children:[e.jsx(a.Icon,{name:"canvas"}),e.jsx("span",{children:"Duplicate"})]})]})},tt=({volume:t,project:s})=>{var x;const l=K(),c=a.useNotify(),i=w(),n=F.useState(null),{hasClusterInternalCustomVolumeCopy:d}=ne(),u=A().shape({name:T().test(...oe(s,t.type,n,t.name)).required("This field is required")}),m=q({initialValues:{name:t.name,isRenaming:!1,pool:t.pool},validationSchema:u,onSubmit:p=>{if(t.name===p.name){m.setFieldValue("isRenaming",!1),m.setSubmitting(!1);return}ke(s,t,p.name).then(()=>{const y=`/ui/project/${s}/storage/pool/${t.pool}/volumes/${t.type}/${p.name}`;l(y),i.success(e.jsxs(e.Fragment,{children:["Storage volume ",e.jsx("strong",{children:t.name})," renamed to"," ",e.jsx(k,{type:"volume",value:p.name,to:y}),"."]})),m.setFieldValue("isRenaming",!1)}).catch(y=>{c.failure("Renaming failed",y)}).finally(()=>{m.setSubmitting(!1)})}}),h="p-segmented-control__button";return e.jsx(be,{name:t.name,parentItems:[e.jsx(ie,{to:`/ui/project/${s}/storage/volumes`,children:"Storage volumes"},1)],controls:e.jsx("div",{className:"p-segmented-control",children:e.jsxs("div",{className:"p-segmented-control__list",children:[e.jsx(Ye,{storageVolume:t,project:s,classname:h}),d&&e.jsx(et,{volume:t,className:h}),e.jsx(Ne,{label:"Delete",volume:t,project:s,appearance:"",hasIcon:!0,onFinish:()=>{l(`/ui/project/${s}/storage/volumes`),i.success(e.jsxs(e.Fragment,{children:["Storage volume"," ",e.jsx(I,{bold:!0,type:"volume",value:t.name})," ","deleted."]}))},classname:h})]})}),isLoaded:!0,formik:m,renameDisabledReason:(((x=t.used_by)==null?void 0:x.length)??0)>0?"Can not rename, volume is currently in use.":void 0})},st=({project:t,volume:s})=>{var i,n;const l=()=>{de("storage-overview-tab")};F.useEffect(l,[s]),X("resize",l);const{data:c}=re();return e.jsxs("div",{className:"storage-overview-tab",children:[e.jsxs(a.Row,{className:"section",children:[e.jsx(a.Col,{size:3,children:e.jsx("h2",{className:"p-heading--5",children:"General"})}),e.jsx(a.Col,{size:7,children:e.jsx("table",{children:e.jsxs("tbody",{children:[e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"Name"}),e.jsx("td",{children:s.name})]}),e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"Type"}),e.jsx("td",{children:le(s)})]}),e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"Content type"}),e.jsx("td",{children:ce(s)})]}),e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"Description"}),e.jsx("td",{children:s.description?s.description:"-"})]}),e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"Cluster member"}),e.jsx("td",{children:(i=c==null?void 0:c.environment)!=null&&i.server_clustered&&s.location?e.jsx(I,{type:"cluster-member",value:s.location}):"-"})]}),e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"Pool"}),e.jsx("td",{children:e.jsx(k,{type:"pool",value:s.pool,to:`/ui/project/${s.project}/storage/pool/${s.pool}`})})]}),e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"Date created"}),e.jsx("td",{children:E(s.created_at)})]}),e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"Size"}),e.jsx("td",{children:e.jsx(De,{volume:s})})]}),e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"Custom config"}),e.jsx("td",{children:Object.entries(s.config).length===0?"-":e.jsx("table",{children:e.jsx("tbody",{children:Object.entries(s.config).map(([d,u],m)=>e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:d}),e.jsx("td",{children:u})]},m))})})})]})]})})})]}),e.jsxs(a.Row,{className:"section",children:[e.jsx(a.Col,{size:3,children:e.jsxs("h2",{className:"p-heading--5",children:["Used by (",((n=s.used_by)==null?void 0:n.length)??0,")"]})}),e.jsx(a.Col,{size:7,children:e.jsx(Ve,{storage:s,project:t})})]})]})},z=t=>({name:t.name,project:t.project,pool:t.pool,size:t.config.size??"GiB",content_type:t.content_type,volumeType:t.type,security_shifted:t.config["security.shifted"],security_unmapped:t.config["security.unmapped"],snapshots_expiry:t.config["snapshots.expiry"],snapshots_pattern:t.config["snapshots.pattern"],snapshots_schedule:t.config["snapshots.schedule"],block_filesystem:t.config["block.filesystem"],block_mount_options:t.config["block.mount_options"],block_type:t.config["block.type"],zfs_blocksize:t.config["zfs.blocksize"],zfs_block_mode:t.config["zfs.block_mode"],zfs_delegate:t.config["zfs.delegate"],zfs_remove_snapshots:t.config["zfs.remove_snapshots"],zfs_use_refquota:t.config["zfs.use_refquota"],zfs_reserve_space:t.config["zfs.reserve_space"],readOnly:!0,isCreating:!1,entityType:"storageVolume"}),at=({volume:t})=>{const s=K(),l=a.useNotify(),c=w(),i=D(),{section:n}=O(),{project:d}=O();if(!d)return e.jsx(e.Fragment,{children:"Missing project"});const u=A().shape({name:T().required("This field is required")}),m=q({initialValues:z(t),validationSchema:u,enableReinitialize:!0,onSubmit:x=>{const p=ee(x,d,t);Z(x.pool,d,{...p,etag:t.etag}).then(()=>{m.setValues(z(p)),i.invalidateQueries({queryKey:[S.storage]}),i.invalidateQueries({queryKey:[S.storage,t.pool,d,p.type,p.name]}),c.success(e.jsxs(e.Fragment,{children:["Storage volume"," ",e.jsx(k,{type:"volume",value:p.name,to:`/ui/project/${t.project}/storage/pool/${t.pool}/volumes/custom/${p.name}`})," ","updated."]}))}).catch(y=>{l.failure("Storage volume update failed",y)}).finally(()=>{m.setSubmitting(!1)})}}),h=x=>{const p=`/ui/project/${d}/storage/pool/${t.pool}/volumes/${t.type}/${t.name}/configuration`;s(x===W?p:`${p}/${U(x)}`)};return e.jsxs("div",{className:"edit-storage-volume",children:[e.jsx(Re,{formik:m,section:n??U(W),setSection:h}),e.jsx(Ke,{children:m.values.readOnly?null:e.jsxs(e.Fragment,{children:[e.jsx(a.Button,{appearance:"base",onClick:async()=>m.setValues(z(t)),children:"Cancel"}),e.jsx(Se,{formik:m,disabled:!m.values.name})]})})]})},nt=({volume:t,snapshot:s,close:l})=>{const c=P(),i=a.useNotify(),n=w(),d=D(),u=F.useState(null),m=r=>{d.invalidateQueries({predicate:g=>g.queryKey[0]===S.volumes||g.queryKey[0]===S.storage}),n.success(e.jsxs(e.Fragment,{children:["Snapshot ",e.jsx(R,{name:r,volume:t})," saved."]})),o.setSubmitting(!1),l()},h=async r=>{await Be({volume:t,snapshot:s,expiresAt:r}).catch(g=>{i.failure("Snapshot update failed",g),o.setSubmitting(!1)})},x=async r=>{const g=e.jsx(R,{name:s.name,volume:t});return new Promise(N=>{Te({volume:t,snapshot:s,newName:r}).then(b=>{c.set(b.metadata.id,()=>{N()},$=>{n.failure(`Snapshot ${s.name} rename failed`,new Error($),g),o.setSubmitting(!1)})}).catch(b=>{i.failure("Snapshot rename failed",b,g),o.setSubmitting(!1)})})},[p,y]=s.expires_at?me(new Date(s.expires_at)).slice(0,16).split(" "):[null,null],o=q({initialValues:{name:s.name,expirationDate:p,expirationTime:y},validateOnMount:!0,validationSchema:Le(t,u,s.name),onSubmit:async r=>{i.clear();const g=r.expirationDate&&r.expirationTime?ue(Oe(r.expirationDate,r.expirationTime)):null;g!==s.expires_at&&await h(g),r.name!==s.name&&await x(r.name),m(r.name)}});return e.jsx(Qe,{isEdit:!0,formik:o,close:l})},ot=({volume:t,snapshot:s,isDeleting:l,isRestoring:c})=>{const{openPortal:i,closePortal:n,isOpen:d,Portal:u}=a.usePortal();return e.jsxs(e.Fragment,{children:[d&&e.jsx(u,{children:e.jsx(nt,{close:n,volume:t,snapshot:s})}),e.jsx(a.Button,{appearance:"base",hasIcon:!0,dense:!0,disabled:l||c,onClick:i,type:"button","aria-label":"Edit snapshot",title:"Edit",children:e.jsx(a.Icon,{name:"edit"})})]})},it=({volume:t,snapshot:s})=>{const l=P(),c=a.useNotify(),i=w(),[n,d]=F.useState(!1),[u,m]=F.useState(!1),h=D(),x=e.jsx(k,{type:"volume",value:t.name,to:`/ui/project/${t.project}/storage/pool/${t.pool}/volumes/custom/${t.name}`}),p=()=>{d(!0);const o=e.jsx(R,{name:s.name,volume:t});qe(t,s).then(r=>{l.set(r.metadata.id,()=>i.success(e.jsxs(e.Fragment,{children:["Snapshot"," ",e.jsx(I,{bold:!0,type:"snapshot",value:s.name})," ","deleted for volume ",x,"."]})),g=>i.failure(`Snapshot ${s.name} deletion failed`,new Error(g),o),()=>{d(!1),h.invalidateQueries({predicate:g=>g.queryKey[0]===S.volumes||g.queryKey[0]===S.storage})})}).catch(r=>{c.failure("Snapshot deletion failed",r,o),d(!1)})},y=()=>{m(!0),Pe(t,s).then(()=>{i.success(e.jsxs(e.Fragment,{children:["Snapshot"," ",e.jsx(R,{name:s.name,volume:t})," ","restored for volume ",x,"."]}))}).catch(o=>{c.failure("Snapshot restore failed",o)}).finally(()=>{m(!1),h.invalidateQueries({predicate:o=>o.queryKey[0]===S.volumes||o.queryKey[0]===S.storage})})};return e.jsx(e.Fragment,{children:e.jsx(a.List,{inline:!0,className:pe("u-no-margin--bottom","actions-list",{"u-snapshot-actions":!n&&!u}),items:[e.jsx(ot,{volume:t,snapshot:s,isDeleting:n,isRestoring:u},"edit"),e.jsx(a.ConfirmationButton,{appearance:"base",loading:u,className:"has-icon is-dense",title:"Confirm restore",confirmationModalProps:{title:"Confirm restore",children:e.jsxs("p",{children:["This will restore snapshot ",e.jsx(M,{item:s,bold:!0}),".",e.jsx("br",{}),"This action cannot be undone, and can result in data loss."]}),confirmButtonLabel:"Restore",confirmButtonAppearance:"positive",onConfirm:y},disabled:n||u,shiftClickEnabled:!0,showShiftClickHint:!0,children:e.jsx(a.Icon,{name:"change-version"})},"restore"),e.jsx(a.ConfirmationButton,{appearance:"base",loading:n,className:"has-icon is-dense",confirmationModalProps:{title:"Confirm delete",children:e.jsxs("p",{children:["This will permanently delete snapshot"," ",e.jsx(M,{item:s,bold:!0}),".",e.jsx("br",{}),"This action cannot be undone, and can result in data loss."]}),confirmButtonLabel:"Delete snapshot",onConfirm:p},disabled:n||u,shiftClickEnabled:!0,showShiftClickHint:!0,children:e.jsx(a.Icon,{name:"delete"})},"delete")]})})},rt=({volume:t,snapshotNames:s,onStart:l,onFinish:c})=>{const i=P(),n=w(),[d,u]=F.useState(!1),m=D(),h=s.length,x=()=>{u(!0),l(),Ee(t,s,i).then(p=>{const{fulfilledCount:y,rejectedCount:o}=he(p);y===h?n.success(`${s.length} ${B("snapshot",s.length)} deleted`):o===h?n.failure("Snapshot bulk deletion failed",void 0,e.jsxs(e.Fragment,{children:[e.jsx("b",{children:h})," ",B("snapshot",h)," could not be deleted."]})):n.failure("Snapshot bulk deletion partially failed",void 0,e.jsxs(e.Fragment,{children:[e.jsx("b",{children:y})," ",B("snapshot",y)," ","deleted.",e.jsx("br",{}),e.jsx("b",{children:o})," ",B("snapshot",o)," ","could not be deleted."]})),m.invalidateQueries({predicate:r=>r.queryKey[0]===S.volumes||r.queryKey[0]===S.storage}),u(!1),c()}).catch(p=>{n.failure("Snapshot bulk deletion failed",p),u(!1)})};return e.jsx(We,{confirmationButtonProps:{loading:d,disabled:d,appearance:""},onDelete:x,entityType:"snapshot",entities:s,deletableEntities:s,buttonLabel:`Delete ${B("snapshot",s.length)}`})},lt=({volume:t,close:s})=>{const l=a.useNotify(),c=w(),i=D(),n=q({initialValues:z(t),onSubmit:u=>{const m=ee(u,t.project);Z(t.pool,t.project,{...m,etag:t.etag}).then(()=>{c.success(e.jsxs(e.Fragment,{children:["Snapshot configuration updated for volume"," ",e.jsx(k,{type:"volume",value:t.name,to:`/ui/project/${t.project}/storage/pool/${t.pool}/volumes/custom/${t.name}`}),"."]})),i.invalidateQueries({queryKey:[S.storage],predicate:h=>h.queryKey[0]===S.volumes||h.queryKey[0]===S.storage})}).catch(h=>{l.failure("Configuration update failed",h)}).finally(()=>{s(),n.setSubmitting(!1)})}}),d=u=>{u.key==="Escape"&&s()};return e.jsx(a.Modal,{close:s,className:"edit-snapshot-config",title:"Snapshot configuration",buttonRow:n.values.readOnly?e.jsxs("div",{className:"u-space-between u-flex-row-reverse",children:[e.jsx(a.Button,{className:"u-no-margin--bottom u-no-margin--right",onClick:s,children:"Close"}),e.jsx(a.Button,{className:"u-no-margin--bottom",type:"button",onClick:async()=>n.setFieldValue("readOnly",!1),children:"Edit configuration"})]}):e.jsxs(e.Fragment,{children:[e.jsx(a.Button,{appearance:"base",className:"u-no-margin--bottom",type:"button",onClick:s,children:"Cancel"}),e.jsx(a.ActionButton,{appearance:"positive",className:"u-no-margin--bottom",loading:n.isSubmitting,disabled:n.isSubmitting,onClick:()=>void n.submitForm(),children:"Save"})]}),onKeyDown:d,children:e.jsx(Me,{formik:n})})},J=({volume:t,isDisabled:s,className:l})=>{const{openPortal:c,closePortal:i,isOpen:n,Portal:d}=a.usePortal();return e.jsxs(e.Fragment,{children:[n&&e.jsx(d,{children:e.jsx("div",{className:"snapshot-list",children:e.jsx(lt,{close:i,volume:t})})}),e.jsx(a.Button,{onClick:c,className:l,disabled:s,children:"See configuration"})]})},ct=({volume:t})=>{const s=ge(),[l,c]=F.useState(""),[i,n]=F.useState([]),[d,u]=F.useState([]),[m,h]=F.useState(H()),x=a.useNotify(),{project:p,isLoading:y}=je(),{data:o,error:r,isLoading:g}=xe({queryKey:[S.storage,S.snapshots,t.pool,t.project,t.type,t.name],queryFn:async()=>ze({pool:t.pool,project:t.project,type:t.type,volumeName:t.name})}),N=Ae(p);F.useEffect(()=>{const j=new Set(o==null?void 0:o.map(Q=>Q.name)),V=i.filter(Q=>j.has(Q));V.length!==i.length&&n(V)},[o,i]);const b=(o==null?void 0:o.filter(j=>!(l&&!j.name.toLowerCase().includes(l.toLowerCase()))))??[],$=o&&o.length>0,v=[{content:m?e.jsxs(e.Fragment,{children:["Name",e.jsx("br",{}),e.jsx("div",{className:"header-second-row",children:"Date created"})]}):"Name",sortKey:m?"created_at":"name",className:"name"},...m?[]:[{content:"Date created",sortKey:"created_at",className:"created"}],{content:"Expiry date",sortKey:"expires_at",className:"expiration"},{"aria-label":"Actions",className:"actions"}],C=b.map(j=>{const V=e.jsx(it,{volume:t,snapshot:j});return{key:j.name,className:"u-row",name:j.name,columns:[{content:e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"u-truncate",title:j.name,children:e.jsx(M,{item:j})}),m&&e.jsx("div",{className:"u-text--muted",children:E(j.created_at)})]}),role:"rowheader","aria-label":"Name",className:"name"},...m?[]:[{content:E(j.created_at),role:"rowheader","aria-label":"Created at",className:"created"}],{content:E(j.expires_at??""),role:"rowheader","aria-label":"Expires at",className:"expiration"},{content:V,role:"rowheader","aria-label":"Actions",className:"u-align--right actions"}],sortData:{name:j.name.toLowerCase(),created_at:j.created_at,expires_at:j.expires_at}}}),{rows:f,updateSort:_}=Je({rows:C,defaultSort:"created_at",defaultSortDirection:"descending"});return X("resize",()=>{h(H())}),r&&x.failure("Loading storage volume snapshots failed",r),g||y?e.jsx(Y,{text:"Loading storage volume snapshots..."}):o?e.jsxs("div",{className:"snapshot-list",children:[$&&e.jsx("div",{className:"upper-controls-bar",children:i.length===0?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"search-box-wrapper",children:e.jsx(a.SearchBox,{name:"search-snapshot",className:"search-box margin-right",type:"text",onChange:j=>{c(j)},placeholder:"Search for snapshots",value:l,"aria-label":"Search for snapshots"})}),e.jsx(J,{volume:t,className:"u-no-margin--right"}),e.jsx(G,{volume:t,className:"u-float-right",isDisabled:N})]}):e.jsx("div",{className:"p-panel__controls",children:e.jsx(rt,{volume:t,snapshotNames:i,onStart:()=>{u(i)},onFinish:()=>{u([])}})})}),$?e.jsx(e.Fragment,{children:e.jsx(He,{dependencies:[b],tableId:"volume-snapshot-table",belowIds:["status-bar"],children:e.jsx(a.TablePagination,{data:f,id:"pagination",itemName:"snapshot",className:"u-no-margin--top","aria-label":"Table pagination control",description:i.length>0&&e.jsx(Ge,{totalCount:o.length??0,itemName:"snapshot",parentName:"volume",selectedNames:i,setSelectedNames:n,filteredNames:b.map(j=>j.name)}),children:e.jsx(Ue,{id:"volume-snapshot-table",headers:v,rows:f,sortable:!0,emptyStateMsg:"No snapshot found matching this search",itemName:"snapshot",parentName:"instance",selectedNames:i,setSelectedNames:n,disabledNames:d,filteredNames:b.map(j=>j.name),onUpdateSort:_,defaultSort:"created_at",defaultSortDirection:"descending"})})})}):e.jsxs(a.EmptyState,{className:"empty-state",image:e.jsx(a.Icon,{name:"snapshot",className:"empty-state-icon"}),title:"No snapshots found",children:[e.jsx("p",{children:p&&N?e.jsxs(e.Fragment,{children:["Snapshots are disabled for project"," ",e.jsx(M,{item:p,bold:!0}),"."]}):"There are no snapshots for this volume."}),e.jsx("p",{children:e.jsxs("a",{href:`${s}/howto/storage_backup_volume/#storage-backup-snapshots`,target:"_blank",rel:"noopener noreferrer",children:["Learn more about snapshots",e.jsx(a.Icon,{className:"external-link-icon",name:"external-link"})]})}),e.jsx(J,{volume:t,isDisabled:N}),e.jsx(G,{volume:t,className:"empty-state-button",isDisabled:N})]})]}):e.jsx(e.Fragment,{children:"Loading storage volume snapshots failed"})},dt=["Overview","Configuration","Snapshots"],Jt=()=>{const t=a.useNotify(),{pool:s,project:l,activeTab:c,type:i,volume:n}=O();if(!s)return e.jsx(e.Fragment,{children:"Missing storage pool"});if(!l)return e.jsx(e.Fragment,{children:"Missing project"});if(!i)return e.jsx(e.Fragment,{children:"Missing type"});if(!n)return e.jsx(e.Fragment,{children:"Missing volume"});const{data:d,error:u,isLoading:m}=we(s,l,i,n);return u&&t.failure("Loading storage volume failed",u),m?e.jsx(Y,{text:"Loading storage volume..."}):d?e.jsx(fe,{header:e.jsx(tt,{volume:d,project:l}),contentClassName:"detail-page sotrage-volume-form u-no-padding--bottom",children:e.jsxs(a.Row,{children:[e.jsx(Ie,{tabs:dt,activeTab:c,tabUrl:`/ui/project/${l}/storage/pool/${s}/volumes/${i}/${d.name}`}),e.jsx(ye,{}),!c&&e.jsx("div",{role:"tabpanel","aria-labelledby":"overview",children:e.jsx(st,{volume:d,project:l})}),c==="configuration"&&e.jsx("div",{role:"tabpanel","aria-labelledby":"configuration",children:e.jsx(at,{volume:d})}),c==="snapshots"&&e.jsx("div",{role:"tabpanel","aria-labelledby":"snapshots",children:e.jsx(ct,{volume:d})})]})}):e.jsx(e.Fragment,{children:"Loading storage volume failed"})};export{Jt as default};
Close