40 lines
864 B
Go
40 lines
864 B
Go
package apps
|
|
|
|
import (
|
|
"github.com/TeaOSLab/EdgeUser/internal/web/actions/actionutils"
|
|
"github.com/TeaOSLab/EdgeUser/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, err := findAppMap(this.Parent(), params.AppId)
|
|
if err != nil {
|
|
this.ErrorPage(err)
|
|
return
|
|
}
|
|
|
|
// 鏋勫缓椤堕儴 tabbar
|
|
httpdnsutils.AddAppTabbar(this.Parent(), app.GetString("name"), params.AppId, "domains")
|
|
|
|
domains, err := listDomainMaps(this.Parent(), app.GetInt64("id"), "")
|
|
if err != nil {
|
|
this.ErrorPage(err)
|
|
return
|
|
}
|
|
|
|
this.Data["app"] = app
|
|
this.Data["domains"] = domains
|
|
this.Data["keyword"] = ""
|
|
this.Show()
|
|
}
|