in console-ui/src/layouts/MainLayout.js [115:207]
render() {
const {
locale = {},
version,
functionMode,
authEnabled,
consoleUiEnable,
startupMode,
} = this.props;
const { visible } = this.state;
const MenuData = getMenuData(functionMode);
return (
<section
className="next-shell next-shell-desktop next-shell-brand"
style={{ minHeight: '100vh' }}
>
<Header />
<section className="next-shell-sub-main">
<div className="main-container next-shell-main">
<div className="left-panel next-aside-navigation">
<div
className="next-shell-navigation next-shell-mini next-shell-aside"
style={{ padding: 0 }}
>
{this.isShowGoBack() ? (
<div className="go-back" onClick={() => this.goBack()}>
<Icon type="arrow-left" />
</div>
) : (
<>
<h1 className="nav-title">
{locale.nacosName}
<span>{version}</span>
</h1>
<h1 className="nav-mode">
{locale.nacosMode}
<span>{startupMode}</span>
</h1>
<Menu
defaultOpenKeys={this.defaultOpenKeys()}
className="next-nav next-normal next-active next-right next-no-arrow next-nav-embeddable"
openMode="single"
>
{consoleUiEnable &&
consoleUiEnable === 'true' &&
MenuData.map((subMenu, idx) => {
if (subMenu.children) {
const sublabel = subMenu.badge ? (
<span>
<Badge
content={subMenu.badge}
style={{
backgroundColor: '#FC0E3D',
color: '#FFFFFF',
right: '-45px',
top: '-10px',
}}
>
{locale[subMenu.key]}
</Badge>
</span>
) : (
`${locale[subMenu.key]}`
);
return (
<SubMenu key={String(idx)} label={sublabel}>
{subMenu.children.map((item, i) => (
<Item
key={[idx, i].join('-')}
onClick={() => this.navTo(item.url)}
className={this.isCurrentPath(item.url)}
>
{locale[item.key]}
</Item>
))}
</SubMenu>
);
}
return (
<Item
key={String(idx)}
className={['first-menu', this.isCurrentPath(subMenu.url)]
.filter(c => c)
.join(' ')}
onClick={() => this.navTo(subMenu.url)}
>
{locale[subMenu.key]}
</Item>
);
})}
</Menu>
</>
)}