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/ProjectConfiguration-duP6UH7r.js
import{bF as U,j as t,r as k,c6 as I,d as r,w as V,K as L,s as $,c as S,D as M,ce as z,R as N,t as B,e as K,f as P,a8 as Q,h as q,cf as A,u as H,J as O,cg as Y,a3 as F,a2 as J,ap as W}from"./index-C5moRkRM.js";import{r as G,i as X,n as Z,d as ee,a as te,c as ie,b as se,p as ne,e as re,v as oe,f as ae,P as T}from"./ProjectForm-B-btT8Ea.js";import{o as ce}from"./ConfigurationTable-CbP4ksvx.js";import{C as E}from"./instanceAndProfilePayloads-OWzzIEo8.js";import{g as le,d as de,a as me}from"./devices-DziiOcJy.js";import{c as ue}from"./imageRegistry-DUJSvWII.js";import{R as fe}from"./RenameHeader-B0XWLDzt.js";import{R as j}from"./ResourceLabel-5vQU6ndJ.js";import{u as D}from"./projects-BYXh-TO0.js";import{U as v}from"./UsedByRow-CGbB_Zua.js";import{P as C}from"./ProjectRichChip-CJO1yxV_.js";import{F as ge}from"./FormFooterLayout-CeiFxYRr.js";import{F as pe}from"./FormSubmitBtn-B_GaKHDH.js";import"./FormMenuItem-C57SBRlg.js";import"./AutoExpandingTextArea-BtMcH1Et.js";import"./ScrollableForm-B4FKGNcE.js";import"./StoragePoolSelector-B2DFQOGf.js";import"./useStoragePools-Crzn42fh.js";import"./useClusterMembers-DYP3yC8I.js";import"./cluster-members-B9SkLa7e.js";import"./StoragePoolSize-BVlyAxMa.js";import"./Meter-BW_a3lG4.js";import"./NetworkSelector-C5MLjtvJ.js";import"./useNetworks-CeA2QAgG.js";import"./ProfileRichChip-DiaW3-Ut.js";import"./ResourceLink-CSSa-WON.js";import"./ProfileResourceLimits-l412cqLM.js";import"./ItemName-Dt16GXN3.js";import"./RichTooltipTable-D64CU4ks.js";import"./usedBy-DXaW3nP7.js";import"./resourceDetails-XsDjMA3V.js";import"./storageVolume-D_kSLHXQ.js";import"./storageBucket-Dt08U0oy.js";import"./TruncatedList-BLaVrNb3.js";import"./StoragePoolExplanationTooltip-CY366rOX.js";import"./ExplanationTooltip-AfbgOckm.js";import"./NetworkExplanationTooltip-iJ9Mk_HD.js";import"./ScrollableConfigurationTable-Co066DBV.js";import"./DiskSizeSelector-T95OK-_Q.js";import"./useResources-5hLrDJjf.js";import"./useClusterGroups-Cie_-_5l.js";import"./useImageRegistries-CUqZ1QFj.js";import"./image-registries-CGiwo-wc.js";import"./images-CQST2R8G.js";import"./EditReplicatorPanel-Bm8QIS1m.js";import"./useEscCallback-CiLQokzn.js";import"./ConfirmationCheckbox-DamTlu4y.js";import"./useClusterLinks-BDw2JUo9.js";import"./cluster-links-BdFv14ie.js";import"./useIdentities-C0Vj9TWR.js";import"./useInstances-B6o12EBG.js";import"./promises-DrIa_NWl.js";import"./index-BCn5QfZZ.js";import"./ClusterLinkRichChip-DuawR_xB.js";import"./ExpandableList-Z2D161-q.js";import"./ProjectSelector-BglOCzqU.js";import"./ReplicatorList-aCMUxRqC.js";import"./BaseLayout-CVDACG-R.js";import"./useSortTableData-DOqSqaiW.js";import"./CreateClusterLink-Ka3SHLUU.js";import"./GroupSelection-B6dmxkpH.js";import"./SelectableMainTable-wRMsxkIr.js";import"./PermissionGroupsFilter-BXndyO8l.js";import"./useAuthGroups-C-Po2Wwd.js";import"./BackLink-CIO3yW-G.js";import"./ConfigFieldDescription-qFQi1Efr.js";import"./useConfigOptions-BxC1oiVQ.js";import"./userKeys-DCvuKatN.js";import"./Breadcrumb-CpbG2SRs.js";import"./UsedByItem-BEoDNz3K.js";import"./useImages-B2pew3-d.js";import"./InstanceRichChip-maOU00Yu.js";import"./InstanceStatus-BeAPw0ld.js";import"./formChangeCount-DmPjPAAr.js";const _e=(e,i,s)=>({name:e.name,readOnly:!0,description:e.description,default_instance_storage_pool:i?de(i):"",default_project_network:i?le(i):"",restricted:e.config.restricted==="true",features_images:e.config["features.images"]==="true",features_profiles:U(e),features_networks:e.config["features.networks"]==="true",features_networks_zones:e.config["features.networks.zones"]==="true",features_storage_buckets:e.config["features.storage.buckets"]==="true",features_storage_volumes:e.config["features.storage.volumes"]==="true",entityType:"project",limits_instances:e.config["limits.instances"]?parseInt(e.config["limits.instances"]):void 0,limits_containers:e.config["limits.containers"]?parseInt(e.config["limits.containers"]):void 0,limits_virtual_machines:e.config["limits.virtual-machines"]?parseInt(e.config["limits.virtual-machines"]):void 0,limits_disk:e.config["limits.disk"],limits_networks:e.config["limits.networks"]?parseInt(e.config["limits.networks"]):void 0,limits_cpu:e.config["limits.cpu"]?parseInt(e.config["limits.cpu"]):void 0,limits_memory:e.config["limits.memory"]?e.config["limits.memory"]:void 0,limits_processes:e.config["limits.processes"]?parseInt(e.config["limits.processes"]):void 0,restricted_cluster_groups:e.config["restricted.cluster.groups"],restricted_cluster_target:e.config["restricted.cluster.target"],restricted_virtual_machines_low_level:e.config["restricted.virtual-machines.lowlevel"],restricted_containers_low_level:e.config["restricted.containers.lowlevel"],restricted_containers_nesting:e.config["restricted.containers.nesting"],restricted_containers_privilege:e.config["restricted.containers.privilege"],restricted_container_interception:e.config["restricted.containers.interception"],restrict_backups:e.config["restricted.backups"],restrict_snapshots:e.config["restricted.snapshots"],restricted_idmap_uid:e.config["restricted.idmap.uid"],restricted_idmap_gid:e.config["restricted.idmap.gid"],restricted_devices_disk:e.config["restricted.devices.disk"],restricted_devices_disk_paths:e.config["restricted.devices.disk.paths"],restricted_devices_gpu:e.config["restricted.devices.gpu"],restricted_devices_infiniband:e.config["restricted.devices.infiniband"],restricted_devices_nic:e.config["restricted.devices.nic"],restricted_devices_pci:e.config["restricted.devices.pci"],restricted_devices_unix_block:e.config["restricted.devices.unix-block"],restricted_devices_unix_char:e.config["restricted.devices.unix-char"],restricted_devices_unix_hotplug:e.config["restricted.devices.unix-hotplug"],restricted_devices_usb:e.config["restricted.devices.usb"],restricted_network_access:e.config["restricted.networks.access"],restricted_network_subnets:e.config["restricted.networks.subnets"],restricted_network_uplinks:e.config["restricted.networks.uplinks"],restricted_network_zones:e.config["restricted.networks.zones"],restricted_registries:e.config["restricted.registries"],restricted_registries_mode:ue(e.config["restricted.registries"]),replica_mode:e.replica_mode,replica_cluster:e.config["replica.cluster"],editRestriction:s}),he=(e,i)=>{const s=ce(),o=new Set(["name","description","config","replica_mode"]);return{...re(i),config:{...ne(i),...se(i),...i.restricted?{...ie(i),...te(i),...ee(i),...Z(i),...X(i)}:{},...G(i),...E(e.config,s)},...E(e,o)}},ye=({project:e})=>{const i=e.used_by?.filter(s=>!s.includes("/1.0/profiles/default"));return t.jsx("table",{className:"p-main-table delete-project-table",children:t.jsxs("tbody",{children:[t.jsx(v,{entityType:"instance",usedBy:i}),t.jsx(v,{entityType:"profile",usedBy:i}),t.jsx(v,{entityType:"image",usedBy:i}),t.jsx(v,{entityType:"volume",usedBy:i})]})})},xe=({project:e,handleDelete:i,isLoading:s,closePortal:o})=>{const[c,u]=k.useState(!0),l=I(e),a=n=>{u(n.target.value!==e.name)},f=n=>{n.key==="Enter"&&!c&&!s&&i()};return t.jsxs(r.Modal,{title:"Confirm delete",className:"delete-project-dialog",close:o,buttonRow:[t.jsx("span",{className:"u-float-left confirm-input",children:t.jsx(r.Input,{name:"confirm-delete-project-input",type:"text",onChange:a,onKeyDown:f,placeholder:e.name,className:"u-no-margin--bottom"})},"confirm-input"),t.jsx(r.ActionButton,{appearance:"negative",className:"u-no-margin--bottom",onClick:i,loading:s,disabled:c,children:"Permanently delete"},"confirm-action-button")],children:[t.jsx(r.NotificationConsumer,{}),t.jsxs("p",{children:["This will permanently delete project"," ",t.jsx(j,{type:"project",value:e.name,bold:!0}),".",t.jsx("br",{}),"This action cannot be undone, and can result in data loss."]}),!l&&t.jsxs(t.Fragment,{children:["The following items will also be deleted:",t.jsx(ye,{project:e})]}),t.jsx("p",{children:"To continue, please type the project name below."})]})},be=(e,i,s)=>e?i?"The default project cannot be deleted":s?"Delete project":"Delete project and all its resources":"You do not have permission to delete this project",ve=({project:e})=>{const i=V(),s=L(),o=r.useNotify(),c=r.useToastNotification(),u=$(),[l,a]=k.useState(!1),f=S(),{canDeleteProject:n}=D(),{openPortal:_,closePortal:g,isOpen:m,Portal:d}=r.usePortal(),h=e.name==="default",y=I(e),p=()=>{o.clear(),g()},x=()=>{c.success(t.jsxs(t.Fragment,{children:["Project ",t.jsx(j,{bold:!0,type:"project",value:e.name})," ","deleted."]}))},w=()=>{a(!0),z(e,!y).then(R=>{f(`${N}/ui/project/default/instances`),c.info(t.jsxs(t.Fragment,{children:["Deletion of project"," ",t.jsx(j,{bold:!0,type:"project",value:e.name})," has started."]})),s.set(R.metadata.id,()=>{x()},b=>c.failure(`Deleting project ${e.name} failed`,new Error(b))),p()}).catch(R=>{a(!1),o.failure("Project deletion failed",R);const b=document.querySelector(".delete-project-dialog .p-modal__dialog");b&&b.scrollTo({top:0,behavior:"smooth"})}).finally(()=>{u.invalidateQueries({queryKey:[B.projects]})})};return t.jsxs(t.Fragment,{children:[t.jsx(r.Button,{onClick:_,hasIcon:!i,disabled:!n(e)||h||l,className:"u-no-margin--bottom",children:t.jsxs(r.Tooltip,{message:be(n(e),h,y),children:[!i&&t.jsx(M,{icon:"delete"}),t.jsx("span",{children:"Delete project"})]})}),m&&t.jsx(d,{children:t.jsx(xe,{project:e,handleDelete:w,isLoading:l,closePortal:p})})]})},Pe=({project:e})=>{const i=L(),s=S(),o=r.useToastNotification(),c=k.useState(null),{canEditProject:u}=D(),l=K().shape({name:P().test("deduplicate","A project with this name already exists",async n=>e.name===n||Q(n,"",c,"projects")).required("Project name is required")}),a=q({initialValues:{name:e.name,isRenaming:!1},validationSchema:l,onSubmit:n=>{if(e.name===n.name){a.setFieldValue("isRenaming",!1),a.setSubmitting(!1);return}const _=t.jsx(C,{projectName:e.name,urlSuffix:"/configuration"});A(e.name,n.name).then(g=>{i.set(g.metadata.id,()=>{const m=`${N}/ui/project/${encodeURIComponent(n.name)}/configuration`;s(m),o.success(t.jsxs(t.Fragment,{children:["Project ",t.jsx("strong",{children:e.name})," renamed to"," ",t.jsx(C,{projectName:n.name,urlSuffix:"/configuration"}),"."]})),a.setFieldValue("isRenaming",!1)},m=>o.failure(`Renaming project ${e.name} failed`,new Error(m),_),()=>{a.setSubmitting(!1)})}).catch(g=>{a.setSubmitting(!1),o.failure(`Renaming project ${e.name} failed`,g,_)})}}),f=()=>{if(!u(e))return"You do not have permission to rename this project";if(e.name==="default")return"Cannot rename the default project";if(!(e.used_by&&e.used_by.length===1&&e.used_by[0].split("?")[0]==="/1.0/profiles/default")&&e.used_by&&e.used_by.length>0)return"Cannot rename a non-empty project."};return t.jsx(fe,{name:e.name,parentItems:["Project configuration"],renameDisabledReason:f(),controls:t.jsx(ve,{project:e}),isLoaded:!!e,formik:a})},ke=({project:e})=>{const i=S(),{isRestricted:s}=H(),o=r.useNotify(),c=r.useToastNotification(),u=$(),{section:l}=O(),{canEditProject:a}=D(),{data:f}=me("default",e.name),n=()=>{J("form-contents","p-bottom-controls")};k.useEffect(n,[o.notification?.message,l]),r.useListener(window,n,"resize",!0);const _=K().shape({name:P().required(),replica_mode:P().oneOf(["","leader","standby"]).optional(),replica_cluster:P().optional()}),g=a(e)?void 0:"You do not have permission to edit this project",m=_e(e,f,g),d=q({initialValues:m,validationSchema:_,validate:oe,enableReinitialize:!0,onSubmit:p=>{const x=he(e,p);x.etag=e.etag,Y(x).then(()=>{c.success(t.jsxs(t.Fragment,{children:["Project"," ",t.jsx(C,{projectName:e.name,urlSuffix:"/instances"})," ","updated."]})),d.setFieldValue("readOnly",!0)}).catch(w=>{o.failure("Project update failed",w)}).finally(()=>{d.setSubmitting(!1),u.invalidateQueries({queryKey:[B.projects]})})}}),h=`${N}/ui/project/${encodeURIComponent(e.name)}/configuration`,y=p=>{i(p===T?h:`${h}/${F(p)}`)};return t.jsxs(r.CustomLayout,{header:t.jsx(Pe,{project:e}),contentClassName:"edit-project",children:[t.jsx(ae,{formik:d,project:e,section:l??F(T),updateSection:y,isEdit:!0}),!s&&t.jsx(ge,{children:d.values.readOnly?null:t.jsxs(t.Fragment,{children:[t.jsx(r.Button,{appearance:"base",onClick:async()=>d.setValues(m),children:"Cancel"}),t.jsx(pe,{formik:d,baseUrl:h,disabled:!d.values.name})]})})]})},Qt=()=>{const{project:e}=O();if(!e)return t.jsx(t.Fragment,{children:"Missing project"});const{data:i,isLoading:s}=W(e);return s?t.jsx(r.Spinner,{className:"u-loader",text:"Loading...",isMainComponent:!0}):i?t.jsx(ke,{project:i},i.name):t.jsx(t.Fragment,{children:"Loading project failed"})};export{Qt as default};

Youez - 2016 - github.com/yon3zu
LinuXploit