package apps import ( "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils" "github.com/iwind/TeaGo/actions" ) type DomainsCreatePopupAction struct { actionutils.ParentAction } func (this *DomainsCreatePopupAction) Init() { this.Nav("", "", "") } func (this *DomainsCreatePopupAction) RunGet(params struct { AppId int64 }) { app, err := findAppMap(this.Parent(), params.AppId) if err != nil { this.ErrorPage(err) return } this.Data["app"] = app this.Show() } func (this *DomainsCreatePopupAction) RunPost(params struct { AppId int64 Domain string Must *actions.Must CSRF *actionutils.CSRF }) { params.Must.Field("appId", params.AppId).Gt(0, "请选择应用") params.Must.Field("domain", params.Domain).Require("请输入域名") err := createDomain(this.Parent(), params.AppId, params.Domain) if err != nil { this.ErrorPage(err) return } this.Success() }