en lang edit, new designed

This commit is contained in:
MHSanaei
2023-02-12 17:20:09 +03:30
parent 920259b6f8
commit 6d28c39ae8
22 changed files with 296 additions and 200 deletions

View File

@@ -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);
}
}

View File

@@ -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 '';
}
}

View File

@@ -54,4 +54,16 @@ function addZero(num) {
function toFixed(num, n) {
n = Math.pow(10, n);
return Math.round(num * n) / n;
}
}
function debounce (fn, delay) {
var timeoutID = null
return function () {
clearTimeout(timeoutID)
var args = arguments
var that = this
timeoutID = setTimeout(function () {
fn.apply(that, args)
}, delay)
}
}