Skip to content

Commit

Permalink
[ISSUE alibaba#8602] fix display error after delete current namespace (
Browse files Browse the repository at this point in the history
…alibaba#8609)

- fix some warnings, such as use rowProps instead of getRowProps etc
- MainLayout keeps namespace param

Close alibaba#8602
  • Loading branch information
onewe authored Jun 24, 2022
1 parent bbbba1f commit 29b2fa4
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 12 deletions.
7 changes: 5 additions & 2 deletions console-ui/src/layouts/MainLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ class MainLayout extends React.Component {

navTo(url) {
const { search } = this.props.location;
this.props.history.push([url, search].join(''));
let urlSearchParams = new URLSearchParams(search);
urlSearchParams.set('namespace', window.nownamespace);
urlSearchParams.set('namespaceShowName', window.namespaceShowName);
this.props.history.push([url, '?', urlSearchParams.toString()].join(''));
}

isCurrentPath(url) {
Expand Down Expand Up @@ -120,7 +123,7 @@ class MainLayout extends React.Component {
}
return (
<Item
key={idx}
key={String(idx)}
className={['first-menu', this.isCurrentPath(subMenu.url)]
.filter(c => c)
.join(' ')}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ class PasswordReset extends React.Component {
render() {
const { locale } = this.props;
const { getError } = this.field;
const { username, onOk, onCancel } = this.props;
const { username, onOk, onCancel, visible } = this.props;
return (
<>
<Dialog
title={locale.resetPassword}
visible={username}
visible={visible}
onOk={() => {
const vals = this.check();
if (vals) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ class ClusterNodeList extends React.Component {
<Table
dataSource={this.state.dataSource}
locale={{ empty: pubNoData }}
getRowProps={row => this.rowColor(row)}
rowProps={row => this.rowColor(row)}
>
<Column title={locale.nodeIp} dataIndex="address" width="20%" />
<Column
Expand Down
6 changes: 4 additions & 2 deletions console-ui/src/pages/NameSpace/NameSpace.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class NameSpace extends React.Component {
this.state = {
loading: false,
defaultNamespace: '',
defaultNamespaceName: 'public',
dataSource: [],
};
}
Expand Down Expand Up @@ -162,8 +163,6 @@ class NameSpace extends React.Component {
namespaceName,
namespaceID,
configurationManagement,
removeSuccess,
deletedSuccessfully,
deletedFailure,
} = locale;
Dialog.confirm({
Expand Down Expand Up @@ -193,6 +192,9 @@ class NameSpace extends React.Component {
const urlnamespace = getParams('namespace');
if (record.namespace === urlnamespace) {
setParams('namespace', this.state.defaultNamespace);
setParams('namespaceShowName', this.state.defaultNamespaceName);
window.nownamespace = this.state.defaultNamespace;
window.namespaceShowName = this.state.defaultNamespaceName;
}
} else {
Dialog.alert({ content: res.message, title: deletedFailure });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ class ServiceList extends React.Component {
<Table
dataSource={this.state.dataSource}
locale={{ empty: pubNoData }}
getRowProps={row => this.rowColor(row)}
rowProps={row => this.rowColor(row)}
loading={this.state.loading}
>
<Column title={locale.columnServiceName} dataIndex="name" />
Expand Down
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?fc5d786f5bd050c52a07" rel="stylesheet"></head>
<link href="./css/main.css?7449a5cb967e58fecbaa" 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?fc5d786f5bd050c52a07"></script></body>
<script type="text/javascript" src="./js/main.js?7449a5cb967e58fecbaa"></script></body>

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

Large diffs are not rendered by default.

0 comments on commit 29b2fa4

Please sign in to comment.