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

修复一些前端问题 #1199

Merged
merged 1 commit into from
Nov 30, 2023
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
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
Loading