From e28e46db320c233699aea56c4061a29c0baff9c3 Mon Sep 17 00:00:00 2001 From: 0xJacky Date: Fri, 12 Aug 2022 00:23:42 +0800 Subject: [PATCH] Get certificate info from local file --- frontend/src/api/domain.ts | 4 +- frontend/src/version.json | 2 +- frontend/src/views/domain/cert/Cert.vue | 7 +- frontend/src/views/domain/cert/CertInfo.vue | 4 +- frontend/version.json | 2 +- server/api/cert.go | 270 +++++++++++--------- server/api/domain.go | 1 + server/model/cert.go | 9 +- server/pkg/cert/auto_cert.go | 18 +- server/pkg/cert/cert_info.go | 44 ++-- server/router/routers.go | 2 +- 11 files changed, 197 insertions(+), 166 deletions(-) diff --git a/frontend/src/api/domain.ts b/frontend/src/api/domain.ts index b295c3e6..e72a4dbe 100644 --- a/frontend/src/api/domain.ts +++ b/frontend/src/api/domain.ts @@ -14,8 +14,8 @@ class Domain extends Curd { return http.get('template') } - cert_info(domain: string) { - return http.get('cert/' + domain + '/info') + cert_info(path: string) { + return http.get('cert_info?ssl_certificate_path=' + path) } add_auto_cert(domain: string) { diff --git a/frontend/src/version.json b/frontend/src/version.json index b70ec6a5..2a2dafe3 100644 --- a/frontend/src/version.json +++ b/frontend/src/version.json @@ -1 +1 @@ -{"version":"1.5.0","build_id":40,"total_build":110} \ No newline at end of file +{"version":"1.5.0","build_id":41,"total_build":111} \ No newline at end of file diff --git a/frontend/src/views/domain/cert/Cert.vue b/frontend/src/views/domain/cert/Cert.vue index ba246a0e..90366542 100644 --- a/frontend/src/views/domain/cert/Cert.vue +++ b/frontend/src/views/domain/cert/Cert.vue @@ -23,6 +23,11 @@ const name = computed(() => { return props.directivesMap['server_name'][0].params.trim() }) +const ssl_certificate_path = computed(() => { + return props.directivesMap['ssl_certificate']?.[0].params.trim() ?? null +}) + + const enabled = computed({ get() { return props.enabled @@ -36,7 +41,7 @@ const enabled = computed({