mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-04-23 07:56:08 +00:00
Change TunSettings to support separate IPv4/IPv6 MTU values and add gateway, DNS, autoSystemRoutingTable and autoOutboundsInterface properties. Introduces _normalizeMtu to accept legacy single-value or array forms and provide sensible defaults. Update fromJson/toJson to handle new fields and preserve backward compatibility. Update tun form UI to expose MTU IPv4/IPv6 inputs, Gateway/DNS tag selects, Auto Routing Table and Auto Outbounds input.
94 lines
2.5 KiB
HTML
94 lines
2.5 KiB
HTML
{{define "form/tun"}}
|
|
<a-form
|
|
:colon="false"
|
|
:label-col="{ md: {span:8} }"
|
|
:wrapper-col="{ md: {span:14} }"
|
|
>
|
|
<a-form-item>
|
|
<template slot="label">
|
|
<a-tooltip>
|
|
<template slot="title">
|
|
<span>{{ i18n "pages.xray.tun.nameDesc" }}</span>
|
|
</template>
|
|
Interface Name
|
|
<a-icon type="question-circle"></a-icon>
|
|
</a-tooltip>
|
|
</template>
|
|
<a-input v-model.trim="inbound.settings.name" placeholder="xray0"></a-input>
|
|
</a-form-item>
|
|
<a-form-item>
|
|
<template slot="label">
|
|
<a-tooltip>
|
|
<template slot="title">
|
|
<span>{{ i18n "pages.xray.tun.mtuDesc" }}</span>
|
|
</template>
|
|
MTU IPv4
|
|
<a-icon type="question-circle"></a-icon>
|
|
</a-tooltip>
|
|
</template>
|
|
<a-input-number
|
|
v-model.number="inbound.settings.mtu[0]"
|
|
:min="1"
|
|
:max="9000"
|
|
placeholder="1500"
|
|
></a-input-number>
|
|
</a-form-item>
|
|
<a-form-item label="MTU IPv6">
|
|
<a-input-number
|
|
v-model.number="inbound.settings.mtu[1]"
|
|
:min="1"
|
|
:max="9000"
|
|
placeholder="1280"
|
|
></a-input-number>
|
|
</a-form-item>
|
|
<a-form-item label="Gateway">
|
|
<a-select
|
|
mode="tags"
|
|
v-model="inbound.settings.gateway"
|
|
:style="{ width: '100%' }"
|
|
:token-separators="[',']"
|
|
placeholder="IPv4/IPv6 gateway"
|
|
></a-select>
|
|
</a-form-item>
|
|
<a-form-item label="DNS">
|
|
<a-select
|
|
mode="tags"
|
|
v-model="inbound.settings.dns"
|
|
:style="{ width: '100%' }"
|
|
:token-separators="[',']"
|
|
placeholder="DNS servers"
|
|
></a-select>
|
|
</a-form-item>
|
|
<a-form-item>
|
|
<template slot="label">
|
|
<a-tooltip>
|
|
<template slot="title">
|
|
<span>{{ i18n "pages.xray.tun.userLevelDesc" }}</span>
|
|
</template>
|
|
{{ i18n "pages.xray.tun.userLevel" }}
|
|
<a-icon type="question-circle"></a-icon>
|
|
</a-tooltip>
|
|
</template>
|
|
<a-input-number
|
|
v-model.number="inbound.settings.userLevel"
|
|
:min="0"
|
|
placeholder="0"
|
|
></a-input-number>
|
|
</a-form-item>
|
|
<a-form-item label="Auto Routing Table">
|
|
<a-select
|
|
mode="tags"
|
|
v-model="inbound.settings.autoSystemRoutingTable"
|
|
:style="{ width: '100%' }"
|
|
:token-separators="[',']"
|
|
placeholder="e.g. vpn, proxy"
|
|
></a-select>
|
|
</a-form-item>
|
|
<a-form-item label="Auto Outbounds">
|
|
<a-input
|
|
v-model.trim="inbound.settings.autoOutboundsInterface"
|
|
placeholder="auto"
|
|
></a-input>
|
|
</a-form-item>
|
|
</a-form>
|
|
{{end}}
|