All Downloads are FREE. Search and download functionalities are using the official Maven repository.

theme.keycloak.v2.admin.resources.assets.SessionsTable-fafa2640.js Maven / Gradle / Ivy

There is a newer version: 25.0.1
Show newest version
import{n as A,c as r,cb as I,u as D,d as k,r as d,j as s,B as R,L as p,aO as w,ab as z,g as y,cR as O}from"./index-831988f6.js";import{u as E}from"./ConfirmDialog-927d61dd.js";import{L as T}from"./PaginatingTableToolbar-c55a17f1.js";import{K as V}from"./KeycloakDataTable-2267a354.js";import{u as M}from"./useFormatDate-abfcb505.js";import{b as B}from"./ToolbarContent-186be8fd.js";import{L as F,a as U,b as P}from"./ListItem-dbf5a2d8.js";const W={name:"CubesIcon",height:512,width:512,svgPath:"M488.6 250.2L392 214V105.5c0-15-9.3-28.4-23.4-33.7l-100-37.5c-8.1-3.1-17.1-3.1-25.3 0l-100 37.5c-14.1 5.3-23.4 18.7-23.4 33.7V214l-96.6 36.2C9.3 255.5 0 268.9 0 283.9V394c0 13.6 7.7 26.1 19.9 32.2l100 50c10.1 5.1 22.1 5.1 32.2 0l103.9-52 103.9 52c10.1 5.1 22.1 5.1 32.2 0l100-50c12.2-6.1 19.9-18.6 19.9-32.2V283.9c0-15-9.3-28.4-23.4-33.7zM358 214.8l-85 31.9v-68.2l85-37v73.3zM154 104.1l102-38.2 102 38.2v.6l-102 41.4-102-41.4v-.6zm84 291.1l-85 42.5v-79.1l85-38.8v75.4zm0-112l-102 41.4-102-41.4v-.6l102-38.2 102 38.2v.6zm240 112l-85 42.5v-79.1l85-38.8v75.4zm0-112l-102 41.4-102-41.4v-.6l102-38.2 102 38.2v.6z",yOffset:0,xOffset:0},q=A(W),G=t=>{const{realm:o}=r();return s.jsx(p,{to:w({realm:o,id:t.userId,tab:"sessions"}),children:t.username})},H=t=>{const{realm:o}=r();return s.jsx(F,{variant:U.inline,children:Object.entries(t.clients).map(([n,l])=>s.jsx(P,{children:s.jsx(p,{to:z({realm:o,clientId:n,tab:"sessions"}),children:l})},n))})};function $({loader:t,hiddenColumns:o=[],emptyInstructions:n,logoutUser:l,filter:f,isSearching:g,isPaginated:h}){const{realm:c}=r(),{whoAmI:C}=I(),{t:i}=D("sessions"),{addError:b}=k(),m=M(),[v,x]=d.useState(0),u=()=>x(e=>e+1),j=d.useMemo(()=>[{name:"username",displayKey:"sessions:user",cellRenderer:G},{name:"type",displayKey:"common:type"},{name:"start",displayKey:"sessions:started",cellRenderer:a=>m(new Date(a.start))},{name:"lastAccess",displayKey:"sessions:lastAccess",cellRenderer:a=>m(new Date(a.lastAccess))},{name:"ipAddress",displayKey:"events:ipAddress"},{name:"clients",displayKey:"sessions:clients",cellRenderer:H}].filter(({name:a})=>!o.includes(a)),[c,o]),[K,L]=E({titleKey:"sessions:logoutAllSessions",messageKey:"sessions:logoutAllDescription",continueButtonLabel:"common:confirm",onConfirm:async()=>{try{await y.users.logout({id:l}),u()}catch(e){b("sessions:logoutAllSessionsError",e)}}});async function S(e){await y.realms.deleteSession({realm:c,session:e.id}),e.userId===C.getUserId()?await O.logout({redirectUri:""}):u()}return s.jsxs(s.Fragment,{children:[s.jsx(L,{}),s.jsx(V,{loader:t,ariaLabelKey:"sessions:title",searchPlaceholderKey:"sessions:searchForSession",isPaginated:h,isSearching:g,searchTypeComponent:f,toolbarItem:l&&s.jsx(B,{children:s.jsx(R,{onClick:K,children:i("logoutAllSessions")})}),columns:j,actions:[{title:i("common:signOut"),onRowClick:S}],emptyState:s.jsx(T,{hasIcon:!0,icon:q,message:i("noSessions"),instructions:n||i("noSessionsDescription")})},v)]})}export{q as C,$ as S};
//# sourceMappingURL=SessionsTable-fafa2640.js.map




© 2015 - 2024 Weber Informatics LLC | Privacy Policy