diff --git a/km-console/packages/layout-clusters-fe/src/pages/MirrorMaker2/index.less b/km-console/packages/layout-clusters-fe/src/pages/MirrorMaker2/index.less
index 826649028..d73f5625a 100644
--- a/km-console/packages/layout-clusters-fe/src/pages/MirrorMaker2/index.less
+++ b/km-console/packages/layout-clusters-fe/src/pages/MirrorMaker2/index.less
@@ -185,7 +185,7 @@
.operate-connector-drawer-use-json {
.CodeMirror.cm-s-default {
- height: calc(100vh - 146px);
+ height: calc(100vh - 196px);
}
.dcloud-form-item {
margin-bottom: 0 !important;
diff --git a/km-console/packages/layout-clusters-fe/src/pages/SecurityACLs/EditDrawer.tsx b/km-console/packages/layout-clusters-fe/src/pages/SecurityACLs/EditDrawer.tsx
index e155f3dad..1cc3a9099 100644
--- a/km-console/packages/layout-clusters-fe/src/pages/SecurityACLs/EditDrawer.tsx
+++ b/km-console/packages/layout-clusters-fe/src/pages/SecurityACLs/EditDrawer.tsx
@@ -132,17 +132,35 @@ const AddDrawer = forwardRef((_, ref) => {
form.validateFields().then((formData) => {
const submitData = [];
const { configType, principle, kafkaUser } = formData;
-
if (configType === 'custom') {
// 1. 自定义权限
// TODO: 需要和后端联调
- const { resourceType, resourcePatternType, aclPermissionType, aclOperation, aclClientHost } = formData;
+ const {
+ resourceType,
+ resourcePatternType,
+ aclPermissionType,
+ aclOperation,
+ aclClientHost,
+ cluster,
+ topicName,
+ topicPatternType,
+ groupName,
+ groupPatternType,
+ transactionalId,
+ transactionalIdPatternType,
+ } = formData;
submitData.push({
clusterId,
kafkaUser: principle === 'all' ? '*' : kafkaUser,
resourceType,
- resourcePatternType,
- resourceName: '*',
+ resourcePatternType: cluster
+ ? 3
+ : topicPatternType
+ ? topicPatternType
+ : groupPatternType
+ ? groupPatternType
+ : transactionalIdPatternType,
+ resourceName: cluster ? cluster : topicName ? topicName : groupName ? groupName : transactionalId,
aclPermissionType,
aclOperation,
aclClientHost,
@@ -348,37 +366,43 @@ const AddDrawer = forwardRef((_, ref) => {
{({ getFieldValue }) =>
getFieldValue(`${type}Principle`) === 'special' ? (
- ({
- validator: (rule: any, value: string) => {
- if (!value) {
- return Promise.reject(`${UpperCaseType}Name 不能为空`);
- }
- if (type === 'topic' && getFieldValue(`${type}PatternType`) === ACL_PATTERN_TYPE['Literal']) {
- return Utils.request(api.getTopicMetadata(clusterId as any, value)).then((res: any) => {
- return res?.exist ? Promise.resolve() : Promise.reject('该 Topic 不存在');
- });
+ type !== 'transactionalId' ? (
+ ({
+ validator: (rule: any, value: string) => {
+ if (!value) {
+ return Promise.reject(`${UpperCaseType}Name 不能为空`);
+ }
+ if (type === 'topic' && getFieldValue(`${type}PatternType`) === ACL_PATTERN_TYPE['Literal']) {
+ return Utils.request(api.getTopicMetadata(clusterId as any, value)).then((res: any) => {
+ return res?.exist ? Promise.resolve() : Promise.reject('该 Topic 不存在');
+ });
+ }
+ return Promise.resolve();
+ },
+ }),
+ ]}
+ >
+ {
+ if (option?.value.includes(value)) {
+ return true;
}
- return Promise.resolve();
- },
- }),
- ]}
- >
- {
- if (option?.value.includes(value)) {
- return true;
- }
- return false;
- }}
- options={type === 'topic' ? topicMetaData : groupMetaData}
- placeholder={`请输入 ${type}Name`}
- />
-
+ return false;
+ }}
+ options={type === 'topic' ? topicMetaData : groupMetaData}
+ placeholder={`请输入 ${type}Name`}
+ />
+
+ ) : (
+
+
+
+ )
) : null
}
@@ -400,7 +424,7 @@ const AddDrawer = forwardRef((_, ref) => {
Deny
-
{
Literal
Prefixed
-
+ */}
{
{({ getFieldValue }) => {
const type = getFieldValue('resourceType');
- if (type === ACL_RESOURCE_TYPE['Cluster'] || type === ACL_RESOURCE_TYPE['TransactionalId']) {
+ if (type === ACL_RESOURCE_TYPE['Cluster']) {
//TODO需要和后端获取集群和事务接口联调
return (
{
);
+ } else if (type === ACL_RESOURCE_TYPE['TransactionalId']) {
+ return ;
} else if (type === ACL_RESOURCE_TYPE['Topic']) {
return ;
} else if (type === ACL_RESOURCE_TYPE['Group']) {
diff --git a/km-console/packages/layout-clusters-fe/src/pages/SecurityACLs/index.tsx b/km-console/packages/layout-clusters-fe/src/pages/SecurityACLs/index.tsx
index 9919afdda..46befe501 100644
--- a/km-console/packages/layout-clusters-fe/src/pages/SecurityACLs/index.tsx
+++ b/km-console/packages/layout-clusters-fe/src/pages/SecurityACLs/index.tsx
@@ -14,6 +14,7 @@ import AddACLDrawer, {
RESOURCE_TO_OPERATIONS_MAP,
RESOURCE_MAP_KEYS,
} from './EditDrawer';
+import { ClustersPermissionMap } from '../CommonConfig';
import './index.less';
const { confirm } = Modal;
@@ -105,7 +106,7 @@ const SecurityACLs = (): JSX.Element => {
};
const columns = () => {
- const baseColumns = [
+ const baseColumns: any = [
{
title: 'Principal',
dataIndex: 'kafkaUser',
@@ -143,7 +144,9 @@ const SecurityACLs = (): JSX.Element => {
title: 'Host',
dataIndex: 'aclClientHost',
},
- {
+ ];
+ if (global.hasPermission && global.hasPermission(ClustersPermissionMap.SECURITY_ACL_DELETE)) {
+ baseColumns.push({
title: '操作',
dataIndex: '',
width: 120,
@@ -156,8 +159,8 @@ const SecurityACLs = (): JSX.Element => {
>
);
},
- },
- ];
+ });
+ }
return baseColumns;
};
@@ -238,15 +241,19 @@ const SecurityACLs = (): JSX.Element => {
-