fix: Topic Messages 详情提示优化

This commit is contained in:
GraceWalk
2022-09-22 15:20:31 +08:00
parent fc82999d45
commit 802b382b36

View File

@@ -10,7 +10,7 @@ const defaultParams: any = {
maxRecords: 100,
pullTimeoutUnitMs: 5000,
// filterPartitionId: 1,
filterOffsetReset: 0
filterOffsetReset: 0,
};
const defaultpaPagination = {
current: 1,
@@ -32,8 +32,8 @@ const TopicMessages = (props: any) => {
// 获取消息开始位置
const offsetResetList = [
{ 'label': 'latest', value: 0 },
{ 'label': 'earliest', value: 1 }
{ label: 'latest', value: 0 },
{ label: 'earliest', value: 1 },
];
// 默认排序
@@ -99,10 +99,10 @@ const TopicMessages = (props: any) => {
const onTableChange = (pagination: any, filters: any, sorter: any, extra: any) => {
setPagination(pagination);
// 只有排序事件时,触发重新请求后端数据
if(extra.action === 'sort') {
if (extra.action === 'sort') {
setSorter({
sortField: sorter.field || '',
sortType: sorter.order ? sorter.order.substring(0, sorter.order.indexOf('end')) : ''
sortType: sorter.order ? sorter.order.substring(0, sorter.order.indexOf('end')) : '',
});
}
// const asc = sorter?.order && sorter?.order === 'ascend' ? true : false;
@@ -137,11 +137,11 @@ const TopicMessages = (props: any) => {
<Form form={form} layout="inline" onFinish={onFinish}>
<Form.Item name="filterOffsetReset">
<Select
options={offsetResetList}
size="small"
style={{ width: '120px' }}
className={'detail-table-select'}
placeholder="请选择offset"
options={offsetResetList}
size="small"
style={{ width: '120px' }}
className={'detail-table-select'}
placeholder="请选择offset"
/>
</Form.Item>
<Form.Item name="filterPartitionId">
@@ -172,7 +172,14 @@ const TopicMessages = (props: any) => {
style={{ margin: '12px 0 4px', padding: '7px 12px', background: '#FFF9E6' }}
message={
<div>
Topic最近的100条messagesmessages<a onClick={jumpConsume}>Produce&Consume</a>
Topic 100 messages
{process.env.BUSINESS_VERSION ? (
<span>
messages <a onClick={jumpConsume}>Produce&Consume</a>
</span>
) : (
''
)}
</div>
}
type="warning"
@@ -194,7 +201,7 @@ const TopicMessages = (props: any) => {
bordered: false,
onChange: onTableChange,
scroll: { x: 'max-content' },
sortDirections: ['descend', 'ascend', 'default']
sortDirections: ['descend', 'ascend', 'default'],
},
}}
/>