{{define "form/outbound"}}
<!-- base -->
<a-tabs
:active-key="outModal.activeKey"
:style="{ padding: '0', backgroundColor: 'transparent' }"
@change="(activeKey) => {outModal.toggleJson(activeKey == '2'); }"
>
<a-tab-pane key="1" tab="Form">
<a-form
:colon="false"
:label-col="{ md: {span:8} }"
:wrapper-col="{ md: {span:14} }"
>
<a-form-item label='{{ i18n "protocol" }}'>
<a-select
v-model="outbound.protocol"
:dropdown-class-name="themeSwitcher.currentTheme"
>
<a-select-option v-for="x,y in Protocols" :value="x"
>[[ y ]]</a-select-option
>
</a-select>
</a-form-item>
<a-form-item
label='{{ i18n "pages.xray.outbound.tag" }}'
has-feedback
:validate-status="outModal.duplicateTag? 'warning' : 'success'"
>
<a-input
v-model.trim="outbound.tag"
@change="outModal.check()"
placeholder='{{ i18n "pages.xray.outbound.tagDesc" }}'
></a-input>
</a-form-item>
<a-form-item label='{{ i18n "pages.xray.outbound.sendThrough" }}'>
<a-input v-model="outbound.sendThrough"></a-input>
</a-form-item>
<!-- freedom settings-->
<template v-if="outbound.protocol === Protocols.Freedom">
<a-form-item label="Strategy">
<a-select
v-model="outbound.settings.domainStrategy"
:dropdown-class-name="themeSwitcher.currentTheme"
>
<a-select-option v-for="s in OutboundDomainStrategies" :value="s"
>[[ s ]]</a-select-option
>
</a-select>
</a-form-item>
<a-form-item label="Redirect">
<a-input v-model="outbound.settings.redirect"></a-input>
</a-form-item>
<a-form-item label="IPs Blocked">
<a-select
mode="tags"
v-model="outbound.settings.ipsBlocked"
:style="{ width: '100%' }"
:dropdown-class-name="themeSwitcher.currentTheme"
:token-separators="[',']"
placeholder="IP/CIDR/geoip:*/ext:*"
>
</a-select>
</a-form-item>
<a-form-item label="Fragment">
<a-switch
:checked="Object.keys(outbound.settings.fragment).length >0"
@change="checked => outbound.settings.fragment = checked ? new Outbound.FreedomSettings.Fragment() : {}"
>
</a-switch>
</a-form-item>
<template v-if="Object.keys(outbound.settings.fragment).length >0">
<a-form-item label="Packets">
<a-select
v-model="outbound.settings.fragment.packets"
:dropdown-class-name="themeSwitcher.currentTheme"
>
<a-select-option v-for="s in ['1-3','tlshello']" :value="s"
>[[ s ]]</a-select-option
>
</a-select>
</a-form-item>
<a-form-item label="Length">
<a-input v-model.trim="outbound.settings.fragment.length"></a-input>
</a-form-item>
<a-form-item label="Interval">
<a-input
v-model.trim="outbound.settings.fragment.interval"
></a-input>
</a-form-item>
<a-form-item label="Max Split">
<a-input
v-model.trim="outbound.settings.fragment.maxSplit"
></a-input>
</a-form-item>
</template>
<!-- Switch for Noises -->
<a-form-item label="Noises">
<a-switch
:checked="outbound.settings.noises.length > 0"
@change="checked => outbound.settings.noises = checked ? [new Outbound.FreedomSettings.Noise()] : []"
>
</a-switch>
</a-form-item>
<!-- Add Noise Button -->
<template v-if="outbound.settings.noises.length > 0">
<a-form-item label="Noises">
<a-button
icon="plus"
type="primary"
size="small"
@click="outbound.settings.addNoise()"
></a-button>
</a-form-item>
<!-- Noise Configurations -->
<a-form
v-for="(noise, index) in outbound.settings.noises"
:key="index"
:colon="false"
:label-col="{ md: {span:8} }"
:wrapper-col="{ md: {span:14} }"
>
<a-divider :style="{ margin: '0' }">
Noise [[ index + 1 ]]
<a-icon
v-if="outbound.settings.noises.length > 1"
type="delete"
@click="() => outbound.settings.delNoise(index)"
:style="{ color: 'rgb(255, 77, 79)', cursor: 'pointer' }"
></a-icon>
</a-divider>
<a-form-item label="Type">
<a-select
v-model="noise.type"
:dropdown-class-name="themeSwitcher.currentTheme"
>
<a-select-option
v-for="s in ['rand','base64','str', 'hex']"
:value="s"
>[[ s ]]</a-select-option
>
</a-select>
</a-form-item>
<a-form-item label="Packet">
<a-input v-model.trim="noise.packet"></a-input>
</a-form-item>
<a-form-item label="Delay">
<a-input v-model.trim="noise.delay"></a-input>
</a-form-item>
<a-form-item label="Apply To">
<a-select
v-model="noise.applyTo"
:dropdown-class-name="themeSwitcher.currentTheme"
>
<a-select-option v-for="s in ['ip','ipv4','ipv6']" :value="s"
>[[ s ]]</a-select-option
>
</a-select>
</a-form-item>
</a-form>
</template>
</template>
<!-- blackhole settings -->
<template v-if="outbound.protocol === Protocols.Blackhole">
<a-form-item label="Response Type">
<a-select
v-model="outbound.settings.type"
:dropdown-class-name="themeSwitcher.currentTheme"
>
<a-select-option v-for="s in ['', 'none','http']" :value="s"
>[[ s ]]</a-select-option
>
</a-select>
</a-form-item>
</template>
<!-- dns settings -->
<template v-if="outbound.protocol === Protocols.DNS">
<a-form-item label='{{ i18n "pages.inbounds.network" }}'>
<a-select
v-model="outbound.settings.network"
:dropdown-cl
|