2021-10-16 12:03:21 +08:00
|
|
|
// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
|
|
|
|
|
|
|
|
|
|
package dns
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
2023-06-30 18:08:30 +08:00
|
|
|
"github.com/TeaOSLab/EdgeCommon/pkg/langs/codes"
|
2021-10-16 12:03:21 +08:00
|
|
|
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type RegenerateCNAMEAction struct {
|
|
|
|
|
actionutils.ParentAction
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (this *RegenerateCNAMEAction) RunPost(params struct {
|
|
|
|
|
ServerId int64
|
|
|
|
|
}) {
|
2023-06-30 18:08:30 +08:00
|
|
|
defer this.CreateLogInfo(codes.ServerDNS_LogRegenerateDNSName, params.ServerId)
|
2021-10-16 12:03:21 +08:00
|
|
|
|
2022-08-26 19:51:07 +08:00
|
|
|
_, err := this.RPC().ServerRPC().RegenerateServerDNSName(this.AdminContext(), &pb.RegenerateServerDNSNameRequest{ServerId: params.ServerId})
|
2021-10-16 12:03:21 +08:00
|
|
|
if err != nil {
|
|
|
|
|
this.ErrorPage(err)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.Success()
|
|
|
|
|
}
|