From 2d354eafa3e6207fdf20b0e657ab59abbcefb9b1 Mon Sep 17 00:00:00 2001 From: MHSanaei Date: Tue, 6 Feb 2024 13:45:01 +0330 Subject: [PATCH] fix - Ensure logs are not null in show method #1763 --- web/html/xui/index.html | 4 ++-- web/job/check_client_ip_job.go | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/web/html/xui/index.html b/web/html/xui/index.html index 258d4154..a9391952 100644 --- a/web/html/xui/index.html +++ b/web/html/xui/index.html @@ -440,8 +440,8 @@ loading: false, show(logs) { this.visible = true; - this.logs = logs; - this.formattedLogs = logs.length > 0 ? this.formatLogs(logs) : "No Record..."; + this.logs = logs || []; + this.formattedLogs = this.logs.length > 0 ? this.formatLogs(this.logs) : "No Record..."; }, formatLogs(logs) { let formattedLogs = ''; diff --git a/web/job/check_client_ip_job.go b/web/job/check_client_ip_job.go index 905a8cc7..65e2a0ca 100644 --- a/web/job/check_client_ip_job.go +++ b/web/job/check_client_ip_job.go @@ -88,7 +88,7 @@ func (j *CheckClientIpJob) checkFail2BanInstalled() { err := exec.Command(cmd, args...).Run() if err != nil { - logger.Warning("fail2ban is not installed. IP limiting may not work properly.") + logger.Error("fail2ban is not installed. IP limiting may not work properly.") } } @@ -96,12 +96,12 @@ func (j *CheckClientIpJob) processLogFile() { accessLogPath := xray.GetAccessLogPath() if accessLogPath == "none" { - logger.Warning("Access log is set to 'none' check your Xray Configs") + logger.Error("Access log is set to 'none' check your Xray Configs") return } if accessLogPath == "" { - logger.Warning("Access log doesn't exist in your Xray Configs") + logger.Error("Access log doesn't exist in your Xray Configs") return }