mirror of
https://github.com/didi/KnowStreaming.git
synced 2025-12-24 11:52:08 +08:00
[Bugfix]修复权限ACL管理中,消费组列表展示错误的问题(#991)
This commit is contained in:
@@ -94,6 +94,7 @@ const api = {
|
|||||||
getTopicGroupPartitionsHistory: (clusterPhyId: number, groupName: string) =>
|
getTopicGroupPartitionsHistory: (clusterPhyId: number, groupName: string) =>
|
||||||
getApi(`/clusters/${clusterPhyId}/groups/${groupName}/partitions`),
|
getApi(`/clusters/${clusterPhyId}/groups/${groupName}/partitions`),
|
||||||
resetGroupOffset: () => getApi('/group-offsets'),
|
resetGroupOffset: () => getApi('/group-offsets'),
|
||||||
|
getGroupOverview: (clusterPhyId: number) => getApi(`/clusters/${clusterPhyId}/groups-overview`),
|
||||||
|
|
||||||
// topics列表
|
// topics列表
|
||||||
getTopicsList: (clusterPhyId: number) => getApi(`/clusters/${clusterPhyId}/topics-overview`),
|
getTopicsList: (clusterPhyId: number) => getApi(`/clusters/${clusterPhyId}/topics-overview`),
|
||||||
|
|||||||
@@ -85,6 +85,7 @@ const AddDrawer = forwardRef((_, ref) => {
|
|||||||
return;
|
return;
|
||||||
});
|
});
|
||||||
const [topicMetaData, setTopicMetaData] = React.useState([]);
|
const [topicMetaData, setTopicMetaData] = React.useState([]);
|
||||||
|
const [groupMetaData, setGroupMetaData] = React.useState([]);
|
||||||
|
|
||||||
// 获取 Topic 元信息
|
// 获取 Topic 元信息
|
||||||
const getTopicMetaData = (newValue: any) => {
|
const getTopicMetaData = (newValue: any) => {
|
||||||
@@ -102,6 +103,21 @@ const AddDrawer = forwardRef((_, ref) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 获取 Group 元信息
|
||||||
|
const getGroupMetaData = () => {
|
||||||
|
Utils.request(api.getGroupOverview(+clusterId), {
|
||||||
|
method: 'GET',
|
||||||
|
}).then((res: any) => {
|
||||||
|
const groups = res?.bizData.map((item: any) => {
|
||||||
|
return {
|
||||||
|
label: item.name,
|
||||||
|
value: item.name,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
setGroupMetaData(groups);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
// 获取 kafkaUser 列表
|
// 获取 kafkaUser 列表
|
||||||
const getKafkaUserList = () => {
|
const getKafkaUserList = () => {
|
||||||
Utils.request(api.getKafkaUsers(clusterId), {
|
Utils.request(api.getKafkaUsers(clusterId), {
|
||||||
@@ -209,6 +225,7 @@ const AddDrawer = forwardRef((_, ref) => {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
getKafkaUserList();
|
getKafkaUserList();
|
||||||
getTopicMetaData('');
|
getTopicMetaData('');
|
||||||
|
getGroupMetaData();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -321,7 +338,7 @@ const AddDrawer = forwardRef((_, ref) => {
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}}
|
}}
|
||||||
options={topicMetaData}
|
options={type === 'topic' ? topicMetaData : groupMetaData}
|
||||||
placeholder={`请输入 ${type}Name`}
|
placeholder={`请输入 ${type}Name`}
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
|||||||
Reference in New Issue
Block a user