[ISSUE #2089]Config list return page bug fix (#2737)

* keep query criteria

* configlist_returnpage_bug_fix
This commit is contained in:
zhenxianyimeng 2020-06-15 16:35:14 +08:00 committed by GitHub
parent ee8da9ba6f
commit 49ff59ef67
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 58 additions and 25 deletions

View File

@ -185,23 +185,31 @@ class ClusterNodeList extends React.Component {
width="20%"
cell={function(value, index, record) {
if (value === 'UP') {
return (<Tag key={`p_p_${value}`} type="primary" color="green">
{value}
</Tag>);
return (
<Tag key={`p_p_${value}`} type="primary" color="green">
{value}
</Tag>
);
}
if (value === 'DOWN') {
return (<Tag key={`p_p_${value}`} type="primary" color="red">
{value}
</Tag>);
return (
<Tag key={`p_p_${value}`} type="primary" color="red">
{value}
</Tag>
);
}
if (value === 'SUSPICIOUS') {
return (<Tag key={`p_p_${value}`} type="primary" color="orange">
{value}
</Tag>);
return (
<Tag key={`p_p_${value}`} type="primary" color="orange">
{value}
</Tag>
);
}
return (<Tag key={`p_p_${value}`} type="primary" color="turquoise">
{value}
</Tag>);
return (
<Tag key={`p_p_${value}`} type="primary" color="turquoise">
{value}
</Tag>
);
}}
/>
<Column
@ -210,13 +218,17 @@ class ClusterNodeList extends React.Component {
width="50%"
cell={function(value, index, record) {
function showCollapse() {
const collapse = (<Collapse>
<Panel title="节点元数据">
<ul>
<li><pre>{JSON.stringify(value, null, 4)}</pre></li>
</ul>
</Panel>
</Collapse>);
const collapse = (
<Collapse>
<Panel title="节点元数据">
<ul>
<li>
<pre>{JSON.stringify(value, null, 4)}</pre>
</li>
</ul>
</Panel>
</Collapse>
);
return collapse;
}

View File

@ -54,6 +54,8 @@ class ConfigDetail extends React.Component {
this.tenant = getParams('namespace') || '';
this.searchDataId = getParams('searchDataId') || '';
this.searchGroup = getParams('searchGroup') || '';
this.pageSize = getParams('pageSize');
this.pageNo = getParams('pageNo');
// this.params = window.location.hash.split('?')[1]||'';
}
@ -149,6 +151,8 @@ class ConfigDetail extends React.Component {
group: this.searchGroup,
dataId: this.searchDataId,
namespace: this.tenant,
pageNo: this.pageNo,
pageSize: this.pageSize,
})
);
}

View File

@ -318,8 +318,17 @@ class ConfigEditor extends React.Component {
const namespace = getParams('namespace');
const group = getParams('searchGroup') || '';
const dataId = getParams('searchDataId') || '';
const pageSize = getParams('pageSize');
const pageNo = getParams('pageNo');
this.props.history.push(
generateUrl('/configurationManagement', { serverId, group, dataId, namespace })
generateUrl('/configurationManagement', {
serverId,
group,
dataId,
namespace,
pageSize,
pageNo,
})
);
}

View File

@ -84,7 +84,7 @@ class ConfigurationManagement extends React.Component {
value: '',
visible: false,
total: 0,
pageSize: 10,
pageSize: getParams('pageSize') ? getParams('pageSize') : 10,
currentPage: 1,
dataSource: [],
fieldValue: [],
@ -252,15 +252,21 @@ class ConfigurationManagement extends React.Component {
}
this.tenant = getParams('namespace') || ''; // 为当前实例保存tenant参数
this.serverId = getParams('serverId') || '';
const prePageNo = getParams('pageNo');
const prePageSize = getParams('pageSize');
this.pageNo = prePageNo ? prePageNo : pageNo;
this.pageSize = prePageSize ? prePageSize : this.state.pageSize;
const params = {
dataId: this.dataId,
group: this.group,
appName: this.appName,
config_tags: this.state.config_tags.join(','),
pageNo,
pageSize: this.state.pageSize,
pageNo: prePageNo ? prePageNo : pageNo,
pageSize: prePageSize ? prePageSize : this.state.pageSize,
tenant: this.tenant,
};
setParams('pageSize', null);
setParams('pageNo', null);
if (this.dataId.indexOf('*') !== -1 || this.group.indexOf('*') !== -1) {
params.search = 'blur';
} else {
@ -514,7 +520,7 @@ class ConfigurationManagement extends React.Component {
record.group
}&namespace=${this.tenant}&edasAppName=${this.edasAppName}&searchDataId=${
this.dataId
}&searchGroup=${this.group}`
}&searchGroup=${this.group}&pageSize=${this.pageSize}&pageNo=${this.pageNo}`
);
}
@ -526,7 +532,9 @@ class ConfigurationManagement extends React.Component {
record.group
}&namespace=${this.tenant}&edasAppName=${this.edasAppName}&edasAppId=${
this.edasAppId
}&searchDataId=${this.dataId}&searchGroup=${this.group}`
}&searchDataId=${this.dataId}&searchGroup=${this.group}&pageSize=${this.pageSize}&pageNo=${
this.pageNo
}`
);
}