mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-25 03:00:25 +08:00
实现基本的域名、记录管理
This commit is contained in:
34
internal/web/actions/default/ns/users/options.go
Normal file
34
internal/web/actions/default/ns/users/options.go
Normal file
@@ -0,0 +1,34 @@
|
||||
package users
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
||||
"github.com/iwind/TeaGo/maps"
|
||||
)
|
||||
|
||||
type OptionsAction struct {
|
||||
actionutils.ParentAction
|
||||
}
|
||||
|
||||
func (this *OptionsAction) RunPost(params struct{}) {
|
||||
usersResp, err := this.RPC().UserRPC().ListEnabledUsers(this.AdminContext(), &pb.ListEnabledUsersRequest{
|
||||
Offset: 0,
|
||||
Size: 10000, // TODO 改进 <ns-user-selector> 组件
|
||||
})
|
||||
if err != nil {
|
||||
this.ErrorPage(err)
|
||||
return
|
||||
}
|
||||
|
||||
userMaps := []maps.Map{}
|
||||
for _, user := range usersResp.Users {
|
||||
userMaps = append(userMaps, maps.Map{
|
||||
"id": user.Id,
|
||||
"fullname": user.Fullname,
|
||||
"username": user.Username,
|
||||
})
|
||||
}
|
||||
this.Data["users"] = userMaps
|
||||
|
||||
this.Success()
|
||||
}
|
||||
Reference in New Issue
Block a user