mirror of
https://github.com/retspen/webvirtcloud
synced 2025-07-31 12:41:08 +00:00
logs i18n problems fixed
This commit is contained in:
parent
da9fbeaff4
commit
b81b63a962
17 changed files with 8792 additions and 11604 deletions
|
|
@ -3,6 +3,7 @@ from django.utils.translation import gettext_lazy as _
|
|||
|
||||
class Logs(Model):
|
||||
user = CharField(_("user"), max_length=50)
|
||||
ip = CharField(_("ip"), max_length=50, default=None, blank=True, null=True)
|
||||
host = CharField(_("host"), max_length=50, default="-")
|
||||
instance = CharField(_("instance"), max_length=50)
|
||||
message = CharField(_("message"), max_length=255)
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ from instances.models import Instance
|
|||
from logs.models import Logs
|
||||
|
||||
|
||||
def addlogmsg(user, host, instance, message):
|
||||
def addlogmsg(user, host, instance, message, ip=None):
|
||||
"""
|
||||
:param user:
|
||||
:param host:
|
||||
|
|
@ -15,7 +15,7 @@ def addlogmsg(user, host, instance, message):
|
|||
:param message:
|
||||
:return:
|
||||
"""
|
||||
add_log_msg = Logs(user=user, host=host, instance=instance, message=message)
|
||||
add_log_msg = Logs(user=user, host=host, instance=instance, message=message, ip=ip)
|
||||
add_log_msg.save()
|
||||
|
||||
|
||||
|
|
@ -33,6 +33,7 @@ def vm_logs(request, vname):
|
|||
for l in logs_:
|
||||
log = dict()
|
||||
log["user"] = l.user
|
||||
log["ip"] = l.ip
|
||||
log["host"] = l.host
|
||||
log["instance"] = l.instance
|
||||
log["message"] = l.message
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue