add delete acl entry from acl detail
This commit is contained in:
@@ -72,6 +72,17 @@ public class AclAuthController {
|
|||||||
return aclService.addConsumerAcl(param.toTopicEntry(), param.toGroupEntry());
|
return aclService.addConsumerAcl(param.toTopicEntry(), param.toGroupEntry());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* delete acl .
|
||||||
|
*
|
||||||
|
* @param entry entry
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@DeleteMapping
|
||||||
|
public Object deleteAclByUser(@RequestBody AclEntry entry) {
|
||||||
|
return aclService.deleteAcl(entry);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* delete user acl .
|
* delete user acl .
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ public class AclServiceImpl implements AclService, SmartInitializingSingleton {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override public ResponseData deleteAcl(AclEntry entry) {
|
@Override public ResponseData deleteAcl(AclEntry entry) {
|
||||||
return aclConsole.deleteAcl(entry, false, false, false) ? ResponseData.create().success() : ResponseData.create().failed();
|
return aclConsole.deleteAcl(entry) ? ResponseData.create().success() : ResponseData.create().failed();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public ResponseData addAcl(AclEntry entry) {
|
@Override public ResponseData addAcl(AclEntry entry) {
|
||||||
|
|||||||
@@ -121,6 +121,10 @@ class KafkaAclConsole(config: KafkaConfig) extends KafkaConsole(config: KafkaCon
|
|||||||
}).asInstanceOf[Boolean]
|
}).asInstanceOf[Boolean]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def deleteAcl(entry: AclEntry): Boolean = {
|
||||||
|
deleteAcl(Collections.singleton(entry.toAclBindingFilter))
|
||||||
|
}
|
||||||
|
|
||||||
def deleteUserAcl(entry: AclEntry): Boolean = {
|
def deleteUserAcl(entry: AclEntry): Boolean = {
|
||||||
val filter: AclBindingFilter = entry.toAclBindingFilter
|
val filter: AclBindingFilter = entry.toAclBindingFilter
|
||||||
val delFilter = new AclBindingFilter(new ResourcePatternFilter(ResourceType.ANY, null, filter.patternFilter().patternType()),
|
val delFilter = new AclBindingFilter(new ResourcePatternFilter(ResourceType.ANY, null, filter.patternFilter().patternType()),
|
||||||
|
|||||||
@@ -39,4 +39,8 @@ export const KafkaAclApi = {
|
|||||||
url: "/acl/detail",
|
url: "/acl/detail",
|
||||||
method: "post",
|
method: "post",
|
||||||
},
|
},
|
||||||
|
deleteAcl: {
|
||||||
|
url: "/acl",
|
||||||
|
method: "delete",
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -328,7 +328,7 @@ function getAclList(data, requestParameters) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const columns = [
|
const columns = [
|
||||||
{ title: "用户名", dataIndex: "username", key: "username" },
|
{ title: "用户名", dataIndex: "username", key: "username", width: 200 },
|
||||||
{
|
{
|
||||||
title: "topic列表",
|
title: "topic列表",
|
||||||
dataIndex: "topicList",
|
dataIndex: "topicList",
|
||||||
@@ -347,6 +347,7 @@ const columns = [
|
|||||||
title: "操作",
|
title: "操作",
|
||||||
key: "operation",
|
key: "operation",
|
||||||
scopedSlots: { customRender: "operation" },
|
scopedSlots: { customRender: "operation" },
|
||||||
|
width: 350,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,16 @@
|
|||||||
}
|
}
|
||||||
"
|
"
|
||||||
>>
|
>>
|
||||||
<a slot="name" slot-scope="text">{{ text }}</a>
|
<a slot="action" slot-scope="record">
|
||||||
|
<a-popconfirm
|
||||||
|
:title="'删除操作权限: ' + record.operation + '?'"
|
||||||
|
ok-text="确认"
|
||||||
|
cancel-text="取消"
|
||||||
|
@confirm="onDelete(record)"
|
||||||
|
>
|
||||||
|
<a-button>删除</a-button>
|
||||||
|
</a-popconfirm>
|
||||||
|
</a>
|
||||||
</a-table>
|
</a-table>
|
||||||
</div>
|
</div>
|
||||||
</a-modal>
|
</a-modal>
|
||||||
@@ -98,8 +107,23 @@ export default {
|
|||||||
this.$message.error(res.msg);
|
this.$message.error(res.msg);
|
||||||
} else {
|
} else {
|
||||||
this.data = res.data.list;
|
this.data = res.data.list;
|
||||||
// this.data.slice(0, data.length);
|
}
|
||||||
// this.data.push(...res.data.list);
|
});
|
||||||
|
},
|
||||||
|
onDelete(record) {
|
||||||
|
const param = Object.assign({}, record);
|
||||||
|
delete param["null"];
|
||||||
|
const api = KafkaAclApi.deleteAcl;
|
||||||
|
request({
|
||||||
|
url: api.url,
|
||||||
|
method: api.method,
|
||||||
|
data: param,
|
||||||
|
}).then((res) => {
|
||||||
|
if (res.code != 0) {
|
||||||
|
this.$message.error(res.msg);
|
||||||
|
} else {
|
||||||
|
this.$message.success(res.msg);
|
||||||
|
this.getAclDetail();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user