Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/MHSanaei/3x-ui.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
Diffstat (limited to 'web')
-rw-r--r--web/html/index.html4
-rw-r--r--web/service/server.go8
2 files changed, 7 insertions, 5 deletions
diff --git a/web/html/index.html b/web/html/index.html
index 84445fbf..1c6bb0be 100644
--- a/web/html/index.html
+++ b/web/html/index.html
@@ -844,9 +844,11 @@
text = `<td>${log.Email}</td>`;
}
+ const { locale, timeZone } = Intl.DateTimeFormat().resolvedOptions();
+
formattedLogs += `
<tr ${outboundColor}>
- <td><b>${new Date(log.DateTime).toLocaleString()}</b></td>
+ <td><b>${new Date(log.DateTime).toLocaleString(locale, { timeZone })}</b></td>
<td>${log.FromAddress}</td>
<td>${log.ToAddress}</td>
<td>${log.Inbound}</td>
diff --git a/web/service/server.go b/web/service/server.go
index b7cfc3a7..d48a96c3 100644
--- a/web/service/server.go
+++ b/web/service/server.go
@@ -794,17 +794,17 @@ func (s *ServerService) GetXrayLogs(
for i, part := range parts {
if i == 0 {
- dateTime, err := time.Parse("2006/01/02 15:04:05.999999", parts[0]+" "+parts[1])
+ dateTime, err := time.ParseInLocation("2006/01/02 15:04:05.999999", parts[0]+" "+parts[1], time.Local)
if err != nil {
continue
}
- entry.DateTime = dateTime
+ entry.DateTime = dateTime.UTC()
}
if part == "from" {
- entry.FromAddress = parts[i+1]
+ entry.FromAddress = strings.TrimLeft(parts[i+1], "/")
} else if part == "accepted" {
- entry.ToAddress = parts[i+1]
+ entry.ToAddress = strings.TrimLeft(parts[i+1], "/")
} else if strings.HasPrefix(part, "[") {
entry.Inbound = part[1:]
} else if strings.HasSuffix(part, "]") {