Compare commits

...

3 commits

Author SHA1 Message Date
Nebulosa
533a1f18ba
Merge 742d901a61 into 4c797dc154 2025-12-24 11:53:44 +03:00
zd
4c797dc154
fix: display of outbound traffic (#3604)
Some checks failed
Release 3X-UI / build (386) (push) Has been cancelled
Release 3X-UI / build (amd64) (push) Has been cancelled
Release 3X-UI / build (arm64) (push) Has been cancelled
Release 3X-UI / build (armv5) (push) Has been cancelled
Release 3X-UI / build (armv6) (push) Has been cancelled
Release 3X-UI / build (armv7) (push) Has been cancelled
Release 3X-UI / build (s390x) (push) Has been cancelled
Release 3X-UI / Build for Windows (push) Has been cancelled
shows the direction of traffic
2025-12-23 15:43:25 +01:00
Nebulosa
742d901a61 Set log folder variable to /var/log/3x-ui 2025-12-05 14:42:13 +03:00
5 changed files with 13 additions and 4 deletions

4
.env.example Normal file
View file

@ -0,0 +1,4 @@
XUI_DEBUG=true
XUI_DB_FOLDER=x-ui
XUI_LOG_FOLDER=x-ui
XUI_BIN_FOLDER=x-ui

5
CONTRIBUTING.md Normal file
View file

@ -0,0 +1,5 @@
## Local Development Setup
- Create a directory named `x-ui` in the project root
- Rename `.env.example` to `.env `
- Run `main.go`

View file

@ -109,7 +109,7 @@ func GetLogFolder() string {
if runtime.GOOS == "windows" {
return filepath.Join(".", "log")
}
return "/var/log"
return "/var/log/3x-ui"
}
func copyFile(src, dst string) error {

View file

@ -527,10 +527,10 @@
findOutboundTraffic(o) {
for (const otraffic of this.outboundsTraffic) {
if (otraffic.tag == o.tag) {
return SizeFormatter.sizeFormat(otraffic.up) + ' / ' + SizeFormatter.sizeFormat(otraffic.down);
return `↑ ${SizeFormatter.sizeFormat(otraffic.up)} / ${SizeFormatter.sizeFormat(otraffic.down)} ↓`
}
}
return SizeFormatter.sizeFormat(0) + ' / ' + SizeFormatter.sizeFormat(0);
return `${SizeFormatter.sizeFormat(0)} / ${SizeFormatter.sizeFormat(0)}`
},
findOutboundAddress(o) {
serverObj = null;

View file

@ -39,7 +39,7 @@ os_version=""
os_version=$(grep "^VERSION_ID" /etc/os-release | cut -d '=' -f2 | tr -d '"' | tr -d '.')
# Declare Variables
log_folder="${XUI_LOG_FOLDER:=/var/log}"
log_folder="${XUI_LOG_FOLDER:=/var/log/3x-ui}"
iplimit_log_path="${log_folder}/3xipl.log"
iplimit_banned_log_path="${log_folder}/3xipl-banned.log"