mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-12-24 19:06:35 +08:00
阶段性提交
This commit is contained in:
35
internal/web/actions/default/common/changedClusters.go
Normal file
35
internal/web/actions/default/common/changedClusters.go
Normal file
@@ -0,0 +1,35 @@
|
||||
package common
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/rpc/pb"
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||
"github.com/iwind/TeaGo/maps"
|
||||
)
|
||||
|
||||
type ChangedClustersAction struct {
|
||||
actionutils.ParentAction
|
||||
}
|
||||
|
||||
func (this *ChangedClustersAction) Init() {
|
||||
this.Nav("", "", "")
|
||||
}
|
||||
|
||||
func (this *ChangedClustersAction) RunGet(params struct{}) {
|
||||
resp, err := this.RPC().NodeClusterRPC().FindAllChangedClusters(this.AdminContext(), &pb.FindAllChangedClustersRequest{})
|
||||
if err != nil {
|
||||
this.ErrorPage(err)
|
||||
return
|
||||
}
|
||||
|
||||
result := []maps.Map{}
|
||||
for _, cluster := range resp.Clusters {
|
||||
result = append(result, maps.Map{
|
||||
"id": cluster.Id,
|
||||
"name": cluster.Name,
|
||||
})
|
||||
}
|
||||
|
||||
this.Data["clusters"] = result
|
||||
|
||||
this.Success()
|
||||
}
|
||||
Reference in New Issue
Block a user