mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-09 16:50:26 +08:00
优化API命名
This commit is contained in:
@@ -79,9 +79,9 @@ func (this *CreateBatchAction) RunPost(params struct {
|
|||||||
resp, err := this.RPC().NodeRPC().CreateNode(this.AdminContext(), &pb.CreateNodeRequest{
|
resp, err := this.RPC().NodeRPC().CreateNode(this.AdminContext(), &pb.CreateNodeRequest{
|
||||||
Name: ip,
|
Name: ip,
|
||||||
NodeClusterId: params.ClusterId,
|
NodeClusterId: params.ClusterId,
|
||||||
GroupId: params.GroupId,
|
NodeGroupId: params.GroupId,
|
||||||
RegionId: params.RegionId,
|
NodeRegionId: params.RegionId,
|
||||||
Login: nil,
|
NodeLogin: nil,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
|
|||||||
@@ -133,9 +133,9 @@ func (this *CreateNodeAction) RunPost(params struct {
|
|||||||
createResp, err := this.RPC().NodeRPC().CreateNode(this.AdminContext(), &pb.CreateNodeRequest{
|
createResp, err := this.RPC().NodeRPC().CreateNode(this.AdminContext(), &pb.CreateNodeRequest{
|
||||||
Name: params.Name,
|
Name: params.Name,
|
||||||
NodeClusterId: params.ClusterId,
|
NodeClusterId: params.ClusterId,
|
||||||
GroupId: params.GroupId,
|
NodeGroupId: params.GroupId,
|
||||||
RegionId: params.RegionId,
|
NodeRegionId: params.RegionId,
|
||||||
Login: loginInfo,
|
NodeLogin: loginInfo,
|
||||||
DnsDomainId: params.DnsDomainId,
|
DnsDomainId: params.DnsDomainId,
|
||||||
DnsRoutes: dnsRouteCodes,
|
DnsRoutes: dnsRouteCodes,
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -43,12 +43,12 @@ func (this *CreatePopupAction) RunPost(params struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.Data["group"] = maps.Map{
|
this.Data["group"] = maps.Map{
|
||||||
"id": createResp.GroupId,
|
"id": createResp.NodeGroupId,
|
||||||
"name": params.Name,
|
"name": params.Name,
|
||||||
}
|
}
|
||||||
|
|
||||||
// 创建日志
|
// 创建日志
|
||||||
defer this.CreateLog(oplogs.LevelInfo, "创建集群分组", createResp.GroupId)
|
defer this.CreateLog(oplogs.LevelInfo, "创建节点分组", createResp.NodeGroupId)
|
||||||
|
|
||||||
this.Success()
|
this.Success()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ func (this *DeleteAction) RunPost(params struct {
|
|||||||
this.Fail("此分组正在被使用不能删除,请修改节点后再删除")
|
this.Fail("此分组正在被使用不能删除,请修改节点后再删除")
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err = this.RPC().NodeGroupRPC().DeleteNodeGroup(this.AdminContext(), &pb.DeleteNodeGroupRequest{GroupId: params.GroupId})
|
_, err = this.RPC().NodeGroupRPC().DeleteNodeGroup(this.AdminContext(), &pb.DeleteNodeGroupRequest{NodeGroupId: params.GroupId})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ func (this *IndexAction) Init() {
|
|||||||
func (this *IndexAction) RunGet(params struct {
|
func (this *IndexAction) RunGet(params struct {
|
||||||
ClusterId int64
|
ClusterId int64
|
||||||
}) {
|
}) {
|
||||||
groupsResp, err := this.RPC().NodeGroupRPC().FindAllEnabledNodeGroupsWithClusterId(this.AdminContext(), &pb.FindAllEnabledNodeGroupsWithClusterIdRequest{
|
groupsResp, err := this.RPC().NodeGroupRPC().FindAllEnabledNodeGroupsWithNodeClusterId(this.AdminContext(), &pb.FindAllEnabledNodeGroupsWithNodeClusterIdRequest{
|
||||||
NodeClusterId: params.ClusterId,
|
NodeClusterId: params.ClusterId,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -27,7 +27,7 @@ func (this *IndexAction) RunGet(params struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
groupMaps := []maps.Map{}
|
groupMaps := []maps.Map{}
|
||||||
for _, group := range groupsResp.Groups {
|
for _, group := range groupsResp.NodeGroups {
|
||||||
countResp, err := this.RPC().NodeRPC().CountAllEnabledNodesWithNodeGroupId(this.AdminContext(), &pb.CountAllEnabledNodesWithNodeGroupIdRequest{NodeGroupId: group.Id})
|
countResp, err := this.RPC().NodeRPC().CountAllEnabledNodesWithNodeGroupId(this.AdminContext(), &pb.CountAllEnabledNodesWithNodeGroupIdRequest{NodeGroupId: group.Id})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
|
|||||||
@@ -18,13 +18,13 @@ func (this *SelectPopupAction) Init() {
|
|||||||
func (this *SelectPopupAction) RunGet(params struct {
|
func (this *SelectPopupAction) RunGet(params struct {
|
||||||
ClusterId int64
|
ClusterId int64
|
||||||
}) {
|
}) {
|
||||||
groupsResp, err := this.RPC().NodeGroupRPC().FindAllEnabledNodeGroupsWithClusterId(this.AdminContext(), &pb.FindAllEnabledNodeGroupsWithClusterIdRequest{NodeClusterId: params.ClusterId})
|
groupsResp, err := this.RPC().NodeGroupRPC().FindAllEnabledNodeGroupsWithNodeClusterId(this.AdminContext(), &pb.FindAllEnabledNodeGroupsWithNodeClusterIdRequest{NodeClusterId: params.ClusterId})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
groupMaps := []maps.Map{}
|
groupMaps := []maps.Map{}
|
||||||
for _, group := range groupsResp.Groups {
|
for _, group := range groupsResp.NodeGroups {
|
||||||
groupMaps = append(groupMaps, maps.Map{
|
groupMaps = append(groupMaps, maps.Map{
|
||||||
"id": group.Id,
|
"id": group.Id,
|
||||||
"name": group.Name,
|
"name": group.Name,
|
||||||
@@ -44,12 +44,12 @@ func (this *SelectPopupAction) RunPost(params struct {
|
|||||||
this.Fail("请选择要使用的分组")
|
this.Fail("请选择要使用的分组")
|
||||||
}
|
}
|
||||||
|
|
||||||
groupResp, err := this.RPC().NodeGroupRPC().FindEnabledNodeGroup(this.AdminContext(), &pb.FindEnabledNodeGroupRequest{GroupId: params.GroupId})
|
groupResp, err := this.RPC().NodeGroupRPC().FindEnabledNodeGroup(this.AdminContext(), &pb.FindEnabledNodeGroupRequest{NodeGroupId: params.GroupId})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
group := groupResp.Group
|
group := groupResp.NodeGroup
|
||||||
if group == nil {
|
if group == nil {
|
||||||
this.NotFound("nodeGroup", params.GroupId)
|
this.NotFound("nodeGroup", params.GroupId)
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ type SortAction struct {
|
|||||||
func (this *SortAction) RunPost(params struct {
|
func (this *SortAction) RunPost(params struct {
|
||||||
GroupIds []int64
|
GroupIds []int64
|
||||||
}) {
|
}) {
|
||||||
_, err := this.RPC().NodeGroupRPC().UpdateNodeGroupOrders(this.AdminContext(), &pb.UpdateNodeGroupOrdersRequest{GroupIds: params.GroupIds})
|
_, err := this.RPC().NodeGroupRPC().UpdateNodeGroupOrders(this.AdminContext(), &pb.UpdateNodeGroupOrdersRequest{NodeGroupIds: params.GroupIds})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -19,12 +19,12 @@ func (this *UpdatePopupAction) Init() {
|
|||||||
func (this *UpdatePopupAction) RunGet(params struct {
|
func (this *UpdatePopupAction) RunGet(params struct {
|
||||||
GroupId int64
|
GroupId int64
|
||||||
}) {
|
}) {
|
||||||
groupResp, err := this.RPC().NodeGroupRPC().FindEnabledNodeGroup(this.AdminContext(), &pb.FindEnabledNodeGroupRequest{GroupId: params.GroupId})
|
groupResp, err := this.RPC().NodeGroupRPC().FindEnabledNodeGroup(this.AdminContext(), &pb.FindEnabledNodeGroupRequest{NodeGroupId: params.GroupId})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
group := groupResp.Group
|
group := groupResp.NodeGroup
|
||||||
if group == nil {
|
if group == nil {
|
||||||
this.NotFound("nodeGroup", params.GroupId)
|
this.NotFound("nodeGroup", params.GroupId)
|
||||||
return
|
return
|
||||||
@@ -48,7 +48,7 @@ func (this *UpdatePopupAction) RunPost(params struct {
|
|||||||
Field("name", params.Name).
|
Field("name", params.Name).
|
||||||
Require("请输入分组名称")
|
Require("请输入分组名称")
|
||||||
_, err := this.RPC().NodeGroupRPC().UpdateNodeGroup(this.AdminContext(), &pb.UpdateNodeGroupRequest{
|
_, err := this.RPC().NodeGroupRPC().UpdateNodeGroup(this.AdminContext(), &pb.UpdateNodeGroupRequest{
|
||||||
GroupId: params.GroupId,
|
NodeGroupId: params.GroupId,
|
||||||
Name: params.Name,
|
Name: params.Name,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -47,8 +47,8 @@ func (this *IndexAction) RunGet(params struct {
|
|||||||
|
|
||||||
countResp, err := this.RPC().NodeRPC().CountAllEnabledNodesMatch(this.AdminContext(), &pb.CountAllEnabledNodesMatchRequest{
|
countResp, err := this.RPC().NodeRPC().CountAllEnabledNodesMatch(this.AdminContext(), &pb.CountAllEnabledNodesMatchRequest{
|
||||||
NodeClusterId: params.ClusterId,
|
NodeClusterId: params.ClusterId,
|
||||||
GroupId: params.GroupId,
|
NodeGroupId: params.GroupId,
|
||||||
RegionId: params.RegionId,
|
NodeRegionId: params.RegionId,
|
||||||
InstallState: types.Int32(params.InstalledState),
|
InstallState: types.Int32(params.InstalledState),
|
||||||
ActiveState: types.Int32(params.ActiveState),
|
ActiveState: types.Int32(params.ActiveState),
|
||||||
Keyword: params.Keyword,
|
Keyword: params.Keyword,
|
||||||
@@ -65,8 +65,8 @@ func (this *IndexAction) RunGet(params struct {
|
|||||||
Offset: page.Offset,
|
Offset: page.Offset,
|
||||||
Size: page.Size,
|
Size: page.Size,
|
||||||
NodeClusterId: params.ClusterId,
|
NodeClusterId: params.ClusterId,
|
||||||
GroupId: params.GroupId,
|
NodeGroupId: params.GroupId,
|
||||||
RegionId: params.RegionId,
|
NodeRegionId: params.RegionId,
|
||||||
InstallState: types.Int32(params.InstalledState),
|
InstallState: types.Int32(params.InstalledState),
|
||||||
ActiveState: types.Int32(params.ActiveState),
|
ActiveState: types.Int32(params.ActiveState),
|
||||||
Keyword: params.Keyword,
|
Keyword: params.Keyword,
|
||||||
@@ -104,19 +104,19 @@ func (this *IndexAction) RunGet(params struct {
|
|||||||
|
|
||||||
// 分组
|
// 分组
|
||||||
var groupMap maps.Map = nil
|
var groupMap maps.Map = nil
|
||||||
if node.Group != nil {
|
if node.NodeGroup != nil {
|
||||||
groupMap = maps.Map{
|
groupMap = maps.Map{
|
||||||
"id": node.Group.Id,
|
"id": node.NodeGroup.Id,
|
||||||
"name": node.Group.Name,
|
"name": node.NodeGroup.Name,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 区域
|
// 区域
|
||||||
var regionMap maps.Map = nil
|
var regionMap maps.Map = nil
|
||||||
if node.Region != nil {
|
if node.NodeRegion != nil {
|
||||||
regionMap = maps.Map{
|
regionMap = maps.Map{
|
||||||
"id": node.Region.Id,
|
"id": node.NodeRegion.Id,
|
||||||
"name": node.Region.Name,
|
"name": node.NodeRegion.Name,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -162,14 +162,14 @@ func (this *IndexAction) RunGet(params struct {
|
|||||||
|
|
||||||
// 所有分组
|
// 所有分组
|
||||||
groupMaps := []maps.Map{}
|
groupMaps := []maps.Map{}
|
||||||
groupsResp, err := this.RPC().NodeGroupRPC().FindAllEnabledNodeGroupsWithClusterId(this.AdminContext(), &pb.FindAllEnabledNodeGroupsWithClusterIdRequest{
|
groupsResp, err := this.RPC().NodeGroupRPC().FindAllEnabledNodeGroupsWithNodeClusterId(this.AdminContext(), &pb.FindAllEnabledNodeGroupsWithNodeClusterIdRequest{
|
||||||
NodeClusterId: params.ClusterId,
|
NodeClusterId: params.ClusterId,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
for _, group := range groupsResp.Groups {
|
for _, group := range groupsResp.NodeGroups {
|
||||||
countResp, err := this.RPC().NodeRPC().CountAllEnabledNodesWithNodeGroupId(this.AdminContext(), &pb.CountAllEnabledNodesWithNodeGroupIdRequest{NodeGroupId: group.Id})
|
countResp, err := this.RPC().NodeRPC().CountAllEnabledNodesWithNodeGroupId(this.AdminContext(), &pb.CountAllEnabledNodesWithNodeGroupIdRequest{NodeGroupId: group.Id})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ func (this *InstallManualAction) RunGet(params struct {
|
|||||||
}) {
|
}) {
|
||||||
this.Data["leftMenuItems"] = LeftMenuItemsForInstall(this.AdminContext(), params.ClusterId, "manual")
|
this.Data["leftMenuItems"] = LeftMenuItemsForInstall(this.AdminContext(), params.ClusterId, "manual")
|
||||||
|
|
||||||
nodesResp, err := this.RPC().NodeRPC().FindAllNotInstalledNodesWithClusterId(this.AdminContext(), &pb.FindAllNotInstalledNodesWithClusterIdRequest{NodeClusterId: params.ClusterId})
|
nodesResp, err := this.RPC().NodeRPC().FindAllNotInstalledNodesWithNodeClusterId(this.AdminContext(), &pb.FindAllNotInstalledNodesWithNodeClusterIdRequest{NodeClusterId: params.ClusterId})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ func (this *InstallRemoteAction) RunGet(params struct {
|
|||||||
}) {
|
}) {
|
||||||
this.Data["leftMenuItems"] = LeftMenuItemsForInstall(this.AdminContext(), params.ClusterId, "install")
|
this.Data["leftMenuItems"] = LeftMenuItemsForInstall(this.AdminContext(), params.ClusterId, "install")
|
||||||
|
|
||||||
nodesResp, err := this.RPC().NodeRPC().FindAllNotInstalledNodesWithClusterId(this.AdminContext(), &pb.FindAllNotInstalledNodesWithClusterIdRequest{NodeClusterId: params.ClusterId})
|
nodesResp, err := this.RPC().NodeRPC().FindAllNotInstalledNodesWithNodeClusterId(this.AdminContext(), &pb.FindAllNotInstalledNodesWithNodeClusterIdRequest{NodeClusterId: params.ClusterId})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -170,19 +170,19 @@ func (this *NodeAction) RunGet(params struct {
|
|||||||
|
|
||||||
// 分组
|
// 分组
|
||||||
var groupMap maps.Map = nil
|
var groupMap maps.Map = nil
|
||||||
if node.Group != nil {
|
if node.NodeGroup != nil {
|
||||||
groupMap = maps.Map{
|
groupMap = maps.Map{
|
||||||
"id": node.Group.Id,
|
"id": node.NodeGroup.Id,
|
||||||
"name": node.Group.Name,
|
"name": node.NodeGroup.Name,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 区域
|
// 区域
|
||||||
var regionMap maps.Map = nil
|
var regionMap maps.Map = nil
|
||||||
if node.Region != nil {
|
if node.NodeRegion != nil {
|
||||||
regionMap = maps.Map{
|
regionMap = maps.Map{
|
||||||
"id": node.Region.Id,
|
"id": node.NodeRegion.Id,
|
||||||
"name": node.Region.Name,
|
"name": node.NodeRegion.Name,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -141,19 +141,19 @@ func (this *UpdateAction) RunGet(params struct {
|
|||||||
|
|
||||||
// 分组
|
// 分组
|
||||||
var groupMap maps.Map = nil
|
var groupMap maps.Map = nil
|
||||||
if node.Group != nil {
|
if node.NodeGroup != nil {
|
||||||
groupMap = maps.Map{
|
groupMap = maps.Map{
|
||||||
"id": node.Group.Id,
|
"id": node.NodeGroup.Id,
|
||||||
"name": node.Group.Name,
|
"name": node.NodeGroup.Name,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 区域
|
// 区域
|
||||||
var regionMap maps.Map = nil
|
var regionMap maps.Map = nil
|
||||||
if node.Region != nil {
|
if node.NodeRegion != nil {
|
||||||
regionMap = maps.Map{
|
regionMap = maps.Map{
|
||||||
"id": node.Region.Id,
|
"id": node.NodeRegion.Id,
|
||||||
"name": node.Region.Name,
|
"name": node.NodeRegion.Name,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -322,11 +322,11 @@ func (this *UpdateAction) RunPost(params struct {
|
|||||||
// 保存
|
// 保存
|
||||||
_, err := this.RPC().NodeRPC().UpdateNode(this.AdminContext(), &pb.UpdateNodeRequest{
|
_, err := this.RPC().NodeRPC().UpdateNode(this.AdminContext(), &pb.UpdateNodeRequest{
|
||||||
NodeId: params.NodeId,
|
NodeId: params.NodeId,
|
||||||
GroupId: params.GroupId,
|
NodeGroupId: params.GroupId,
|
||||||
RegionId: params.RegionId,
|
NodeRegionId: params.RegionId,
|
||||||
Name: params.Name,
|
Name: params.Name,
|
||||||
NodeClusterId: params.ClusterId,
|
NodeClusterId: params.ClusterId,
|
||||||
Login: loginInfo,
|
NodeLogin: loginInfo,
|
||||||
MaxCPU: params.MaxCPU,
|
MaxCPU: params.MaxCPU,
|
||||||
IsOn: params.IsOn,
|
IsOn: params.IsOn,
|
||||||
DnsDomainId: params.DnsDomainId,
|
DnsDomainId: params.DnsDomainId,
|
||||||
|
|||||||
@@ -35,8 +35,8 @@ func (this *IndexAction) RunGet(params struct {
|
|||||||
// 认证
|
// 认证
|
||||||
var grantMap interface{} = nil
|
var grantMap interface{} = nil
|
||||||
|
|
||||||
if cluster.GrantId > 0 {
|
if cluster.NodeGrantId > 0 {
|
||||||
grantResp, err := this.RPC().NodeGrantRPC().FindEnabledNodeGrant(this.AdminContext(), &pb.FindEnabledNodeGrantRequest{NodeGrantId: cluster.GrantId})
|
grantResp, err := this.RPC().NodeGrantRPC().FindEnabledNodeGrant(this.AdminContext(), &pb.FindEnabledNodeGrantRequest{NodeGrantId: cluster.NodeGrantId})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
return
|
return
|
||||||
@@ -81,7 +81,7 @@ func (this *IndexAction) RunPost(params struct {
|
|||||||
_, err := this.RPC().NodeClusterRPC().UpdateNodeCluster(this.AdminContext(), &pb.UpdateNodeClusterRequest{
|
_, err := this.RPC().NodeClusterRPC().UpdateNodeCluster(this.AdminContext(), &pb.UpdateNodeClusterRequest{
|
||||||
NodeClusterId: params.ClusterId,
|
NodeClusterId: params.ClusterId,
|
||||||
Name: params.Name,
|
Name: params.Name,
|
||||||
GrantId: params.GrantId,
|
NodeGrantId: params.GrantId,
|
||||||
InstallDir: params.InstallDir,
|
InstallDir: params.InstallDir,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ func (this *UpdateNodeSSHAction) RunPost(params struct {
|
|||||||
|
|
||||||
_, err := this.RPC().NodeRPC().UpdateNodeLogin(this.AdminContext(), &pb.UpdateNodeLoginRequest{
|
_, err := this.RPC().NodeRPC().UpdateNodeLogin(this.AdminContext(), &pb.UpdateNodeLoginRequest{
|
||||||
NodeId: params.NodeId,
|
NodeId: params.NodeId,
|
||||||
Login: login,
|
NodeLogin: login,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ func (this *UpgradeRemoteAction) RunGet(params struct {
|
|||||||
this.Data["leftMenuItems"] = LeftMenuItemsForInstall(this.AdminContext(), params.ClusterId, "upgrade")
|
this.Data["leftMenuItems"] = LeftMenuItemsForInstall(this.AdminContext(), params.ClusterId, "upgrade")
|
||||||
|
|
||||||
nodes := []maps.Map{}
|
nodes := []maps.Map{}
|
||||||
resp, err := this.RPC().NodeRPC().FindAllUpgradeNodesWithClusterId(this.AdminContext(), &pb.FindAllUpgradeNodesWithClusterIdRequest{NodeClusterId: params.ClusterId})
|
resp, err := this.RPC().NodeRPC().FindAllUpgradeNodesWithNodeClusterId(this.AdminContext(), &pb.FindAllUpgradeNodesWithNodeClusterIdRequest{NodeClusterId: params.ClusterId})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -9,20 +9,20 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
)
|
)
|
||||||
|
|
||||||
// 安装升级相关的左侧菜单
|
// LeftMenuItemsForInstall 安装升级相关的左侧菜单
|
||||||
func LeftMenuItemsForInstall(ctx context.Context, clusterId int64, selectedItem string) []maps.Map {
|
func LeftMenuItemsForInstall(ctx context.Context, clusterId int64, selectedItem string) []maps.Map {
|
||||||
rpcClient, _ := rpc.SharedRPC()
|
rpcClient, _ := rpc.SharedRPC()
|
||||||
countNotInstalled := int64(0)
|
countNotInstalled := int64(0)
|
||||||
countUpgrade := int64(0)
|
countUpgrade := int64(0)
|
||||||
if rpcClient != nil {
|
if rpcClient != nil {
|
||||||
{
|
{
|
||||||
resp, err := rpcClient.NodeRPC().CountAllNotInstalledNodesWithClusterId(ctx, &pb.CountAllNotInstalledNodesWithClusterIdRequest{NodeClusterId: clusterId})
|
resp, err := rpcClient.NodeRPC().CountAllNotInstalledNodesWithNodeClusterId(ctx, &pb.CountAllNotInstalledNodesWithNodeClusterIdRequest{NodeClusterId: clusterId})
|
||||||
if err == nil {
|
if err == nil {
|
||||||
countNotInstalled = resp.Count
|
countNotInstalled = resp.Count
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
resp, err := rpcClient.NodeRPC().CountAllUpgradeNodesWithClusterId(ctx, &pb.CountAllUpgradeNodesWithClusterIdRequest{NodeClusterId: clusterId})
|
resp, err := rpcClient.NodeRPC().CountAllUpgradeNodesWithNodeClusterId(ctx, &pb.CountAllUpgradeNodesWithNodeClusterIdRequest{NodeClusterId: clusterId})
|
||||||
if err == nil {
|
if err == nil {
|
||||||
countUpgrade = resp.Count
|
countUpgrade = resp.Count
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ func (this *CreateAction) RunPost(params struct {
|
|||||||
|
|
||||||
createResp, err := this.RPC().NodeClusterRPC().CreateNodeCluster(this.AdminContext(), &pb.CreateNodeClusterRequest{
|
createResp, err := this.RPC().NodeClusterRPC().CreateNodeCluster(this.AdminContext(), &pb.CreateNodeClusterRequest{
|
||||||
Name: params.Name,
|
Name: params.Name,
|
||||||
GrantId: params.GrantId,
|
NodeGrantId: params.GrantId,
|
||||||
InstallDir: params.InstallDir,
|
InstallDir: params.InstallDir,
|
||||||
DnsDomainId: params.DnsDomainId,
|
DnsDomainId: params.DnsDomainId,
|
||||||
DnsName: params.DnsName,
|
DnsName: params.DnsName,
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ func (this *DeleteAction) RunPost(params struct {
|
|||||||
defer this.CreateLog(oplogs.LevelInfo, "删除SSH认证 %d", params.GrantId)
|
defer this.CreateLog(oplogs.LevelInfo, "删除SSH认证 %d", params.GrantId)
|
||||||
|
|
||||||
// 检查是否有别的集群或节点正在使用
|
// 检查是否有别的集群或节点正在使用
|
||||||
countResp, err := this.RPC().NodeClusterRPC().CountAllEnabledNodeClustersWithGrantId(this.AdminContext(), &pb.CountAllEnabledNodeClustersWithGrantIdRequest{
|
countResp, err := this.RPC().NodeClusterRPC().CountAllEnabledNodeClustersWithNodeGrantId(this.AdminContext(), &pb.CountAllEnabledNodeClustersWithNodeGrantIdRequest{
|
||||||
GrantId: params.GrantId,
|
NodeGrantId: params.GrantId,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
@@ -28,7 +28,7 @@ func (this *DeleteAction) RunPost(params struct {
|
|||||||
this.Fail("有集群正在使用此服务,请修改后再删除")
|
this.Fail("有集群正在使用此服务,请修改后再删除")
|
||||||
}
|
}
|
||||||
|
|
||||||
countResp2, err := this.RPC().NodeRPC().CountAllEnabledNodesWithGrantId(this.AdminContext(), &pb.CountAllEnabledNodesWithGrantIdRequest{GrantId: params.GrantId})
|
countResp2, err := this.RPC().NodeRPC().CountAllEnabledNodesWithNodeGrantId(this.AdminContext(), &pb.CountAllEnabledNodesWithNodeGrantIdRequest{NodeGrantId: params.GrantId})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ func (this *GrantAction) RunGet(params struct {
|
|||||||
|
|
||||||
// 使用此认证的集群
|
// 使用此认证的集群
|
||||||
clusterMaps := []maps.Map{}
|
clusterMaps := []maps.Map{}
|
||||||
clustersResp, err := this.RPC().NodeClusterRPC().FindAllEnabledNodeClustersWithGrantId(this.AdminContext(), &pb.FindAllEnabledNodeClustersWithGrantIdRequest{GrantId: params.GrantId})
|
clustersResp, err := this.RPC().NodeClusterRPC().FindAllEnabledNodeClustersWithNodeGrantId(this.AdminContext(), &pb.FindAllEnabledNodeClustersWithNodeGrantIdRequest{NodeGrantId: params.GrantId})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
return
|
return
|
||||||
@@ -61,7 +61,7 @@ func (this *GrantAction) RunGet(params struct {
|
|||||||
|
|
||||||
// 使用此认证的节点
|
// 使用此认证的节点
|
||||||
nodeMaps := []maps.Map{}
|
nodeMaps := []maps.Map{}
|
||||||
nodesResp, err := this.RPC().NodeRPC().FindAllEnabledNodesWithGrantId(this.AdminContext(), &pb.FindAllEnabledNodesWithGrantIdRequest{GrantId: params.GrantId})
|
nodesResp, err := this.RPC().NodeRPC().FindAllEnabledNodesWithNodeGrantId(this.AdminContext(), &pb.FindAllEnabledNodesWithNodeGrantIdRequest{NodeGrantId: params.GrantId})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ func (this *IndexAction) RunGet(params struct {
|
|||||||
grantMaps := []maps.Map{}
|
grantMaps := []maps.Map{}
|
||||||
for _, grant := range grantsResp.NodeGrants {
|
for _, grant := range grantsResp.NodeGrants {
|
||||||
// 集群数
|
// 集群数
|
||||||
countClustersResp, err := this.RPC().NodeClusterRPC().CountAllEnabledNodeClustersWithGrantId(this.AdminContext(), &pb.CountAllEnabledNodeClustersWithGrantIdRequest{GrantId: grant.Id})
|
countClustersResp, err := this.RPC().NodeClusterRPC().CountAllEnabledNodeClustersWithNodeGrantId(this.AdminContext(), &pb.CountAllEnabledNodeClustersWithNodeGrantIdRequest{NodeGrantId: grant.Id})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
return
|
return
|
||||||
@@ -50,7 +50,7 @@ func (this *IndexAction) RunGet(params struct {
|
|||||||
countClusters := countClustersResp.Count
|
countClusters := countClustersResp.Count
|
||||||
|
|
||||||
// 节点数
|
// 节点数
|
||||||
countNodesResp, err := this.RPC().NodeRPC().CountAllEnabledNodesWithGrantId(this.AdminContext(), &pb.CountAllEnabledNodesWithGrantIdRequest{GrantId: grant.Id})
|
countNodesResp, err := this.RPC().NodeRPC().CountAllEnabledNodesWithNodeGrantId(this.AdminContext(), &pb.CountAllEnabledNodesWithNodeGrantIdRequest{NodeGrantId: grant.Id})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ func (this *IndexAction) RunGet(params struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 需要升级的节点
|
// 需要升级的节点
|
||||||
countUpgradeNodesResp, err := this.RPC().NodeRPC().CountAllUpgradeNodesWithClusterId(this.AdminContext(), &pb.CountAllUpgradeNodesWithClusterIdRequest{NodeClusterId: cluster.Id})
|
countUpgradeNodesResp, err := this.RPC().NodeRPC().CountAllUpgradeNodesWithNodeClusterId(this.AdminContext(), &pb.CountAllUpgradeNodesWithNodeClusterIdRequest{NodeClusterId: cluster.Id})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
return
|
return
|
||||||
@@ -203,19 +203,19 @@ func (this *IndexAction) searchNodes(keyword string) {
|
|||||||
|
|
||||||
// 分组
|
// 分组
|
||||||
var groupMap maps.Map = nil
|
var groupMap maps.Map = nil
|
||||||
if node.Group != nil {
|
if node.NodeGroup != nil {
|
||||||
groupMap = maps.Map{
|
groupMap = maps.Map{
|
||||||
"id": node.Group.Id,
|
"id": node.NodeGroup.Id,
|
||||||
"name": node.Group.Name,
|
"name": node.NodeGroup.Name,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 区域
|
// 区域
|
||||||
var regionMap maps.Map = nil
|
var regionMap maps.Map = nil
|
||||||
if node.Region != nil {
|
if node.NodeRegion != nil {
|
||||||
regionMap = maps.Map{
|
regionMap = maps.Map{
|
||||||
"id": node.Region.Id,
|
"id": node.NodeRegion.Id,
|
||||||
"name": node.Region.Name,
|
"name": node.NodeRegion.Name,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ func (this *ClusterAction) RunGet(params struct {
|
|||||||
this.Data["dnsInfo"] = dnsMap
|
this.Data["dnsInfo"] = dnsMap
|
||||||
|
|
||||||
// 节点DNS解析记录
|
// 节点DNS解析记录
|
||||||
nodesResp, err := this.RPC().NodeRPC().FindAllEnabledNodesDNSWithClusterId(this.AdminContext(), &pb.FindAllEnabledNodesDNSWithClusterIdRequest{NodeClusterId: params.ClusterId})
|
nodesResp, err := this.RPC().NodeRPC().FindAllEnabledNodesDNSWithNodeClusterId(this.AdminContext(), &pb.FindAllEnabledNodesDNSWithNodeClusterIdRequest{NodeClusterId: params.ClusterId})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
return
|
return
|
||||||
@@ -117,7 +117,7 @@ func (this *ClusterAction) RunGet(params struct {
|
|||||||
this.Data["nodes"] = nodeMaps
|
this.Data["nodes"] = nodeMaps
|
||||||
|
|
||||||
// 代理服务解析记录
|
// 代理服务解析记录
|
||||||
serversResp, err := this.RPC().ServerRPC().FindAllEnabledServersDNSWithClusterId(this.AdminContext(), &pb.FindAllEnabledServersDNSWithClusterIdRequest{NodeClusterId: params.ClusterId})
|
serversResp, err := this.RPC().ServerRPC().FindAllEnabledServersDNSWithNodeClusterId(this.AdminContext(), &pb.FindAllEnabledServersDNSWithNodeClusterIdRequest{NodeClusterId: params.ClusterId})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ func (this *NodesPopupAction) RunGet(params struct {
|
|||||||
|
|
||||||
for _, cluster := range clustersResp.NodeClusters {
|
for _, cluster := range clustersResp.NodeClusters {
|
||||||
// 节点DNS解析记录
|
// 节点DNS解析记录
|
||||||
nodesResp, err := this.RPC().NodeRPC().FindAllEnabledNodesDNSWithClusterId(this.AdminContext(), &pb.FindAllEnabledNodesDNSWithClusterIdRequest{NodeClusterId: cluster.Id})
|
nodesResp, err := this.RPC().NodeRPC().FindAllEnabledNodesDNSWithNodeClusterId(this.AdminContext(), &pb.FindAllEnabledNodesDNSWithNodeClusterIdRequest{NodeClusterId: cluster.Id})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ func (this *ServersPopupAction) RunGet(params struct {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
for _, cluster := range clustersResp.NodeClusters {
|
for _, cluster := range clustersResp.NodeClusters {
|
||||||
serversResp, err := this.RPC().ServerRPC().FindAllEnabledServersDNSWithClusterId(this.AdminContext(), &pb.FindAllEnabledServersDNSWithClusterIdRequest{NodeClusterId: cluster.Id})
|
serversResp, err := this.RPC().ServerRPC().FindAllEnabledServersDNSWithNodeClusterId(this.AdminContext(), &pb.FindAllEnabledServersDNSWithNodeClusterIdRequest{NodeClusterId: cluster.Id})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ func SendMessageToCluster(ctx context.Context, clusterId int64, code string, msg
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 获取所有节点
|
// 获取所有节点
|
||||||
nodesResp, err := defaultRPCClient.NodeRPC().FindAllEnabledNodesWithClusterId(ctx, &pb.FindAllEnabledNodesWithClusterIdRequest{NodeClusterId: clusterId})
|
nodesResp, err := defaultRPCClient.NodeRPC().FindAllEnabledNodesWithNodeClusterId(ctx, &pb.FindAllEnabledNodesWithNodeClusterIdRequest{NodeClusterId: clusterId})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return results, err
|
return results, err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,12 +37,12 @@ func (this *CreatePopupAction) RunPost(params struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.Data["group"] = maps.Map{
|
this.Data["group"] = maps.Map{
|
||||||
"id": createResp.GroupId,
|
"id": createResp.ServerGroupId,
|
||||||
"name": params.Name,
|
"name": params.Name,
|
||||||
}
|
}
|
||||||
|
|
||||||
// 创建日志
|
// 创建日志
|
||||||
defer this.CreateLog(oplogs.LevelInfo, "创建代理服务分组 %d", createResp.GroupId)
|
defer this.CreateLog(oplogs.LevelInfo, "创建代理服务分组 %d", createResp.ServerGroupId)
|
||||||
|
|
||||||
this.Success()
|
this.Success()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ func (this *DeleteAction) RunPost(params struct {
|
|||||||
defer this.CreateLog(oplogs.LevelInfo, "删除代理服务分组 %d", params.GroupId)
|
defer this.CreateLog(oplogs.LevelInfo, "删除代理服务分组 %d", params.GroupId)
|
||||||
|
|
||||||
// 检查是否正在使用
|
// 检查是否正在使用
|
||||||
countResp, err := this.RPC().ServerRPC().CountAllEnabledServersWithGroupId(this.AdminContext(), &pb.CountAllEnabledServersWithGroupIdRequest{GroupId: params.GroupId})
|
countResp, err := this.RPC().ServerRPC().CountAllEnabledServersWithServerGroupId(this.AdminContext(), &pb.CountAllEnabledServersWithServerGroupIdRequest{ServerGroupId: params.GroupId})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
return
|
return
|
||||||
@@ -27,7 +27,7 @@ func (this *DeleteAction) RunPost(params struct {
|
|||||||
this.Fail("此分组正在被使用不能删除,请修改相关服务后再删除")
|
this.Fail("此分组正在被使用不能删除,请修改相关服务后再删除")
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err = this.RPC().ServerGroupRPC().DeleteServerGroup(this.AdminContext(), &pb.DeleteServerGroupRequest{GroupId: params.GroupId})
|
_, err = this.RPC().ServerGroupRPC().DeleteServerGroup(this.AdminContext(), &pb.DeleteServerGroupRequest{ServerGroupId: params.GroupId})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -23,8 +23,8 @@ func (this *IndexAction) RunGet(params struct{}) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
groupMaps := []maps.Map{}
|
groupMaps := []maps.Map{}
|
||||||
for _, group := range groupsResp.Groups {
|
for _, group := range groupsResp.ServerGroups {
|
||||||
countResp, err := this.RPC().ServerRPC().CountAllEnabledServersWithGroupId(this.AdminContext(), &pb.CountAllEnabledServersWithGroupIdRequest{GroupId: group.Id})
|
countResp, err := this.RPC().ServerRPC().CountAllEnabledServersWithServerGroupId(this.AdminContext(), &pb.CountAllEnabledServersWithServerGroupIdRequest{ServerGroupId: group.Id})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ func (this *SelectPopupAction) RunGet(params struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
groupMaps := []maps.Map{}
|
groupMaps := []maps.Map{}
|
||||||
for _, group := range groupsResp.Groups {
|
for _, group := range groupsResp.ServerGroups {
|
||||||
// 已经选过的就跳过
|
// 已经选过的就跳过
|
||||||
if lists.ContainsInt64(selectedGroupIds, group.Id) {
|
if lists.ContainsInt64(selectedGroupIds, group.Id) {
|
||||||
continue
|
continue
|
||||||
@@ -58,12 +58,12 @@ func (this *SelectPopupAction) RunPost(params struct {
|
|||||||
this.Fail("请选择要使用的分组")
|
this.Fail("请选择要使用的分组")
|
||||||
}
|
}
|
||||||
|
|
||||||
groupResp, err := this.RPC().ServerGroupRPC().FindEnabledServerGroup(this.AdminContext(), &pb.FindEnabledServerGroupRequest{GroupId: params.GroupId})
|
groupResp, err := this.RPC().ServerGroupRPC().FindEnabledServerGroup(this.AdminContext(), &pb.FindEnabledServerGroupRequest{ServerGroupId: params.GroupId})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
group := groupResp.Group
|
group := groupResp.ServerGroup
|
||||||
if group == nil {
|
if group == nil {
|
||||||
this.NotFound("serverGroup", params.GroupId)
|
this.NotFound("serverGroup", params.GroupId)
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ func (this *SortAction) RunPost(params struct {
|
|||||||
// 创建日志
|
// 创建日志
|
||||||
defer this.CreateLog(oplogs.LevelInfo, "修改代理分组排序")
|
defer this.CreateLog(oplogs.LevelInfo, "修改代理分组排序")
|
||||||
|
|
||||||
_, err := this.RPC().ServerGroupRPC().UpdateServerGroupOrders(this.AdminContext(), &pb.UpdateServerGroupOrdersRequest{GroupIds: params.GroupIds})
|
_, err := this.RPC().ServerGroupRPC().UpdateServerGroupOrders(this.AdminContext(), &pb.UpdateServerGroupOrdersRequest{ServerGroupIds: params.GroupIds})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -19,12 +19,12 @@ func (this *UpdatePopupAction) Init() {
|
|||||||
func (this *UpdatePopupAction) RunGet(params struct {
|
func (this *UpdatePopupAction) RunGet(params struct {
|
||||||
GroupId int64
|
GroupId int64
|
||||||
}) {
|
}) {
|
||||||
groupResp, err := this.RPC().ServerGroupRPC().FindEnabledServerGroup(this.AdminContext(), &pb.FindEnabledServerGroupRequest{GroupId: params.GroupId})
|
groupResp, err := this.RPC().ServerGroupRPC().FindEnabledServerGroup(this.AdminContext(), &pb.FindEnabledServerGroupRequest{ServerGroupId: params.GroupId})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
group := groupResp.Group
|
group := groupResp.ServerGroup
|
||||||
if group == nil {
|
if group == nil {
|
||||||
this.NotFound("serverGroup", params.GroupId)
|
this.NotFound("serverGroup", params.GroupId)
|
||||||
return
|
return
|
||||||
@@ -51,7 +51,7 @@ func (this *UpdatePopupAction) RunPost(params struct {
|
|||||||
Field("name", params.Name).
|
Field("name", params.Name).
|
||||||
Require("请输入分组名称")
|
Require("请输入分组名称")
|
||||||
_, err := this.RPC().ServerGroupRPC().UpdateServerGroup(this.AdminContext(), &pb.UpdateServerGroupRequest{
|
_, err := this.RPC().ServerGroupRPC().UpdateServerGroup(this.AdminContext(), &pb.UpdateServerGroupRequest{
|
||||||
GroupId: params.GroupId,
|
ServerGroupId: params.GroupId,
|
||||||
Name: params.Name,
|
Name: params.Name,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -332,7 +332,7 @@ func (this *CreateAction) RunPost(params struct {
|
|||||||
ExcludeNodesJSON: excludeNodesJSON,
|
ExcludeNodesJSON: excludeNodesJSON,
|
||||||
WebId: webId,
|
WebId: webId,
|
||||||
ReverseProxyJSON: reverseProxyRefJSON,
|
ReverseProxyJSON: reverseProxyRefJSON,
|
||||||
GroupIds: params.GroupIds,
|
ServerGroupIds: params.GroupIds,
|
||||||
}
|
}
|
||||||
if httpConfig != nil {
|
if httpConfig != nil {
|
||||||
data, err := json.Marshal(httpConfig)
|
data, err := json.Marshal(httpConfig)
|
||||||
|
|||||||
@@ -67,8 +67,8 @@ func (this *IndexAction) RunGet(params struct {
|
|||||||
|
|
||||||
// 全部数量
|
// 全部数量
|
||||||
countResp, err := this.RPC().ServerRPC().CountAllEnabledServersMatch(this.AdminContext(), &pb.CountAllEnabledServersMatchRequest{
|
countResp, err := this.RPC().ServerRPC().CountAllEnabledServersMatch(this.AdminContext(), &pb.CountAllEnabledServersMatchRequest{
|
||||||
ClusterId: params.ClusterId,
|
NodeClusterId: params.ClusterId,
|
||||||
GroupId: params.GroupId,
|
ServerGroupId: params.GroupId,
|
||||||
Keyword: params.Keyword,
|
Keyword: params.Keyword,
|
||||||
AuditingFlag: params.AuditingFlag,
|
AuditingFlag: params.AuditingFlag,
|
||||||
})
|
})
|
||||||
@@ -84,8 +84,8 @@ func (this *IndexAction) RunGet(params struct {
|
|||||||
serversResp, err := this.RPC().ServerRPC().ListEnabledServersMatch(this.AdminContext(), &pb.ListEnabledServersMatchRequest{
|
serversResp, err := this.RPC().ServerRPC().ListEnabledServersMatch(this.AdminContext(), &pb.ListEnabledServersMatchRequest{
|
||||||
Offset: page.Offset,
|
Offset: page.Offset,
|
||||||
Size: page.Size,
|
Size: page.Size,
|
||||||
ClusterId: params.ClusterId,
|
NodeClusterId: params.ClusterId,
|
||||||
GroupId: params.GroupId,
|
ServerGroupId: params.GroupId,
|
||||||
Keyword: params.Keyword,
|
Keyword: params.Keyword,
|
||||||
AuditingFlag: params.AuditingFlag,
|
AuditingFlag: params.AuditingFlag,
|
||||||
})
|
})
|
||||||
@@ -155,8 +155,8 @@ func (this *IndexAction) RunGet(params struct {
|
|||||||
|
|
||||||
// 分组
|
// 分组
|
||||||
groupMaps := []maps.Map{}
|
groupMaps := []maps.Map{}
|
||||||
if len(server.Groups) > 0 {
|
if len(server.ServerGroups) > 0 {
|
||||||
for _, group := range server.Groups {
|
for _, group := range server.ServerGroups {
|
||||||
groupMaps = append(groupMaps, maps.Map{
|
groupMaps = append(groupMaps, maps.Map{
|
||||||
"id": group.Id,
|
"id": group.Id,
|
||||||
"name": group.Name,
|
"name": group.Name,
|
||||||
@@ -240,7 +240,7 @@ func (this *IndexAction) RunGet(params struct {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
groupMaps := []maps.Map{}
|
groupMaps := []maps.Map{}
|
||||||
for _, group := range groupsResp.Groups {
|
for _, group := range groupsResp.ServerGroups {
|
||||||
groupName := group.Name
|
groupName := group.Name
|
||||||
groupMaps = append(groupMaps, maps.Map{
|
groupMaps = append(groupMaps, maps.Map{
|
||||||
"id": group.Id,
|
"id": group.Id,
|
||||||
|
|||||||
@@ -74,8 +74,8 @@ func (this *IndexAction) RunGet(params struct {
|
|||||||
|
|
||||||
// 分组
|
// 分组
|
||||||
groupMaps := []maps.Map{}
|
groupMaps := []maps.Map{}
|
||||||
if len(server.Groups) > 0 {
|
if len(server.ServerGroups) > 0 {
|
||||||
for _, group := range server.Groups {
|
for _, group := range server.ServerGroups {
|
||||||
groupMaps = append(groupMaps, maps.Map{
|
groupMaps = append(groupMaps, maps.Map{
|
||||||
"id": group.Id,
|
"id": group.Id,
|
||||||
"name": group.Name,
|
"name": group.Name,
|
||||||
@@ -143,7 +143,7 @@ func (this *IndexAction) RunPost(params struct {
|
|||||||
Description: params.Description,
|
Description: params.Description,
|
||||||
NodeClusterId: params.ClusterId,
|
NodeClusterId: params.ClusterId,
|
||||||
IsOn: params.IsOn,
|
IsOn: params.IsOn,
|
||||||
GroupIds: params.GroupIds,
|
ServerGroupIds: params.GroupIds,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
|
|||||||
Reference in New Issue
Block a user