根据权限展示用户、客户端、组、领域设置、认证、事件等业务入口。 新增安全配置概览:领域状态、注册、邮箱验证、暴力破解保护。 侧栏增加领域上下文、状态和业务分组。 重构通用页面标题组件,统一标题、说明、状态、开关和操作区。 增加统一工作区容器,并优化表格、表单及详情页布局。 补充简体中文、繁体中文和英文文案。
66 lines
1.8 KiB
TypeScript
66 lines
1.8 KiB
TypeScript
/**
|
|
* This file has been claimed for ownership from @keycloakify/keycloak-admin-ui version 260700.0.2.
|
|
* To relinquish ownership and restore this file to its original content, run the following command:
|
|
*
|
|
* $ npx keycloakify own --path "admin/KcAdminUi.tsx" --revert
|
|
*/
|
|
|
|
import "@patternfly/patternfly/patternfly-addons.css";
|
|
import "@patternfly/react-core/dist/styles/base.css";
|
|
import { useEffect, useReducer } from "react";
|
|
import { startColorSchemeManagement } from "./colorScheme";
|
|
import { createHashRouter, RouterProvider } from "react-router-dom";
|
|
import { i18n } from "./i18n/i18n";
|
|
import { Root } from "./Root";
|
|
import { routes } from "./routes";
|
|
import { getKcContext } from "./KcContext";
|
|
|
|
import "./index.css";
|
|
import "../console-ui.css";
|
|
import "./workspace.css";
|
|
|
|
const { kcContext } = getKcContext();
|
|
|
|
document.documentElement.dataset.kcThemeName = kcContext.themeName;
|
|
|
|
const router = createHashRouter([
|
|
{
|
|
path: "/",
|
|
element: <Root />,
|
|
children: routes
|
|
}
|
|
]);
|
|
const prI18nInitialized = i18n.init();
|
|
startColorSchemeManagement();
|
|
|
|
export default function KcAdminUi() {
|
|
const [isI18nInitialized, setI18nInitialized] = useReducer(() => true, false);
|
|
|
|
useEffect(() => {
|
|
prI18nInitialized.then(() => setI18nInitialized());
|
|
}, []);
|
|
|
|
useEffect(() => {
|
|
if (!isI18nInitialized) {
|
|
return;
|
|
}
|
|
|
|
const updateDocumentTitle = () => {
|
|
document.title = i18n.t("nexusAdminConsoleTitle");
|
|
};
|
|
|
|
updateDocumentTitle();
|
|
i18n.on("languageChanged", updateDocumentTitle);
|
|
|
|
return () => {
|
|
i18n.off("languageChanged", updateDocumentTitle);
|
|
};
|
|
}, [isI18nInitialized]);
|
|
|
|
if (!isI18nInitialized) {
|
|
return null;
|
|
}
|
|
|
|
return <RouterProvider router={router} />;
|
|
}
|