11<script setup lang="ts">
22import {useGettext } from ' vue3-gettext'
3- import {computed , h , nextTick , onMounted , ref , VNode , watch } from ' vue'
3+ import {computed , nextTick , ref , watch } from ' vue'
44import {message } from ' ant-design-vue'
55import domain from ' @/api/domain'
66import websocket from ' @/lib/websocket'
77import Template from ' @/views/template/Template.vue'
88
99const {$gettext, interpolate} = useGettext ()
1010
11- const props = defineProps ([' directivesMap' , ' current_server_directives' , ' enabled' ])
11+ const props = defineProps ([' config_name ' , ' directivesMap' , ' current_server_directives' , ' enabled' ])
1212
1313const emit = defineEmits ([' changeEnabled' , ' callback' , ' update:enabled' ])
1414
@@ -50,7 +50,7 @@ function job() {
5050 })
5151 }
5252 }).then (() => {
53- issue_cert (name .value , callback )
53+ issue_cert (props . config_name , name .value , callback )
5454 })
5555}
5656
@@ -61,13 +61,13 @@ function callback(ssl_certificate: string, ssl_certificate_key: string) {
6161
6262function change_auto_cert(r : boolean ) {
6363 if (r ) {
64- domain .add_auto_cert (name . value ).then (() => {
64+ domain .add_auto_cert (props . config_name ).then (() => {
6565 message .success (interpolate ($gettext (' Auto-renewal enabled for %{name}' ), {name: name .value }))
6666 }).catch (e => {
6767 message .error (e .message ?? interpolate ($gettext (' Enable auto-renewal failed for %{name}' ), {name: name .value }))
6868 })
6969 } else {
70- domain .remove_auto_cert (name . value ).then (() => {
70+ domain .remove_auto_cert (props . config_name ).then (() => {
7171 message .success (interpolate ($gettext (' Auto-renewal disabled for %{name}' ), {name: name .value }))
7272 }).catch (e => {
7373 message .error (e .message ?? interpolate ($gettext (' Disable auto-renewal failed for %{name}' ), {name: name .value }))
@@ -86,7 +86,7 @@ function log(msg: string) {
8686 (logContainer .value as any as Element ).scroll ({top: 320 , left: 0 , behavior: ' smooth' })
8787}
8888
89- const issue_cert = async (server_name : string , callback : Function ) => {
89+ const issue_cert = async (config_name : string , server_name : string , callback : Function ) => {
9090 progressStatus .value = ' active'
9191 modalClosable .value = false
9292 modalVisible .value = true
@@ -95,7 +95,7 @@ const issue_cert = async (server_name: string, callback: Function) => {
9595
9696 log ($gettext (' Getting the certificate, please wait...' ))
9797
98- const ws = websocket (' /api/cert/issue ' , false )
98+ const ws = websocket (` /api/domain/${ config_name }/cert ` , false )
9999
100100 ws .onopen = () => {
101101 ws .send (JSON .stringify ({
0 commit comments