mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-12 10:55:51 +02:00
fix: ngx_directives not update #218
This commit is contained in:
parent
4bab7b243d
commit
26788f301f
3 changed files with 14 additions and 5 deletions
|
@ -34,7 +34,7 @@ function init() {
|
|||
})
|
||||
}
|
||||
|
||||
function save() {
|
||||
async function save() {
|
||||
return ngx.build_config(ngx_config).then(r => {
|
||||
// eslint-disable-next-line promise/no-nesting
|
||||
domain.save(ngx_config.name, { name: ngx_config.name, content: r.content, overwrite: true }).then(() => {
|
||||
|
@ -82,8 +82,13 @@ async function next() {
|
|||
await save()
|
||||
current_step.value++
|
||||
}
|
||||
|
||||
const ngx_directives = computed(() => {
|
||||
return ngx_config.servers[0].directives
|
||||
})
|
||||
|
||||
provide('save_site_config', save)
|
||||
provide('ngx_directives', ngx_config.servers[0].directives)
|
||||
provide('ngx_directives', ngx_directives)
|
||||
provide('ngx_config', ngx_config)
|
||||
</script>
|
||||
|
||||
|
|
|
@ -72,8 +72,12 @@ function build_template() {
|
|||
})
|
||||
}
|
||||
|
||||
const ngx_directives = computed(() => {
|
||||
return data.value?.directives
|
||||
})
|
||||
|
||||
provide('build_template', build_template)
|
||||
provide('ngx_directives', data.value?.directives)
|
||||
provide('ngx_directives', ngx_directives)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<script setup lang="ts">
|
||||
import { useGettext } from 'vue3-gettext'
|
||||
import Draggable from 'vuedraggable'
|
||||
import { provide } from 'vue'
|
||||
import type { ComputedRef } from 'vue'
|
||||
import DirectiveAdd from './DirectiveAdd.vue'
|
||||
import DirectiveEditorItem from '@/views/domain/ngx_conf/directive/DirectiveEditorItem.vue'
|
||||
import type { NgxDirective } from '@/api/ngx'
|
||||
|
@ -13,7 +13,7 @@ defineProps<{
|
|||
const { $gettext } = useGettext()
|
||||
const current_idx = ref(-1)
|
||||
|
||||
const ngx_directives = inject('ngx_directives') as NgxDirective[]
|
||||
const ngx_directives = inject('ngx_directives') as ComputedRef<NgxDirective[]>
|
||||
|
||||
provide('current_idx', current_idx)
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue