mirror of
https://github.com/retspen/webvirtcloud
synced 2026-12-01 16:36:06 +00:00
fix(logs): the VM page's Logs tab shows times as the Logs page does
The Logs tab of a VM's Stats showed each row's time in UTC, formatted by
the process locale ("11/10/26 08:43:08" whatever the page's language),
while the Logs page shows the same row in the panel's time zone
("2026-11-10 11:43:08" with TIME_ZONE=Europe/Istanbul). The tab now
shows the panel's time in the Logs page's format, and its Date heading
names the zone as the Logs page's does.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
This commit is contained in:
parent
ae3496ac50
commit
a8f7c8aeaa
7 changed files with 86 additions and 75 deletions
|
|
@ -1,5 +1,6 @@
|
|||
from django.http import JsonResponse
|
||||
from django.shortcuts import get_object_or_404
|
||||
from django.utils import timezone
|
||||
from django.utils.translation import gettext as _
|
||||
|
||||
from admin.decorators import superuser_only
|
||||
|
|
@ -23,6 +24,7 @@ def vm_logs(request, pk):
|
|||
"instance": log.instance,
|
||||
"message": log.message,
|
||||
"result": results[log.success],
|
||||
"date": log.date.strftime("%x %X"),
|
||||
# as the Logs page shows it: in the panel's time zone, which the tab's heading names
|
||||
"date": timezone.localtime(log.date).strftime("%Y-%m-%d %H:%M:%S"),
|
||||
})
|
||||
return JsonResponse(logs, safe=False)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue