refactor(vless): drop selectedAuth, expose two explicit auth buttons
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 <noreply@anthropic.com>
This commit is contained in:
@@ -302,12 +302,11 @@
|
||||
this.inbound.stream.tls.echServerKeys = "";
|
||||
this.inbound.stream.tls.settings.echConfigList = "";
|
||||
},
|
||||
async getNewVlessEnc() {
|
||||
const selected = inModal.inbound.settings.selectedAuth;
|
||||
if (!selected) {
|
||||
this.clearVlessEnc();
|
||||
return;
|
||||
}
|
||||
// Pulls the requested auth block from `xray vlessenc` (which always returns
|
||||
// both X25519 and ML-KEM-768 variants) and applies it to the inbound's
|
||||
// decryption/encryption strings. The auth mode is implied by the resulting
|
||||
async getNewVlessEnc(authLabel) {
|
||||
if (!authLabel) return;
|
||||
|
||||
inModal.loading(true);
|
||||
const msg = await HttpUtil.get("/panel/api/server/getNewVlessEnc");
|
||||
@@ -318,10 +317,10 @@
|
||||
}
|
||||
|
||||
const auths = msg.obj.auths || [];
|
||||
const block = auths.find((a) => a.label === selected);
|
||||
const block = auths.find((a) => a.label === authLabel);
|
||||
|
||||
if (!block) {
|
||||
console.error("No auth block for", selected);
|
||||
console.error("No auth block for", authLabel);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -331,7 +330,6 @@
|
||||
clearVlessEnc() {
|
||||
this.inbound.settings.decryption = "none";
|
||||
this.inbound.settings.encryption = "none";
|
||||
this.inbound.settings.selectedAuth = undefined;
|
||||
},
|
||||
// Vision Seed methods - must be in Vue methods for proper template binding.
|
||||
// Mirror the inModal helpers but use Vue.set so the form re-renders.
|
||||
|
||||
Reference in New Issue
Block a user