perf: 优化activity log

pull/9552/head
ibuler 2023-02-14 20:01:29 +08:00
parent f147724447
commit fd38f5d89d
16 changed files with 412 additions and 363 deletions

View File

@ -0,0 +1,17 @@
# Generated by Django 3.2.14 on 2023-02-14 10:54
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('assets', '0108_alter_platform_charset'),
]
operations = [
migrations.AlterModelOptions(
name='asset',
options={'ordering': ['name'], 'permissions': [('refresh_assethardwareinfo', 'Can refresh asset hardware info'), ('test_assetconnectivity', 'Can test asset connectivity'), ('push_assetaccount', 'Can push account to asset'), ('test_account', 'Can verify account'), ('match_asset', 'Can match asset'), ('add_assettonode', 'Add asset to node'), ('move_assettonode', 'Move asset to node'), ('remove_assetfromnode', 'Remove asset from node')], 'verbose_name': 'Asset'},
),
]

View File

@ -5,22 +5,22 @@ from importlib import import_module
from django.conf import settings
from django.db.models import F, Value, CharField
from rest_framework import generics
from rest_framework.permissions import IsAuthenticated
from rest_framework.mixins import ListModelMixin, CreateModelMixin, RetrieveModelMixin
from rest_framework.permissions import IsAuthenticated
from ops.models.job import JobAuditLog
from common.api import JMSGenericViewSet
from common.drf.filters import DatetimeRangeFilter
from common.plugins.es import QuerySet as ESQuerySet
from orgs.utils import current_org, tmp_to_root_org
from ops.models.job import JobAuditLog
from orgs.mixins.api import OrgGenericViewSet, OrgBulkModelViewSet
from orgs.utils import current_org, tmp_to_root_org
from .backends import TYPE_ENGINE_MAPPING
from .const import ActivityChoices
from .models import FTPLog, UserLoginLog, OperateLog, PasswordChangeLog, ActivityLog
from .serializers import FTPLogSerializer, UserLoginLogSerializer, JobAuditLogSerializer
from .serializers import (
OperateLogSerializer, OperateLogActionDetailSerializer,
PasswordChangeLogSerializer, ActivityOperatorLogSerializer,
PasswordChangeLogSerializer, ActivityUnionLogSerializer,
)
@ -79,7 +79,7 @@ class MyLoginLogAPIView(UserLoginCommonMixin, generics.ListAPIView):
class ResourceActivityAPIView(generics.ListAPIView):
serializer_class = ActivityOperatorLogSerializer
serializer_class = ActivityUnionLogSerializer
rbac_perms = {
'GET': 'audits.view_activitylog',
}
@ -96,10 +96,10 @@ class ResourceActivityAPIView(generics.ListAPIView):
@staticmethod
def get_activity_log_qs(fields, limit=30, **filters):
queryset = ActivityLog.objects.filter(**filters).annotate(
r_type=F('type'), r_detail_id=F('detail_id'),
r_detail=F('detail'), r_user=Value(None, CharField()),
r_action=Value(None, CharField()),
).values(*fields)[:limit]
r_type=F('type'), r_detail_id=F('detail_id'),
r_detail=F('detail'), r_user=Value(None, CharField()),
r_action=Value(None, CharField()),
).values(*fields)[:limit]
return queryset
def get_queryset(self):
@ -113,7 +113,7 @@ class ResourceActivityAPIView(generics.ListAPIView):
qs1 = self.get_operate_log_qs(fields, resource_id=resource_id)
qs2 = self.get_activity_log_qs(fields, resource_id=resource_id)
queryset = qs2.union(qs1)
return queryset[:limit]
return queryset.order_by('-datetime')[:limit]
class OperateLogViewSet(RetrieveModelMixin, ListModelMixin, OrgGenericViewSet):
@ -163,54 +163,3 @@ class PasswordChangeLogViewSet(ListModelMixin, JMSGenericViewSet):
user__in=[str(user) for user in users]
)
return queryset
# Todo: 看看怎么搞
# class CommandExecutionViewSet(ListModelMixin, OrgGenericViewSet):
# model = CommandExecution
# serializer_class = CommandExecutionSerializer
# extra_filter_backends = [DatetimeRangeFilter]
# date_range_filter_fields = [
# ('date_start', ('date_from', 'date_to'))
# ]
# filterset_fields = [
# 'user__name', 'user__username', 'command',
# 'account', 'is_finished'
# ]
# search_fields = [
# 'command', 'user__name', 'user__username',
# 'account__username',
# ]
# ordering = ['-date_created']
#
# def get_queryset(self):
# queryset = super().get_queryset()
# if getattr(self, 'swagger_fake_view', False):
# return queryset.model.objects.none()
# if current_org.is_root():
# return queryset
# # queryset = queryset.filter(run_as__org_id=current_org.org_id())
# return queryset
#
#
# class CommandExecutionHostRelationViewSet(OrgRelationMixin, OrgBulkModelViewSet):
# serializer_class = CommandExecutionHostsRelationSerializer
# m2m_field = CommandExecution.hosts.field
# filterset_fields = [
# 'id', 'asset', 'commandexecution'
# ]
# search_fields = ('asset__name', )
# http_method_names = ['options', 'get']
# rbac_perms = {
# 'GET': 'ops.view_commandexecution',
# 'list': 'ops.view_commandexecution',
# }
#
# def get_queryset(self):
# queryset = super().get_queryset()
# queryset = queryset.annotate(
# asset_display=Concat(
# F('asset__name'), Value('('),
# F('asset__address'), Value(')')
# )
# )
# return queryset

View File

@ -15,4 +15,8 @@ class Migration(migrations.Migration):
name='resource_id',
field=models.CharField(blank=True, db_index=True, default='', max_length=36, verbose_name='Resource'),
),
migrations.AlterModelOptions(
name='operatelog',
options={'ordering': ('-datetime',), 'verbose_name': 'Operate log'},
),
]

View File

@ -10,8 +10,4 @@ class Migration(migrations.Migration):
]
operations = [
migrations.AlterModelOptions(
name='operatelog',
options={'ordering': ('-datetime',), 'verbose_name': 'Operate log'},
),
]

View File

@ -39,11 +39,6 @@ class Migration(migrations.Migration):
name='diff',
field=models.JSONField(default=dict, encoder=common.db.encoder.ModelJSONFieldEncoder, null=True),
),
migrations.AddField(
model_name='operatelog',
name='detail',
field=models.CharField(blank=True, max_length=128, null=True, verbose_name='Detail'),
),
migrations.RunPython(migrate_operate_log_after_before),
migrations.RemoveField(model_name='operatelog', name='after', ),
migrations.RemoveField(model_name='operatelog', name='before', ),

View File

@ -5,7 +5,7 @@ from rest_framework import serializers
from audits.backends.db import OperateLogStore
from common.serializers.fields import LabeledChoiceField
from common.utils import reverse
from common.utils import reverse, i18n_trans
from common.utils.timezone import as_current_tz
from ops.models.job import JobAuditLog
from ops.serializers.job import JobExecutionSerializer
@ -106,7 +106,7 @@ class SessionAuditSerializer(serializers.ModelSerializer):
fields = "__all__"
class ActivityOperatorLogSerializer(serializers.Serializer):
class ActivityUnionLogSerializer(serializers.Serializer):
timestamp = serializers.SerializerMethodField()
detail_url = serializers.SerializerMethodField()
content = serializers.SerializerMethodField()
@ -119,9 +119,9 @@ class ActivityOperatorLogSerializer(serializers.Serializer):
def get_content(obj):
if not obj['r_detail']:
action = obj['r_action'].replace('_', ' ').capitalize()
ctn = _('User {} {} this resource.').format(obj['r_user'], _(action))
ctn = _('User {} {} this resource').format(obj['r_user'], _(action))
else:
ctn = obj['r_detail']
ctn = i18n_trans(obj['r_detail'])
return ctn
@staticmethod

View File

