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.178
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/41228/share/lxd-ui/assets/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /snap/lxd/41228/share/lxd-ui/assets//PermissionIdpGroups-qlIvMdkn.js
import{j as e,R as N,ay as R,bC as ie,bA as re,u as U,z as Q,s as H,d as o,r as D,a8 as le,t as G,B as A,e as Y,f as V,h as J,o as M,D as $,O as de,b as ue,v as ce,w as pe,L as me,H as ge}from"./index-C5moRkRM.js";import{S as he}from"./SelectableMainTable-wRMsxkIr.js";import{S as fe}from"./SelectedTableNotification-DR6-T9f2.js";import{u as ye}from"./useSortTableData-DOqSqaiW.js";import{u as K,a as X,p as _}from"./useEscCallback-CiLQokzn.js";import{P as L}from"./PageHeader-BRr9_J16.js";import{E as Ie}from"./ExplanationTooltip-AfbgOckm.js";import{P as xe}from"./PermissionGroupsFilter-BXndyO8l.js";import{R as W}from"./ResourceLabel-5vQU6ndJ.js";import{G as Z}from"./GroupSelection-B6dmxkpH.js";import{u as ee}from"./useEditHistory-CaQ4A7TN.js";import{R as te}from"./ResourceLink-CSSa-WON.js";import{u as se}from"./useAuthGroups-C-Po2Wwd.js";import{N as ne}from"./NameWithGroupForm-De399V1v.js";import{B as be}from"./BulkDeleteButton--AqObKRB.js";import{G as Se}from"./GroupSelectionActions-TZWyuTAP.js";const z=({children:t})=>e.jsx(Ie,{explanation:"IDP groups map identity provider groups to LXD groups.",docPath:"/explanation/authorization/#use-groups-defined-by-the-identity-provider",docLabel:"Learn more about IDP groups",children:t}),je=["can_delete","can_edit"],Pe=async t=>{const n=new URLSearchParams;return n.set("recursion","1"),re(n,t,je),fetch(`${N}/1.0/auth/identity-provider-groups?${n.toString()}`).then(R).then(r=>r.metadata)},De=async t=>{await fetch(`${N}/1.0/auth/identity-provider-groups`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:t.name,groups:t.groups})}).then(R)},Ne=async t=>{await fetch(`${N}/1.0/auth/identity-provider-groups/${encodeURIComponent(t.name)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}).then(R)},ve=async(t,n)=>{await fetch(`${N}/1.0/auth/identity-provider-groups/${encodeURIComponent(t)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:n})}).then(R)},Ge=async t=>{await fetch(`${N}/1.0/auth/identity-provider-groups/${encodeURIComponent(t)}`,{method:"DELETE"}).then(R)},Ce=async t=>Promise.allSettled(t.map(async n=>Ge(n))).then(ie),O=()=>{const{isFineGrained:t}=U();return{canDeleteIdpGroup:d=>Q(t,"can_delete",d?.access_entitlements),canEditIdpGroup:d=>Q(t,"can_edit",d?.access_entitlements)}},oe=(t,n)=>["deduplicate","An identity provider group with this name already exists",async r=>n&&r===n||le(r,"",t,"auth/identity-provider-groups")],ae=t=>{const n=H(),r=o.useNotify(),d=o.useToastNotification(),[a,p]=D.useState(!1),{canDeleteIdpGroup:j}=O(),l=[],i=[];t.forEach(u=>{j(u)?i.push(u):l.push(u)});const P=i.length===1;return{deleteIdpGroups:()=>{p(!0);const u=P?e.jsxs(e.Fragment,{children:["IDP group"," ",e.jsx(W,{bold:!0,type:"idp-group",value:i[0].name})," ","deleted."]}):`${i.length} IDP groups deleted.`;Ce(i.map(b=>b.name)).then(()=>{n.invalidateQueries({queryKey:[G.idpGroups]}),n.invalidateQueries({queryKey:[G.currentIdentity]}),d.success(u)}).catch(b=>{r.failure(`${A("IDP group",i.length)} deletion failed`,b)}).finally(()=>{p(!1)})},isDeleting:a,restrictedIdpGroups:l,deletableIdpGroups:i}},we=()=>{const t=K(),n=o.useNotify(),r=o.useToastNotification(),d=H(),a=D.useState(null),{data:p=[],error:j,isLoading:l}=se(),{desiredState:i,save:P}=ee({initialState:{groupsAdded:new Set}});j&&n.failure("Loading panel details failed",j);const y=(x,g)=>{P(g?{groupsAdded:new Set}:{groupsAdded:new Set(x)})},u=()=>{t.clear(),n.clear()};X(u);const b=x=>{const g={name:x.name,groups:Array.from(i.groupsAdded)};m.setSubmitting(!0),De(g).then(()=>{r.success(e.jsxs(e.Fragment,{children:["IDP group"," ",e.jsx(te,{type:"idp-group",value:x.name,to:`${N}/ui/permissions/idp-groups`})," ","created."]})),d.invalidateQueries({queryKey:[G.idpGroups]}),d.invalidateQueries({queryKey:[G.currentIdentity]}),u()}).catch(S=>{n.failure("IDP group creation failed",S)}).finally(()=>{m.setSubmitting(!1)})},I=Y().shape({name:V().test(...oe(a)).required("IDP group name is required")}),m=J({initialValues:{name:""},validationSchema:I,onSubmit:b});return e.jsxs(o.SidePanel,{loading:l,hasError:!p,children:[e.jsx(o.SidePanel.Header,{children:e.jsx(o.SidePanel.HeaderTitle,{children:e.jsx(z,{children:"Create IDP group"})})}),e.jsx(M,{className:"u-no-padding"}),e.jsx(ne,{formik:m}),e.jsx("p",{children:"Groups"}),e.jsx(o.SidePanel.Content,{className:"u-no-padding",children:e.jsx(Z,{groups:p,modifiedGroups:i.groupsAdded,parentItemName:"",selectedGroups:i.groupsAdded,setSelectedGroups:y,toggleGroup:x=>{const g=new Set([...i.groupsAdded]);g.has(x)?g.delete(x):g.add(x),y([...g],g.size===0)},scrollDependencies:[p,i.groupsAdded.size,n.notification,m]})}),e.jsxs(o.SidePanel.Footer,{className:"u-align--right",children:[e.jsx(o.Button,{appearance:"base",onClick:u,className:"u-no-margin--bottom",children:"Cancel"}),e.jsx(o.ActionButton,{appearance:"positive",onClick:()=>{m.submitForm()},className:"u-no-margin--bottom",disabled:!m.isValid||m.isSubmitting||!m.values.name,loading:m.isSubmitting,children:"Create IDP group"})]})]})},Ee=({idpGroups:t})=>{const{deletableIdpGroups:n,restrictedIdpGroups:r,deleteIdpGroups:d}=ae(t),a=()=>{if(r.length)return[`${n.length} ${A("IDP group",n.length)} will be deleted.`,`${r.length} ${A("IDP group",r.length)} that you do not have permission to delete will be ignored.`]};return e.jsx(be,{entities:t,deletableEntities:n,entityType:"IDP group",onDelete:d,disabledReason:n.length?void 0:`You do not have permission to delete the selected ${A("idp group",t.length)}`,className:"u-no-margin--bottom",buttonLabel:`Delete ${t.length} ${A("IDP group",t.length)}`,bulkDeleteBreakdown:a()})},Ae=({idpGroup:t,onClose:n})=>{const r=K(),d=o.useNotify(),a=o.useToastNotification(),p=H(),j=D.useState(null),{data:l=[],error:i,isLoading:P}=se(),{desiredState:y,save:u,undo:b}=ee({initialState:{groupsAdded:new Set,groupsRemoved:new Set}});i&&d.failure("Loading panel details failed",i);const I=new Set(y.groupsAdded);for(const s of t.groups)y.groupsRemoved.has(s)||I.add(s);const m=()=>{const s=new Set;for(const c of t.groups)I.has(c)||s.add(c);for(const c of l)!t.groups.includes(c.name)&&I.has(c.name)&&s.add(c.name);return s},x=(s,c)=>{u(c?{groupsAdded:new Set,groupsRemoved:new Set(l.map(f=>f.name))}:{groupsAdded:new Set(s),groupsRemoved:new Set})},g=s=>{const c=I.has(s),f=new Set(y.groupsAdded),E=new Set(y.groupsRemoved);c?(f.delete(s),E.add(s)):(f.add(s),E.delete(s)),u({groupsAdded:f,groupsRemoved:E})},S=()=>{r.clear(),d.clear(),n?.()};X(S);const T=s=>{const c=new Set(t.groups);for(const v of y.groupsAdded)c.add(v);for(const v of y.groupsRemoved)c.delete(v);let f=Ne({...t,groups:Array.from(c)});t.name!==s.name&&(f=f.then(async()=>ve(t?.name??"",s.name))),h.setSubmitting(!0),f.then(()=>{a.success(e.jsxs(e.Fragment,{children:["IDP group"," ",e.jsx(te,{type:"idp-group",value:s.name,to:`${N}/ui/permissions/idp-groups`})," ","updated."]})),p.invalidateQueries({queryKey:[G.idpGroups]}),p.invalidateQueries({queryKey:[G.currentIdentity]}),S()}).catch(v=>{d.failure("IDP group update failed",v)}).finally(()=>{h.setSubmitting(!1)})},B=Y().shape({name:V().test(...oe(j,r.idpGroup??"")).required("IDP group name is required")}),h=J({initialValues:{name:t?.name??""},enableReinitialize:!0,validationSchema:B,onSubmit:T}),C=m(),F=!!h.touched.name,w=h.isValid&&h.values.name,k=!!C.size,q=F&&w||w&&k;return e.jsxs(o.SidePanel,{loading:P,hasError:!l,children:[e.jsx(o.SidePanel.Header,{children:e.jsx(o.SidePanel.HeaderTitle,{className:"u-truncate",children:e.jsx(z,{children:`Edit IDP group ${t?.name}`})})}),e.jsx(M,{className:"u-no-padding"}),e.jsx(ne,{formik:h}),e.jsx("p",{children:"Map groups to this idp group"}),e.jsx(o.SidePanel.Content,{className:"u-no-padding",children:e.jsx(Z,{groups:l,modifiedGroups:C,parentItemName:"IDP group",parentItems:[t],selectedGroups:I,setSelectedGroups:x,toggleGroup:g,scrollDependencies:[l,C.size,d.notification,h]})}),e.jsx(o.SidePanel.Footer,{className:"u-align--right",children:e.jsx(Se,{modifiedGroups:C,undoChange:b,closePanel:S,onSubmit:()=>{h.submitForm()},loading:h.isSubmitting,disabled:!q||h.isSubmitting,isEdit:!0})})]})},Te=({idpGroup:t})=>{const{canDeleteIdpGroup:n}=O(),{isDeleting:r,deletableIdpGroups:d,deleteIdpGroups:a}=ae([t]);return e.jsx(o.ConfirmationButton,{onHoverText:n(t)?"Delete IDP group":"You do not have permission to delete this IDP group",appearance:"base",className:"has-icon is-dense","aria-label":"Delete IDP group",type:"button",disabled:!n(t),shiftClickEnabled:!0,showShiftClickHint:!0,confirmationModalProps:{title:"Confirm IDP group deletion",confirmButtonLabel:"Delete",confirmButtonLoading:r,onConfirm:a,className:"permission-confirm-modal",children:e.jsxs("p",{children:["Are you sure you want to delete the IDP group"," ",e.jsx(W,{type:"idp-group",value:d[0]?.name,bold:!0}),"?"]})},children:e.jsx($,{icon:"delete"})})},Le=()=>{const{isFineGrained:t}=U();return de({queryKey:[G.idpGroups],queryFn:async()=>Pe(t),enabled:t!==null})},Je=()=>{const t=o.useNotify(),{data:n=[],error:r,isLoading:d}=Le(),a=K(),[p,j]=D.useState(""),[l,i]=D.useState([]),{data:P}=ue(),y=P?.config?.["oidc.groups.claim"],{canCreateIdpGroups:u}=ce(),{canEditIdpGroup:b}=O(),I=pe(),[m,x]=D.useState(!0);r&&t.failure("Loading provider groups failed",r),D.useEffect(()=>{const s=l.filter(c=>n.some(f=>f.name===c));s.length!==l.length&&i(s)},[n]),D.useEffect(()=>{a.idpGroup&&i([a.idpGroup])},[a.idpGroup,n]);const g=[{content:"Name",className:"name",sortKey:"name"},{content:"Mapped groups",sortKey:"groups",className:"u-align--right mapped-groups"},{"aria-label":"Actions",className:"u-align--right actions",heading:"Actions"}],S=n.filter(s=>!p||s.name.toLowerCase().includes(p)),T=n.filter(s=>l.includes(s.name)),B=S.map(s=>{const c=()=>{if(b(s))return e.jsx(o.Button,{appearance:"link",dense:!0,onClick:()=>{a.openEditIdpGroup(s.name)},children:s.groups.length});const f=A("group",s.groups?.length??0),E=s.groups?.join(`
- `),v=`Assigned ${f}:
- ${E}`;return e.jsx("div",{title:s.groups?.length?v:"",children:s.groups?.length||0})};return{key:s.name,name:s.name,className:"u-row",columns:[{content:s.name,role:"rowheader","aria-label":"Name",className:"u-truncate",title:s.name},{content:c(),role:"cell",className:"u-align--right mapped-groups","aria-label":"Number of mapped groups"},{className:"actions u-align--right",content:e.jsx(o.List,{inline:!0,className:"u-no-margin--bottom actions-list",items:[e.jsx(o.Button,{appearance:"base",hasIcon:!0,dense:!0,onClick:()=>{a.openEditIdpGroup(s.name)},type:"button","aria-label":"Edit IDP group details",title:b(s)?"Edit details":"You do not have permission to modify this IDP group",disabled:!b(s),children:e.jsx($,{icon:"edit"})},`edit-${s.name}`),e.jsx(Te,{idpGroup:s},`delete-${s.name}`)]}),role:"cell","aria-label":"Actions"}],sortData:{name:s.name.toLowerCase(),groups:s.groups.length}}}),{rows:h,updateSort:C}=ye({rows:B});if(d)return e.jsx(o.Spinner,{className:"u-loader",text:"Loading...",isMainComponent:!0});const F=()=>l.length>0?e.jsx(fe,{totalCount:n.length??0,itemName:"IDP group",parentName:"",selectedNames:l,setSelectedNames:i,filteredNames:S.map(s=>s.name),hideActions:!!a.panel}):null,w=n.length>0,k=e.jsxs(e.Fragment,{children:[e.jsx(e.Fragment,{children:"Identity provider groups map authentication entities from your identity provider to groups within LXD."}),!y&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),"You need to set your server"," ",e.jsxs(me,{to:`${N}/ui/settings`,children:["configuration (",e.jsx("code",{children:"oidc.groups.claim"}),")"]})," ","to the name of the custom claim that provides the IDP groups."]}),e.jsx("br",{}),e.jsx(ge,{docPath:"/explanation/authorization/#use-groups-defined-by-the-identity-provider",children:"Learn more about IDP groups"})]}),q=w?e.jsxs(e.Fragment,{children:[m&&e.jsx(o.Notification,{severity:"information",onDismiss:()=>{x(!1)},children:k}),e.jsx(o.ScrollableTable,{dependencies:[n],tableId:"idp-groups-table",belowIds:["status-bar"],children:e.jsx(o.TablePagination,{data:h,id:"pagination",itemName:"IDP group",className:"u-no-margin--top","aria-label":"Table pagination control",description:F(),children:e.jsx(he,{id:"idp-groups-table",className:"permission-idp-group-table",headers:g,rows:h,sortable:!0,responsive:!0,emptyStateMsg:"No identity provider groups found matching this search",onUpdateSort:C,itemName:"IDP group",parentName:"",selectedNames:l,setSelectedNames:i,disabledNames:[],filteredNames:S.map(s=>s.name),disableSelect:!!a.panel})})})]}):e.jsxs(o.EmptyState,{className:"empty-state",image:e.jsx($,{icon:"user-group",className:"empty-state-icon"}),title:"No IDP group mappings",children:[e.jsx("p",{children:k}),e.jsxs(o.Button,{className:"empty-state-button",appearance:"positive",onClick:a.openCreateIdpGroup,disabled:!u(),title:u()?"":"You do not have permission to create IDP groups",hasIcon:!I,children:[!I&&e.jsx($,{icon:"plus"}),e.jsx("span",{children:"Create IDP group"})]})]});return e.jsxs(e.Fragment,{children:[e.jsxs(o.CustomLayout,{mainClassName:"permission-idp-groups-list",contentClassName:"u-no-padding--bottom",header:e.jsxs(L,{children:[e.jsxs(L.Left,{children:[e.jsx(L.Title,{children:e.jsx(z,{children:"IDP groups"})}),!l.length&&w?e.jsx(L.Search,{children:e.jsx(xe,{onChange:j,value:p,disabled:!!a.idpGroup})}):null,l.length>0&&!a.panel&&e.jsx(e.Fragment,{children:e.jsx(Ee,{idpGroups:T})})]}),w&&e.jsx(L.BaseActions,{children:!l.length&&e.jsxs(o.Button,{appearance:"positive",className:"u-no-margin--bottom u-float-right",onClick:a.openCreateIdpGroup,disabled:!u(),title:u()?"":"You do not have permission to create IDP groups",hasIcon:!I,children:[!I&&e.jsx($,{icon:"plus"}),e.jsx("span",{children:"Create IDP group"})]})})]}),children:[!a.panel&&e.jsx(M,{}),e.jsx(o.Row,{children:q})]}),a.panel===_.createIdpGroup&&e.jsx(we,{}),a.panel===_.editIdpGroup&&T.length>0&&e.jsx(Ae,{idpGroup:T[0],onClose:()=>{i([])}})]})};export{Je as default};

Youez - 2016 - github.com/yon3zu
LinuXploit