Fixed link to client (#2489)
This commit is contained in:
parent
1c296a1641
commit
495c9e917d
1 changed files with 17 additions and 12 deletions
|
@ -14,24 +14,15 @@ import { useAdminClient } from "../context/auth/AdminClient";
|
||||||
import { RevocationModal } from "./RevocationModal";
|
import { RevocationModal } from "./RevocationModal";
|
||||||
import { LogoutAllSessionsModal } from "./LogoutAllSessionsModal";
|
import { LogoutAllSessionsModal } from "./LogoutAllSessionsModal";
|
||||||
import helpUrls from "../help-urls";
|
import helpUrls from "../help-urls";
|
||||||
|
import { toClient } from "../clients/routes/Client";
|
||||||
|
import { useRealm } from "../context/realm-context/RealmContext";
|
||||||
|
|
||||||
import "./SessionsSection.css";
|
import "./SessionsSection.css";
|
||||||
|
|
||||||
const Clients = (row: UserSessionRepresentation) => {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
{Object.values(row.clients!).map((client) => (
|
|
||||||
<Link key={client} to="" className="pf-u-mx-sm">
|
|
||||||
{client}
|
|
||||||
</Link>
|
|
||||||
))}
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default function SessionsSection() {
|
export default function SessionsSection() {
|
||||||
const { t } = useTranslation("sessions");
|
const { t } = useTranslation("sessions");
|
||||||
const adminClient = useAdminClient();
|
const adminClient = useAdminClient();
|
||||||
|
const { realm } = useRealm();
|
||||||
const [revocationModalOpen, setRevocationModalOpen] = useState(false);
|
const [revocationModalOpen, setRevocationModalOpen] = useState(false);
|
||||||
const [logoutAllSessionsModalOpen, setLogoutAllSessionsModalOpen] =
|
const [logoutAllSessionsModalOpen, setLogoutAllSessionsModalOpen] =
|
||||||
useState(false);
|
useState(false);
|
||||||
|
@ -80,6 +71,20 @@ export default function SessionsSection() {
|
||||||
return userSessions;
|
return userSessions;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const Clients = (row: UserSessionRepresentation) => (
|
||||||
|
<>
|
||||||
|
{Object.entries(row.clients!).map(([clientId, client]) => (
|
||||||
|
<Link
|
||||||
|
key={client}
|
||||||
|
to={toClient({ clientId, realm, tab: "settings" })}
|
||||||
|
className="pf-u-mx-sm"
|
||||||
|
>
|
||||||
|
{client}
|
||||||
|
</Link>
|
||||||
|
))}
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
|
||||||
const dropdownItems = [
|
const dropdownItems = [
|
||||||
<DropdownItem
|
<DropdownItem
|
||||||
key="toggle-modal"
|
key="toggle-modal"
|
||||||
|
|
Loading…
Reference in a new issue