mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-16 13:40:24 +08:00
28 lines
554 B
Go
28 lines
554 B
Go
package acme
|
|
|
|
import (
|
|
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
|
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
|
)
|
|
|
|
type RunAction struct {
|
|
actionutils.ParentAction
|
|
}
|
|
|
|
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)
|
|
}
|
|
}
|