Skip to content

Commit

Permalink
合并主分支 (#1199) (#1201)
Browse files Browse the repository at this point in the history
请不要在没有先创建Issue的情况下创建Pull Request。

## 变更的目的是什么

XXXXX

## 简短的更新日志

- [Bugfix]修复重置offset接口调用过多问题
- [Bugfix]修复消费组Offset重置后,提示重置成功,但是前端不刷新数据,Offset无变化的问题
- [Optimize]消费组详情控制数据实时刷新

## 验证这一变化

XXXX

请遵循此清单,以帮助我们快速轻松地整合您的贡献:

* [ ] 一个 PR(Pull Request的简写)只解决一个问题,禁止一个 PR 解决多个问题;
* [ ] 确保 PR 有对应的 Issue(通常在您开始处理之前创建),除非是书写错误之类的琐碎更改不需要 Issue ;
* [ ] 格式化 PR 及 Commit-Log 的标题及内容,例如 #861 。PS:Commit-Log 需要在 Git Commit
代码时进行填写,在 GitHub 上修改不了;
* [ ] 编写足够详细的 PR 描述,以了解 PR 的作用、方式和原因;
* [ ] 编写必要的单元测试来验证您的逻辑更正。如果提交了新功能或重大更改,请记住在 test 模块中添加 integration-test;
* [ ] 确保编译通过,集成测试通过;

请不要在没有先创建Issue的情况下创建Pull Request。

## 变更的目的是什么

XXXXX

## 简短的更新日志

XX

## 验证这一变化

XXXX

请遵循此清单,以帮助我们快速轻松地整合您的贡献:

* [ ] 一个 PR(Pull Request的简写)只解决一个问题,禁止一个 PR 解决多个问题;
* [ ] 确保 PR 有对应的 Issue(通常在您开始处理之前创建),除非是书写错误之类的琐碎更改不需要 Issue ;
* [ ] 格式化 PR 及 Commit-Log 的标题及内容,例如 #861 。PS:Commit-Log 需要在 Git Commit
代码时进行填写,在 GitHub 上修改不了;
* [ ] 编写足够详细的 PR 描述,以了解 PR 的作用、方式和原因;
* [ ] 编写必要的单元测试来验证您的逻辑更正。如果提交了新功能或重大更改,请记住在 test 模块中添加 integration-test;
* [ ] 确保编译通过,集成测试通过;
  • Loading branch information
Wyb7290 authored Nov 30, 2023
1 parent 2339a6f commit 49d3d07
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ const GroupDetail = (props: any) => {
chartData={chartData}
groupName={hashDataParse(location.hash).groupName}
loading={loadingObj}
refreshKey={refreshKey}
/>
),
// expandedRowRender,
Expand Down Expand Up @@ -268,7 +269,12 @@ const GroupDetail = (props: any) => {
},
}}
/>
<ResetOffsetDrawer visible={resetOffsetVisible} setVisible={setResetOffsetVisible} record={resetOffsetArg}></ResetOffsetDrawer>
<ResetOffsetDrawer
visible={resetOffsetVisible}
setVisible={setResetOffsetVisible}
record={resetOffsetArg}
resetOffsetFn={forceRefresh}
></ResetOffsetDrawer>
</Drawer>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { IconFont } from '@knowdesign/icons';
import API from '@src/api/index';
import { hashDataParse } from '@src/constants/common';
const { Option } = Select;
import PubSub from 'pubsub-js'

export interface MetricLine {
createTime?: number;
Expand Down Expand Up @@ -42,7 +41,7 @@ const metricWithType = [
{ metricName: 'Lag', metricType: 102 },
];

export const ExpandedRow: any = ({ record, groupName }: any) => {
export const ExpandedRow: any = ({ record, groupName, refreshKey }: any) => {
const params: any = useParams<{
clusterId: string;
}>();
Expand Down Expand Up @@ -194,7 +193,7 @@ export const ExpandedRow: any = ({ record, groupName }: any) => {
endTime: timeRange[1],
topNu: 0,
};
Utils.post(API.getTopicGroupMetricHistory(clusterId), params).then((data: Array<MetricData>) => {
Utils.post(API.getTopicGroupMetricHistory(clusterId), params, { timeout: 300000 }).then((data: Array<MetricData>) => {
// ! 替换接口返回
setAllGroupMetricsData(data);
});
Expand All @@ -211,15 +210,6 @@ export const ExpandedRow: any = ({ record, groupName }: any) => {
getTopicGroupMetric({ pagination, sorter });
};

// useEffect(() => {
// getTopicGroupMetric();
// }, [sortObj]);

// 订阅重置offset成功的消息
PubSub.subscribe('ConsumerGroup-ResetOffset', function(data){
getTopicGroupMetric({});
})

useEffect(() => {
const hashData = hashDataParse(location.hash);
// if (!hashData.groupName) return;
Expand Down Expand Up @@ -248,7 +238,7 @@ export const ExpandedRow: any = ({ record, groupName }: any) => {
// 获取Consumer列表 表格模式
getTopicGroupMetric({});
});
}, [hashDataParse(location.hash).groupName]);
}, [hashDataParse(location.hash).groupName, refreshKey]);

useEffect(() => {
if (partitionList.length === 0) return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { useParams } from 'react-router-dom';
import EditTable from '../TestingProduce/component/EditTable';
import Api from '@src/api/index';
import moment from 'moment';
import PubSub from 'pubsub-js';

const CustomSelectResetTime = (props: { value?: string; onChange?: (val: Number | String) => void }) => {
const { value, onChange } = props;
Expand Down Expand Up @@ -45,7 +44,7 @@ const CustomSelectResetTime = (props: { value?: string; onChange?: (val: Number
};

export default (props: any) => {
const { record, visible, setVisible } = props;
const { record, visible, setVisible, resetOffsetFn } = props;
const routeParams = useParams<{
clusterId: string;
}>();
Expand Down Expand Up @@ -108,7 +107,7 @@ export default (props: any) => {
});
setVisible(false);
// 发布重置offset成功的消息
PubSub.publish('ConsumerGroup-ResetOffset', '1');
resetOffsetFn();
} else {
notification.error({
message: '重置offset失败',
Expand Down

0 comments on commit 49d3d07

Please sign in to comment.