From aaa0f66a37344e46f4fb39d565e7a6efb0ab3570 Mon Sep 17 00:00:00 2001 From: Alireza Ahmadi Date: Sun, 10 Dec 2023 15:56:07 +0100 Subject: [PATCH] small fixes --- sub/subService.go | 10 ----- web/assets/js/model/xray.js | 6 +-- web/assets/js/util/common.js | 22 +++++----- web/html/xui/form/protocol/trojan.html | 61 +++++++++++++++++++------- web/html/xui/form/protocol/vless.html | 57 +++++++++++++++++------- web/html/xui/index.html | 2 +- web/html/xui/xray.html | 2 +- 7 files changed, 102 insertions(+), 58 deletions(-) diff --git a/sub/subService.go b/sub/subService.go index 7c2371a1..11485f8f 100644 --- a/sub/subService.go +++ b/sub/subService.go @@ -401,11 +401,6 @@ func (s *SubService) genVlessLink(inbound *model.Inbound, email string) string { params["spx"] = spx } } - if serverName, ok := searchKey(realitySettings, "serverName"); ok { - if sname, ok := serverName.(string); ok && len(sname) > 0 { - address = sname - } - } } if streamNetwork == "tcp" && len(clients[clientIndex].Flow) > 0 { @@ -583,11 +578,6 @@ func (s *SubService) genTrojanLink(inbound *model.Inbound, email string) string params["spx"] = spx } } - if serverName, ok := searchKey(realitySettings, "serverName"); ok { - if sname, ok := serverName.(string); ok && len(sname) > 0 { - address = sname - } - } } } diff --git a/web/assets/js/model/xray.js b/web/assets/js/model/xray.js index 240ed8f9..8ba74aa3 100644 --- a/web/assets/js/model/xray.js +++ b/web/assets/js/model/xray.js @@ -1563,7 +1563,7 @@ Inbound.VLESSSettings = class extends Inbound.Settings { fallbacks=[],) { super(protocol); this.vlesses = vlesses; - this.decryption = 'none'; // Using decryption is not implemented here + this.decryption = decryption; this.fallbacks = fallbacks; } @@ -1695,11 +1695,11 @@ Inbound.TrojanSettings = class extends Inbound.Settings { this.fallbacks = fallbacks; } - addTrojanFallback() { + addFallback() { this.fallbacks.push(new Inbound.TrojanSettings.Fallback()); } - delTrojanFallback(index) { + delFallback(index) { this.fallbacks.splice(index, 1); } diff --git a/web/assets/js/util/common.js b/web/assets/js/util/common.js index 4aeaee82..426735b0 100644 --- a/web/assets/js/util/common.js +++ b/web/assets/js/util/common.js @@ -113,35 +113,35 @@ function usageColor(data, threshold, total) { function clientUsageColor(clientStats, trafficDiff) { switch (true) { case !clientStats || clientStats.total == 0: - return "#7a316f"; + return "#7a316f"; // Purple case clientStats.up + clientStats.down < clientStats.total - trafficDiff: - return "#0e49b5"; + return "#0e49b5"; // Blue case clientStats.up + clientStats.down < clientStats.total: - return "#ffa031"; + return "#f37b24"; // Orange default: - return "#e04141"; + return "#e04141"; // red } } function userExpiryColor(threshold, client, isDark = false) { if (!client.enable) { - return isDark ? '#2c3950' : '#bcbcbc'; + return isDark ? '#2c3950' : '#bcbcbc'; // Gray } now = new Date().getTime(), expiry = client.expiryTime; switch (true) { case expiry === null: - return "#389e0d"; + return "#7a316f"; // Purple case expiry < 0: - return "#0e49b5"; + return "#0e49b5"; // Blue case expiry == 0: - return "#7a316f"; + return "#7a316f"; // Purple case now < expiry - threshold: - return "#0e49b5"; + return "#0e49b5"; // Blue case now < expiry: - return "#f37b24"; + return "#f37b24"; // Orange default: - return "#e04141"; + return "#e04141"; // red } } diff --git a/web/html/xui/form/protocol/trojan.html b/web/html/xui/form/protocol/trojan.html index 07698019..8f24c632 100644 --- a/web/html/xui/form/protocol/trojan.html +++ b/web/html/xui/form/protocol/trojan.html @@ -24,7 +24,7 @@ + @click="inbound.settings.addFallback()"> + @@ -35,24 +35,51 @@ fallback[[ index + 1 ]] - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + +
Name + + + +
Alpn + + + +
Path + + + +
Dest + + + +
xVer + + + +
diff --git a/web/html/xui/form/protocol/vless.html b/web/html/xui/form/protocol/vless.html index c7e206c6..7cc998d9 100644 --- a/web/html/xui/form/protocol/vless.html +++ b/web/html/xui/form/protocol/vless.html @@ -40,21 +40,48 @@ - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + +
Name + + + +
Alpn + + + +
Path + + + +
Dest + + + +
xVer + + + +
diff --git a/web/html/xui/index.html b/web/html/xui/index.html index eafc0995..cf61d90d 100644 --- a/web/html/xui/index.html +++ b/web/html/xui/index.html @@ -438,7 +438,7 @@ formatLogs(logs) { let formattedLogs = ''; const levels = ["DEBUG","INFO","WARNING","ERROR"]; - const levelColors = ["#3c89e8","#0e49b5","#f37b24","#e04141","#bcbcbc"]; + const levelColors = ["#3c89e8","#008771","#f37b24","#e04141","#bcbcbc"]; logs.forEach((log, index) => { let [data, message] = log.split(" - ",2); diff --git a/web/html/xui/xray.html b/web/html/xui/xray.html index df4c7b20..371456ac 100644 --- a/web/html/xui/xray.html +++ b/web/html/xui/xray.html @@ -151,7 +151,7 @@