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

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

Close #8602
This commit is contained in:
onewe 2022-06-24 15:01:08 +08:00 committed by GitHub
parent bbbba1f453
commit 29b2fa4302
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 17 additions and 12 deletions

View File

@ -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) {
@ -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(' ')}

View File

@ -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) {

View File

@ -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

View File

@ -39,6 +39,7 @@ class NameSpace extends React.Component {
this.state = {
loading: false,
defaultNamespace: '',
defaultNamespaceName: 'public',
dataSource: [],
};
}
@ -162,8 +163,6 @@ class NameSpace extends React.Component {
namespaceName,
namespaceID,
configurationManagement,
removeSuccess,
deletedSuccessfully,
deletedFailure,
} = locale;
Dialog.confirm({
@ -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 });

View File

@ -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" />

View File

@ -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>
@ -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>

File diff suppressed because one or more lines are too long