fix errors in UI

This commit is contained in:
Alireza Ahmadi
2025-01-11 11:26:32 +01:00
parent 7e41af0da8
commit 94473b40de
2 changed files with 13 additions and 13 deletions
+12 -12
View File
@@ -113,7 +113,7 @@
<v-row> <v-row>
<v-col cols="12" sm="6" md="4"> <v-col cols="12" sm="6" md="4">
<v-select <v-select
v-model="ruleData.sniff" v-model="ruleData.sniffer"
:items="sniffers" :items="sniffers"
:label="$t('rule.sniffer')" :label="$t('rule.sniffer')"
multiple multiple
@@ -254,7 +254,7 @@ export default {
this.loading = true this.loading = true
let newRule = <any>{ let newRule = <any>{
action: this.ruleData.action, action: this.ruleData.action,
invert: this.ruleData.invert, invert: this.ruleData.invert? this.ruleData.invert : undefined,
} }
// Filter action data // Filter action data
@@ -263,25 +263,25 @@ export default {
newRule.outbound = this.ruleData.outbound newRule.outbound = this.ruleData.outbound
break break
case 'route-options': case 'route-options':
newRule.override_address = this.ruleData.override_address.length > 0 ? this.ruleData.override_address : undefined newRule.override_address = this.ruleData.override_address?.length > 0 ? this.ruleData.override_address : undefined
newRule.override_port = this.ruleData.override_port > 0 ? this.ruleData.override_port : undefined newRule.override_port = this.ruleData?.override_port > 0 ? this.ruleData.override_port : undefined
newRule.network_strategy = this.ruleData.network_strategy.length > 0 ? this.ruleData.network_strategy : undefined newRule.network_strategy = this.ruleData.network_strategy?.length > 0 ? this.ruleData.network_strategy : undefined
newRule.fallback_delay = this.ruleData.fallback_delay.length > 0 ? this.ruleData.fallback_delay : undefined newRule.fallback_delay = this.ruleData.fallback_delay?.length > 0 ? this.ruleData.fallback_delay : undefined
newRule.udp_disable_domain_unmapping = this.ruleData.udp_disable_domain_unmapping? true : undefined newRule.udp_disable_domain_unmapping = this.ruleData.udp_disable_domain_unmapping? true : undefined
newRule.udp_connect = this.ruleData.udp_connect? true : undefined newRule.udp_connect = this.ruleData.udp_connect? true : undefined
newRule.udp_timeout = this.ruleData.udp_timeout.length > 0 ? this.ruleData.udp_timeout : undefined newRule.udp_timeout = this.ruleData.udp_timeout?.length > 0 ? this.ruleData.udp_timeout : undefined
break break
case 'reject': case 'reject':
newRule.method = this.ruleData.method.length > 0 ? this.ruleData.method : undefined newRule.method = this.ruleData.method?.length > 0 ? this.ruleData.method : undefined
newRule.no_drop = this.ruleData.no_drop? true : undefined newRule.no_drop = this.ruleData.no_drop? true : undefined
break break
case 'sniff': case 'sniff':
newRule.sniffer = this.ruleData.sniffer.length > 0 ? this.ruleData.sniffer : undefined newRule.sniffer = this.ruleData.sniffer?.length > 0 ? this.ruleData.sniffer : undefined
newRule.timeout = this.ruleData.timeout.length > 0 ? this.ruleData.timeout : undefined newRule.timeout = this.ruleData.timeout?.length > 0 ? this.ruleData.timeout : undefined
break break
case 'resolve': case 'resolve':
newRule.strategy = this.ruleData.strategy.length > 0 ? this.ruleData.strategy : undefined newRule.strategy = this.ruleData.strategy?.length > 0 ? this.ruleData.strategy : undefined
newRule.server = this.ruleData.server.length > 0 ? this.ruleData.server : undefined newRule.server = this.ruleData.server?.length > 0 ? this.ruleData.server : undefined
break break
} }
+1 -1
View File
@@ -140,7 +140,7 @@ const clients = computed((): Client[] => {
}) })
const onlines = computed(() => { const onlines = computed(() => {
return Data().onlines.inbound ? inbounds.value.map(i => Data().onlines.inbound.includes(i.tag)) : [] return Data().onlines.inbound?? []
}) })
const modal = ref({ const modal = ref({