Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

优化节点显示,添加mode #11275

Merged
merged 1 commit into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion console-ui/src/layouts/MainLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class MainLayout extends React.Component {
location: PropTypes.object,
history: PropTypes.object,
version: PropTypes.any,
startupMode: PropTypes.any,
getState: PropTypes.func,
functionMode: PropTypes.string,
authEnabled: PropTypes.string,
Expand Down Expand Up @@ -98,7 +99,14 @@ class MainLayout extends React.Component {
}

render() {
const { locale = {}, version, functionMode, authEnabled, consoleUiEnable } = this.props;
const {
locale = {},
version,
functionMode,
authEnabled,
consoleUiEnable,
startupMode,
} = this.props;
const { visible } = this.state;
const MenuData = getMenuData(functionMode);
return (
Expand All @@ -124,6 +132,10 @@ class MainLayout extends React.Component {
{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"
Expand Down
24 changes: 22 additions & 2 deletions console-ui/src/layouts/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1507,7 +1507,27 @@ h6 {
text-align: center;
font-size: 14px;
font-weight: bold;
height: 72px;
height: 60px;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
border-bottom: var(--shell-brand-navigation-ver-divider-size, 1px) var(--shell-brand-navigation-ver-divider-style, solid) var(--shell-brand-navigation-ver-divider-color, #EEEEEE);
display: flex;
justify-content: center;
align-items: center;

span {
margin-left: 5px;
}
}

.nav-mode {
margin: 0;
// background-color: #E4F3FE;
text-align: center;
font-size: 12px;
font-weight: bold;
height: 45px;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
Expand Down Expand Up @@ -1561,4 +1581,4 @@ h6 {
.next-dialog-close {
display: none;
}
}
}
5 changes: 3 additions & 2 deletions console-ui/src/locales/en-US.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ const I18N_CONF = {
},
MainLayout: {
nacosName: 'NACOS',
nacosMode: 'MODE',
doesNotExist: 'The page you visit does not exist',
configurationManagementVirtual: 'ConfigManagement',
configurationManagement: 'Configurations',
Expand Down Expand Up @@ -671,8 +672,8 @@ const I18N_CONF = {
readWrite: 'Read and write',
},
Components: {
copySuccessfully: 'Success copied!',
}
copySuccessfully: 'Success copied!',
},
};

export default I18N_CONF;
5 changes: 3 additions & 2 deletions console-ui/src/locales/zh-CN.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const I18N_CONF = {
},
MainLayout: {
nacosName: 'NACOS',
nacosMode: '模式',
doesNotExist: '您访问的页面不存在',
configurationManagementVirtual: '配置管理',
configurationManagement: '配置列表',
Expand Down Expand Up @@ -666,8 +667,8 @@ const I18N_CONF = {
readWrite: '读写',
},
Components: {
copySuccessfully: '复制成功!',
}
copySuccessfully: '复制成功!',
},
};

export default I18N_CONF;
Original file line number Diff line number Diff line change
Expand Up @@ -219,11 +219,12 @@ class ClusterNodeList extends React.Component {
locale={{ empty: pubNoData }}
rowProps={row => this.rowColor(row)}
>
<Column title={locale.nodeIp} dataIndex="address" width="20%" />
<Column title={locale.nodeIp} dataIndex="address" width="20%" align="center" />
<Column
title={locale.nodeState}
dataIndex="state"
width="20%"
width="10%"
align="center"
cell={function(value, index, record) {
if (value === 'UP') {
return (
Expand Down Expand Up @@ -256,7 +257,7 @@ class ClusterNodeList extends React.Component {
<Column
title={locale.extendInfo}
dataIndex="extendInfo"
width="30%"
width="50%"
cell={function(value, index, record) {
function showCollapse() {
const collapse = (
Expand All @@ -280,6 +281,7 @@ class ClusterNodeList extends React.Component {
title={locale.operation}
dataIndex="address"
width="20%"
align="center"
cell={this.renderCol.bind(this)}
/>
</Table>
Expand Down
1 change: 1 addition & 0 deletions console-ui/src/reducers/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ const getState = () => dispatch =>
loginPageEnabled: res.login_page_enabled,
authEnabled: res.auth_enabled,
consoleUiEnable: res.console_ui_enabled,
startupMode: res.startup_mode,
},
});
})
Expand Down
2 changes: 1 addition & 1 deletion console/src/main/resources/static/css/main.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions console/src/main/resources/static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<link rel="stylesheet" type="text/css" href="console-ui/public/css/icon.css">
<link rel="stylesheet" type="text/css" href="console-ui/public/css/font-awesome.css">
<!-- 第三方css结束 -->
<link href="./css/main.css?4b245988901d784c9128" rel="stylesheet"></head>
<link href="./css/main.css?c8c3e819b0fa18cbca1c" rel="stylesheet"></head>

<body>
<div id="root" style="overflow:hidden"></div>
Expand All @@ -56,6 +56,6 @@
<script src="console-ui/public/js/merge.js"></script>
<script src="console-ui/public/js/loader.js"></script>
<!-- 第三方js结束 -->
<script type="text/javascript" src="./js/main.js?4b245988901d784c9128"></script></body>
<script type="text/javascript" src="./js/main.js?c8c3e819b0fa18cbca1c"></script></body>

</html>
6 changes: 3 additions & 3 deletions console/src/main/resources/static/js/main.js

Large diffs are not rendered by default.

Loading