Преглед на файлове

fix: maybe error when enable TLS #230

close #230
0xJacky преди 1 година
родител
ревизия
17d6216e36
променени са 3 файла, в които са добавени 3 реда и са изтрити 16 реда
  1. 1 1
      app/src/views/domain/DomainEdit.vue
  2. 1 14
      app/src/views/domain/cert/components/ObtainCert.vue
  3. 1 1
      app/src/views/domain/ngx_conf/LogEntry.vue

+ 1 - 1
app/src/views/domain/DomainEdit.vue

@@ -141,7 +141,7 @@ const save = async () => {
     }
   }
 
-  await domain.save(name.value, {
+  return domain.save(name.value, {
     name: filename.value || name.value,
     content: configText.value,
     overwrite: true,

+ 1 - 14
app/src/views/domain/cert/components/ObtainCert.vue

@@ -2,7 +2,6 @@
 import { useGettext } from 'vue3-gettext'
 import { Modal, message } from 'ant-design-vue'
 import type { ComputedRef, Ref } from 'vue'
-import template from '@/api/template'
 import domain from '@/api/domain'
 import AutoCertStepOne from '@/views/domain/cert/components/AutoCertStepOne.vue'
 import type { NgxConfig, NgxDirective } from '@/api/ngx'
@@ -82,19 +81,7 @@ function change_auto_cert(status: boolean) {
 
 async function onchange(status: boolean) {
   if (status) {
-    await template.get_block('letsencrypt.conf').then(r => {
-      ngx_config.servers.forEach(async v => {
-        v.locations = v?.locations?.filter(l => l.path !== '/.well-known/acme-challenge')
-
-        v.locations?.push(...r.locations)
-      })
-    }).then(async () => {
-      // if ssl_certificate is empty, do not save, just use the config from last step.
-      if (directivesMap.value.ssl_certificate?.[0])
-        await save_site_config()
-
-      job()
-    })
+    job()
   }
   else {
     ngx_config.servers.forEach(v => {

+ 1 - 1
app/src/views/domain/ngx_conf/LogEntry.vue

@@ -8,7 +8,7 @@ import type { NgxConfig } from '@/api/ngx'
 const props = defineProps<{
   ngxConfig: NgxConfig
   currentServerIdx: number
-  name: string
+  name?: string
 }>()
 
 const { $gettext } = useGettext()