35 lines
850 B
Go
35 lines
850 B
Go
package apps
|
|
|
|
import (
|
|
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
|
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/httpdns/httpdnsutils"
|
|
)
|
|
|
|
type DomainsAction struct {
|
|
actionutils.ParentAction
|
|
}
|
|
|
|
func (this *DomainsAction) Init() {
|
|
this.Nav("httpdns", "app", "domains")
|
|
}
|
|
|
|
func (this *DomainsAction) RunGet(params struct {
|
|
AppId int64
|
|
}) {
|
|
httpdnsutils.AddLeftMenu(this.Parent())
|
|
app := pickApp(params.AppId)
|
|
|
|
// 构建顶部 tabbar
|
|
httpdnsutils.AddAppTabbar(this.Parent(), app.GetString("name"), params.AppId, "domains")
|
|
|
|
domains := mockDomains(app.GetInt64("id"))
|
|
for _, domain := range domains {
|
|
domainName := domain.GetString("name")
|
|
domain["customRecordCount"] = countCustomRecordsByDomain(app.GetInt64("id"), domainName)
|
|
}
|
|
|
|
this.Data["app"] = app
|
|
this.Data["domains"] = domains
|
|
this.Show()
|
|
}
|