feat: add server on a site config #89

This commit is contained in:
0xJacky 2023-03-13 21:42:39 +08:00
parent 3a595fcb42
commit 445be37f4e
No known key found for this signature in database
GPG key ID: B6E4A6E4A561BAF0
5 changed files with 21 additions and 4 deletions

View file

@ -1,7 +1,7 @@
{
"name": "nginx-ui-frontend-next",
"private": true,
"version": "1.7.6",
"version": "1.7.7",
"type": "commonjs",
"scripts": {
"dev": "vite",

View file

@ -1 +1 @@
{"version":"1.7.6","build_id":83,"total_build":153}
{"version":"1.7.7","build_id":85,"total_build":155}

View file

@ -68,7 +68,9 @@ async function add() {
<a-list-item>
<a-card size="small" :title="item.name">
<template #extra>
<a-button type="link" @click="view(item.filename)">{{ $gettext('View') }}</a-button>
<a-button type="link"
size="small" @click="view(item.filename)">{{ $gettext('View') }}
</a-button>
</template>
<p>{{ $gettext('Author') }}: {{ item.author }}</p>
<p>{{ $gettext('Description') }}: {{ trans_description(item) }}</p>

View file

@ -8,6 +8,7 @@ import Cert from '@/views/domain/cert/Cert.vue'
import LogEntry from '@/views/domain/ngx_conf/LogEntry.vue'
import ConfigTemplate from '@/views/domain/ngx_conf/ConfigTemplate.vue'
import CodeEditor from '@/components/CodeEditor/CodeEditor.vue'
import {PlusOutlined} from '@ant-design/icons-vue'
const {$gettext} = useGettext()
@ -145,6 +146,13 @@ watch(current_server_index, () => {
})
})
function add_server() {
props.ngx_config.servers.push({
comments: '',
locations: [],
directives: []
})
}
</script>
<template>
@ -190,6 +198,13 @@ watch(current_server_index, () => {
</div>
</a-tab-pane>
<template #rightExtra>
<a-button @click="add_server" type="link" size="small">
<PlusOutlined/>
{{ $gettext('Add') }}
</a-button>
</template>
</a-tabs>
</div>

View file

@ -1 +1 @@
{"version":"1.7.6","build_id":83,"total_build":153}
{"version":"1.7.7","build_id":85,"total_build":155}