GIF89a=( õ' 7IAXKgNgYvYx\%wh…hŽth%ˆs%—x¨}9®Œ©€&©‰%¶†(¹–.¹5·œD¹&Çš)ÇŸ5ǘ;Í£*È¡&Õ²)ׯ7×µ<Ñ»4ï°3ø‘HÖ§KͯT÷¨Yÿšqÿ»qÿÔFØ !ù ' !ÿ NETSCAPE2.0 , =( þÀ“pH,È¤rÉl:ŸÐ¨tJ­Z¯Ø¬vËíz¿à°xL.›Ïè´zÍn»ßð¸|N¯Ûïø¼~Ïïûÿ€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§gª«ªE¯°¨¬ª±²Œ¹º¹E¾­”´ÂB¶¯ §Åȸ»ÑD¾¿Á•ÄÅ®° ÝH¾ÒLÀÆDÙ«D¶BÝïðÀ¾DÑÑÔTÌÍíH òGö¨A RÎڐ |¥ ٭&ºìE8œ¹kGÔAÞpx­a¶­ã R2XB®åE8I€Õ6Xî:vT)äžþÀq¦è³¥ì仕F~%xñ  4#ZÔ‰O|-4Bs‘X:= QÉ œš lºÒyXJŠGȦ|s hÏíK–3l7·B|¥$'7Jީܪ‰‡àá”Dæn=Pƒ ¤Òëí‰`䌨ljóá¯Éüv>á–Á¼5 ½.69ûϸd«­ºÀûnlv©‹ªîf{¬ÜãPbŸ  l5‘ޝpß ´ ˜3aÅùäI«O’ý·‘áÞ‡˜¾Æ‚ÙÏiÇÿ‹Àƒ #öó)pâš Þ½ ‘Ý{ó)vmÞü%D~ 6f s}ŃƒDØW Eþ`‡þ À…L8xá†ç˜{)x`X/> Ì}mø‚–RØ‘*|`D=‚Ø_ ^ð5 !_…'aä“OÚ—7âcð`D”Cx`ÝÂ¥ä‹éY¹—F¼¤¥Š?¡Õ™ n@`} lď’ÄÉ@4>ñd œ à‘vÒxNÃ×™@žd=ˆgsžG±æ ´²æud &p8Qñ)ˆ«lXD©øÜéAžHìySun jª×k*D¤LH] †¦§C™Jä–´Xb~ʪwStŽ6K,°£qÁœ:9ت:¨þªl¨@¡`‚ûÚ ».Û¬¯t‹ÆSÉ[:°=Š‹„‘Nåû”Ìî{¿ÂA ‡Rà›ÀÙ6úë°Ÿð0Ä_ ½;ÃϱîÉì^ÇÛÇ#Ëë¼ôº!±Ä˜íUîÅÇ;0L1óÁµö«p% AÀºU̬ݵ¼á%霼€‡¯Á~`ÏG¯»À× ­²± =4ªnpð3¾¤³¯­ü¾¦îuÙuµÙ®|%2ÊIÿür¦#0·ÔJ``8È@S@5ê¢ ö×Þ^`8EÜ]ý.뜃Âç 7 ú ȉÞj œ½Dç zý¸iþœÑÙûÄë!ˆÞÀl§Ïw‹*DçI€nEX¯¬¼ &A¬Go¼QföõFç°¯;é¦÷îŽêJ°îúôF5¡ÌQ|îúöXªæ»TÁÏyñêï]ê² o óÎC=öõ›ÒÓPB@ D×½œä(>èCÂxŽ`±«Ÿ–JЀ»Û á¤±p+eE0`ëŽ`A Ú/NE€Ø†À9‚@¤à H½7”à‡%B‰`Àl*ƒó‘–‡8 2ñ%¸ —€:Ù1Á‰E¸àux%nP1ð!‘ðC)¾P81lÑɸF#ˆ€{´âé°ÈB„0>±û °b¡Š´±O‚3È–Ù()yRpbµ¨E.Z‘D8ÊH@% òŒx+%Ù˜Æcü »¸˜fõ¬b·d`Fê™8èXH"ÉÈ-±|1Ô6iI, 2““¬$+](A*jÐ QTÂo‰.ÛU슬Œã„Ž`¯SN¡–¶Äåyše¯ª’­¬‚´b¦Éož œ)åyâ@Ì®3 ÎtT̉°&Ø+žLÀf"Ø-|žçÔ>‡Ðv¦Ðžì\‚ Q1)Ž@Žh#aP72”ˆ™¨$‚ !ù " , =( …7IAXG]KgNgYvYxR"k\%w]'}hŽth%ˆg+ˆs%—r.—m3šx3˜x¨}9®€&©€+¨‡7§‰%¶†(¹–.¹œD¹&ǘ;Í•&ײ)×»4ïÌ6ò§KÍ þ@‘pH,È¤rÉl:ŸÐ¨tJ­Z¯Ø¬vËíz¿à°xL.›Ïè´zÍn»ßð¸|N¯Ûïø¼~Ïïûÿ€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§g «¬ E ±± ¨­¶°ººE Á´”·®C¬²§Ç¶Œ»ÓDÃÕƷ¯Ê±H½ºM×ÁGÚ¬D¶BËÁ½î½DÓôTÏÛßîG»ôõC×CÌ l&âž:'òtU³6ɹ#·Ø)€'Ü.6±&ëÍÈ» K(8p0N?!æ2"ÛˆNIJX>R¼ÐO‚M '¡¨2¸*Ÿþ>#n↠å@‚<[:¡Iïf’ ¤TÚ˘CdbÜÙ“[«ŽEú5MBo¤×@€`@„€Êt W-3 ¶Ÿ¡BíêäjIÝ…Eò9[T…$íêﯧ„…•s»Óȳ¹€ÅÚdc®UUρ#±Ùïldj?´í¼²`\ŽÁðÞu|3'ÖŒ]ë6 ¶S#²‡˜FKLÈ *N E´‘áäŠ$˜›eÄYD„ºq«.è촁ƒs \-ÔjA 9²õ÷å- üúM[Âx(ís÷ì®x€|í¡Ù’p¦‚ ŽkÛTÇDpE@WÜ ²Ç]kŠ1¨ þ€·Yb ÓÁ‰l°*n0 ç™—žzBdОu¾7ĉBl€â‰-ºx~|UåU‰  h*Hœ|e"#"?vpÄiŠe6^ˆ„+qâŠm8 #VÇá ‘å–ÄV„œ|Аè•m"сœn|@›U¶ÆÎž—Špb¥G¨ED”€±Úê2FÌIç? >Éxå Œ± ¡¤„%‘žjŸ‘ꄯ<Ìaà9ijÐ2˜D¦È&›†Z`‚å]wþ¼Â:ç6àB¤7eFJ|õÒ§Õ,¨äàFÇ®cS·Ê¶+B°,‘Þ˜ºNûãØ>PADÌHD¹æž«ÄÀnÌ¥}­#Ë’ë QÀÉSÌÂÇ2ÌXÀ{æk²lQÁ2«ÊðÀ¯w|2Í h‹ÄÂG€,m¾¶ë3ÐÙ6-´ÅE¬L°ÆIij*K½ÀÇqï`DwVÍQXœÚÔpeœ±¬Ñ q˜§Tœ½µƒ°Œìu Â<¶aØ*At¯lmEØ ü ôÛN[P1ÔÛ¦­±$ÜÆ@`ùåDpy¶yXvCAyåB`ŽD¶ 0QwG#¯ æš[^Äþ $ÀÓÝǦ{„L™[±úKÄgÌ;ï£S~¹ìGX.ôgoT.»åˆ°ùŸûù¡?1zö¦Ÿž:ÅgÁ|ìL¹ „®£œŠ‚à0œ]PÁ^p F<"•ç?!,ñ‡N4—…PÄ Á„ö¨Û:Tè@hÀ‹%táÿ:ø-žI<`þ‹p I….)^ 40D#p@ƒj4–؀:²‰1Øâr˜¼F2oW¼#Z†;$Q q” ‘ ÂK¦ñNl#29 !’F@¥Bh·ᏀL!—XFóLH‘Kh¤.«hE&JòG¨¥<™WN!€ÑÙÚˆY„@†>Œž19J" 2,/ &.GXB%ÌRÈ9B6¹W]’î×ÔW¥’IÎ$ ñ‹ÓŒE8YÆ ¼³™ñA5“à®Q.aŸB€&Ø©³ JÁ—! ¦t)K%tœ-¦JF bòNMxLôþ)ÐR¸Ð™‘ èÝ6‘O!THÌ„HÛ ‰ !ù ) , =( …AXKgNgYvYxR"k\%wh…hŽh%ˆg+ˆs%—r.—x3˜x¨}9®€&©€+¨Œ,©‡7§‰%¶†(¹–.¹5·&Çš)ǘ;Í•&×£*Ȳ)ׯ7×»4ï°3øÌ6ò‘HÖ§KÍ»Hó¯T÷¨Yÿ»qÿÇhÿ þÀ”pH,È¤rÉl:ŸÐ¨tJ­Z¯Ø¬vËíz¿à°xL.›Ïè´zÍn»ßð¸|N¯Ûïø¼~Ïïûÿ€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§g ª« E$±²¨ª­ · °²½$E$ÂÕ««D· Í ¿¦Ç¶¸ÌŒ¾³CÃÅÆ E ééH½MÛÂGâªD­ çBêêϾD²ÒaÀà€Š1r­ðÓ¤ ÔožzU!L˜C'¾yW½UGtäÇïÙllê0×àÂuGþ)AÀs[þ·xì ÁxO%ƒûX2ó—  P£n›R/¡ÑšHše+êDm?# —‘Ç£6¡8íJ¡ŸâDiäªM¥Ö„ôj“¬¹£5oQ7°- <‡ *´lãÓŒ2r/a!l)dÈ A™ÈE¢ôÔ͆…ð ;Ö˜c ¡%ß‚’Ùˆâ¸b½—pe~C"BíëÚHïeF2§æŠ8qb t_`urŠeü wÅu3êæPv§h•"ß`íÍxçLĹÜÖ3á  ~Öº“®›¸ÏMDfJÙ °„ÛµáWõ%§œ‚à©–‚X ÓØ)@®Ñ›Eþ´wëuÅSxb8y\mÖzœ¥§ZbºE—ÂLªÌw!y(>¡™wú=Ç|ÅÝs¢d €CÁW)HÜcC$€L Ä7„r.á\{)@ð` @ äXÈ$PD” `šaG:§æˆOˆ72EÐamn]ù"ŒcÊxÑŒ° &dR8`g«iÙŸLR!¦P …d’ä¡“¦ðÎTƒ¦ià|À _ ¥ Qi#¦Šg›Æ ›noMµ ›V ã£)p ç£ÎW…š=Âeªk§†j„ ´®1ß²sÉxéW«jšl|0¯B0Û, \jÛ´›6±¬¶C ÛíWþï|ëÙ‹¸ñzĸV {ì;Ýñn¼òVˆm³I¼³.Ðã¤PN¥ ²µ¼„µCã+¹ÍByî£Ñ¾HŸ›ëê 7ìYÆFTk¨SaoaY$Dµœìï¿Ã29RÈkt Çïfñ ÇÒ:ÀÐSp¹3ÇI¨â¥DZÄ ü9Ïýögñ½­uÔ*3)O‘˜Ö[_hv ,àî×Et Ÿé¶BH€ Õ[ü±64M@ÔSÌM7dÐl5-ÄÙU܍´©zߌ3Ô€3ž„ „ ¶ÛPô½5×g› êÚ˜kN„Ý…0Îj4€Ìë°“#{þÕ3S2çKÜ'ợlø¼Ú2K{° {Û¶?žm𸧠ËI¼nEò='êüóºè^üæÃ_Û=°óž‚ì#Oý¿Í'¡½áo..ÏYìnüñCœO±Áa¿¢Kô½o,üÄËbö²çºíï{ËC Ú— "”Ï{ËK ÍÒw„õ±Oz dÕ¨à:$ ƒô—«v»] A#ð «€¿šéz)Rx׿ˆ¥‚d``èw-îyÏf×K!ð€þ­Ð|ìPľ„=Ì`ý(f” 'Pa ¥ÐBJa%Ðâf§„%Š¡}FàáÝ×6>ÉäŠG"éŽè=ø!oа^FP¼Ø©Q„ÀCÙÁ`(Ž\ÄÝ® ©Â$<n@dÄ E#ììUÒI! ‚#lù‹`k¦ÐÇ'Rró’ZýNBÈMF Í[¤+‹ðɈ-áwj¨¥þ8¾rá ,VÂh„"|½œ=×G_¦Ñ™EØ 0i*%̲˜Æda0mV‚k¾)›;„&6 p>ÓjK “¦Ç# âDÂ:ûc?:R Ó¬fÞéI-Ì“•Ã<ä=™Ï7˜3œ¨˜c2ŒW ,ˆ”8(T™P‰F¡Jhç"‚ ; 403WebShell
403Webshell
Server IP : 143.110.188.43  /  Your IP : 216.73.217.31
Web Server : Apache/2.4.57 (Ubuntu)
System : Linux Client-Droplet 6.5.0-44-generic #44-Ubuntu SMP PREEMPT_DYNAMIC Fri Jun 7 15:10:09 UTC 2024 x86_64
User : www-data ( 33)
PHP Version : 8.2.10-2ubuntu2.2
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /snap/lxd/41172/share/lxd-ui/assets/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /snap/lxd/41172/share/lxd-ui/assets//StorageVolumeDetail-D-0c3fUB.js
import{d as a,J as F,s as T,c as $,j as e,E as H,t as S,R as _,r as C,x as me,q,b as te,h as M,aX as pe,V as oe,ab as ue,e as A,f as P,a7 as he,aH as ge,ao as xe,w as je,aI as fe,L as be,aq as D,a1 as Se,H as O,a2 as Y,aB as ye,aC as Ce,B,M as Ne,G as Ve,aP as ke,o as Fe}from"./index-H4PaR1Ay.js";import{R as we}from"./RenameHeader-DLx2_niW.js";import{g as v,t as _e,m as Pe,l as Te,r as Me,f as G}from"./storageVolume-B1nkHAqF.js";import{R as Q}from"./ResourceLink-uXW9L0Ar.js";import{h as se,i as ae,g as Re,m as Be,j as Le,r as De,k as ne}from"./storage-volumes-fC4CfBPB.js";import{u as w,D as Ee}from"./DeleteStorageVolumeBtn-CD0v6TIN.js";import{F as U,B as J}from"./BackLink-Cuy7YFjT.js";import{V as N}from"./VolumeLinkChip-BFYsSF0j.js";import{P as ie}from"./ProjectRichChip-CFmGZ5fm.js";import{S as Ie,C as ve,P as $e}from"./ProjectSelectTable-DxlORqFA.js";import{k as re,h as qe,Z as X}from"./useStoragePools-R3ZOO4pU.js";import{c as ze,g as Ue,i as Oe}from"./snapshots-oc8RhmUf.js";import{S as Qe}from"./StoragePoolSelector-CJRwrd1Y.js";import{a as Ke,c as Ae}from"./useVolumes-Xg79hRkT.js";import{C as He}from"./ClusterMemberSelector-DIlP54jh.js";import{u as Ye}from"./projects-CsVQvwvI.js";import{R as E}from"./ResourceLabel-BMIFVwPY.js";import{S as Ge}from"./StorageUsedBy-CzlSAyDc.js";import{S as Je,u as Xe,g as Ze,a as K,r as We,b as et,d as tt,c as ot,V as Z,f as st}from"./VolumeAddSnapshotBtn-C26sVUhZ.js";import{C as at}from"./ClusterMemberRichChip-D4mdkN-w.js";import{S as nt}from"./StoragePoolRichChip-B2CCdBci.js";import{v as le,d as it,M as W,e as rt}from"./StorageVolumeForm-D9fkrXvn.js";import{F as lt}from"./FormFooterLayout-BAdc854l.js";import{F as ct}from"./FormSubmitBtn-DqQV2Ofa.js";import{T as dt}from"./TabLinks-DBJMWW_3.js";import{S as mt}from"./SnapshotForm-CjWTOtSm.js";import{I as pt}from"./ItemName-COo4SMvJ.js";import{S as ut}from"./SelectableMainTable-DVpI1gAH.js";import{S as ht}from"./SelectedTableNotification-BiyTngX2.js";import{g as gt}from"./promises-DrIa_NWl.js";import{B as xt}from"./BulkDeleteButton-B0G_6fsa.js";import{u as jt}from"./useBulkDetails-DSAq8m1i.js";import{u as ft}from"./useSortTableData-Dpr3aigs.js";import"./Breadcrumb-1nP3kv9p.js";import"./index-BCn5QfZZ.js";import"./RichTooltipTable-BK1fclsa.js";import"./devices-BmVPmxwo.js";import"./useClusterMembers-7DaTUHV4.js";import"./cluster-members-LZARpnVy.js";import"./StoragePoolSize-lekZ0CbT.js";import"./Meter-Bmiz6lct.js";import"./StoragePoolClusterMember-CYpJr3C7.js";import"./images-BuQHcoRx.js";import"./ClusterMemberExplanationTooltip-B--IjkYZ.js";import"./ExplanationTooltip-BtzkKEJm.js";import"./UsedByRow-CODDVByL.js";import"./UsedByItem-bMh12Ksd.js";import"./useImages-BYHePzIj.js";import"./imageRegistry-BR44AA00.js";import"./image-registries-CM9txDWK.js";import"./InstanceRichChip-CmtepUSG.js";import"./InstanceStatus-DrJFk_Gl.js";import"./useInstances-CTyW6bRj.js";import"./ConfirmationCheckbox-BIDRuxD0.js";import"./TruncatedList-BHP7CqkY.js";import"./ProfileRichChip-BLxwj1Me.js";import"./ProfileResourceLimits-CLeCMI9t.js";import"./usedBy-CACK-irk.js";import"./resourceDetails-DtLpXei1.js";import"./storageBucket-B7LHuAXl.js";import"./ExpandableList-CQ-CShP2.js";import"./ClusterMemberStatus-B6uUiMQe.js";import"./ClusterMemberMemoryUsage-BybgBxEL.js";import"./FormMenuItem-wWC_cxfa.js";import"./ConfigurationTable-DEm36PYo.js";import"./ConfigFieldDescription-BuOtqnNZ.js";import"./useConfigOptions-qesCQJVe.js";import"./DiskSizeSelector-97sBb-TL.js";import"./options-DGWNjuoa.js";import"./ScrollableForm-BtdYbmZT.js";import"./StoragePoolExplanationTooltip-75F5PHZT.js";import"./ScrollableConfigurationTable-gvGDy_Ul.js";import"./instanceAndProfilePayloads-DnzPlN57.js";import"./userKeys--m55T-U-.js";import"./formChangeCount-obF4N3HN.js";const bt=({volume:t,close:o,type:n,target:i})=>{const l=a.useToastNotification(),c=F(),d=T(),m=$(),x=()=>{let s="";const r=v(t),g=v({...t,project:n==="project"?i:t.project,pool:n==="pool"?i:t.pool,location:n==="cluster member"?i:t.location}),b=e.jsx(Q,{type:"pool",value:i,to:`${_}/ui/project/${encodeURIComponent(t.project)}/storage/pool/${encodeURIComponent(i)}`});n==="cluster member"&&(s=e.jsxs(e.Fragment,{children:["Volume ",e.jsx(N,{volume:{...t,location:i}})," ","successfully migrated to cluster member"," ",e.jsx(Q,{type:"cluster-member",value:i,to:`${_}/ui/cluster/member/${encodeURIComponent(i)}`})]}),r!==g&&m(g)),n==="pool"&&(s=e.jsxs(e.Fragment,{children:["Volume ",e.jsx(N,{volume:{...t,pool:i}}),"successfully migrated to pool ",b]}),r!==g&&m(g)),n==="project"&&(s=e.jsxs(e.Fragment,{children:["Volume ",e.jsx(N,{volume:{...t,project:i}}),"successfully moved to project ",e.jsx(ie,{projectName:i})]}),r!==g&&m(g)),l.success(s)},f=s=>{let r="";n==="cluster member"&&(r=`Cluster member migration failed for volume ${t.name}`),n==="pool"&&(r=`Migration failed for volume ${t.name} to pool ${i}`),n==="project"&&(r=`Project move failed for volume ${t.name}`),l.failure(r,s,e.jsx(N,{volume:t}))},p=s=>{f(new Error(s))},u=()=>{d.invalidateQueries({queryKey:[S.volumes,t.name,t.project]}),d.invalidateQueries({queryKey:[S.volumes,t.project]}),d.invalidateQueries({queryKey:[S.operations,t.project]})};return{handleMigrate:()=>{const s=n==="pool"?i:void 0,r=n==="project"?i:void 0;Be(t,t.project,s,t.location,r).then(g=>{c.set(g.metadata.id,()=>{x()},b=>{p(b)},u),l.info(e.jsxs(e.Fragment,{children:[H(n)," migration started for"," ",e.jsx(N,{volume:t}),"."]})),d.invalidateQueries({queryKey:[S.volumes,t.name,t.project]})}).catch(g=>{f(g)}).finally(()=>{o()})},handleMemberMigrate:()=>{const s=n==="cluster member"?i:void 0,r=t.location,g=se(t,t.name,t.project);ae(g,t.pool,t.project,s).then(b=>{l.info(e.jsxs(e.Fragment,{children:[H(n)," migration started for"," ",e.jsx(N,{volume:t}),"."]})),c.set(b.metadata.id,()=>{d.invalidateQueries({queryKey:[S.volumes,t.name,t.project]}),Re(t.name,t.pool,t.project,r).then(V=>{c.set(V.metadata.id,()=>{x()},k=>{p(k)},u),d.invalidateQueries({queryKey:[S.isoVolumes]}),d.invalidateQueries({queryKey:[S.projects,t.project]}),d.invalidateQueries({queryKey:[S.storage,t.pool,S.volumes,t.project,t.location]}),d.invalidateQueries({predicate:k=>k.queryKey[0]===S.volumes})})},V=>{p(V)},u)}).catch(b=>{f(b)}).finally(()=>{o()})}}},St=({volume:t,onSelect:o,onCancel:n,migrate:i})=>{const[l,c]=C.useState(""),d=e.jsx("div",{className:"migrate-instance-summary",children:e.jsxs("p",{children:["This will migrate volume ",e.jsx("strong",{children:t.name})," to storage pool"," ",e.jsx("b",{children:l}),"."]})});return e.jsxs(e.Fragment,{children:[l?d:e.jsx(Ie,{onSelect:m=>{c(m),o(m)},disablePool:{name:t.pool,reason:"Volume is already in this pool"}}),e.jsxs("footer",{id:"migrate-volume-actions",className:"p-modal__footer",children:[e.jsx(a.Button,{className:"u-no-margin--bottom",type:"button","aria-label":"cancel migrate",appearance:"base",onClick:()=>{n(),c("")},children:"Cancel"}),e.jsx(a.ActionButton,{appearance:"positive",className:"u-no-margin--bottom",onClick:()=>{i(l)},disabled:!l,children:"Migrate"})]})]})},yt=({volume:t,onSelect:o,targetMember:n,onCancel:i,migrate:l})=>{const c=e.jsx("div",{className:"migrate-instance-summary",children:e.jsxs("p",{children:["This will migrate volume ",e.jsx("strong",{children:t.name})," to cluster member ",e.jsx("b",{children:n}),"."]})});return e.jsxs(e.Fragment,{children:[n&&c,!n&&e.jsx(ve,{onSelect:o,disableMember:{name:t.location,reason:"Volume already on this member"}}),e.jsxs("footer",{id:"migrate-volume-actions",className:"p-modal__footer",children:[e.jsx(a.Button,{className:"u-no-margin--bottom",type:"button","aria-label":"cancel migrate",appearance:"base",onClick:i,children:"Cancel"}),e.jsx(a.ActionButton,{appearance:"positive",className:"u-no-margin--bottom",onClick:()=>{l(n)},disabled:!n,children:"Migrate"})]})]})},Ct=({volume:t,onSelect:o,targetProject:n,onCancel:i,migrate:l})=>{const c=e.jsx("div",{className:"migrate-instance-summary",children:e.jsxs("p",{children:["This will migrate the volume ",e.jsx("strong",{children:t.name})," to the project ",e.jsx("b",{children:n}),"."]})});return e.jsxs(e.Fragment,{children:[n&&c,!n&&e.jsx($e,{onSelect:o,disableProject:{name:t.project,reason:"Volume already in this project"}}),e.jsxs("footer",{id:"migrate-volume-actions",className:"p-modal__footer",children:[e.jsx(a.Button,{className:"u-no-margin--bottom",type:"button","aria-label":"cancel migrate",appearance:"base",onClick:i,children:"Cancel"}),e.jsx(a.ActionButton,{appearance:"positive",className:"u-no-margin--bottom",onClick:()=>{l(n)},disabled:!n,children:"Migrate"})]})]})},Nt=({close:t,volume:o})=>{const[n,i]=C.useState(""),[l,c]=C.useState(""),d=me(),{data:m}=re(o.pool),{handleMigrate:x,handleMemberMigrate:f}=bt({close:t,volume:o,type:n,target:l}),p=()=>{if(l){c("");return}if(n){i("");return}},u=()=>n?l?e.jsx(J,{title:"Confirm migration",linkText:`Choose ${n}`,onClick:p}):e.jsx(J,{title:e.jsxs(e.Fragment,{children:["Choose ",n," for volume ",e.jsx("strong",{children:o.name})]}),linkText:"Choose migration method",onClick:p}):"Choose migration method";return e.jsxs(a.Modal,{close:t,className:"migrate-instance-modal",children:[e.jsxs("header",{className:"p-modal__header",children:[e.jsx("h2",{className:"p-modal__title",id:"migrate-title",children:u()},n?l?"confirm":"select":"start"),e.jsx("button",{className:"p-modal__close","aria-label":"Close active modal",onClick:t,children:"Close"})]}),!n&&e.jsxs("div",{className:"choose-migration-type",children:[d&&qe(m?.driver||"")&&e.jsx(U,{icon:"cluster-host",title:"Migrate volume to a different cluster member",onClick:()=>{i("cluster member")}}),e.jsx(U,{icon:"storage-pool",title:"Move volume to a different storage pool",onClick:()=>{i("pool")}}),e.jsx(U,{icon:"folder",title:"Move volume to a different project",onClick:()=>{i("project")}})]}),n==="cluster member"&&e.jsx(yt,{volume:o,onSelect:c,targetMember:l,onCancel:p,migrate:f}),n==="pool"&&e.jsx(St,{volume:o,onSelect:c,onCancel:p,migrate:x}),n==="project"&&e.jsx(Ct,{volume:o,onSelect:c,targetProject:l,onCancel:p,migrate:x})]})},Vt=({volume:t,classname:o,onClose:n})=>{const{openPortal:i,closePortal:l,isOpen:c,Portal:d}=a.usePortal(),{canEditVolume:m}=w(),x=t.used_by?.length===0,f=()=>{l(),n?.()},p=()=>m(t)?x?"Migrate volume":"Volume is in use":"You do not have permission to migrate this volume";return e.jsxs(e.Fragment,{children:[c&&e.jsx(d,{children:e.jsx(Nt,{close:f,volume:t})}),e.jsxs(a.ActionButton,{onClick:i,type:"button",className:q("u-no-margin--bottom has-icon",o),disabled:!m(t)||!x,title:p(),children:[e.jsx(a.Icon,{name:"machines"}),e.jsx("span",{children:"Migrate"})]})]})},kt=({volume:t,close:o})=>{const n=F(),i=a.useToastNotification(),l=e.jsx(N,{volume:t}),{data:c}=te(),d=c?.environment?.backup_metadata_version_range??[],m=u=>{const h=new URLSearchParams;h.set("project",t.project),pe(h,t.location);const j=`${_}/1.0/storage-pools/${encodeURIComponent(t.pool)}/volumes/${encodeURIComponent(t.type)}/${encodeURIComponent(t.name)}/backups/${encodeURIComponent(u)}/export?${h.toString()}`,s=document.createElement("a");s.href=j,s.download=u,s.click(),window.URL.revokeObjectURL(j),i.success(e.jsxs(e.Fragment,{children:["Volume ",l," download started:",e.jsx("br",{}),e.jsx("a",{href:j,children:u})]}))},x=u=>{const h=new Date;return h.setHours(h.getHours()+u),h},f=u=>{const h=new Date().toISOString().replaceAll(":","-").split(".")[0],j=`${t.name}-${h}.tar${u.compression==="gzip"?".gz":""}`,s=JSON.stringify({name:j,expires_at:x(u.expirationHours).toISOString(),compression_algorithm:u.compression,volume_only:u.volumeOnly,optimized_storage:u.optimizedStorage,version:Number(u.exportVersion)});Le(t,s).then(r=>{i.info(e.jsxs(e.Fragment,{children:["Backing up volume ",l,".",e.jsx("br",{}),"Download will start, when the export is ready."]})),n.set(r.metadata.id,()=>{m(j)},g=>i.failure(`Could not download volume ${t.name}`,new Error(g),l))}).catch(r=>i.failure(`Could not download volume ${t.name}`,r,l)).finally(()=>{o()})},p=M({initialValues:{compression:"gzip",exportVersion:"2",expirationHours:6,volumeOnly:!1,optimizedStorage:!0},onSubmit:u=>{f(u)}});return e.jsx(a.Modal,{close:o,className:"export-volume-modal",title:"Export Volume",buttonRow:e.jsxs(e.Fragment,{children:[e.jsx(a.Button,{appearance:"base",className:"u-no-margin--bottom",type:"button",onClick:o,children:"Cancel"}),e.jsx(a.ActionButton,{appearance:"positive",className:"u-no-margin--bottom",loading:p.isSubmitting,disabled:p.isSubmitting,onClick:()=>{p.submitForm()},children:"Export volume"})]}),children:e.jsxs(a.Form,{onSubmit:p.handleSubmit,children:[e.jsx(a.Select,{...p.getFieldProps("compression"),id:"project",label:"Compression",help:"No compression will be faster, but larger",options:[{value:"gzip",label:"Gzip"},{value:"none",label:"None"}]}),e.jsx(a.Select,{...p.getFieldProps("exportVersion"),id:"exportVersion",label:"Export version",help:"Lower versions allow imports on older LXD versions",options:d.map(u=>({value:u.toString(),label:u.toString()}))}),e.jsx(a.CheckboxInput,{...p.getFieldProps("optimizedStorage"),label:"Use storage driver optimized format",help:"Can only be restored on a similar pool",checked:p.values.optimizedStorage}),e.jsx(a.CheckboxInput,{...p.getFieldProps("volumeOnly"),label:"Export without volume snapshots",error:p.touched.volumeOnly?p.errors.volumeOnly:null,checked:p.values.volumeOnly}),e.jsx(a.Input,{type:"submit",hidden:!0,value:"Hidden input"})]})})},Ft=({volume:t,classname:o,onClose:n})=>{const{openPortal:i,closePortal:l,isOpen:c,Portal:d}=a.usePortal(),{canManageVolumeBackups:m}=w(),{project:x}=oe(),f=ze(x),p=()=>{l(),n?.()},u=()=>m(t)?f?`Project "${x?.name}" doesn't allow for backup creation.`:"Export volume":"You do not have permission to export this volume.";return e.jsxs(e.Fragment,{children:[c&&e.jsx(d,{children:e.jsx(kt,{close:p,volume:t})}),e.jsxs(a.Button,{appearance:"default",className:q("u-no-margin--bottom has-icon",o),onClick:i,title:u(),disabled:!m(t)||f,children:[e.jsx(a.Icon,{name:"export"}),e.jsx("span",{children:"Export"})]})]})},wt=({volume:t,close:o})=>{const n=a.useToastNotification(),i=C.useState(null),l=F(),{data:c=[],isLoading:d}=ue(),{data:m}=re(t.pool),{data:x=[],isLoading:f}=Ke(t.project),p=r=>{const g={...t,name:r.name,project:r.project,pool:r.pool,location:r.location};n.success(e.jsxs(e.Fragment,{children:["Created volume ",e.jsx(N,{volume:g}),"."]}))},u=r=>{n.failure("Volume copy failed.",r,e.jsx(N,{volume:t}))},h=r=>{const g=r.name+"-copy";return ge(g,x)},j=A().shape({name:P().required("Volume name is required"),project:P().required(),pool:P().required(),location:P().optional()}).test("deduplicate","",async function(r){const{name:g,project:b,pool:V,location:k}=r;return await he(g,b||"default",i,`storage-pools/${encodeURIComponent(V)}/volumes/custom`,k)?!0:this.createError({path:"name",message:"A volume with this name already exist in the target project and storage pool"})}),s=M({initialValues:{name:h(t),project:t.project,copySnapshots:!0,pool:t.pool,location:X(m?.driver??"")?"":t.location},enableReinitialize:!0,validationSchema:j,onSubmit:r=>{const g=se(t,r.name,r.project,!r.copySnapshots);ae(g,r.pool,r.project,r.location).then(b=>{n.info(e.jsxs(e.Fragment,{children:["Copy of volume ",e.jsx(N,{volume:t})," started."]})),l.set(b.metadata.id,()=>{p(r)},V=>{u(new Error(V))})}).catch(b=>{n.failure("Volume copy failed.",b)}).finally(()=>{o()})}});return e.jsx(a.Modal,{close:o,className:"copy-volumes-modal",title:"Copy volume",buttonRow:e.jsxs(e.Fragment,{children:[e.jsx(a.Button,{appearance:"base",className:"u-no-margin--bottom",type:"button",onClick:o,children:"Cancel"}),e.jsx(a.ActionButton,{appearance:"positive",className:"u-no-margin--bottom",loading:s.isSubmitting,disabled:!s.isValid||s.isSubmitting||d||f,onClick:()=>{s.submitForm()},children:"Copy"})]}),children:e.jsxs(a.Form,{onSubmit:s.handleSubmit,children:[e.jsx(a.Input,{...s.getFieldProps("name"),type:"text",label:"New volume name",error:s.touched.name?s.errors.name:null}),e.jsx(Qe,{value:s.values.pool,setValue:r=>{s.setFieldValue("pool",r)},selectProps:{id:"pool",label:"Storage pool"}}),!X(m?.driver??"")&&e.jsx(He,{...s.getFieldProps("location")}),e.jsx(a.Select,{...s.getFieldProps("project"),id:"project",label:"Target project",options:c.map(r=>({label:r.name,value:r.name}))}),e.jsx(a.CheckboxInput,{...s.getFieldProps("copySnapshots"),label:"Copy with snapshots",checked:s.values.copySnapshots,error:s.touched.copySnapshots?s.errors.copySnapshots:null}),e.jsx(a.Input,{type:"submit",hidden:!0,value:"Hidden input"})]})})},_t=({volume:t,classname:o,onClose:n})=>{const{openPortal:i,closePortal:l,isOpen:c,Portal:d}=a.usePortal(),{canCreateStorageVolumes:m}=Ye(),{data:x}=xe(t.project),f=()=>{l(),n?.()};return e.jsxs(e.Fragment,{children:[c&&e.jsx(d,{children:e.jsx(wt,{close:f,volume:t})}),e.jsxs(a.Button,{appearance:"default","aria-label":"Copy volume",className:q("u-no-margin--bottom has-icon",o),onClick:i,title:m(x)?"Copy volume":"You do not have permission to copy this volume",disabled:!m(x),children:[e.jsx(a.Icon,{name:"canvas"}),e.jsx("span",{children:"Copy"})]})]})},Pt=({volume:t,project:o})=>{const n=je(fe),i=$(),l=a.useToastNotification(),c=n?"p-contextual-menu__link":"p-segmented-control__button",d=[e.jsx(Vt,{volume:t,classname:c},"migrate"),e.jsx(_t,{volume:t,classname:c},"copy"),e.jsx(Ft,{volume:t,classname:c},"export"),e.jsx(Ee,{label:"Delete",volume:t,project:o,appearance:"",hasIcon:!0,onFinish:()=>{i(`${_}/ui/project/${encodeURIComponent(o)}/storage/volumes`),l.success(e.jsxs(e.Fragment,{children:["Storage volume"," ",e.jsx(E,{bold:!0,type:"volume",value:t.name})," deleted."]}))},classname:c},"delete")];return e.jsx(e.Fragment,{children:n?e.jsx(a.ContextualMenu,{closeOnOutsideClick:!1,toggleLabel:"Actions",position:"left",hasToggleIcon:!0,title:"actions",children:m=>e.jsx("span",{children:[...d].map(x=>C.cloneElement(x,{onClose:m}))})}):e.jsx("div",{className:"p-segmented-control",children:e.jsx("div",{className:"p-segmented-control__list",children:d})})})},Tt=({volume:t,project:o})=>{const n=$(),i=a.useNotify(),l=a.useToastNotification(),c=C.useState(null),{canEditVolume:d}=w(),m=F(),x=s=>{if((s.used_by?.length??0)>0)return"Can not rename, volume is currently in use.";if(!d(s))return"You do not have permission to rename this volume"},f=A().shape({name:P().test(..._e(o,t.type,c,t)).required("This field is required")}),p=s=>{const r=Pe(t)?`${_}/ui/project/${encodeURIComponent(o)}/storage/pool/${encodeURIComponent(t.pool)}/member/${encodeURIComponent(t.location)}/volumes/${encodeURIComponent(t.type)}/${encodeURIComponent(s.name)}`:`${_}/ui/project/${encodeURIComponent(o)}/storage/pool/${encodeURIComponent(t.pool)}/volumes/${encodeURIComponent(t.type)}/${encodeURIComponent(s.name)}`;n(r),l.success(e.jsxs(e.Fragment,{children:["Storage volume ",e.jsx("strong",{children:t.name})," renamed to"," ",e.jsx(Q,{type:"volume",value:s.name,to:r}),"."]})),j.setFieldValue("isRenaming",!1)},u=s=>{i.failure("Renaming failed",s)},h=()=>{j.setSubmitting(!1)},j=M({initialValues:{name:t.name,isRenaming:!1},validationSchema:f,onSubmit:s=>{if(t.name===s.name){j.setFieldValue("isRenaming",!1),j.setSubmitting(!1);return}De(o,t,s.name,t.location).then(r=>{m.set(r.metadata.id,()=>{p(s)},g=>{u(new Error(g))},h)}).catch(u)}});return e.jsx(we,{name:t.name,parentItems:[e.jsx(be,{to:`${_}/ui/project/${encodeURIComponent(o)}/storage/volumes`,children:"Storage volumes"},1)],controls:t?e.jsx(Pt,{project:o,volume:t}):null,isLoaded:!0,formik:j,renameDisabledReason:x(t)})},Mt=({volume:t})=>{const o=()=>{Se("storage-overview-tab")};C.useEffect(o,[t]),a.useListener(window,o,"resize",!0);const{data:n}=te();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:t.name})]}),e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"Type"}),e.jsx("td",{children:Te(t)})]}),e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"Content type"}),e.jsx("td",{children:Me(t)})]}),e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"Description"}),e.jsx("td",{children:t.description?t.description:"-"})]}),e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"Cluster member"}),e.jsx("td",{children:n?.environment?.server_clustered&&t.location?e.jsx(at,{clusterMember:t.location}):"-"})]}),e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"Pool"}),e.jsx("td",{children:e.jsx(nt,{poolName:t.pool,projectName:t.project,location:t.location})})]}),e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"Date created"}),e.jsx("td",{children:D(t.created_at)})]}),e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"Size"}),e.jsx("td",{children:e.jsx(Je,{volume:t})})]}),e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",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(([i,l],c)=>e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:i}),e.jsx("td",{children:l})]},c))})})})]})]})})})]}),e.jsxs(a.Row,{className:"section",children:[e.jsx(a.Col,{size:3,children:e.jsx("h2",{className:"p-heading--5",children:"Used by"})}),e.jsx(a.Col,{size:7,children:e.jsx(Ge,{storage:t})})]})]})},I=(t,o)=>({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",editRestriction:o,clusterMember:t.location}),Rt=({volume:t})=>{const o=$(),n=a.useNotify(),i=a.useToastNotification(),l=T(),{section:c}=O(),{project:d}=O(),{canEditVolume:m}=w(),x=F();if(!d)return e.jsx(e.Fragment,{children:"Missing project"});const f=A().shape({name:P().required("This field is required")}),p=m(t)?void 0:"You do not have permission to edit this volume",u=b=>{s.setValues(I(b)),l.invalidateQueries({queryKey:[S.storage]}),l.invalidateQueries({queryKey:[S.storage,t.pool,d,b.type,b.name]}),i.success(e.jsxs(e.Fragment,{children:["Storage volume ",e.jsx(N,{volume:t})," updated."]}))},h=b=>{n.failure("Storage volume update failed",b)},j=()=>{s.setSubmitting(!1)},s=M({initialValues:I(t,p),validationSchema:f,enableReinitialize:!0,onSubmit:b=>{const V=le(b,d,t);ne(b.pool,d,{...V,etag:t.etag},t.location).then(k=>{x.set(k.metadata.id,()=>{u(V)},R=>{h(new Error(R))},j)}).catch(h)}}),r=`${v(t)}/configuration`,g=b=>{o(b===W?r:`${r}/${Y(b)}`)};return e.jsxs("div",{className:"edit-storage-volume",children:[e.jsx(it,{formik:s,section:c??Y(W),setSection:g}),e.jsx(lt,{children:s.values.readOnly?null:e.jsxs(e.Fragment,{children:[e.jsx(a.Button,{appearance:"base",onClick:async()=>s.setValues(I(t)),children:"Cancel"}),e.jsx(ct,{formik:s,baseUrl:r,disabled:!s.values.name})]})})]})},Bt=({volume:t,snapshot:o,close:n})=>{const i=F(),l=a.useToastNotification(),c=T(),d=C.useState(null),m=async h=>new Promise((j,s)=>{We(t,o,h).then(r=>{i.set(r.metadata.id,()=>{j()},g=>{s(new Error(g))})}).catch(r=>{s(r)})}),[x,f]=o.expires_at?ye(new Date(o.expires_at)).slice(0,16).split(" "):[null,null],p=async h=>{let j=!0;h.name!==o.name&&await m(h.name).catch(s=>{l.failure("Snapshot update failed",s),j=!1}),j&&l.success(e.jsxs(e.Fragment,{children:["Snapshot ",e.jsx(K,{name:h.name,volume:t})," ","saved."]})),c.invalidateQueries({predicate:s=>s.queryKey[0]===S.volumes||s.queryKey[0]===S.storage}),u.setSubmitting(!1),n()},u=M({initialValues:{name:o.name,expirationDate:x,expirationTime:f},validateOnMount:!0,validationSchema:Ze(t,d,o.name),onSubmit:async h=>{const j=h.expirationDate&&h.expirationTime?Ce(Ue(h.expirationDate,h.expirationTime)):null;j!==o.expires_at&&await Xe(t,o,j).then(s=>{i.set(s.metadata.id,()=>{p(h)},r=>{l.failure("Snapshot update failed",new Error(r))})}).catch(s=>{l.failure("Snapshot update failed",s)})}});return e.jsx(mt,{isEdit:!0,formik:u,close:n})},Lt=({volume:t,snapshot:o,isDeleting:n,isRestoring:i})=>{const{openPortal:l,closePortal:c,isOpen:d,Portal:m}=a.usePortal(),{canManageStorageVolumeSnapshots:x}=w();return e.jsxs(e.Fragment,{children:[d&&e.jsx(m,{children:e.jsx(Bt,{close:c,volume:t,snapshot:o})}),e.jsx(a.Button,{appearance:"base",hasIcon:!0,dense:!0,disabled:!x(t)||n||i,onClick:l,type:"button","aria-label":"Edit snapshot",title:x(t)?"Edit":"You do not have permission to edit this snapshot",children:e.jsx(a.Icon,{name:"edit"})})]})},Dt=({volume:t,snapshot:o})=>{const n=F(),i=a.useNotify(),l=a.useToastNotification(),[c,d]=C.useState(!1),[m,x]=C.useState(!1),f=T(),{canManageStorageVolumeSnapshots:p}=w(),u=s=>p(t)?`${s} snapshot`:`You do not have permission to ${s.toLowerCase()} this snapshot`,h=()=>{d(!0);const s=e.jsx(K,{name:o.name,volume:t});tt(t,o).then(r=>{n.set(r.metadata.id,()=>l.success(e.jsxs(e.Fragment,{children:["Snapshot"," ",e.jsx(E,{bold:!0,type:"snapshot",value:o.name})," ","deleted for volume ",e.jsx(N,{volume:t}),"."]})),g=>l.failure(`Snapshot ${o.name} deletion failed`,new Error(g),s),()=>{d(!1),f.invalidateQueries({predicate:g=>g.queryKey[0]===S.volumes||g.queryKey[0]===S.storage})})}).catch(r=>{i.failure("Snapshot deletion failed",r,s),d(!1)})},j=()=>{x(!0),et(t,o).then(()=>{l.success(e.jsxs(e.Fragment,{children:["Snapshot"," ",e.jsx(K,{name:o.name,volume:t})," ","restored for volume ",e.jsx(N,{volume:t}),"."]}))}).catch(s=>{i.failure("Snapshot restore failed",s)}).finally(()=>{x(!1),f.invalidateQueries({predicate:s=>s.queryKey[0]===S.volumes||s.queryKey[0]===S.storage})})};return e.jsx(e.Fragment,{children:e.jsx(a.List,{inline:!0,className:q("u-no-margin--bottom","actions-list",{"u-snapshot-actions":!c&&!m}),items:[e.jsx(Lt,{volume:t,snapshot:o,isDeleting:c,isRestoring:m},"edit"),e.jsx(a.ConfirmationButton,{appearance:"base",loading:m,className:"has-icon is-dense",title:"Confirm restore",confirmationModalProps:{title:"Confirm restore",children:e.jsxs("p",{children:["This will restore snapshot"," ",e.jsx(E,{type:"snapshot",value:o.name,bold:!0}),".",e.jsx("br",{}),"This action cannot be undone, and can result in data loss."]}),confirmButtonLabel:u("Restore"),confirmButtonAppearance:"positive",onConfirm:j},disabled:!p(t)||c||m,shiftClickEnabled:!0,showShiftClickHint:!0,children:e.jsx(a.Icon,{name:"change-version"})},"restore"),e.jsx(a.ConfirmationButton,{appearance:"base",loading:c,className:"has-icon is-dense",confirmationModalProps:{title:"Confirm delete",children:e.jsxs("p",{children:["This will permanently delete snapshot"," ",e.jsx(E,{type:"snapshot",value:o.name,bold:!0}),".",e.jsx("br",{}),"This action cannot be undone, and can result in data loss."]}),confirmButtonLabel:u("Delete"),onConfirm:h},disabled:!p(t)||c||m,shiftClickEnabled:!0,showShiftClickHint:!0,children:e.jsx(a.Icon,{name:"delete"})},"delete")]})})},Et=({volume:t,snapshotNames:o,onStart:n,onFinish:i})=>{const l=F(),c=a.useToastNotification(),[d,m]=C.useState(!1),x=T(),{canManageStorageVolumeSnapshots:f}=w(),p=jt(),u=o.length,h=()=>{m(!0),n(),ot(t,o,l).then(j=>{const{fulfilledCount:s,rejectedCount:r}=gt(j);s===u?c.success(`${o.length} ${B("snapshot",o.length)} deleted`,p(j)):r===u?c.failure("Snapshot bulk deletion failed",void 0,e.jsxs(e.Fragment,{children:[e.jsx("b",{children:u})," ",B("snapshot",u)," could not be deleted."]}),p(j)):c.failure("Snapshot bulk deletion partially failed",void 0,e.jsxs(e.Fragment,{children:[e.jsx("b",{children:s})," ",B("snapshot",s)," ","deleted.",e.jsx("br",{}),e.jsx("b",{children:r})," ",B("snapshot",r)," ","could not be deleted."]}),p(j)),x.invalidateQueries({predicate:g=>g.queryKey[0]===S.volumes||g.queryKey[0]===S.storage}),m(!1),i()}).catch(j=>{c.failure("Snapshot bulk deletion failed",j),m(!1)})};return e.jsx(xt,{confirmationButtonProps:{loading:d,disabled:!f(t)||d,appearance:""},onDelete:h,entityType:"snapshot",entities:o,deletableEntities:o,buttonLabel:`Delete ${B("snapshot",o.length)}`,disabledReason:f(t)?void 0:"You do not have permission to manage snapshots for this volume"})},It=({volume:t,close:o})=>{const n=a.useNotify(),i=a.useToastNotification(),l=T(),c=F(),d=()=>{i.success(e.jsxs(e.Fragment,{children:["Snapshot configuration updated for volume"," ",e.jsx(N,{volume:t}),"."]})),l.invalidateQueries({queryKey:[S.storage],predicate:p=>p.queryKey[0]===S.volumes||p.queryKey[0]===S.storage})},m=p=>{n.failure("Configuration update failed",p)},x=()=>{o(),f.setSubmitting(!1)},f=M({initialValues:I(t),onSubmit:p=>{const u=le(p,t.project,t);ne(t.pool,t.project,{...u,etag:t.etag},t.location).then(h=>{c.set(h.metadata.id,d,j=>{m(new Error(j))},x)}).catch(m)}});return e.jsx(a.Modal,{close:o,className:"edit-snapshot-config",title:"Snapshot configuration",buttonRow:f.values.readOnly?e.jsx(a.Button,{className:"u-no-margin--bottom u-no-margin--right",onClick:o,children:"Close"}):e.jsxs(e.Fragment,{children:[e.jsx(a.Button,{appearance:"base",className:"u-no-margin--bottom",type:"button",onClick:o,children:"Cancel"}),e.jsx(a.ActionButton,{appearance:"positive",className:"u-no-margin--bottom",loading:f.isSubmitting,disabled:f.isSubmitting,onClick:()=>{f.submitForm()},children:"Save"})]}),children:e.jsx(rt,{formik:f})})},ee=({volume:t,isDisabled:o,className:n})=>{const{openPortal:i,closePortal:l,isOpen:c,Portal:d}=a.usePortal(),{canEditVolume:m}=w();return e.jsxs(e.Fragment,{children:[c&&e.jsx(d,{children:e.jsx("div",{className:"snapshot-list",children:e.jsx(It,{close:l,volume:t})})}),e.jsx(a.Button,{onClick:i,className:n,disabled:!m(t)||o,title:m(t)?"Configure snapshot":"You do not have permission to configure this volume",children:"See configuration"})]})},vt=({volume:t})=>{const[o,n]=C.useState(""),[i,l]=C.useState([]),[c,d]=C.useState([]),[m,x]=C.useState(G()),f=a.useNotify(),{project:p,isLoading:u}=oe(),{data:h,error:j,isLoading:s}=Ne({queryKey:[S.storage,S.snapshots,t.pool,t.project,t.type,t.name,t.location],queryFn:async()=>st(t)}),r=Oe(p);C.useEffect(()=>{const y=new Set(h?.map(z=>z.name)),L=i.filter(z=>y.has(z));L.length!==i.length&&l(L)},[h,i]);const g=h?.filter(y=>!(o&&!y.name.toLowerCase().includes(o.toLowerCase())))??[],b=h&&h.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"}],k=g.map(y=>{const L=e.jsx(Dt,{volume:t,snapshot:y});return{key:y.name,className:"u-row",name:y.name,columns:[{content:e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"u-truncate",title:y.name,children:e.jsx(pt,{item:y})}),m&&e.jsx("div",{className:"u-text--muted",children:D(y.created_at)})]}),role:"rowheader","aria-label":"Name",className:"name"},...m?[]:[{content:D(y.created_at),role:"cell","aria-label":"Created at",className:"created"}],{content:D(y.expires_at??""),role:"cell","aria-label":"Expires at",className:"expiration"},{content:L,role:"cell","aria-label":"Actions",className:"u-align--right actions"}],sortData:{name:y.name.toLowerCase(),created_at:y.created_at,expires_at:y.expires_at}}}),{rows:R,updateSort:ce}=ft({rows:k,defaultSort:"created_at",defaultSortDirection:"descending"}),de=()=>{x(G())};return a.useListener(window,de,"resize",!0),j&&f.failure("Loading storage volume snapshots failed",j),s||u?e.jsx(a.Spinner,{className:"u-loader",text:"Loading...",isMainComponent:!0}):h?e.jsxs("div",{className:"snapshot-list",children:[b&&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--large",type:"text",onChange:y=>{n(y)},placeholder:"Search for snapshots",value:o,"aria-label":"Search for snapshots"})}),e.jsx(ee,{volume:t,className:"u-no-margin--right"}),e.jsx(Z,{volume:t,className:"u-float-right",isDisabled:r})]}):e.jsx("div",{className:"p-panel__controls",children:e.jsx(Et,{volume:t,snapshotNames:i,onStart:()=>{d(i)},onFinish:()=>{d([])}})})}),b?e.jsx(e.Fragment,{children:e.jsx(a.ScrollableTable,{dependencies:[g],tableId:"volume-snapshot-table",belowIds:["status-bar"],children:e.jsx(a.TablePagination,{data:R,id:"pagination",itemName:"snapshot",className:"u-no-margin--top","aria-label":"Table pagination control",description:i.length>0&&e.jsx(ht,{totalCount:h.length??0,itemName:"snapshot",parentName:"volume",selectedNames:i,setSelectedNames:l,filteredNames:g.map(y=>y.name)}),children:e.jsx(ut,{id:"volume-snapshot-table",className:"volume-snapshot-table",headers:V,rows:R,responsive:!0,sortable:!0,emptyStateMsg:"No snapshot found matching this search",itemName:"snapshot",parentName:"instance",selectedNames:i,setSelectedNames:l,disabledNames:c,filteredNames:g.map(y=>y.name),onUpdateSort:ce,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&&r?e.jsxs(e.Fragment,{children:["Snapshots are disabled for project"," ",e.jsx(ie,{projectName:p.name,urlSuffix:"/configuration"}),"."]}):"There are no snapshots for this volume."}),e.jsx("p",{children:e.jsx(Ve,{docPath:"/howto/storage_backup_volume/#storage-backup-snapshots",hasExternalIcon:!0,children:"Learn more about snapshots"})}),e.jsx(ee,{volume:t,isDisabled:r}),e.jsx(Z,{volume:t,className:"empty-state-button",isDisabled:r})]})]}):e.jsx(e.Fragment,{children:"Loading storage volume snapshots failed"})},$t=["Overview","Configuration","Snapshots"],ls=()=>{const{pool:t,project:o,member:n,activeTab:i,type:l,volume:c}=O();if(!t)return e.jsx(e.Fragment,{children:"Missing storage pool"});if(!o)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:d,error:m,isLoading:x}=Ae(t,o,l,c,n);return x?e.jsx(a.Spinner,{className:"u-loader",text:"Loading...",isMainComponent:!0}):d?e.jsx(a.CustomLayout,{header:e.jsx(Tt,{volume:d,project:o}),contentClassName:"detail-page storage-volume-form u-no-padding--bottom",children:e.jsxs(a.Row,{children:[e.jsx(dt,{tabs:$t,activeTab:i,tabUrl:v(d)}),e.jsx(Fe,{}),!i&&e.jsx("div",{role:"tabpanel","aria-labelledby":"overview",children:e.jsx(Mt,{volume:d})}),i==="configuration"&&e.jsx("div",{role:"tabpanel","aria-labelledby":"configuration",children:e.jsx(Rt,{volume:d})}),i==="snapshots"&&e.jsx("div",{role:"tabpanel","aria-labelledby":"snapshots",children:e.jsx(vt,{volume:d})})]})}):e.jsx(ke,{entityType:"volume",entityName:c,errorMessage:m?.message})};export{ls as default};

Youez - 2016 - github.com/yon3zu
LinuXploit