mirror of
https://github.com/retspen/webvirtcloud
synced 2026-11-11 12:46:49 +00:00
libvirt names a VM by its <name>.xml file, so a name can have up to 251 bytes. The panel's VM, removed-VM and log records held 120 characters: on PostgreSQL one longer name made the host's sync fail and the VM list answer with an error. They now hold 255. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
15 lines
725 B
Python
15 lines
725 B
Python
from django.db.models import BooleanField, CharField, DateTimeField, GenericIPAddressField, Model, TextField
|
|
from django.utils.translation import gettext_lazy as _
|
|
|
|
class Logs(Model):
|
|
user = CharField(_("user"), max_length=150)
|
|
host = CharField(_("host"), max_length=255, default="-")
|
|
instance = CharField(_("instance"), max_length=255)
|
|
instance_uuid = CharField(_("instance UUID"), max_length=36, blank=True, default="", db_index=True)
|
|
message = TextField(_("message"))
|
|
date = DateTimeField(_("date"), auto_now_add=True, db_index=True)
|
|
success = BooleanField(_("success"), null=True)
|
|
ip = GenericIPAddressField(_("IP address"), null=True)
|
|
|
|
def __str__(self):
|
|
return self.instance
|