Skip to content

Commit 2f08fe3

Browse files
committed
fix: site adding issues
1. Fix the issue of being unable to save when adding a website 2. Fix the issue of being unable to apply for a certificate after adding a website for the first time
1 parent 5d0407e commit 2f08fe3

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

frontend/src/views/domain/DomainAdd.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ import template from '@/api/template'
1212
1313
const {$gettext, interpolate} = useGettext()
1414
15-
const config = reactive({name: ''})
1615
const ngx_config = reactive({
16+
name: '',
1717
servers: [{
1818
directives: [],
1919
locations: []
@@ -40,10 +40,10 @@ function init() {
4040
4141
function save() {
4242
ngx.build_config(ngx_config).then(r => {
43-
domain.save(config.name, {name: config.name, content: r.content}).then(() => {
43+
domain.save(ngx_config.name, {name: ngx_config.name, content: r.content, overwrite: true}).then(() => {
4444
message.success($gettext('Saved successfully'))
4545
46-
domain.enable(config.name).then(() => {
46+
domain.enable(ngx_config.name).then(() => {
4747
message.success($gettext('Enabled successfully'))
4848
current_step.value++
4949
window.scroll({top: 0, left: 0, behavior: 'smooth'})
@@ -93,7 +93,7 @@ const has_server_name = computed(() => {
9393
<template v-if="current_step===0">
9494
<a-form layout="vertical">
9595
<a-form-item :label="$gettext('Configuration Name')">
96-
<a-input v-model:value="config.name"/>
96+
<a-input v-model:value="ngx_config.name"/>
9797
</a-form-item>
9898
</a-form>
9999

@@ -131,7 +131,7 @@ const has_server_name = computed(() => {
131131
<a-button
132132
type="primary"
133133
@click="save"
134-
:disabled="!config.name||!has_server_name"
134+
:disabled="!ngx_config.name||!has_server_name"
135135
>
136136
<translate>Next</translate>
137137
</a-button>

0 commit comments

Comments
 (0)