Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/MHSanaei/3x-ui.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormhsanaei <ho3ein.sanaei@gmail.com>2024-09-16 12:41:21 +0300
committermhsanaei <ho3ein.sanaei@gmail.com>2024-09-16 12:41:21 +0300
commit566cd9e9c4b7f10f19b7eb647c6c7cad4647ac44 (patch)
tree88dfe6ef573c216f79b14d4205407f4d2ec96b21 /web/assets
parentad78cec7c79c51f16940f54baeb35cbefd18d939 (diff)
New - Allocate
Diffstat (limited to 'web/assets')
-rw-r--r--web/assets/js/model/xray.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/web/assets/js/model/xray.js b/web/assets/js/model/xray.js
index 8b7fca28..3710ec6e 100644
--- a/web/assets/js/model/xray.js
+++ b/web/assets/js/model/xray.js
@@ -1197,6 +1197,27 @@ class Sniffing extends XrayCommonClass {
}
}
+class Allocate extends XrayCommonClass {
+ constructor(
+ strategy = "always",
+ refresh = 5,
+ concurrency = 3,
+ ) {
+ super();
+ this.strategy = strategy;
+ this.refresh = refresh;
+ this.concurrency = concurrency;
+ }
+
+ static fromJson(json = {}) {
+ return new Allocate(
+ json.strategy,
+ json.refresh,
+ json.concurrency,
+ );
+ }
+}
+
class Inbound extends XrayCommonClass {
constructor(
port = RandomUtil.randomIntRange(10000, 60000),
@@ -1206,6 +1227,7 @@ class Inbound extends XrayCommonClass {
streamSettings = new StreamSettings(),
tag = '',
sniffing = new Sniffing(),
+ allocate = new Allocate(),
clientStats = '',
) {
super();
@@ -1216,6 +1238,7 @@ class Inbound extends XrayCommonClass {
this.stream = streamSettings;
this.tag = tag;
this.sniffing = sniffing;
+ this.allocate = allocate;
this.clientStats = clientStats;
}
getClientStats() {
@@ -1406,6 +1429,7 @@ class Inbound extends XrayCommonClass {
this.stream = new StreamSettings();
this.tag = '';
this.sniffing = new Sniffing();
+ this.allocate = new Allocate();
}
genVmessLink(address = '', port = this.port, forceTls, remark = '', clientId, security) {
@@ -1885,6 +1909,7 @@ class Inbound extends XrayCommonClass {
StreamSettings.fromJson(json.streamSettings),
json.tag,
Sniffing.fromJson(json.sniffing),
+ Allocate.fromJson(json.allocate),
json.clientStats
)
}
@@ -1902,6 +1927,7 @@ class Inbound extends XrayCommonClass {
streamSettings: streamSettings,
tag: this.tag,
sniffing: this.sniffing.toJson(),
+ allocate: this.allocate.toJson(),
clientStats: this.clientStats
};
}