feat(inbounds): expose Vision testseed field with sensible default

Add a "Vision testseed" form item to the inbound modal for TCP + TLS/reality
inbounds, normalized to positive integers and defaulting to [900,500,900,256].
Apply the same default in the outbound form adapter when no valid saved seed
is present.

Replace the http/mixed snapshot assertions in inbound-defaults with explicit
field checks so generated credentials don't break the snapshots.
This commit is contained in:
MHSanaei
2026-05-28 02:33:13 +02:00
parent 1a096d72f1
commit 486ac9c28d
4 changed files with 28 additions and 19 deletions
@@ -1428,6 +1428,21 @@ export default function InboundFormModal({
{t('pages.inbounds.vlessAuthSelected', { auth: selectedVlessAuth })}
</Text>
</Form.Item>
{network === 'tcp' && (security === 'tls' || security === 'reality') && (
<Form.Item
label="Vision testseed"
name={['settings', 'testseed']}
initialValue={[900, 500, 900, 256]}
normalize={(v: unknown) =>
Array.isArray(v)
? v.map((x) => Number(x)).filter((n) => Number.isInteger(n) && n > 0)
: []
}
extra="Applies only to clients using the xtls-rprx-vision flow; ignored otherwise."
>
<Select mode="tags" tokenSeparators={[',', ' ']} placeholder="four positive integers" />
</Form.Item>
)}
</>
)}