Skip to content

Commit

Permalink
fix: current_server_directives.splice is undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
0xJacky committed Dec 10, 2023
1 parent d2ba3eb commit 33039f0
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 9 deletions.
1 change: 1 addition & 0 deletions app/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_PROXY_TARGET=http://127.0.0.1:9001
2 changes: 1 addition & 1 deletion app/src/version.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version":"2.0.0-beta.6","build_id":77,"total_build":281}
{"version":"2.0.0-beta.6","build_id":78,"total_build":282}
8 changes: 4 additions & 4 deletions app/src/views/domain/cert/components/ObtainCert.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { useGettext } from 'vue3-gettext'
import { Modal, message } from 'ant-design-vue'
import type { Ref } from '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'
Expand Down Expand Up @@ -39,7 +39,7 @@ const no_server_name = inject('no_server_name') as Ref<boolean>
const props = inject('props') as Props
const issuing_cert = inject('issuing_cert') as Ref<boolean>
const ngx_config = inject('ngx_config') as NgxConfig
const current_server_directives = inject('current_server_directives') as NgxDirective[]
const current_server_directives = inject('current_server_directives') as ComputedRef<NgxDirective[]>
const name = computed(() => {
return directivesMap.value.server_name[0].params.trim()
Expand Down Expand Up @@ -121,7 +121,7 @@ function job() {
const server_name_idx = directivesMap.value.server_name[0]?.idx ?? 0
if (!directivesMap.value.ssl_certificate) {
current_server_directives.splice(server_name_idx + 1, 0, {
current_server_directives.value.splice(server_name_idx + 1, 0, {
directive: 'ssl_certificate',
params: '',
})
Expand All @@ -131,7 +131,7 @@ function job() {
if (!directivesMap.value.ssl_certificate_key) {
const ssl_certificate_idx = directivesMap.value.ssl_certificate[0]?.idx ?? 0
current_server_directives.splice(ssl_certificate_idx + 1, 0, {
current_server_directives.value.splice(ssl_certificate_idx + 1, 0, {
directive: 'ssl_certificate_key',
params: '',
})
Expand Down
3 changes: 0 additions & 3 deletions app/src/views/domain/ngx_conf/NgxConfigEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,6 @@ function change_tls(status: boolean) {
}, {
directive: 'listen',
params: '[::]:443 ssl',
}, {
directive: 'http2',
params: 'on',
})
const server_name_idx = directivesMap.value?.server_name?.[0].idx ?? 0
Expand Down
2 changes: 1 addition & 1 deletion app/version.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version":"2.0.0-beta.6","build_id":77,"total_build":281}
{"version":"2.0.0-beta.6","build_id":78,"total_build":282}

0 comments on commit 33039f0

Please sign in to comment.