diff --git a/internal/web/actions/default/servers/certs/acme/index.go b/internal/web/actions/default/servers/certs/acme/index.go
index cf6f6c91..537589ee 100644
--- a/internal/web/actions/default/servers/certs/acme/index.go
+++ b/internal/web/actions/default/servers/certs/acme/index.go
@@ -4,6 +4,7 @@ import (
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
"github.com/iwind/TeaGo/maps"
+ timeutil "github.com/iwind/TeaGo/utils/time"
)
type IndexAction struct {
@@ -48,8 +49,10 @@ func (this *IndexAction) RunGet(params struct{}) {
var certMap maps.Map = nil
if task.SslCert != nil {
certMap = maps.Map{
- "id": task.SslCert.Id,
- "name": task.SslCert.Name,
+ "id": task.SslCert.Id,
+ "name": task.SslCert.Name,
+ "beginTime": timeutil.FormatTime("Y-m-d", task.SslCert.TimeBeginAt),
+ "endTime": timeutil.FormatTime("Y-m-d", task.SslCert.TimeEndAt),
}
}
diff --git a/internal/web/actions/default/servers/certs/acme/run.go b/internal/web/actions/default/servers/certs/acme/run.go
index 986b90d2..7086386d 100644
--- a/internal/web/actions/default/servers/certs/acme/run.go
+++ b/internal/web/actions/default/servers/certs/acme/run.go
@@ -2,14 +2,26 @@ package acme
import (
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
- "time"
+ "github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
)
type RunAction struct {
actionutils.ParentAction
}
-func (this *RunAction) RunPost(params struct{}) {
- time.Sleep(5 * time.Second) // TODO
- this.Success()
+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)
+ }
}
diff --git a/web/public/js/components/common/labels.js b/web/public/js/components/common/labels.js
index 91382b28..0f1bea25 100644
--- a/web/public/js/components/common/labels.js
+++ b/web/public/js/components/common/labels.js
@@ -18,3 +18,7 @@ Vue.component("tiny-basic-label", {
template: `
暂时还没有证书申请任务。
+ +| 操作 | ||||||
|---|---|---|---|---|---|---|
| {{task.acmeUser.email}} | {{task.dnsProvider.name}} | {{task.dnsDomain}} | @@ -29,7 +31,10 @@
-
+
+ {{task.cert.endTime}}
+
+ -
|
Y @@ -37,14 +42,14 @@ |
- {{task.cert.name}}
+ {{task.cert.name}}
-
|
- 修改 - 执行 - 删除 + 修改 + 执行 + 删除 |