2020-11-25 21:19:07 +08:00
|
|
|
package acme
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
2020-11-26 16:39:01 +08:00
|
|
|
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
2020-11-25 21:19:07 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type RunAction struct {
|
|
|
|
|
actionutils.ParentAction
|
|
|
|
|
}
|
|
|
|
|
|
2020-11-26 16:39:01 +08:00
|
|
|
func (this *RunAction) RunPost(params struct {
|
|
|
|
|
TaskId int64
|
|
|
|
|
}) {
|
|
|
|
|
runResp, err := this.RPC().ACMETaskRPC().RunACMETask(this.AdminContext(), &pb.RunACMETaskRequest{AcmeTaskId: params.TaskId})
|
|
|
|
|
if err != nil {
|
|
|
|
|
this.ErrorPage(err)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if runResp.IsOk {
|
|
|
|
|
this.Data["certId"] = runResp.SslCertId
|
|
|
|
|
this.Success()
|
|
|
|
|
} else {
|
|
|
|
|
this.Fail(runResp.Error)
|
|
|
|
|
}
|
2020-11-25 21:19:07 +08:00
|
|
|
}
|