32 lines
702 B
Go
32 lines
702 B
Go
package apps
|
|
|
|
import (
|
|
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
|
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
|
"github.com/iwind/TeaGo/actions"
|
|
)
|
|
|
|
type AppSettingsToggleSignEnabledAction struct {
|
|
actionutils.ParentAction
|
|
}
|
|
|
|
func (this *AppSettingsToggleSignEnabledAction) RunPost(params struct {
|
|
AppId int64
|
|
IsOn int
|
|
|
|
Must *actions.Must
|
|
}) {
|
|
params.Must.Field("appId", params.AppId).Gt(0, "请选择应用")
|
|
|
|
_, err := this.RPC().HTTPDNSAppRPC().UpdateHTTPDNSAppSignEnabled(this.AdminContext(), &pb.UpdateHTTPDNSAppSignEnabledRequest{
|
|
AppDbId: params.AppId,
|
|
SignEnabled: params.IsOn == 1,
|
|
})
|
|
if err != nil {
|
|
this.ErrorPage(err)
|
|
return
|
|
}
|
|
|
|
this.Success()
|
|
}
|