From 4db42ba40976328c4cb5dac7de623b2f08c20b75 Mon Sep 17 00:00:00 2001 From: MHSanaei Date: Sat, 9 Dec 2023 20:06:12 +0330 Subject: [PATCH] code inconsistencies and parameter mismatch in inbound.VLESSSettings class --- web/assets/js/model/xray.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/web/assets/js/model/xray.js b/web/assets/js/model/xray.js index ec701354..52205a6c 100644 --- a/web/assets/js/model/xray.js +++ b/web/assets/js/model/xray.js @@ -1776,10 +1776,10 @@ Inbound.VLESSSettings = class extends Inbound.Settings { constructor(protocol, vlesses=[new Inbound.VLESSSettings.VLESS()], decryption='none', - fallbacks=[],) { + fallbacks=[]) { super(protocol); this.vlesses = vlesses; - this.decryption = 'none'; // Using decryption is not implemented here + this.decryption = decryption; this.fallbacks = fallbacks; } @@ -1796,20 +1796,20 @@ Inbound.VLESSSettings = class extends Inbound.Settings { return new Inbound.VLESSSettings( Protocols.VLESS, json.clients.map(client => Inbound.VLESSSettings.VLESS.fromJson(client)), - 'none', - Inbound.VLESSSettings.Fallback.fromJson(json.fallbacks), + json.decryption || 'none', + json.fallbacks.map(fallback => Inbound.VLESSSettings.Fallback.fromJson(fallback)), ); } toJson() { return { clients: Inbound.VLESSSettings.toJsonArray(this.vlesses), - decryption: 'none', + decryption: this.decryption, fallbacks: Inbound.VLESSSettings.toJsonArray(this.fallbacks), }; } - }; + Inbound.VLESSSettings.VLESS = class extends XrayCommonClass { constructor(id=RandomUtil.randomUUID(), flow='', email=RandomUtil.randomLowerAndNum(8),limitIp=0, totalGB=0, expiryTime=0, enable=true, tgId='', subId=RandomUtil.randomLowerAndNum(16), reset=0) { super();