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

[ISSUE #8602] fix display error after delete current namespace #8609

Merged
merged 1 commit into from
Jun 24, 2022
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
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.