From 8e2023ee66b7d55feb8e8fd82b5c9f5dec9af825 Mon Sep 17 00:00:00 2001 From: Alireza Ahmadi Date: Mon, 13 May 2024 15:32:17 +0200 Subject: [PATCH] load detour tags --- frontend/src/components/Dial.vue | 14 ++++++++------ frontend/src/components/Listen.vue | 12 +++++++----- frontend/src/components/protocols/ShadowTls.vue | 14 +++++++------- frontend/src/layouts/modals/Inbound.vue | 6 +++--- frontend/src/layouts/modals/Outbound.vue | 2 +- frontend/src/views/Basics.vue | 16 +++------------- frontend/src/views/Inbounds.vue | 10 ++++++++++ 7 files changed, 39 insertions(+), 35 deletions(-) diff --git a/frontend/src/components/Dial.vue b/frontend/src/components/Dial.vue index 8bc617c..49a7503 100644 --- a/frontend/src/components/Dial.vue +++ b/frontend/src/components/Dial.vue @@ -2,10 +2,12 @@ - + + export default { - props: ['dial'], + props: ['dial', 'outTags'], data() { return { menu: false @@ -154,7 +156,7 @@ export default { }, optionDetour: { get(): boolean { return this.$props.dial.detour != undefined }, - set(v:boolean) { v ? this.$props.dial.detour = '' : delete this.$props.dial.detour } + set(v:boolean) { v ? this.$props.dial.detour = this.outTags[0]?? '' : delete this.$props.dial.detour } }, optionBind: { get(): boolean { return this.$props.dial.bind_interface != undefined }, diff --git a/frontend/src/components/Listen.vue b/frontend/src/components/Listen.vue index 987d93a..621f23d 100644 --- a/frontend/src/components/Listen.vue +++ b/frontend/src/components/Listen.vue @@ -20,10 +20,12 @@ - + :items="inTags" + v-model="inbound.detour"> + @@ -106,7 +108,7 @@ \ No newline at end of file diff --git a/frontend/src/views/Inbounds.vue b/frontend/src/views/Inbounds.vue index b17df30..96e3cc4 100644 --- a/frontend/src/views/Inbounds.vue +++ b/frontend/src/views/Inbounds.vue @@ -5,6 +5,8 @@ :id="modal.id" :stats="modal.stats" :data="modal.data" + :inTags="inTags" + :outTags="outTags" @close="closeModal" @save="saveModal" /> @@ -115,6 +117,14 @@ const inbounds = computed((): Inbound[] => { return appConfig.value.inbounds }) +const inTags = computed((): string[] => { + return appConfig.value.inbounds.map(i => i.tag) +}) + +const outTags = computed((): string[] => { + return appConfig.value.outbounds.map(i => i.tag) +}) + const clients = computed((): Client[] => { return Data().clients })