From 3b64a62137191395aa995b5bd5f857999dd1eed2 Mon Sep 17 00:00:00 2001 From: MHSanaei Date: Thu, 7 May 2026 15:08:06 +0200 Subject: [PATCH] refactor(vless): drop selectedAuth, expose two explicit auth buttons MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit selectedAuth was UI-only metadata (Xray never reads it) and entirely redundant with the encryption string itself — the dropdown only controlled which block from `xray vlessenc` to apply. Replace it with two explicit buttons ("X25519" and "ML-KEM-768") so the user picks the auth mode in one click instead of dropdown + Get-New-Keys. - VLESSSettings drops the field from constructor, fromJson, and toJson; legacy `selectedAuth` values still in DB will be silently shed on the next save. - getNewVlessEnc(authLabel) now takes the label as a parameter; clear resets only decryption/encryption. - Fallbacks visibility now keys on encryption === "none" (the same thing the dropdown was effectively gating on). - Info modal drops the redundant Authentication tag and colours the encryption tag red when it's "none", green otherwise. Co-Authored-By: Claude Opus 4.7 --- web/assets/js/model/inbound.js | 6 ------ web/html/form/protocol/vless.html | 22 ++++++++-------------- web/html/modals/inbound_info_modal.html | 9 ++------- web/html/modals/inbound_modal.html | 16 +++++++--------- 4 files changed, 17 insertions(+), 36 deletions(-) diff --git a/web/assets/js/model/inbound.js b/web/assets/js/model/inbound.js index 074670a9..7fcc9ed5 100644 --- a/web/assets/js/model/inbound.js +++ b/web/assets/js/model/inbound.js @@ -2543,7 +2543,6 @@ Inbound.VLESSSettings = class extends Inbound.Settings { decryption = "none", encryption = "none", fallbacks = [], - selectedAuth = undefined, testseed = [], ) { super(protocol); @@ -2551,7 +2550,6 @@ Inbound.VLESSSettings = class extends Inbound.Settings { this.decryption = decryption; this.encryption = encryption; this.fallbacks = fallbacks; - this.selectedAuth = selectedAuth; this.testseed = testseed; } @@ -2587,7 +2585,6 @@ Inbound.VLESSSettings = class extends Inbound.Settings { json.decryption, json.encryption, Inbound.VLESSSettings.Fallback.fromJson(json.fallbacks || []), - json.selectedAuth, testseed, ); return obj; @@ -2610,9 +2607,6 @@ Inbound.VLESSSettings = class extends Inbound.Settings { if (this.fallbacks && this.fallbacks.length > 0) { json.fallbacks = Inbound.VLESSSettings.toJsonArray(this.fallbacks); } - if (this.selectedAuth) { - json.selectedAuth = this.selectedAuth; - } // testseed is only meaningful for the exact xtls-rprx-vision flow, and only when // the user supplied a complete 4-positive-int array. Otherwise omit and let the diff --git a/web/html/form/protocol/vless.html b/web/html/form/protocol/vless.html index fd566e9d..21abc7b2 100644 --- a/web/html/form/protocol/vless.html +++ b/web/html/form/protocol/vless.html @@ -21,16 +21,6 @@ -