This commit is contained in:
biss committed 2026-08-04 19:31:43 +08:00
1 parent ec277d4e3f
commit 387f98680b
8 files changed
+224 -1905

No files matched your search

+7 -1098
View File
File diff suppressed because it is too large. Load diff
+3 -18
View File
@@ -34,12 +34,7 @@
height: 3px; height: 3px;
margin-top: 0.48rem; margin-top: 0.48rem;
border-radius: 99px; border-radius: 99px;
background: linear-gradient( background: var(--console-primary);
90deg,
var(--console-teal) 0 34%,
var(--console-amber) 34% 67%,
var(--console-coral) 67%
);
} }
.nexus-nav-label { .nexus-nav-label {
@@ -83,12 +78,7 @@
left: clamp(1.25rem, 3.2vw, 3.75rem); left: clamp(1.25rem, 3.2vw, 3.75rem);
width: 3px; width: 3px;
border-radius: 99px; border-radius: 99px;
background: linear-gradient( background: var(--console-primary);
180deg,
var(--console-teal) 0 34%,
var(--console-amber) 34% 67%,
var(--console-coral) 67%
);
content: ""; content: "";
} }
@@ -267,12 +257,7 @@
position: absolute; position: absolute;
inset: 0 0 auto; inset: 0 0 auto;
height: 4px; height: 4px;
background: linear-gradient( background: var(--console-primary);
90deg,
var(--console-teal) 0 34%,
var(--console-amber) 34% 67%,
var(--console-coral) 67%
);
content: ""; content: "";
} }
+41 -5
View File
@@ -10,13 +10,14 @@ import { useEnvironment } from "../shared/keycloak-ui-shared";
import { import {
Label, Label,
Nav, Nav,
NavExpandable,
NavGroup, NavGroup,
PageSidebar, PageSidebar,
PageSidebarBody PageSidebarBody
} from "../shared/@patternfly/react-core"; } from "../shared/@patternfly/react-core";
import { FormEvent } from "react"; import { FormEvent } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { NavLink, useNavigate } from "react-router-dom"; import { NavLink, useLocation, useNavigate } from "react-router-dom";
import { useAccess } from "./context/access/Access"; import { useAccess } from "./context/access/Access";
import { useRealm } from "./context/realm-context/RealmContext"; import { useRealm } from "./context/realm-context/RealmContext";
import { useServerInfo } from "./context/server-info/ServerInfoProvider"; import { useServerInfo } from "./context/server-info/ServerInfoProvider";
@@ -61,6 +62,7 @@ const LeftNav = ({ title, path, code, id }: LeftNavProps) => {
id={name} id={name}
data-testid={name} data-testid={name}
to={`/${encodedRealm}${path}`} to={`/${encodedRealm}${path}`}
end={path === ""}
className={({ isActive }) => className={({ isActive }) =>
`pf-v5-c-nav__link${isActive ? " pf-m-current" : ""}` `pf-v5-c-nav__link${isActive ? " pf-m-current" : ""}`
} }
@@ -82,6 +84,7 @@ export const PageNav = () => {
const isFeatureEnabled = useIsFeatureEnabled(); const isFeatureEnabled = useIsFeatureEnabled();
const pages = componentTypes?.["org.keycloak.services.ui.extend.UiPageProvider"]; const pages = componentTypes?.["org.keycloak.services.ui.extend.UiPageProvider"];
const navigate = useNavigate(); const navigate = useNavigate();
const { pathname } = useLocation();
const { realm, realmRepresentation } = useRealm(); const { realm, realmRepresentation } = useRealm();
type SelectedItem = { type SelectedItem = {
@@ -113,6 +116,27 @@ export const PageNav = () => {
hasSomeAccess("realm-admin", "admin") && isFeatureEnabled(Feature.Workflows); hasSomeAccess("realm-admin", "admin") && isFeatureEnabled(Feature.Workflows);
const showManageRealm = environment.masterRealm === environment.realm; const showManageRealm = environment.masterRealm === environment.realm;
const realmName = resolveDisplayName(t, realmRepresentation.displayName, realm); const realmName = resolveDisplayName(t, realmRepresentation.displayName, realm);
const managePaths = [
"/organizations",
"/clients",
"/client-scopes",
"/roles",
"/users",
"/groups",
"/sessions",
"/events"
];
const configurePaths = [
"/realm-settings",
"/authentication",
"/permissions",
"/identity-providers",
"/user-federation",
"/workflows",
"/page-section"
];
const isManageActive = managePaths.some(path => pathname.includes(path));
const isConfigureActive = configurePaths.some(path => pathname.includes(path));
return ( return (
<PageSidebar className="keycloak__page_nav__nav"> <PageSidebar className="keycloak__page_nav__nav">
@@ -151,7 +175,13 @@ export const PageNav = () => {
</NavGroup> </NavGroup>
)} )}
{showManage && ( {showManage && (
<NavGroup aria-label={t("manage")} title={t("manage")}> <NavExpandable
className="admin-nav-group"
groupId="manage"
title={t("manage")}
isActive={isManageActive}
isExpanded={isManageActive}
>
{isFeatureEnabled(Feature.Organizations) && {isFeatureEnabled(Feature.Organizations) &&
realmRepresentation.organizationsEnabled && ( realmRepresentation.organizationsEnabled && (
<LeftNav <LeftNav
@@ -171,10 +201,16 @@ export const PageNav = () => {
<LeftNav title="groups" path="/groups" code="GRP" /> <LeftNav title="groups" path="/groups" code="GRP" />
<LeftNav title="sessions" path="/sessions" code="SES" /> <LeftNav title="sessions" path="/sessions" code="SES" />
<LeftNav title="events" path="/events" code="EVT" /> <LeftNav title="events" path="/events" code="EVT" />
</NavGroup> </NavExpandable>
)} )}
{showConfigure && ( {showConfigure && (
<NavGroup aria-label={t("configure")} title={t("configure")}> <NavExpandable
className="admin-nav-group"
groupId="configure"
title={t("configure")}
isActive={isConfigureActive}
isExpanded={isConfigureActive}
>
<LeftNav <LeftNav
title="realmSettings" title="realmSettings"
path="/realm-settings" path="/realm-settings"
@@ -220,7 +256,7 @@ export const PageNav = () => {
code="EXT" code="EXT"
/> />
))} ))}
</NavGroup> </NavExpandable>
)} )}
</Nav> </Nav>
<div className="admin-nav-footer"> <div className="admin-nav-footer">
Loaded 3 of 8 files, more files were not shown because too many files have changed in this diff. Show more