diff options
Diffstat (limited to 'web/assets/js')
| -rw-r--r-- | web/assets/js/model/inbound.js | 10 | ||||
| -rw-r--r-- | web/assets/js/model/outbound.js | 7 |
2 files changed, 16 insertions, 1 deletions
diff --git a/web/assets/js/model/inbound.js b/web/assets/js/model/inbound.js index e2c9e092..ba2304ef 100644 --- a/web/assets/js/model/inbound.js +++ b/web/assets/js/model/inbound.js @@ -1221,6 +1221,14 @@ class Inbound extends XrayCommonClass { return false; } + // Vision seed applies only when vision flow is selected + canEnableVisionSeed() { + if (!this.canEnableTlsFlow()) return false; + const clients = this.settings?.vlesses; + if (!Array.isArray(clients)) return false; + return clients.some(c => c?.flow === TLS_FLOW_CONTROL.VISION || c?.flow === TLS_FLOW_CONTROL.VISION_UDP443); + } + canEnableReality() { if (![Protocols.VLESS, Protocols.TROJAN].includes(this.protocol)) return false; return ["tcp", "http", "grpc", "xhttp"].includes(this.network); @@ -1902,7 +1910,7 @@ Inbound.VLESSSettings = class extends Inbound.Settings { if (json.testseed && Array.isArray(json.testseed) && json.testseed.length >= 4) { testseed = json.testseed; } - + const obj = new Inbound.VLESSSettings( Protocols.VLESS, (json.clients || []).map(client => Inbound.VLESSSettings.VLESS.fromJson(client)), diff --git a/web/assets/js/model/outbound.js b/web/assets/js/model/outbound.js index c631040e..295ac812 100644 --- a/web/assets/js/model/outbound.js +++ b/web/assets/js/model/outbound.js @@ -621,6 +621,13 @@ class Outbound extends CommonClass { return false; } + // Vision seed applies only when vision flow is selected + canEnableVisionSeed() { + if (!this.canEnableTlsFlow()) return false; + const flow = this.settings?.flow; + return flow === TLS_FLOW_CONTROL.VISION || flow === TLS_FLOW_CONTROL.VISION_UDP443; + } + canEnableReality() { if (![Protocols.VLESS, Protocols.Trojan].includes(this.protocol)) return false; return ["tcp", "http", "grpc", "xhttp"].includes(this.stream.network); |
