管理端全部功能跑通
This commit is contained in:
@@ -13,8 +13,27 @@ func (this *IndexAction) Init() {
|
||||
this.Nav("httpdns", "cluster", "")
|
||||
}
|
||||
|
||||
func (this *IndexAction) RunGet(params struct{}) {
|
||||
func (this *IndexAction) RunGet(params struct {
|
||||
Keyword string
|
||||
}) {
|
||||
httpdnsutils.AddLeftMenu(this.Parent())
|
||||
this.Data["clusters"] = mockClusters()
|
||||
this.Data["keyword"] = params.Keyword
|
||||
|
||||
clusters, err := listClusterMaps(this.Parent(), params.Keyword)
|
||||
if err != nil {
|
||||
this.ErrorPage(err)
|
||||
return
|
||||
}
|
||||
this.Data["clusters"] = clusters
|
||||
|
||||
hasErrorLogs := false
|
||||
for _, cluster := range clusters {
|
||||
if cluster.GetInt("countAllNodes") > cluster.GetInt("countActiveNodes") {
|
||||
hasErrorLogs = true
|
||||
break
|
||||
}
|
||||
}
|
||||
this.Data["hasErrorLogs"] = hasErrorLogs
|
||||
this.Data["page"] = ""
|
||||
this.Show()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user