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:
Diffstat (limited to 'web/assets/js/model')
-rw-r--r--web/assets/js/model/models.js4
-rw-r--r--web/assets/js/model/xray.js21
2 files changed, 17 insertions, 8 deletions
diff --git a/web/assets/js/model/models.js b/web/assets/js/model/models.js
index c2404d3b..9fa5e7fc 100644
--- a/web/assets/js/model/models.js
+++ b/web/assets/js/model/models.js
@@ -151,9 +151,9 @@ class DBInbound {
}
}
- genLink() {
+ genLink(clientIndex) {
const inbound = this.toInbound();
- return inbound.genLink(this.address, this.remark);
+ return inbound.genLink(this.address, this.remark, clientIndex);
}
}
diff --git a/web/assets/js/model/xray.js b/web/assets/js/model/xray.js
index f5cbb1e0..ccddc591 100644
--- a/web/assets/js/model/xray.js
+++ b/web/assets/js/model/xray.js
@@ -1040,7 +1040,6 @@ class Inbound extends XrayCommonClass {
}
}
- remark = this.settings.vmesses[clientIndex].email ?? remark;
let obj = {
v: '2',
ps: remark,
@@ -1063,7 +1062,6 @@ class Inbound extends XrayCommonClass {
const port = this.port;
const type = this.stream.network;
const params = new Map();
- remark = settings.vlesses[clientIndex].email ?? remark;
params.set("type", this.stream.network);
if (this.xtls) {
params.set("security", "xtls");
@@ -1156,7 +1154,6 @@ class Inbound extends XrayCommonClass {
const port = this.port;
const type = this.stream.network;
const params = new Map();
- remark = settings.trojans[clientIndex].email ?? remark;
params.set("type", this.stream.network);
if (this.xtls) {
params.set("security", "xtls");
@@ -1229,10 +1226,22 @@ class Inbound extends XrayCommonClass {
genLink(address='', remark='', clientIndex=0) {
switch (this.protocol) {
- case Protocols.VMESS: return this.genVmessLink(address, remark, clientIndex);
- case Protocols.VLESS: return this.genVLESSLink(address, remark, clientIndex);
+ case Protocols.VMESS:
+ if (this.settings.vmesses[clientIndex].email != ""){
+ remark += '-' + this.settings.vmesses[clientIndex].email
+ }
+ return this.genVmessLink(address, remark, clientIndex);
+ case Protocols.VLESS:
+ if (this.settings.vlesses[clientIndex].email != ""){
+ remark += '-' + this.settings.vlesses[clientIndex].email
+ }
+ return this.genVLESSLink(address, remark, clientIndex);
case Protocols.SHADOWSOCKS: return this.genSSLink(address, remark);
- case Protocols.TROJAN: return this.genTrojanLink(address, remark, clientIndex);
+ case Protocols.TROJAN:
+ if (this.settings.trojans[clientIndex].email != ""){
+ remark += '-' + this.settings.trojans[clientIndex].email
+ }
+ return this.genTrojanLink(address, remark, clientIndex);
default: return '';
}
}