mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-13 03:15:48 +02:00
Get certificate info from local file
This commit is contained in:
parent
c747390f94
commit
e28e46db32
11 changed files with 175 additions and 144 deletions
|
@ -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) {
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"version":"1.5.0","build_id":40,"total_build":110}
|
||||
{"version":"1.5.0","build_id":41,"total_build":111}
|
|
@ -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({
|
|||
|
||||
<template>
|
||||
<div>
|
||||
<cert-info ref="info" :domain="name" v-if="name"/>
|
||||
<cert-info ref="info" :ssl_certificate_path="ssl_certificate_path" v-if="ssl_certificate_path"/>
|
||||
<issue-cert
|
||||
:current_server_directives="props.current_server_directives"
|
||||
:directives-map="props.directivesMap"
|
||||
|
|
|
@ -4,7 +4,7 @@ import dayjs from 'dayjs'
|
|||
import {reactive, ref} from 'vue'
|
||||
import domain from '@/api/domain'
|
||||
|
||||
const props = defineProps(['domain'])
|
||||
const props = defineProps(['ssl_certificate_path'])
|
||||
|
||||
const ok = ref(false)
|
||||
const cert = reactive({issuer_name: '', subject_name: '', not_after: '', not_before: ''})
|
||||
|
@ -12,7 +12,7 @@ const cert = reactive({issuer_name: '', subject_name: '', not_after: '', not_bef
|
|||
get()
|
||||
|
||||
function get() {
|
||||
domain.cert_info(props.domain).then((r: any) => {
|
||||
domain.cert_info(props.ssl_certificate_path).then((r: any) => {
|
||||
Object.assign(cert, r)
|
||||
ok.value = true
|
||||
}).catch(() => {
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"version":"1.5.0","build_id":40,"total_build":110}
|
||||
{"version":"1.5.0","build_id":41,"total_build":111}
|
Loading…
Add table
Add a link
Reference in a new issue