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