mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-05-15 04:38:07 +00:00
some changes
Co-Authored-By: Alireza Ahmadi <alireza7@gmail.com>
This commit is contained in:
parent
872974910c
commit
8489f5f528
6 changed files with 15 additions and 13 deletions
|
@ -181,7 +181,7 @@ class AllSetting {
|
||||||
this.tgBotChatId = "";
|
this.tgBotChatId = "";
|
||||||
this.tgRunTime = "@daily";
|
this.tgRunTime = "@daily";
|
||||||
this.tgBotBackup = false;
|
this.tgBotBackup = false;
|
||||||
this.tgBotLoginNotify = false;
|
this.tgBotLoginNotify = true;
|
||||||
this.tgCpu = "";
|
this.tgCpu = "";
|
||||||
this.tgLang = "en-US";
|
this.tgLang = "en-US";
|
||||||
this.xrayTemplateConfig = "";
|
this.xrayTemplateConfig = "";
|
||||||
|
@ -194,7 +194,7 @@ class AllSetting {
|
||||||
this.subCertFile = "";
|
this.subCertFile = "";
|
||||||
this.subKeyFile = "";
|
this.subKeyFile = "";
|
||||||
this.subUpdates = 0;
|
this.subUpdates = 0;
|
||||||
this.subShowInfo = false;
|
this.subShowInfo = true;
|
||||||
|
|
||||||
this.timeLocation = "Asia/Tehran";
|
this.timeLocation = "Asia/Tehran";
|
||||||
|
|
||||||
|
|
|
@ -1659,10 +1659,10 @@ class Inbound extends XrayCommonClass {
|
||||||
JSON.parse(this.settings).clients.forEach((client,index) => {
|
JSON.parse(this.settings).clients.forEach((client,index) => {
|
||||||
if(this.tls && !ObjectUtil.isArrEmpty(this.stream.tls.settings.domains)){
|
if(this.tls && !ObjectUtil.isArrEmpty(this.stream.tls.settings.domains)){
|
||||||
this.stream.tls.settings.domains.forEach((domain) => {
|
this.stream.tls.settings.domains.forEach((domain) => {
|
||||||
link += this.genLink(domain.domain, remark + '-' + client.email + '-' + domain.remark, index) + '\r\n';
|
link += this.genLink(domain.domain, [remark, client.email, domain.remark].filter(x => x.length > 0).join('-'), index) + '\r\n';
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
link += this.genLink(address, remark + '-' + client.email, index) + '\r\n';
|
link += this.genLink(address, [remark, client.email].filter(x => x.length > 0).join('-'), index) + '\r\n';
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return link;
|
return link;
|
||||||
|
|
|
@ -37,15 +37,16 @@
|
||||||
this.inbound = dbInbound.toInbound();
|
this.inbound = dbInbound.toInbound();
|
||||||
settings = JSON.parse(this.inbound.settings);
|
settings = JSON.parse(this.inbound.settings);
|
||||||
this.client = settings.clients[clientIndex];
|
this.client = settings.clients[clientIndex];
|
||||||
remark = this.dbInbound.remark + ( this.client ? "-" + this.client.email : '');
|
remark = [this.dbInbound.remark, ( this.client ? this.client.email : '')].filter(Boolean).join('-');
|
||||||
address = this.dbInbound.address;
|
address = this.dbInbound.address;
|
||||||
this.subId = '';
|
this.subId = '';
|
||||||
this.qrcodes = [];
|
this.qrcodes = [];
|
||||||
if (this.inbound.tls && !ObjectUtil.isArrEmpty(this.inbound.stream.tls.settings.domains)) {
|
if (this.inbound.tls && !ObjectUtil.isArrEmpty(this.inbound.stream.tls.settings.domains)) {
|
||||||
this.inbound.stream.tls.settings.domains.forEach((domain) => {
|
this.inbound.stream.tls.settings.domains.forEach((domain) => {
|
||||||
|
remarkText = [remark, domain.remark].filter(Boolean).join('-');
|
||||||
this.qrcodes.push({
|
this.qrcodes.push({
|
||||||
remark: remark + "-" + domain.remark,
|
remark: remarkText,
|
||||||
link: this.inbound.genLink(domain.domain, remark + "-" + domain.remark, clientIndex)
|
link: this.inbound.genLink(domain.domain, remarkText, clientIndex)
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -264,14 +264,15 @@
|
||||||
this.clientSettings = this.settings.clients ? Object.values(this.settings.clients)[index] : null;
|
this.clientSettings = this.settings.clients ? Object.values(this.settings.clients)[index] : null;
|
||||||
this.isExpired = this.inbound.isExpiry(index);
|
this.isExpired = this.inbound.isExpiry(index);
|
||||||
this.clientStats = this.settings.clients ? this.dbInbound.clientStats.find(row => row.email === this.clientSettings.email) : [];
|
this.clientStats = this.settings.clients ? this.dbInbound.clientStats.find(row => row.email === this.clientSettings.email) : [];
|
||||||
remark = this.dbInbound.remark + ( this.clientSettings ? "-" + this.clientSettings.email : '');
|
remark = [this.dbInbound.remark, ( this.clientSettings ? this.clientSettings.email : '')].filter(Boolean).join('-');
|
||||||
address = this.dbInbound.address;
|
address = this.dbInbound.address;
|
||||||
this.links = [];
|
this.links = [];
|
||||||
if (this.inbound.tls && !ObjectUtil.isArrEmpty(this.inbound.stream.tls.settings.domains)) {
|
if (this.inbound.tls && !ObjectUtil.isArrEmpty(this.inbound.stream.tls.settings.domains)) {
|
||||||
this.inbound.stream.tls.settings.domains.forEach((domain) => {
|
this.inbound.stream.tls.settings.domains.forEach((domain) => {
|
||||||
|
remarkText = [remark, domain.remark].filter(Boolean).join('-');
|
||||||
this.links.push({
|
this.links.push({
|
||||||
remark: remark + "-" + domain.remark,
|
remark: remarkText,
|
||||||
link: this.inbound.genLink(domain.domain, remark + "-" + domain.remark, index)
|
link: this.inbound.genLink(domain.domain, remarkText, index)
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -110,7 +110,7 @@
|
||||||
if (this.inModal.inbound.settings.shadowsockses.length ==0){
|
if (this.inModal.inbound.settings.shadowsockses.length ==0){
|
||||||
this.inModal.inbound.settings.shadowsockses = [new Inbound.ShadowsocksSettings.Shadowsocks()];
|
this.inModal.inbound.settings.shadowsockses = [new Inbound.ShadowsocksSettings.Shadowsocks()];
|
||||||
}
|
}
|
||||||
if (["aes-128-gcm", "aes-256-gcm", "chacha20-poly1305", "xchacha20-poly1305"].includes(this.inModal.inbound.settings.method)) {
|
if (!this.inModal.inbound.isSS2022) {
|
||||||
this.inModal.inbound.settings.shadowsockses.forEach(client => {
|
this.inModal.inbound.settings.shadowsockses.forEach(client => {
|
||||||
client.method = this.inModal.inbound.settings.method;
|
client.method = this.inModal.inbound.settings.method;
|
||||||
})
|
})
|
||||||
|
|
|
@ -39,7 +39,7 @@ var defaultValueMap = map[string]string{
|
||||||
"tgBotChatId": "",
|
"tgBotChatId": "",
|
||||||
"tgRunTime": "@daily",
|
"tgRunTime": "@daily",
|
||||||
"tgBotBackup": "false",
|
"tgBotBackup": "false",
|
||||||
"tgBotLoginNotify": "false",
|
"tgBotLoginNotify": "true",
|
||||||
"tgCpu": "0",
|
"tgCpu": "0",
|
||||||
"tgLang": "en-US",
|
"tgLang": "en-US",
|
||||||
"secretEnable": "false",
|
"secretEnable": "false",
|
||||||
|
@ -51,7 +51,7 @@ var defaultValueMap = map[string]string{
|
||||||
"subCertFile": "",
|
"subCertFile": "",
|
||||||
"subKeyFile": "",
|
"subKeyFile": "",
|
||||||
"subUpdates": "12",
|
"subUpdates": "12",
|
||||||
"subShowInfo": "false",
|
"subShowInfo": "true",
|
||||||
}
|
}
|
||||||
|
|
||||||
type SettingService struct {
|
type SettingService struct {
|
||||||
|
|
Loading…
Reference in a new issue