@ -2,13 +2,13 @@
#
from celery import signals
from django.db.models.signals import post_save
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _, gettext_noop
from accounts.const import AutomationTypes
from accounts.models import AccountBackupAutomation
from assets.models import Asset, Node
from audits.models import ActivityLog
from common.utils import get_object_or_none
from common.utils import get_object_or_none, i18n_fmt
from jumpserver.utils import current_request
from ops.celery import app
from orgs.utils import tmp_to_root_org
@ -108,21 +108,21 @@ class ActivityLogHandler(object):
@staticmethod
def session_for_activity(obj):
detail = _(
'{} used account[{}], login method[{}] login the asset.'
).format(
obj.user, obj.account, obj.login_from_display
detail = i18n_fmt(
gettext_noop('User %s use account %s login asset %s'),
obj.user, obj.account, obj.asset
)
return obj.asset_id, detail, ActivityChoices.session_log
return [obj.asset_id, obj.user_id, obj.account_id], detail, ActivityChoices.session_log
@staticmethod
def login_log_for_activity(obj):
login_status = _('Success') if obj.status else _('Failed')
detail = _('User {} login this system {}').format(
obj.username, login_status
)
login_status = gettext_noop('Success') if obj.status else gettext_noop('Failed')
detail = i18n_fmt(gettext_noop('User %s login system %s'), obj.username, login_status)
user_id = User.objects.filter(username=obj.username).values('id').first()
return user_id['id'], detail, ActivityChoices.login_log
resource_list = []
if user_id:
resource_list = [user_id['id']]
return resource_list, detail, ActivityChoices.login_log
activity_handler = ActivityLogHandler()
@ -135,18 +135,20 @@ def before_task_publish_for_activity_log(headers=None, **kwargs):
task_display, resource_ids = activity_handler.get_celery_task_info(
task_name, args, **kwargs
)
activities = []
detail = _('User %s performs a task(%s) for this resource.') % (
getattr(current_request, 'user', None), task_display
)
for resource_id in resource_ids:
activities.append(
ActivityLog(
resource_id=resource_id, type=ActivityChoices.task, detail=detail
)
)
ActivityLog.objects.bulk_create(activities)
if not current_request:
user = 'System'
else:
user = str(current_request.user)
detail = i18n_fmt(
gettext_noop('User %s perform a task (%s) for this resource'),
user, task_display
)
activities = [
ActivityLog(resource_id=resource_id, type=ActivityChoices.task, detail=detail)
for resource_id in resource_ids
]
ActivityLog.objects.bulk_create(activities)
activity_info = {
'activity_ids': [a.id for a in activities]
}
@ -167,9 +169,7 @@ def on_celery_task_pre_run_for_activity_log(task_id='', **kwargs):
ActivityLog.objects.bulk_update(activities, ('detail_id',))
def on_session_or_login_log_created(
sender, instance=None, created=False, **kwargs
):
def on_session_or_login_log_created(sender, instance=None, created=False, **kwargs):
handler_mapping = {
'Session': activity_handler.session_for_activity,
'UserLoginLog': activity_handler.login_log_for_activity
@ -178,13 +178,13 @@ def on_session_or_login_log_created(
if not created or model_name not in handler_mapping:
return
resource_id, detail, act_type = handler_mapping[model_name](instance)
ActivityLog.objects.create(
resource_id=resource_id, type=act_type,
detail=detail, detail_id=instance.id
)
resource_ids, detail, act_type = handler_mapping[model_name](instance)
activities = [
ActivityLog(resource_id=i, type=act_type, detail=detail, detail_id=instance.id)
for i in resource_ids
]
ActivityLog.objects.bulk_create(activities)
for sender in [Session, UserLoginLog]:
post_save.connect(on_session_or_login_log_created, sender=sender)
for sd in [Session, UserLoginLog]:
post_save.connect(on_session_or_login_log_created, sender=sd)

View File

@ -1,21 +1,19 @@
# -*- coding: utf-8 -*-
#
from django.utils.functional import LazyObject
from django.utils.translation import ugettext_lazy as _
from django.conf import settings
from django.contrib.auth import BACKEND_SESSION_KEY
from django.dispatch import receiver
from django.utils import timezone, translation
from django.utils.functional import LazyObject
from django.utils.translation import ugettext_lazy as _
from rest_framework.request import Request
from authentication.signals import post_auth_failed, post_auth_success
from authentication.utils import check_different_city_login_if_need
from common.utils import get_request_ip, get_logger
from users.models import User
from ..utils import write_login_log
logger = get_logger(__name__)

View File

@ -2,10 +2,11 @@
#
from .common import *
from .crypto import *
from .django import *
from .encode import *
from .http import *
from .crypto import *
from .random import *
from .jumpserver import *
from .ip import *
from .jumpserver import *
from .random import *
from .translate import *

View File

@ -1,4 +1,4 @@
from django.utils.translation import gettext
from django.utils.translation import gettext, gettext_noop
def translate_value(value):
@ -12,3 +12,32 @@ def translate_value(value):
tpl, data = value.split(sp, 1)
return gettext(tpl + sp) + data
def i18n_fmt(tpl, *args):
if '%' not in tpl:
raise ValueError('Invalid template, should contains %')
if not args:
return tpl
args = [str(arg) for arg in args]
try:
tpl % tuple(args)
except TypeError:
raise ValueError('Invalid template, args not match: {} {}'.format(tpl, args))
return tpl + ' % ' + ', '.join(args)
def i18n_trans(s):
if ' % ' not in s:
return gettext(s)
tpl, args = s.split(' % ', 1)
args = args.split(', ')
args = [gettext(arg) for arg in args]
return gettext(tpl) % tuple(args)
def hello():
log = i18n_fmt(gettext_noop('Hello %s'), 'world')
print(i18n_trans(log))

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6a677ea531b36752e5d3cbfde37bd2667539390e12281b7a4c595fa4d65c1a8a
size 135351
oid sha256:441239d12ee3ba50b36b3e5b31246993601414d4d119c2c784e56b54208a5a96
size 135089

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-02-14 15:32+0800\n"
"POT-Creation-Date: 2023-02-14 19:27+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -24,7 +24,7 @@ msgstr "パラメータ 'action' は [{}] でなければなりません。"
#: accounts/const/account.py:6
#: accounts/serializers/automations/change_secret.py:33
#: assets/models/_user.py:24 audits/signal_handlers/login_log.py:30
#: assets/models/_user.py:24 audits/signal_handlers/login_log.py:28
#: authentication/confirm/password.py:9 authentication/forms.py:32
#: authentication/templates/authentication/login.html:288
#: settings/serializers/auth/ldap.py:25 settings/serializers/auth/ldap.py:47
@ -171,7 +171,7 @@ msgstr "作成のみ"
#: perms/models/asset_permission.py:64 perms/serializers/permission.py:27
#: terminal/backends/command/models.py:21 terminal/models/session/session.py:31
#: terminal/notifications.py:95 terminal/serializers/command.py:16
#: tickets/models/ticket/apply_asset.py:16 xpack/plugins/cloud/models.py:212
#: tickets/models/ticket/apply_asset.py:16 xpack/plugins/cloud/models.py:220
msgid "Asset"
msgstr "資産"
@ -245,7 +245,7 @@ msgstr "アカウントバックアップ計画"
#: assets/models/automations/base.py:106 audits/models.py:43
#: ops/models/base.py:55 ops/models/celery.py:63 ops/models/job.py:114
#: perms/models/asset_permission.py:72 terminal/models/applet/host.py:108
#: terminal/models/session/session.py:43
#: terminal/models/session/session.py:44
#: tickets/models/ticket/apply_application.py:30
#: tickets/models/ticket/apply_asset.py:19
msgid "Date start"
@ -270,7 +270,7 @@ msgid "Trigger mode"
msgstr "トリガーモード"
#: accounts/models/automations/backup_account.py:91 audits/models.py:158
#: terminal/models/session/sharing.py:107 xpack/plugins/cloud/models.py:168
#: terminal/models/session/sharing.py:107 xpack/plugins/cloud/models.py:176
msgid "Reason"
msgstr "理由"
@ -425,7 +425,7 @@ msgstr "アカウントの確認"
#: assets/models/group.py:20 assets/models/label.py:18
#: assets/models/platform.py:20 assets/models/platform.py:74
#: assets/serializers/asset/common.py:63 assets/serializers/asset/common.py:137
#: assets/serializers/platform.py:128
#: assets/serializers/platform.py:131
#: authentication/serializers/connect_token_secret.py:103 ops/mixin.py:20
#: ops/models/adhoc.py:21 ops/models/celery.py:15 ops/models/celery.py:57
#: ops/models/job.py:24 ops/models/playbook.py:22 ops/serializers/job.py:19
@ -527,7 +527,7 @@ msgstr "エスクローされたパスワード"
#: accounts/serializers/account/account.py:75 applications/models.py:11
#: assets/models/label.py:21 assets/models/platform.py:75
#: assets/serializers/asset/common.py:116 assets/serializers/cagegory.py:8
#: assets/serializers/platform.py:90 assets/serializers/platform.py:129
#: assets/serializers/platform.py:93 assets/serializers/platform.py:132
#: perms/serializers/user_permission.py:25 settings/models.py:35
#: tickets/models/ticket/apply_application.py:13
msgid "Category"
@ -538,7 +538,7 @@ msgstr "カテゴリ"
#: acls/serializers/command_acl.py:18 applications/models.py:14
#: assets/models/_user.py:50 assets/models/automations/base.py:20
#: assets/models/cmd_filter.py:74 assets/models/platform.py:76
#: assets/serializers/asset/common.py:117 assets/serializers/platform.py:89
#: assets/serializers/asset/common.py:117 assets/serializers/platform.py:92
#: audits/serializers.py:49
#: authentication/serializers/connect_token_secret.py:116 ops/models/job.py:32
#: perms/serializers/user_permission.py:26 terminal/models/applet/applet.py:30
@ -625,7 +625,7 @@ msgid "Automation task execution"
msgstr "自動タスク実行履歴"
#: accounts/serializers/automations/change_secret.py:150 audits/const.py:52
#: audits/models.py:42 audits/signal_handlers/activity_log.py:120
#: audits/models.py:42 audits/signal_handlers/activity_log.py:119
#: common/const/choices.py:18 ops/const.py:56 ops/serializers/celery.py:39
#: terminal/const.py:59 terminal/models/session/sharing.py:103
#: tickets/views/approve.py:114
@ -633,7 +633,7 @@ msgid "Success"
msgstr "成功"
#: accounts/serializers/automations/change_secret.py:151 audits/const.py:53
#: audits/signal_handlers/activity_log.py:120 common/const/choices.py:19
#: audits/signal_handlers/activity_log.py:119 common/const/choices.py:19
#: ops/const.py:58 terminal/const.py:60 xpack/plugins/cloud/const.py:41
msgid "Failed"
msgstr "失敗しました"
@ -738,7 +738,7 @@ msgid "User"
msgstr "ユーザー"
#: acls/models/command_acl.py:16 assets/models/cmd_filter.py:60
#: ops/serializers/job.py:63 terminal/models/session/session.py:41
#: ops/serializers/job.py:63 terminal/models/session/session.py:42
#: terminal/serializers/command.py:17 terminal/serializers/session.py:19
#: terminal/templates/terminal/_msg_command_alert.html:12
#: terminal/templates/terminal/_msg_command_execute_alert.html:10
@ -1061,9 +1061,9 @@ msgstr "SSHパブリックキー"
#: terminal/models/applet/applet.py:151 terminal/models/applet/host.py:110
#: terminal/models/component/endpoint.py:24
#: terminal/models/component/endpoint.py:100
#: terminal/models/session/session.py:45 tickets/models/comment.py:32
#: terminal/models/session/session.py:46 tickets/models/comment.py:32
#: tickets/models/ticket/general.py:297 users/models/user.py:756
#: xpack/plugins/cloud/models.py:35 xpack/plugins/cloud/models.py:111
#: xpack/plugins/cloud/models.py:35 xpack/plugins/cloud/models.py:119
msgid "Comment"
msgstr "コメント"
@ -1164,7 +1164,7 @@ msgstr "アドレス"
#: assets/models/asset/common.py:109 assets/models/platform.py:111
#: authentication/serializers/connect_token_secret.py:108
#: perms/serializers/user_permission.py:23
#: xpack/plugins/cloud/serializers/account_attrs.py:182
#: xpack/plugins/cloud/serializers/account_attrs.py:179
msgid "Platform"
msgstr "プラットフォーム"
@ -1270,8 +1270,8 @@ msgstr "アセットの自動化タスク"
#: terminal/models/component/status.py:27 terminal/serializers/applet.py:17
#: terminal/serializers/applet_host.py:93 tickets/models/ticket/general.py:283
#: tickets/serializers/super_ticket.py:13
#: tickets/serializers/ticket/ticket.py:20 xpack/plugins/cloud/models.py:164
#: xpack/plugins/cloud/models.py:216
#: tickets/serializers/ticket/ticket.py:20 xpack/plugins/cloud/models.py:172
#: xpack/plugins/cloud/models.py:224
msgid "Status"
msgstr "ステータス"
@ -1408,45 +1408,45 @@ msgstr "有効化"
msgid "Ansible config"
msgstr "Ansible 構成"
#: assets/models/platform.py:43 assets/serializers/platform.py:57
#: assets/models/platform.py:43 assets/serializers/platform.py:60
msgid "Ping enabled"
msgstr "アセット ディスカバリを有効にする"
#: assets/models/platform.py:44 assets/serializers/platform.py:58
#: assets/models/platform.py:44 assets/serializers/platform.py:61
msgid "Ping method"
msgstr "資産検出方法"
#: assets/models/platform.py:45 assets/models/platform.py:58
#: assets/serializers/platform.py:59
#: assets/serializers/platform.py:62
msgid "Gather facts enabled"
msgstr "資産情報の収集を有効にする"
#: assets/models/platform.py:46 assets/models/platform.py:60
#: assets/serializers/platform.py:60
#: assets/serializers/platform.py:63
msgid "Gather facts method"
msgstr "情報収集の方法"
#: assets/models/platform.py:47 assets/serializers/platform.py:63
#: assets/models/platform.py:47 assets/serializers/platform.py:66
msgid "Change secret enabled"
msgstr "パスワードの変更が有効"
#: assets/models/platform.py:49 assets/serializers/platform.py:64
#: assets/models/platform.py:49 assets/serializers/platform.py:67
msgid "Change secret method"
msgstr "パスワード変更モード"
#: assets/models/platform.py:51 assets/serializers/platform.py:65
#: assets/models/platform.py:51 assets/serializers/platform.py:68
msgid "Push account enabled"
msgstr "アカウントのプッシュを有効にする"
#: assets/models/platform.py:53 assets/serializers/platform.py:66
#: assets/models/platform.py:53 assets/serializers/platform.py:69
msgid "Push account method"
msgstr "アカウントプッシュ方式"
#: assets/models/platform.py:55 assets/serializers/platform.py:61
#: assets/models/platform.py:55 assets/serializers/platform.py:64
msgid "Verify account enabled"
msgstr "アカウントの確認をオンにする"
#: assets/models/platform.py:57 assets/serializers/platform.py:62
#: assets/models/platform.py:57 assets/serializers/platform.py:65
msgid "Verify account method"
msgstr "アカウント認証方法"
@ -1458,23 +1458,23 @@ msgstr "メタ"
msgid "Internal"
msgstr "ビルトイン"
#: assets/models/platform.py:82 assets/serializers/platform.py:87
#: assets/models/platform.py:82 assets/serializers/platform.py:90
msgid "Charset"
msgstr "シャーセット"
#: assets/models/platform.py:84 assets/serializers/platform.py:114
#: assets/models/platform.py:84 assets/serializers/platform.py:117
msgid "Domain enabled"
msgstr "ドメインを有効にする"
#: assets/models/platform.py:86 assets/serializers/platform.py:113
#: assets/models/platform.py:86 assets/serializers/platform.py:116
msgid "Su enabled"
msgstr "アカウントの切り替えを有効にする"
#: assets/models/platform.py:87 assets/serializers/platform.py:97
#: assets/models/platform.py:87 assets/serializers/platform.py:100
msgid "Su method"
msgstr "アカウントの切り替え方法"
#: assets/models/platform.py:89 assets/serializers/platform.py:94
#: assets/models/platform.py:89 assets/serializers/platform.py:97
msgid "Automation"
msgstr "オートメーション"
@ -1487,10 +1487,11 @@ msgstr "%(value)s は偶数ではありません"
msgid "Auto fill"
msgstr "自動充填"
#: assets/serializers/asset/common.py:119 assets/serializers/platform.py:92
#: assets/serializers/asset/common.py:119 assets/serializers/platform.py:95
#: authentication/serializers/connect_token_secret.py:28
#: authentication/serializers/connect_token_secret.py:66
#: perms/serializers/user_permission.py:24 xpack/plugins/cloud/models.py:99
#: perms/serializers/user_permission.py:24 xpack/plugins/cloud/models.py:107
#: xpack/plugins/cloud/serializers/task.py:38
msgid "Protocols"
msgstr "プロトコル"
@ -1517,7 +1518,6 @@ msgstr "自動情報"
#: assets/serializers/asset/database.py:24 common/serializers/fields.py:100
#: tickets/serializers/ticket/common.py:58
#: xpack/plugins/cloud/serializers/account_attrs.py:56
#: xpack/plugins/cloud/serializers/account_attrs.py:79
msgid "This field is required."
msgstr "このフィールドは必須です。"
@ -1606,19 +1606,25 @@ msgstr "SFTP が有効"
msgid "SFTP home"
msgstr "SFTP ルート パス"
#: assets/serializers/platform.py:67
#: assets/serializers/platform.py:42
#, fuzzy
#| msgid "Input username"
msgid "Auth with username"
msgstr "カスタム ユーザー名"
#: assets/serializers/platform.py:70
msgid "Gather accounts enabled"
msgstr "アカウント収集を有効にする"
#: assets/serializers/platform.py:68
#: assets/serializers/platform.py:71
msgid "Gather accounts method"
msgstr "アカウントの収集方法"
#: assets/serializers/platform.py:74
#: assets/serializers/platform.py:77
msgid "Primary"
msgstr "主要"
#: assets/serializers/platform.py:115
#: assets/serializers/platform.py:118
msgid "Default Domain"
msgstr "デフォルト ドメイン"
@ -1802,21 +1808,7 @@ msgid "No"
msgstr "否"
#: audits/models.py:34 audits/models.py:61 audits/models.py:130
#: audits/handler.py:140
msgid "{} used account[{}], login method[{}] login the asset."
msgstr ""
"{} トムはアカウント[{}]、ログイン方法[{}]を使ってこの資産を登録しました"
#: audits/handler.py:155
msgid "User {} has executed change auth plan for this account.({})"
msgstr "ユーザー {} はこのアカウントのために改密計画を実行しました。({})"
#: audits/handler.py:168
msgid "User [{}] login this system.[{}]"
msgstr "ユーザー {} がサービスにログインしました。[{}]"
#: audits/models.py:32 audits/models.py:59 audits/models.py:101
#: terminal/models/session/session.py:37 terminal/models/session/sharing.py:95
#: terminal/models/session/session.py:38 terminal/models/session/sharing.py:95
msgid "Remote addr"
msgstr "リモートaddr"
@ -1915,55 +1907,60 @@ msgid "Reason display"
msgstr "理由表示"
#: audits/serializers.py:122
msgid "User {} {} this resource."
#, fuzzy
#| msgid "User {} {} this resource."
msgid "User {} {} this resource"
msgstr "ユーザー {} {} が現在のリソースをサブスクライブしました。"
#: audits/signal_handlers/activity_log.py:112
msgid "{} used account[{}], login method[{}] login the asset."
msgstr ""
"{} トムはアカウント[{}]、ログイン方法[{}]を使ってこの資産を登録しました"
#, fuzzy, python-format
#| msgid "Push accounts to assets"
msgid "User %s use account %s login asset %s"
msgstr "アカウントをアセットにプッシュ:"
#: audits/signal_handlers/activity_log.py:121
msgid "User {} login into this service.[{}]"
#: audits/signal_handlers/activity_log.py:120
#, fuzzy, python-format
#| msgid "User [{}] login this system.[{}]"
msgid "User %s login system %s"
msgstr "ユーザー {} がサービスにログインしました。[{}]"
#: audits/signal_handlers/activity_log.py:139
#: audits/signal_handlers/activity_log.py:140
#, python-format
msgid "User %s performs a task(%s) for this resource."
msgid "User %s perform a task (%s) for this resource"
msgstr ""
#: audits/signal_handlers/login_log.py:29
#: audits/signal_handlers/login_log.py:27
msgid "SSH Key"
msgstr "SSHキー"
#: audits/signal_handlers/login_log.py:31 settings/serializers/auth/sso.py:10
#: audits/signal_handlers/login_log.py:29 settings/serializers/auth/sso.py:10
msgid "SSO"
msgstr "SSO"
#: audits/signal_handlers/login_log.py:32
#: audits/signal_handlers/login_log.py:30
msgid "Auth Token"
msgstr "認証トークン"
#: audits/signal_handlers/login_log.py:33 authentication/notifications.py:73
#: audits/signal_handlers/login_log.py:31 authentication/notifications.py:73
#: authentication/views/login.py:73 authentication/views/wecom.py:177
#: notifications/backends/__init__.py:11 settings/serializers/auth/wecom.py:10
#: users/models/user.py:778
msgid "WeCom"
msgstr "企業微信"
#: audits/signal_handlers/login_log.py:34 authentication/views/feishu.py:144
#: audits/signal_handlers/login_log.py:32 authentication/views/feishu.py:144
#: authentication/views/login.py:85 notifications/backends/__init__.py:14
#: settings/serializers/auth/feishu.py:10 users/models/user.py:780
msgid "FeiShu"
msgstr "本を飛ばす"
#: audits/signal_handlers/login_log.py:35 authentication/views/dingtalk.py:179
#: audits/signal_handlers/login_log.py:33 authentication/views/dingtalk.py:179
#: authentication/views/login.py:79 notifications/backends/__init__.py:12
#: settings/serializers/auth/dingtalk.py:10 users/models/user.py:779
msgid "DingTalk"
msgstr "DingTalk"
#: audits/signal_handlers/login_log.py:36
#: audits/signal_handlers/login_log.py:34
#: authentication/models/temp_token.py:16
msgid "Temporary token"
msgstr "仮パスワード"
@ -3113,6 +3110,12 @@ msgstr "無効な IP"
msgid "Invalid address"
msgstr "無効なアドレス。"
#: common/utils/translate.py:33
#, fuzzy, python-format
#| msgid "Hello"
msgid "Hello %s"
msgstr "こんにちは"
#: common/validators.py:14
msgid "Special char not allowed"
msgstr "特別なcharは許可されていません"
@ -3359,7 +3362,7 @@ msgid "Date last run"
msgstr "最終実行日"
#: ops/models/base.py:51 ops/models/job.py:110
#: xpack/plugins/cloud/models.py:162
#: xpack/plugins/cloud/models.py:170
msgid "Result"
msgstr "結果"
@ -4415,7 +4418,7 @@ msgid "SSO auth key TTL"
msgstr "Token有効期間"
#: settings/serializers/auth/sso.py:17 settings/serializers/security.py:117
#: xpack/plugins/cloud/serializers/account_attrs.py:179
#: xpack/plugins/cloud/serializers/account_attrs.py:176
msgid "Unit: second"
msgstr "単位: 秒"
@ -5606,35 +5609,41 @@ msgstr "セッションのリプレイをアップロードできます"
msgid "Can download session replay"
msgstr "セッション再生をダウンロードできます"
#: terminal/models/session/session.py:35 terminal/models/session/sharing.py:100
#: terminal/models/session/session.py:34
#, fuzzy
#| msgid "Account "
msgid "Account id"
msgstr "アカウント"
#: terminal/models/session/session.py:36 terminal/models/session/sharing.py:100
msgid "Login from"
msgstr "ログイン元"
#: terminal/models/session/session.py:40
#: terminal/models/session/session.py:41
msgid "Replay"
msgstr "リプレイ"
#: terminal/models/session/session.py:44
#: terminal/models/session/session.py:45
msgid "Date end"
msgstr "終了日"
#: terminal/models/session/session.py:234
#: terminal/models/session/session.py:235
msgid "Session record"
msgstr "セッション記録"
#: terminal/models/session/session.py:236
#: terminal/models/session/session.py:237
msgid "Can monitor session"
msgstr "セッションを監視できます"
#: terminal/models/session/session.py:237
#: terminal/models/session/session.py:238
msgid "Can share session"
msgstr "セッションを共有できます"
#: terminal/models/session/session.py:238
#: terminal/models/session/session.py:239
msgid "Can terminate session"
msgstr "セッションを終了できます"
#: terminal/models/session/session.py:239
#: terminal/models/session/session.py:240
msgid "Can validate session action perm"
msgstr "セッションアクションのパーマを検証できます"
@ -5835,7 +5844,7 @@ msgstr "アクセスキー"
msgid "Access key secret"
msgstr "アクセスキーシークレット"
#: terminal/serializers/storage.py:65 xpack/plugins/cloud/models.py:209
#: terminal/serializers/storage.py:65 xpack/plugins/cloud/models.py:217
msgid "Region"
msgstr "リージョン"
@ -6978,47 +6987,55 @@ msgstr "リージョン"
msgid "Hostname strategy"
msgstr "ホスト名戦略"
#: xpack/plugins/cloud/models.py:102 xpack/plugins/cloud/serializers/task.py:40
#: xpack/plugins/cloud/models.py:100
msgid "Unix admin user"
msgstr "Unix adminユーザー"
#: xpack/plugins/cloud/models.py:104
msgid "Windows admin user"
msgstr "Windows管理者"
#: xpack/plugins/cloud/models.py:110 xpack/plugins/cloud/serializers/task.py:41
msgid "IP network segment group"
msgstr "IPネットワークセグメントグループ"
#: xpack/plugins/cloud/models.py:105 xpack/plugins/cloud/serializers/task.py:45
#: xpack/plugins/cloud/models.py:113 xpack/plugins/cloud/serializers/task.py:46
msgid "Sync IP type"
msgstr "同期IPタイプ"
#: xpack/plugins/cloud/models.py:108 xpack/plugins/cloud/serializers/task.py:62
#: xpack/plugins/cloud/models.py:116 xpack/plugins/cloud/serializers/task.py:64
msgid "Always update"
msgstr "常に更新"
#: xpack/plugins/cloud/models.py:114
#: xpack/plugins/cloud/models.py:122
msgid "Date last sync"
msgstr "最終同期日"
#: xpack/plugins/cloud/models.py:119 xpack/plugins/cloud/models.py:160
#: xpack/plugins/cloud/models.py:127 xpack/plugins/cloud/models.py:168
msgid "Sync instance task"
msgstr "インスタンスの同期タスク"
#: xpack/plugins/cloud/models.py:171 xpack/plugins/cloud/models.py:219
#: xpack/plugins/cloud/models.py:179 xpack/plugins/cloud/models.py:227
msgid "Date sync"
msgstr "日付の同期"
#: xpack/plugins/cloud/models.py:175
#: xpack/plugins/cloud/models.py:183
msgid "Sync instance task execution"
msgstr "インスタンスタスクの同期実行"
#: xpack/plugins/cloud/models.py:199
#: xpack/plugins/cloud/models.py:207
msgid "Sync task"
msgstr "同期タスク"
#: xpack/plugins/cloud/models.py:203
#: xpack/plugins/cloud/models.py:211
msgid "Sync instance task history"
msgstr "インスタンスタスク履歴の同期"
#: xpack/plugins/cloud/models.py:206
#: xpack/plugins/cloud/models.py:214
msgid "Instance"
msgstr "インスタンス"
#: xpack/plugins/cloud/models.py:223
#: xpack/plugins/cloud/models.py:231
msgid "Sync instance detail"
msgstr "同期インスタンスの詳細"
@ -7232,52 +7249,52 @@ msgstr "テナントID"
msgid "Subscription ID"
msgstr "サブスクリプションID"
#: xpack/plugins/cloud/serializers/account_attrs.py:98
#: xpack/plugins/cloud/serializers/account_attrs.py:103
#: xpack/plugins/cloud/serializers/account_attrs.py:119
#: xpack/plugins/cloud/serializers/account_attrs.py:144
#: xpack/plugins/cloud/serializers/account_attrs.py:95
#: xpack/plugins/cloud/serializers/account_attrs.py:100
#: xpack/plugins/cloud/serializers/account_attrs.py:116
#: xpack/plugins/cloud/serializers/account_attrs.py:141
msgid "API Endpoint"
msgstr "APIエンドポイント"
#: xpack/plugins/cloud/serializers/account_attrs.py:109
#: xpack/plugins/cloud/serializers/account_attrs.py:106
msgid "Auth url"
msgstr "認証アドレス"
#: xpack/plugins/cloud/serializers/account_attrs.py:110
#: xpack/plugins/cloud/serializers/account_attrs.py:107
msgid "eg: http://openstack.example.com:5000/v3"
msgstr "例えば: http://openstack.example.com:5000/v3"
#: xpack/plugins/cloud/serializers/account_attrs.py:113
#: xpack/plugins/cloud/serializers/account_attrs.py:110
msgid "User domain"
msgstr "ユーザードメイン"
#: xpack/plugins/cloud/serializers/account_attrs.py:120
#: xpack/plugins/cloud/serializers/account_attrs.py:117
msgid "Cert File"
msgstr "証明書ファイル"
#: xpack/plugins/cloud/serializers/account_attrs.py:121
#: xpack/plugins/cloud/serializers/account_attrs.py:118
msgid "Key File"
msgstr "キーファイル"
#: xpack/plugins/cloud/serializers/account_attrs.py:137
#: xpack/plugins/cloud/serializers/account_attrs.py:134
msgid "Service account key"
msgstr "サービスアカウントキー"
#: xpack/plugins/cloud/serializers/account_attrs.py:138
#: xpack/plugins/cloud/serializers/account_attrs.py:135
msgid "The file is in JSON format"
msgstr "ファイルはJSON形式です。"
#: xpack/plugins/cloud/serializers/account_attrs.py:151
#: xpack/plugins/cloud/serializers/account_attrs.py:148
msgid "IP address invalid `{}`, {}"
msgstr "IPアドレスが無効: '{}', {}"
#: xpack/plugins/cloud/serializers/account_attrs.py:157
#: xpack/plugins/cloud/serializers/account_attrs.py:154
msgid ""
"Format for comma-delimited string,Such as: 192.168.1.0/24, "
"10.0.0.0-10.0.0.255"
msgstr "形式はコンマ区切りの文字列です192.168.1.0/24,10.0.0.0-10.0.0.255"
#: xpack/plugins/cloud/serializers/account_attrs.py:161
#: xpack/plugins/cloud/serializers/account_attrs.py:158
msgid ""
"The port is used to detect the validity of the IP address. When the "
"synchronization task is executed, only the valid IP address will be "
@ -7287,19 +7304,19 @@ msgstr ""
"実行されると、有効な IP アドレスのみが同期されます。 <br>ポートが0の場合、す"
"べてのIPアドレスが有効です。"
#: xpack/plugins/cloud/serializers/account_attrs.py:169
#: xpack/plugins/cloud/serializers/account_attrs.py:166
msgid "Hostname prefix"
msgstr "ホスト名プレフィックス"
#: xpack/plugins/cloud/serializers/account_attrs.py:172
#: xpack/plugins/cloud/serializers/account_attrs.py:169
msgid "IP segment"
msgstr "IP セグメント"
#: xpack/plugins/cloud/serializers/account_attrs.py:176
#: xpack/plugins/cloud/serializers/account_attrs.py:173
msgid "Test port"
msgstr "テストポート"
#: xpack/plugins/cloud/serializers/account_attrs.py:179
#: xpack/plugins/cloud/serializers/account_attrs.py:176
msgid "Test timeout"
msgstr "テストタイムアウト"
@ -7325,6 +7342,10 @@ msgstr "実行回数"
msgid "Instance count"
msgstr "インスタンス数"
#: xpack/plugins/cloud/serializers/task.py:63
msgid "Linux admin user"
msgstr "Linux管理者"
#: xpack/plugins/cloud/utils.py:69
msgid "Account unavailable"
msgstr "利用できないアカウント"
@ -7393,6 +7414,21 @@ msgstr "究極のエディション"
msgid "Community edition"
msgstr "コミュニティ版"
#~ msgid "{} used account[{}], login method[{}] login the asset."
#~ msgstr ""
#~ "{} トムはアカウント[{}]、ログイン方法[{}]を使ってこの資産を登録しました"
#, fuzzy
#~| msgid "Hello"
#~ msgid "Hello {}"
#~ msgstr "こんにちは"
#~ msgid "User {} has executed change auth plan for this account.({})"
#~ msgstr "ユーザー {} はこのアカウントのために改密計画を実行しました。({})"
#~ msgid "User {} login into this service.[{}]"
#~ msgstr "ユーザー {} がサービスにログインしました。[{}]"
#~ msgid "Update some assets hardware info. "
#~ msgstr "一部の資産ハードウェア情報を更新します。"
@ -7407,15 +7443,3 @@ msgstr "コミュニティ版"
#~ msgid "Manually test the connectivity of assets under a node"
#~ msgstr "ノードの下のアセットの接続を手動でテストする"
#~ msgid "User {} has executed change auth plan for this account.({})"
#~ msgstr "ユーザー {} はこのアカウントのために改密計画を実行しました。({})"
#~ msgid "Unix admin user"
#~ msgstr "Unix adminユーザー"
#~ msgid "Windows admin user"
#~ msgstr "Windows管理者"
#~ msgid "Linux admin user"
#~ msgstr "Linux管理者"

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3ea4776e6efd07b7d818b5f64d68b14d0c1cbf089766582bd4c2b43e1b183bf8
size 111254
oid sha256:bef1d490ea8a2c381a929d8c214e6be9126efcacc98bc0ea09344bef46369d9e
size 111567

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: JumpServer 0.3.3\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-02-14 15:32+0800\n"
"POT-Creation-Date: 2023-02-14 19:27+0800\n"
"PO-Revision-Date: 2021-05-20 10:54+0800\n"
"Last-Translator: ibuler <ibuler@qq.com>\n"
"Language-Team: JumpServer team<ibuler@qq.com>\n"
@ -23,7 +23,7 @@ msgstr "参数 'action' 必须是 [{}]"
#: accounts/const/account.py:6
#: accounts/serializers/automations/change_secret.py:33
#: assets/models/_user.py:24 audits/signal_handlers/login_log.py:30
#: assets/models/_user.py:24 audits/signal_handlers/login_log.py:28
#: authentication/confirm/password.py:9 authentication/forms.py:32
#: authentication/templates/authentication/login.html:288
#: settings/serializers/auth/ldap.py:25 settings/serializers/auth/ldap.py:47
@ -170,7 +170,7 @@ msgstr "仅创建"
#: perms/models/asset_permission.py:64 perms/serializers/permission.py:27
#: terminal/backends/command/models.py:21 terminal/models/session/session.py:31
#: terminal/notifications.py:95 terminal/serializers/command.py:16
#: tickets/models/ticket/apply_asset.py:16 xpack/plugins/cloud/models.py:212
#: tickets/models/ticket/apply_asset.py:16 xpack/plugins/cloud/models.py:220
msgid "Asset"
msgstr "资产"
@ -244,7 +244,7 @@ msgstr "账号备份计划"
#: assets/models/automations/base.py:106 audits/models.py:43
#: ops/models/base.py:55 ops/models/celery.py:63 ops/models/job.py:114
#: perms/models/asset_permission.py:72 terminal/models/applet/host.py:108
#: terminal/models/session/session.py:43
#: terminal/models/session/session.py:44
#: tickets/models/ticket/apply_application.py:30
#: tickets/models/ticket/apply_asset.py:19
msgid "Date start"
@ -269,7 +269,7 @@ msgid "Trigger mode"
msgstr "触发模式"
#: accounts/models/automations/backup_account.py:91 audits/models.py:158
#: terminal/models/session/sharing.py:107 xpack/plugins/cloud/models.py:168
#: terminal/models/session/sharing.py:107 xpack/plugins/cloud/models.py:176
msgid "Reason"
msgstr "原因"
@ -424,7 +424,7 @@ msgstr "账号验证"
#: assets/models/group.py:20 assets/models/label.py:18
#: assets/models/platform.py:20 assets/models/platform.py:74
#: assets/serializers/asset/common.py:63 assets/serializers/asset/common.py:137
#: assets/serializers/platform.py:128
#: assets/serializers/platform.py:131
#: authentication/serializers/connect_token_secret.py:103 ops/mixin.py:20
#: ops/models/adhoc.py:21 ops/models/celery.py:15 ops/models/celery.py:57
#: ops/models/job.py:24 ops/models/playbook.py:22 ops/serializers/job.py:19
@ -523,7 +523,7 @@ msgstr "已托管密码"
#: accounts/serializers/account/account.py:75 applications/models.py:11
#: assets/models/label.py:21 assets/models/platform.py:75
#: assets/serializers/asset/common.py:116 assets/serializers/cagegory.py:8
#: assets/serializers/platform.py:90 assets/serializers/platform.py:129
#: assets/serializers/platform.py:93 assets/serializers/platform.py:132
#: perms/serializers/user_permission.py:25 settings/models.py:35
#: tickets/models/ticket/apply_application.py:13
msgid "Category"
@ -534,7 +534,7 @@ msgstr "类别"
#: acls/serializers/command_acl.py:18 applications/models.py:14
#: assets/models/_user.py:50 assets/models/automations/base.py:20
#: assets/models/cmd_filter.py:74 assets/models/platform.py:76
#: assets/serializers/asset/common.py:117 assets/serializers/platform.py:89
#: assets/serializers/asset/common.py:117 assets/serializers/platform.py:92
#: audits/serializers.py:49
#: authentication/serializers/connect_token_secret.py:116 ops/models/job.py:32
#: perms/serializers/user_permission.py:26 terminal/models/applet/applet.py:30
@ -621,7 +621,7 @@ msgid "Automation task execution"
msgstr "自动化任务执行历史"
#: accounts/serializers/automations/change_secret.py:150 audits/const.py:52
#: audits/models.py:42 audits/signal_handlers/activity_log.py:120
#: audits/models.py:42 audits/signal_handlers/activity_log.py:119
#: common/const/choices.py:18 ops/const.py:56 ops/serializers/celery.py:39
#: terminal/const.py:59 terminal/models/session/sharing.py:103
#: tickets/views/approve.py:114
@ -629,7 +629,7 @@ msgid "Success"
msgstr "成功"
#: accounts/serializers/automations/change_secret.py:151 audits/const.py:53
#: audits/signal_handlers/activity_log.py:120 common/const/choices.py:19
#: audits/signal_handlers/activity_log.py:119 common/const/choices.py:19
#: ops/const.py:58 terminal/const.py:60 xpack/plugins/cloud/const.py:41
msgid "Failed"
msgstr "失败"
@ -734,7 +734,7 @@ msgid "User"
msgstr "用户"
#: acls/models/command_acl.py:16 assets/models/cmd_filter.py:60
#: ops/serializers/job.py:63 terminal/models/session/session.py:41
#: ops/serializers/job.py:63 terminal/models/session/session.py:42
#: terminal/serializers/command.py:17 terminal/serializers/session.py:19
#: terminal/templates/terminal/_msg_command_alert.html:12
#: terminal/templates/terminal/_msg_command_execute_alert.html:10
@ -1051,9 +1051,9 @@ msgstr "SSH公钥"
#: terminal/models/applet/applet.py:151 terminal/models/applet/host.py:110
#: terminal/models/component/endpoint.py:24
#: terminal/models/component/endpoint.py:100
#: terminal/models/session/session.py:45 tickets/models/comment.py:32
#: terminal/models/session/session.py:46 tickets/models/comment.py:32
#: tickets/models/ticket/general.py:297 users/models/user.py:756
#: xpack/plugins/cloud/models.py:35 xpack/plugins/cloud/models.py:111
#: xpack/plugins/cloud/models.py:35 xpack/plugins/cloud/models.py:119
msgid "Comment"
msgstr "备注"
@ -1154,7 +1154,7 @@ msgstr "地址"
#: assets/models/asset/common.py:109 assets/models/platform.py:111
#: authentication/serializers/connect_token_secret.py:108
#: perms/serializers/user_permission.py:23
#: xpack/plugins/cloud/serializers/account_attrs.py:182
#: xpack/plugins/cloud/serializers/account_attrs.py:179
msgid "Platform"
msgstr "系统平台"
@ -1260,8 +1260,8 @@ msgstr "资产自动化任务"
#: terminal/models/component/status.py:27 terminal/serializers/applet.py:17
#: terminal/serializers/applet_host.py:93 tickets/models/ticket/general.py:283
#: tickets/serializers/super_ticket.py:13
#: tickets/serializers/ticket/ticket.py:20 xpack/plugins/cloud/models.py:164
#: xpack/plugins/cloud/models.py:216
#: tickets/serializers/ticket/ticket.py:20 xpack/plugins/cloud/models.py:172
#: xpack/plugins/cloud/models.py:224
msgid "Status"
msgstr "状态"
@ -1398,45 +1398,45 @@ msgstr "启用"
msgid "Ansible config"
msgstr "Ansible 配置"
#: assets/models/platform.py:43 assets/serializers/platform.py:57
#: assets/models/platform.py:43 assets/serializers/platform.py:60
msgid "Ping enabled"
msgstr "启用资产探活"
#: assets/models/platform.py:44 assets/serializers/platform.py:58
#: assets/models/platform.py:44 assets/serializers/platform.py:61
msgid "Ping method"
msgstr "资产探活方式"
#: assets/models/platform.py:45 assets/models/platform.py:58
#: assets/serializers/platform.py:59
#: assets/serializers/platform.py:62
msgid "Gather facts enabled"
msgstr "启用收集资产信息"
#: assets/models/platform.py:46 assets/models/platform.py:60
#: assets/serializers/platform.py:60
#: assets/serializers/platform.py:63
msgid "Gather facts method"
msgstr "收集信息方式"
#: assets/models/platform.py:47 assets/serializers/platform.py:63
#: assets/models/platform.py:47 assets/serializers/platform.py:66
msgid "Change secret enabled"
msgstr "启用改密"
#: assets/models/platform.py:49 assets/serializers/platform.py:64
#: assets/models/platform.py:49 assets/serializers/platform.py:67
msgid "Change secret method"
msgstr "改密方式"
#: assets/models/platform.py:51 assets/serializers/platform.py:65
#: assets/models/platform.py:51 assets/serializers/platform.py:68
msgid "Push account enabled"
msgstr "启用账号推送"
#: assets/models/platform.py:53 assets/serializers/platform.py:66
#: assets/models/platform.py:53 assets/serializers/platform.py:69
msgid "Push account method"
msgstr "账号推送方式"
#: assets/models/platform.py:55 assets/serializers/platform.py:61
#: assets/models/platform.py:55 assets/serializers/platform.py:64
msgid "Verify account enabled"
msgstr "开启账号验证"
#: assets/models/platform.py:57 assets/serializers/platform.py:62
#: assets/models/platform.py:57 assets/serializers/platform.py:65
msgid "Verify account method"
msgstr "账号验证方式"
@ -1448,23 +1448,23 @@ msgstr "元数据"
msgid "Internal"
msgstr "内置"
#: assets/models/platform.py:82 assets/serializers/platform.py:87
#: assets/models/platform.py:82 assets/serializers/platform.py:90
msgid "Charset"
msgstr "编码"
#: assets/models/platform.py:84 assets/serializers/platform.py:114
#: assets/models/platform.py:84 assets/serializers/platform.py:117
msgid "Domain enabled"
msgstr "启用网域"
#: assets/models/platform.py:86 assets/serializers/platform.py:113
#: assets/models/platform.py:86 assets/serializers/platform.py:116
msgid "Su enabled"
msgstr "启用账号切换"
#: assets/models/platform.py:87 assets/serializers/platform.py:97
#: assets/models/platform.py:87 assets/serializers/platform.py:100
msgid "Su method"
msgstr "账号切换方式"
#: assets/models/platform.py:89 assets/serializers/platform.py:94
#: assets/models/platform.py:89 assets/serializers/platform.py:97
msgid "Automation"
msgstr "自动化"
@ -1477,10 +1477,11 @@ msgstr "%(value)s is not an even number"
msgid "Auto fill"
msgstr "自动代填"
#: assets/serializers/asset/common.py:119 assets/serializers/platform.py:92
#: assets/serializers/asset/common.py:119 assets/serializers/platform.py:95
#: authentication/serializers/connect_token_secret.py:28
#: authentication/serializers/connect_token_secret.py:66
#: perms/serializers/user_permission.py:24 xpack/plugins/cloud/models.py:99
#: perms/serializers/user_permission.py:24 xpack/plugins/cloud/models.py:107
#: xpack/plugins/cloud/serializers/task.py:38
msgid "Protocols"
msgstr "协议组"
@ -1507,7 +1508,6 @@ msgstr "自动化信息"
#: assets/serializers/asset/database.py:24 common/serializers/fields.py:100
#: tickets/serializers/ticket/common.py:58
#: xpack/plugins/cloud/serializers/account_attrs.py:56
#: xpack/plugins/cloud/serializers/account_attrs.py:79
msgid "This field is required."
msgstr "该字段是必填项。"
@ -1596,19 +1596,25 @@ msgstr "SFTP 已启用"
msgid "SFTP home"
msgstr "SFTP 根路径"
#: assets/serializers/platform.py:67
#: assets/serializers/platform.py:42
#, fuzzy
#| msgid "Input username"
msgid "Auth with username"
msgstr "自定义用户名"
#: assets/serializers/platform.py:70
msgid "Gather accounts enabled"
msgstr "启用账号收集"
#: assets/serializers/platform.py:68
#: assets/serializers/platform.py:71
msgid "Gather accounts method"
msgstr "收集账号方式"
#: assets/serializers/platform.py:74
#: assets/serializers/platform.py:77
msgid "Primary"
msgstr "主要的"
#: assets/serializers/platform.py:115
#: assets/serializers/platform.py:118
msgid "Default Domain"
msgstr "默认网域"
@ -1789,20 +1795,8 @@ msgstr "是"
msgid "No"
msgstr "否"
#: audits/handler.py:140
msgid "{} used account[{}], login method[{}] login the asset."
msgstr "{} 使用账户[{}], 登录方式[{}]登录了这个资产."
#: audits/handler.py:155
msgid "User {} has executed change auth plan for this account.({})"
msgstr "用户 {} 为这个账号执行了改密计划.({})"
#: audits/handler.py:168
msgid "User [{}] login this system.[{}]"
msgstr "用户 {} 登录了服务.[{}]"
#: audits/models.py:32 audits/models.py:59 audits/models.py:101
#: terminal/models/session/session.py:37 terminal/models/session/sharing.py:95
#: audits/models.py:34 audits/models.py:61 audits/models.py:130
#: terminal/models/session/session.py:38 terminal/models/session/sharing.py:95
msgid "Remote addr"
msgstr "远端地址"
@ -1901,54 +1895,56 @@ msgid "Reason display"
msgstr "原因描述"
#: audits/serializers.py:122
msgid "User {} {} this resource."
msgstr "用户 {} {} 了当前资源."
msgid "User {} {} this resource"
msgstr "用户 {} {} 了当前资源"
#: audits/signal_handlers/activity_log.py:112
msgid "{} used account[{}], login method[{}] login the asset."
msgstr "{} 使用账户[{}], 登录方式[{}]登录了这个资产."
#: audits/signal_handlers/activity_log.py:121
msgid "User {} login into this service.[{}]"
msgstr "用户 {} 登录了服务.[{}]"
#: audits/signal_handlers/activity_log.py:139
#, python-format
msgid "User %s performs a task(%s) for this resource."
msgstr ""
msgid "User %s use account %s login asset %s"
msgstr "用户 %s 使用账号 %s 登录资产 %s"
#: audits/signal_handlers/login_log.py:29
#: audits/signal_handlers/activity_log.py:120
#, python-format
msgid "User %s login system %s"
msgstr "用户 %s 登录系统 %s"
#: audits/signal_handlers/activity_log.py:140
#, python-format
msgid "User %s perform a task (%s) for this resource"
msgstr "用户 %s 在当前资源, 执行了任务 (%s)"
#: audits/signal_handlers/login_log.py:27
msgid "SSH Key"
msgstr "SSH 密钥"
#: audits/signal_handlers/login_log.py:31 settings/serializers/auth/sso.py:10
#: audits/signal_handlers/login_log.py:29 settings/serializers/auth/sso.py:10
msgid "SSO"
msgstr "SSO"
#: audits/signal_handlers/login_log.py:32
#: audits/signal_handlers/login_log.py:30
msgid "Auth Token"
msgstr "认证令牌"
#: audits/signal_handlers/login_log.py:33 authentication/notifications.py:73
#: audits/signal_handlers/login_log.py:31 authentication/notifications.py:73
#: authentication/views/login.py:73 authentication/views/wecom.py:177
#: notifications/backends/__init__.py:11 settings/serializers/auth/wecom.py:10
#: users/models/user.py:778
msgid "WeCom"
msgstr "企业微信"
#: audits/signal_handlers/login_log.py:34 authentication/views/feishu.py:144
#: audits/signal_handlers/login_log.py:32 authentication/views/feishu.py:144
#: authentication/views/login.py:85 notifications/backends/__init__.py:14
#: settings/serializers/auth/feishu.py:10 users/models/user.py:780
msgid "FeiShu"
msgstr "飞书"
#: audits/signal_handlers/login_log.py:35 authentication/views/dingtalk.py:179
#: audits/signal_handlers/login_log.py:33 authentication/views/dingtalk.py:179
#: authentication/views/login.py:79 notifications/backends/__init__.py:12
#: settings/serializers/auth/dingtalk.py:10 users/models/user.py:779
msgid "DingTalk"
msgstr "钉钉"
#: audits/signal_handlers/login_log.py:36
#: audits/signal_handlers/login_log.py:34
#: authentication/models/temp_token.py:16
msgid "Temporary token"
msgstr "临时密码"
@ -3078,6 +3074,11 @@ msgstr "无效 IP"
msgid "Invalid address"
msgstr "无效地址"
#: common/utils/translate.py:33
#, python-format
msgid "Hello %s"
msgstr "你好 %s"
#: common/validators.py:14
msgid "Special char not allowed"
msgstr "不能包含特殊字符"
@ -3319,7 +3320,7 @@ msgid "Date last run"
msgstr "最后运行日期"
#: ops/models/base.py:51 ops/models/job.py:110
#: xpack/plugins/cloud/models.py:162
#: xpack/plugins/cloud/models.py:170
msgid "Result"
msgstr "结果"
@ -4371,7 +4372,7 @@ msgid "SSO auth key TTL"
msgstr "令牌有效期"
#: settings/serializers/auth/sso.py:17 settings/serializers/security.py:117
#: xpack/plugins/cloud/serializers/account_attrs.py:179
#: xpack/plugins/cloud/serializers/account_attrs.py:176
msgid "Unit: second"
msgstr "单位: 秒"
@ -5528,35 +5529,41 @@ msgstr "可以上传会话录像"
msgid "Can download session replay"
msgstr "可以下载会话录像"
#: terminal/models/session/session.py:35 terminal/models/session/sharing.py:100
#: terminal/models/session/session.py:34
#, fuzzy
#| msgid "Account "
msgid "Account id"
msgstr "账号"
#: terminal/models/session/session.py:36 terminal/models/session/sharing.py:100
msgid "Login from"
msgstr "登录来源"
#: terminal/models/session/session.py:40
#: terminal/models/session/session.py:41
msgid "Replay"
msgstr "回放"
#: terminal/models/session/session.py:44
#: terminal/models/session/session.py:45
msgid "Date end"
msgstr "结束日期"
#: terminal/models/session/session.py:234
#: terminal/models/session/session.py:235
msgid "Session record"
msgstr "会话记录"
#: terminal/models/session/session.py:236
#: terminal/models/session/session.py:237
msgid "Can monitor session"
msgstr "可以监控会话"
#: terminal/models/session/session.py:237
#: terminal/models/session/session.py:238
msgid "Can share session"
msgstr "可以分享会话"
#: terminal/models/session/session.py:238
#: terminal/models/session/session.py:239
msgid "Can terminate session"
msgstr "可以终断会话"
#: terminal/models/session/session.py:239
#: terminal/models/session/session.py:240
msgid "Can validate session action perm"
msgstr "可以验证会话动作权限"
@ -5755,7 +5762,7 @@ msgstr "Access key ID(AK)"
msgid "Access key secret"
msgstr "Access key secret(SK)"
#: terminal/serializers/storage.py:65 xpack/plugins/cloud/models.py:209
#: terminal/serializers/storage.py:65 xpack/plugins/cloud/models.py:217
msgid "Region"
msgstr "地域"
@ -6880,47 +6887,55 @@ msgstr "地域"
msgid "Hostname strategy"
msgstr "主机名策略"
#: xpack/plugins/cloud/models.py:102 xpack/plugins/cloud/serializers/task.py:40
#: xpack/plugins/cloud/models.py:100
msgid "Unix admin user"
msgstr "Unix 管理员"
#: xpack/plugins/cloud/models.py:104
msgid "Windows admin user"
msgstr "Windows 管理员"
#: xpack/plugins/cloud/models.py:110 xpack/plugins/cloud/serializers/task.py:41
msgid "IP network segment group"
msgstr "IP网段组"
#: xpack/plugins/cloud/models.py:105 xpack/plugins/cloud/serializers/task.py:45
#: xpack/plugins/cloud/models.py:113 xpack/plugins/cloud/serializers/task.py:46
msgid "Sync IP type"
msgstr "同步IP类型"
#: xpack/plugins/cloud/models.py:108 xpack/plugins/cloud/serializers/task.py:62
#: xpack/plugins/cloud/models.py:116 xpack/plugins/cloud/serializers/task.py:64
msgid "Always update"
msgstr "总是更新"
#: xpack/plugins/cloud/models.py:114
#: xpack/plugins/cloud/models.py:122
msgid "Date last sync"
msgstr "最后同步日期"
#: xpack/plugins/cloud/models.py:119 xpack/plugins/cloud/models.py:160
#: xpack/plugins/cloud/models.py:127 xpack/plugins/cloud/models.py:168
msgid "Sync instance task"
msgstr "同步实例任务"
#: xpack/plugins/cloud/models.py:171 xpack/plugins/cloud/models.py:219
#: xpack/plugins/cloud/models.py:179 xpack/plugins/cloud/models.py:227
msgid "Date sync"
msgstr "同步日期"
#: xpack/plugins/cloud/models.py:175
#: xpack/plugins/cloud/models.py:183
msgid "Sync instance task execution"
msgstr "同步实例任务执行"
#: xpack/plugins/cloud/models.py:199
#: xpack/plugins/cloud/models.py:207
msgid "Sync task"
msgstr "同步任务"
#: xpack/plugins/cloud/models.py:203
#: xpack/plugins/cloud/models.py:211
msgid "Sync instance task history"
msgstr "同步实例任务历史"
#: xpack/plugins/cloud/models.py:206
#: xpack/plugins/cloud/models.py:214
msgid "Instance"
msgstr "实例"
#: xpack/plugins/cloud/models.py:223
#: xpack/plugins/cloud/models.py:231
msgid "Sync instance detail"
msgstr "同步实例详情"
@ -7134,52 +7149,52 @@ msgstr "租户 ID"
msgid "Subscription ID"
msgstr "订阅 ID"
#: xpack/plugins/cloud/serializers/account_attrs.py:98
#: xpack/plugins/cloud/serializers/account_attrs.py:103
#: xpack/plugins/cloud/serializers/account_attrs.py:119
#: xpack/plugins/cloud/serializers/account_attrs.py:144
#: xpack/plugins/cloud/serializers/account_attrs.py:95
#: xpack/plugins/cloud/serializers/account_attrs.py:100
#: xpack/plugins/cloud/serializers/account_attrs.py:116
#: xpack/plugins/cloud/serializers/account_attrs.py:141
msgid "API Endpoint"
msgstr "API 端点"
#: xpack/plugins/cloud/serializers/account_attrs.py:109
#: xpack/plugins/cloud/serializers/account_attrs.py:106
msgid "Auth url"
msgstr "认证地址"
#: xpack/plugins/cloud/serializers/account_attrs.py:110
#: xpack/plugins/cloud/serializers/account_attrs.py:107
msgid "eg: http://openstack.example.com:5000/v3"
msgstr "如: http://openstack.example.com:5000/v3"
#: xpack/plugins/cloud/serializers/account_attrs.py:113
#: xpack/plugins/cloud/serializers/account_attrs.py:110
msgid "User domain"
msgstr "用户域"
#: xpack/plugins/cloud/serializers/account_attrs.py:120
#: xpack/plugins/cloud/serializers/account_attrs.py:117
msgid "Cert File"
msgstr "证书文件"
#: xpack/plugins/cloud/serializers/account_attrs.py:121
#: xpack/plugins/cloud/serializers/account_attrs.py:118
msgid "Key File"
msgstr "密钥文件"
#: xpack/plugins/cloud/serializers/account_attrs.py:137
#: xpack/plugins/cloud/serializers/account_attrs.py:134
msgid "Service account key"
msgstr "服务账号密钥"
#: xpack/plugins/cloud/serializers/account_attrs.py:138
#: xpack/plugins/cloud/serializers/account_attrs.py:135
msgid "The file is in JSON format"
msgstr "JSON 格式的文件"
#: xpack/plugins/cloud/serializers/account_attrs.py:151
#: xpack/plugins/cloud/serializers/account_attrs.py:148
msgid "IP address invalid `{}`, {}"
msgstr "IP 地址无效: `{}`, {}"
#: xpack/plugins/cloud/serializers/account_attrs.py:157
#: xpack/plugins/cloud/serializers/account_attrs.py:154
msgid ""
"Format for comma-delimited string,Such as: 192.168.1.0/24, "
"10.0.0.0-10.0.0.255"
msgstr "格式为逗号分隔的字符串192.168.1.0/24,10.0.0.0-10.0.0.255"
#: xpack/plugins/cloud/serializers/account_attrs.py:161
#: xpack/plugins/cloud/serializers/account_attrs.py:158
msgid ""
"The port is used to detect the validity of the IP address. When the "
"synchronization task is executed, only the valid IP address will be "
@ -7188,19 +7203,19 @@ msgstr ""
"端口用来检测 IP 地址的有效性,在同步任务执行时,只会同步有效的 IP 地址。 <br>"
"如果端口为 0则表示所有 IP 地址均有效。"
#: xpack/plugins/cloud/serializers/account_attrs.py:169
#: xpack/plugins/cloud/serializers/account_attrs.py:166
msgid "Hostname prefix"
msgstr "主机名前缀"
#: xpack/plugins/cloud/serializers/account_attrs.py:172
#: xpack/plugins/cloud/serializers/account_attrs.py:169
msgid "IP segment"
msgstr "IP 网段"
#: xpack/plugins/cloud/serializers/account_attrs.py:176
#: xpack/plugins/cloud/serializers/account_attrs.py:173
msgid "Test port"
msgstr "测试端口"
#: xpack/plugins/cloud/serializers/account_attrs.py:179
#: xpack/plugins/cloud/serializers/account_attrs.py:176
msgid "Test timeout"
msgstr "测试超时时间"
@ -7224,6 +7239,10 @@ msgstr "执行次数"
msgid "Instance count"
msgstr "实例个数"
#: xpack/plugins/cloud/serializers/task.py:63
msgid "Linux admin user"
msgstr "Linux 管理员"
#: xpack/plugins/cloud/utils.py:69
msgid "Account unavailable"
msgstr "账号无效"
@ -7292,6 +7311,15 @@ msgstr "旗舰版"
msgid "Community edition"
msgstr "社区版"
#~ msgid "{} used account[{}], login method[{}] login the asset."
#~ msgstr "{} 使用账户[{}], 登录方式[{}]登录了这个资产."
#~ msgid "User {} has executed change auth plan for this account.({})"
#~ msgstr "用户 {} 为这个账号执行了改密计划.({})"
#~ msgid "User {} login into this service.[{}]"
#~ msgstr "用户 {} 登录了服务.[{}]"
#~ msgid "Update some assets hardware info. "
#~ msgstr "更新资产硬件信息. "
@ -7307,18 +7335,6 @@ msgstr "社区版"
#~ msgid "Manually test the connectivity of assets under a node"
#~ msgstr "手动测试节点下资产连接性"
#~ msgid "User {} has executed change auth plan for this account.({})"
#~ msgstr "用户 {} 为这个账号执行了改密计划.({})"
#~ msgid "Unix admin user"
#~ msgstr "Unix 管理员"
#~ msgid "Windows admin user"
#~ msgstr "Windows 管理员"
#~ msgid "Linux admin user"
#~ msgstr "Linux 管理员"
#~ msgid "Disk info"
#~ msgstr "硬盘信息"

View File

@ -0,0 +1,19 @@
# Generated by Django 3.2.14 on 2023-02-14 10:54
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('terminal', '0058_auto_20230110_1445'),
]
operations = [
migrations.AddField(
model_name='session',
name='account_id',
field=models.CharField(db_index=True, default='', max_length=128, verbose_name='Account id'),
preserve_default=False,
),
]

View File

@ -31,6 +31,7 @@ class Session(OrgModelMixin):
asset = models.CharField(max_length=128, verbose_name=_("Asset"), db_index=True)
asset_id = models.CharField(blank=True, default='', max_length=36, db_index=True)
account = models.CharField(max_length=128, verbose_name=_("Account"), db_index=True)
account_id = models.CharField(max_length=128, verbose_name=_("Account id"), db_index=True)
protocol = models.CharField(default='ssh', max_length=16, db_index=True)
login_from = models.CharField(max_length=2, choices=LOGIN_FROM.choices, default="ST", verbose_name=_("Login from"))
type = models.CharField(max_length=16, default='normal', db_index=True)