mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-12-25 11:36:34 +08:00
实现在服务中使用分组
This commit is contained in:
@@ -1,31 +0,0 @@
|
||||
package groups
|
||||
|
||||
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 {
|
||||
ClusterId int64
|
||||
}) {
|
||||
groupsResp, err := this.RPC().NodeGroupRPC().FindAllEnabledNodeGroupsWithClusterId(this.AdminContext(), &pb.FindAllEnabledNodeGroupsWithClusterIdRequest{ClusterId: params.ClusterId})
|
||||
if err != nil {
|
||||
this.ErrorPage(err)
|
||||
}
|
||||
|
||||
groupMaps := []maps.Map{}
|
||||
for _, group := range groupsResp.Groups {
|
||||
groupMaps = append(groupMaps, maps.Map{
|
||||
"id": group.Id,
|
||||
"name": group.Name,
|
||||
})
|
||||
}
|
||||
this.Data["groups"] = groupMaps
|
||||
|
||||
this.Success()
|
||||
}
|
||||
@@ -42,7 +42,6 @@ func init() {
|
||||
GetPost("/groups/updatePopup", new(groups.UpdatePopupAction)).
|
||||
Post("/groups/delete", new(groups.DeleteAction)).
|
||||
Post("/groups/sort", new(groups.SortAction)).
|
||||
Post("/groups/options", new(groups.OptionsAction)).
|
||||
GetPost("/groups/selectPopup", new(groups.SelectPopupAction)).
|
||||
|
||||
EndAll()
|
||||
|
||||
Reference in New Issue
Block a user