mirror of https://github.com/jumpserver/jumpserver
perf: 修改 job log
parent
a21cb32245
commit
a7815dc9e5
|
@ -0,0 +1,23 @@
|
||||||
|
# Generated by Django 3.2.14 on 2022-12-20 09:57
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
dependencies = [
|
||||||
|
('audits', '0016_auto_20221111_1919'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.RenameField(
|
||||||
|
model_name='ftplog',
|
||||||
|
old_name='system_user',
|
||||||
|
new_name='account',
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='ftplog',
|
||||||
|
name='account',
|
||||||
|
field=models.CharField(default='', max_length=128, verbose_name='Account'),
|
||||||
|
preserve_default=False,
|
||||||
|
),
|
||||||
|
]
|
|
@ -2,11 +2,11 @@ import uuid
|
||||||
|
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from django.db.models import Q
|
from django.db.models import Q
|
||||||
from django.utils.translation import gettext, ugettext_lazy as _
|
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
|
from django.utils.translation import gettext, ugettext_lazy as _
|
||||||
|
|
||||||
from common.utils import lazyproperty
|
|
||||||
from common.db.encoder import ModelJSONFieldEncoder
|
from common.db.encoder import ModelJSONFieldEncoder
|
||||||
|
from common.utils import lazyproperty
|
||||||
from orgs.mixins.models import OrgModelMixin, Organization
|
from orgs.mixins.models import OrgModelMixin, Organization
|
||||||
from orgs.utils import current_org
|
from orgs.utils import current_org
|
||||||
from .const import (
|
from .const import (
|
||||||
|
@ -32,7 +32,7 @@ class FTPLog(OrgModelMixin):
|
||||||
max_length=128, verbose_name=_("Remote addr"), blank=True, null=True
|
max_length=128, verbose_name=_("Remote addr"), blank=True, null=True
|
||||||
)
|
)
|
||||||
asset = models.CharField(max_length=1024, verbose_name=_("Asset"))
|
asset = models.CharField(max_length=1024, verbose_name=_("Asset"))
|
||||||
system_user = models.CharField(max_length=128, verbose_name=_("System user"))
|
account = models.CharField(max_length=128, verbose_name=_("Account"))
|
||||||
operate = models.CharField(
|
operate = models.CharField(
|
||||||
max_length=16, verbose_name=_("Operate"), choices=OperateChoices.choices
|
max_length=16, verbose_name=_("Operate"), choices=OperateChoices.choices
|
||||||
)
|
)
|
||||||
|
|
|
@ -9,10 +9,8 @@ from ops.serializers.job import JobExecutionSerializer
|
||||||
from terminal.models import Session
|
from terminal.models import Session
|
||||||
from . import models
|
from . import models
|
||||||
from .const import (
|
from .const import (
|
||||||
ActionChoices,
|
ActionChoices, OperateChoices,
|
||||||
OperateChoices,
|
MFAChoices, LoginStatusChoices,
|
||||||
MFAChoices,
|
|
||||||
LoginStatusChoices,
|
|
||||||
LoginTypeChoices,
|
LoginTypeChoices,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -20,11 +18,11 @@ from .const import (
|
||||||
class JobAuditLogSerializer(JobExecutionSerializer):
|
class JobAuditLogSerializer(JobExecutionSerializer):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = JobAuditLog
|
model = JobAuditLog
|
||||||
read_only_fields = ["id", "material", "timedelta", "time_cost", 'is_finished', 'date_start',
|
read_only_fields = [
|
||||||
'date_finished',
|
"id", "material", "time_cost",
|
||||||
'date_created',
|
'date_start', 'date_finished', 'date_created',
|
||||||
'is_success',
|
'is_finished', 'is_success', 'creator_by'
|
||||||
'creator_name']
|
]
|
||||||
fields = read_only_fields + []
|
fields = read_only_fields + []
|
||||||
|
|
||||||
|
|
||||||
|
@ -35,14 +33,8 @@ class FTPLogSerializer(serializers.ModelSerializer):
|
||||||
model = models.FTPLog
|
model = models.FTPLog
|
||||||
fields_mini = ["id"]
|
fields_mini = ["id"]
|
||||||
fields_small = fields_mini + [
|
fields_small = fields_mini + [
|
||||||
"user",
|
"user", "remote_addr", "asset", "account",
|
||||||
"remote_addr",
|
"org_id", "operate", "filename", "is_success",
|
||||||
"asset",
|
|
||||||
"system_user",
|
|
||||||
"org_id",
|
|
||||||
"operate",
|
|
||||||
"filename",
|
|
||||||
"is_success",
|
|
||||||
"date_start",
|
"date_start",
|
||||||
]
|
]
|
||||||
fields = fields_small
|
fields = fields_small
|
||||||
|
|
Loading…
Reference in New Issue