feat: complete group tree (#1967)

* feat: complete group tree

* feat: ui

* fix: i18n

* refactor code

* fix: support remove user from group

* fix: format code

* Update organization.go

* Update organization.go

* Update user_group.go

---------

Co-authored-by: hsluoyz <hsluoyz@qq.com>
This commit is contained in:
Yaodong Yu
2023-06-14 23:27:46 +08:00
committed by GitHub
parent 8e6755845f
commit 7058a34f87
29 changed files with 436 additions and 148 deletions

View File

@ -90,7 +90,7 @@ func (c *ApiController) GetUsers() {
if limit == "" || page == "" {
if groupId != "" {
maskedUsers, err := object.GetMaskedUsers(object.GetUsersByGroup(groupId))
maskedUsers, err := object.GetMaskedUsers(object.GetGroupUsers(groupId))
if err != nil {
c.ResponseError(err.Error())
return
@ -550,3 +550,12 @@ func (c *ApiController) AddUserkeys() {
c.ResponseOk(affected)
}
func (c *ApiController) RemoveUserFromGroup() {
owner := c.Ctx.Request.Form.Get("owner")
name := c.Ctx.Request.Form.Get("name")
groupId := c.Ctx.Request.Form.Get("groupId")
c.Data["json"] = wrapActionResponse(object.RemoveUserFromGroup(owner, name, groupId))
c.ServeJSON()
}