mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-08-21 07:44:13 +00:00
Merge pull request #3332 from jumpserver/dev_char
[Update] 限制 组织和系统用户 名称中使用的特殊字符
This commit is contained in:
commit
c0d1bf8ecc
14
apps/assets/const.py
Normal file
14
apps/assets/const.py
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
#
|
||||||
|
|
||||||
|
from django.utils.translation import ugettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
|
GENERAL_LIMIT_SPECIAL_CHARACTERS_HELP_TEXT = _(
|
||||||
|
'Only Numbers、letters、 chinese and characters ( {} ) are allowed'
|
||||||
|
).format(" ".join(['.', '_', '@', '-']))
|
||||||
|
|
||||||
|
GENERAL_LIMIT_SPECIAL_CHARACTERS_PATTERN = r"^[\._@\w-]+$"
|
||||||
|
|
||||||
|
GENERAL_LIMIT_SPECIAL_CHARACTERS_ERROR_MSG = \
|
||||||
|
_("* The contains characters that are not allowed")
|
@ -7,6 +7,7 @@ from common.utils import get_logger
|
|||||||
from orgs.mixins.forms import OrgModelForm
|
from orgs.mixins.forms import OrgModelForm
|
||||||
|
|
||||||
from ..models import Asset, Node
|
from ..models import Asset, Node
|
||||||
|
from ..const import GENERAL_LIMIT_SPECIAL_CHARACTERS_HELP_TEXT
|
||||||
|
|
||||||
|
|
||||||
logger = get_logger(__file__)
|
logger = get_logger(__file__)
|
||||||
@ -14,10 +15,6 @@ __all__ = [
|
|||||||
'AssetCreateForm', 'AssetUpdateForm', 'AssetBulkUpdateForm', 'ProtocolForm',
|
'AssetCreateForm', 'AssetUpdateForm', 'AssetBulkUpdateForm', 'ProtocolForm',
|
||||||
]
|
]
|
||||||
|
|
||||||
HELP_TEXTS_ASSET_HOSTNAME = _(
|
|
||||||
'Only Numbers、letters、 chinese and characters ( {} ) are allowed'
|
|
||||||
).format(" ".join(['.', '_', '@']))
|
|
||||||
|
|
||||||
|
|
||||||
class ProtocolForm(forms.Form):
|
class ProtocolForm(forms.Form):
|
||||||
name = forms.ChoiceField(
|
name = forms.ChoiceField(
|
||||||
@ -72,7 +69,7 @@ class AssetCreateForm(OrgModelForm):
|
|||||||
'nodes': _("Node"),
|
'nodes': _("Node"),
|
||||||
}
|
}
|
||||||
help_texts = {
|
help_texts = {
|
||||||
'hostname': HELP_TEXTS_ASSET_HOSTNAME,
|
'hostname': GENERAL_LIMIT_SPECIAL_CHARACTERS_HELP_TEXT,
|
||||||
'admin_user': _(
|
'admin_user': _(
|
||||||
'root or other NOPASSWD sudo privilege user existed in asset,'
|
'root or other NOPASSWD sudo privilege user existed in asset,'
|
||||||
'If asset is windows or other set any one, more see admin user left menu'
|
'If asset is windows or other set any one, more see admin user left menu'
|
||||||
@ -119,7 +116,7 @@ class AssetUpdateForm(OrgModelForm):
|
|||||||
'nodes': _("Node"),
|
'nodes': _("Node"),
|
||||||
}
|
}
|
||||||
help_texts = {
|
help_texts = {
|
||||||
'hostname': HELP_TEXTS_ASSET_HOSTNAME,
|
'hostname': GENERAL_LIMIT_SPECIAL_CHARACTERS_HELP_TEXT,
|
||||||
'admin_user': _(
|
'admin_user': _(
|
||||||
'root or other NOPASSWD sudo privilege user existed in asset,'
|
'root or other NOPASSWD sudo privilege user existed in asset,'
|
||||||
'If asset is windows or other set any one, more see admin user left menu'
|
'If asset is windows or other set any one, more see admin user left menu'
|
||||||
|
@ -6,6 +6,7 @@ from django.utils.translation import gettext_lazy as _
|
|||||||
from common.utils import validate_ssh_private_key, ssh_pubkey_gen, get_logger
|
from common.utils import validate_ssh_private_key, ssh_pubkey_gen, get_logger
|
||||||
from orgs.mixins.forms import OrgModelForm
|
from orgs.mixins.forms import OrgModelForm
|
||||||
from ..models import AdminUser, SystemUser
|
from ..models import AdminUser, SystemUser
|
||||||
|
from ..const import GENERAL_LIMIT_SPECIAL_CHARACTERS_HELP_TEXT
|
||||||
|
|
||||||
logger = get_logger(__file__)
|
logger = get_logger(__file__)
|
||||||
__all__ = [
|
__all__ = [
|
||||||
@ -98,6 +99,7 @@ class SystemUserForm(OrgModelForm, PasswordAndKeyAuthForm):
|
|||||||
}),
|
}),
|
||||||
}
|
}
|
||||||
help_texts = {
|
help_texts = {
|
||||||
|
'name': GENERAL_LIMIT_SPECIAL_CHARACTERS_HELP_TEXT,
|
||||||
'auto_push': _('Auto push system user to asset'),
|
'auto_push': _('Auto push system user to asset'),
|
||||||
'priority': _('1-100, High level will be using login asset as default, '
|
'priority': _('1-100, High level will be using login asset as default, '
|
||||||
'if user was granted more than 2 system user'),
|
'if user was granted more than 2 system user'),
|
||||||
|
@ -8,6 +8,10 @@ from django.utils.translation import ugettext_lazy as _
|
|||||||
from orgs.mixins.serializers import BulkOrgResourceModelSerializer
|
from orgs.mixins.serializers import BulkOrgResourceModelSerializer
|
||||||
from common.serializers import AdaptedBulkListSerializer
|
from common.serializers import AdaptedBulkListSerializer
|
||||||
from ..models import Asset, Node, Label
|
from ..models import Asset, Node, Label
|
||||||
|
from ..const import (
|
||||||
|
GENERAL_LIMIT_SPECIAL_CHARACTERS_PATTERN,
|
||||||
|
GENERAL_LIMIT_SPECIAL_CHARACTERS_ERROR_MSG
|
||||||
|
)
|
||||||
from .base import ConnectivitySerializer
|
from .base import ConnectivitySerializer
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
@ -94,10 +98,10 @@ class AssetSerializer(BulkOrgResourceModelSerializer):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def validate_hostname(hostname):
|
def validate_hostname(hostname):
|
||||||
pattern = r"^[\._@\w-]+$"
|
pattern = GENERAL_LIMIT_SPECIAL_CHARACTERS_PATTERN
|
||||||
res = re.match(pattern, hostname)
|
res = re.match(pattern, hostname)
|
||||||
if res is None:
|
if res is None:
|
||||||
msg = _("* The hostname contains characters that are not allowed")
|
msg = GENERAL_LIMIT_SPECIAL_CHARACTERS_ERROR_MSG
|
||||||
raise serializers.ValidationError(msg)
|
raise serializers.ValidationError(msg)
|
||||||
return hostname
|
return hostname
|
||||||
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import re
|
||||||
from rest_framework import serializers
|
from rest_framework import serializers
|
||||||
|
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import ugettext_lazy as _
|
||||||
@ -6,6 +7,10 @@ from common.serializers import AdaptedBulkListSerializer
|
|||||||
from common.utils import ssh_pubkey_gen
|
from common.utils import ssh_pubkey_gen
|
||||||
from orgs.mixins.serializers import BulkOrgResourceModelSerializer
|
from orgs.mixins.serializers import BulkOrgResourceModelSerializer
|
||||||
from ..models import SystemUser
|
from ..models import SystemUser
|
||||||
|
from ..const import (
|
||||||
|
GENERAL_LIMIT_SPECIAL_CHARACTERS_PATTERN,
|
||||||
|
GENERAL_LIMIT_SPECIAL_CHARACTERS_ERROR_MSG
|
||||||
|
)
|
||||||
from .base import AuthSerializer, AuthSerializerMixin
|
from .base import AuthSerializer, AuthSerializerMixin
|
||||||
|
|
||||||
|
|
||||||
@ -33,6 +38,15 @@ class SystemUserSerializer(AuthSerializerMixin, BulkOrgResourceModelSerializer):
|
|||||||
'created_by': {'read_only': True},
|
'created_by': {'read_only': True},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def validate_name(name):
|
||||||
|
pattern = GENERAL_LIMIT_SPECIAL_CHARACTERS_PATTERN
|
||||||
|
res = re.match(pattern, name)
|
||||||
|
if res is None:
|
||||||
|
msg = GENERAL_LIMIT_SPECIAL_CHARACTERS_ERROR_MSG
|
||||||
|
raise serializers.ValidationError(msg)
|
||||||
|
return name
|
||||||
|
|
||||||
def validate_auto_push(self, value):
|
def validate_auto_push(self, value):
|
||||||
login_mode = self.initial_data.get("login_mode")
|
login_mode = self.initial_data.get("login_mode")
|
||||||
protocol = self.initial_data.get("protocol")
|
protocol = self.initial_data.get("protocol")
|
||||||
|
Binary file not shown.
@ -8,7 +8,7 @@ msgid ""
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: Jumpserver 0.3.3\n"
|
"Project-Id-Version: Jumpserver 0.3.3\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2019-10-10 16:15+0800\n"
|
"POT-Creation-Date: 2019-10-12 17:06+0800\n"
|
||||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
"Last-Translator: ibuler <ibuler@qq.com>\n"
|
"Last-Translator: ibuler <ibuler@qq.com>\n"
|
||||||
"Language-Team: Jumpserver team<ibuler@qq.com>\n"
|
"Language-Team: Jumpserver team<ibuler@qq.com>\n"
|
||||||
@ -78,7 +78,7 @@ msgstr "运行参数"
|
|||||||
#: assets/forms/domain.py:15 assets/forms/label.py:13
|
#: assets/forms/domain.py:15 assets/forms/label.py:13
|
||||||
#: assets/models/asset.py:295 assets/models/authbook.py:24
|
#: assets/models/asset.py:295 assets/models/authbook.py:24
|
||||||
#: assets/models/gathered_user.py:14 assets/serializers/admin_user.py:32
|
#: assets/models/gathered_user.py:14 assets/serializers/admin_user.py:32
|
||||||
#: assets/serializers/asset_user.py:82 assets/serializers/system_user.py:31
|
#: assets/serializers/asset_user.py:82 assets/serializers/system_user.py:36
|
||||||
#: assets/templates/assets/admin_user_list.html:46
|
#: assets/templates/assets/admin_user_list.html:46
|
||||||
#: assets/templates/assets/domain_detail.html:60
|
#: assets/templates/assets/domain_detail.html:60
|
||||||
#: assets/templates/assets/domain_list.html:26
|
#: assets/templates/assets/domain_list.html:26
|
||||||
@ -112,8 +112,8 @@ msgstr "资产"
|
|||||||
#: applications/templates/applications/remote_app_detail.html:53
|
#: applications/templates/applications/remote_app_detail.html:53
|
||||||
#: applications/templates/applications/remote_app_list.html:20
|
#: applications/templates/applications/remote_app_list.html:20
|
||||||
#: applications/templates/applications/user_remote_app_list.html:16
|
#: applications/templates/applications/user_remote_app_list.html:16
|
||||||
#: assets/forms/asset.py:24 assets/forms/domain.py:73 assets/forms/user.py:74
|
#: assets/forms/asset.py:21 assets/forms/domain.py:73 assets/forms/user.py:75
|
||||||
#: assets/forms/user.py:94 assets/models/base.py:28 assets/models/cluster.py:18
|
#: assets/forms/user.py:95 assets/models/base.py:28 assets/models/cluster.py:18
|
||||||
#: assets/models/cmd_filter.py:21 assets/models/domain.py:20
|
#: assets/models/cmd_filter.py:21 assets/models/domain.py:20
|
||||||
#: assets/models/group.py:20 assets/models/label.py:18
|
#: assets/models/group.py:20 assets/models/label.py:18
|
||||||
#: assets/templates/assets/admin_user_detail.html:56
|
#: assets/templates/assets/admin_user_detail.html:56
|
||||||
@ -189,7 +189,7 @@ msgstr "参数"
|
|||||||
#: assets/models/cluster.py:28 assets/models/cmd_filter.py:26
|
#: assets/models/cluster.py:28 assets/models/cmd_filter.py:26
|
||||||
#: assets/models/cmd_filter.py:59 assets/models/group.py:21
|
#: assets/models/cmd_filter.py:59 assets/models/group.py:21
|
||||||
#: assets/templates/assets/admin_user_detail.html:68
|
#: assets/templates/assets/admin_user_detail.html:68
|
||||||
#: assets/templates/assets/asset_detail.html:124
|
#: assets/templates/assets/asset_detail.html:122
|
||||||
#: assets/templates/assets/cmd_filter_detail.html:77
|
#: assets/templates/assets/cmd_filter_detail.html:77
|
||||||
#: assets/templates/assets/domain_detail.html:72
|
#: assets/templates/assets/domain_detail.html:72
|
||||||
#: assets/templates/assets/system_user_detail.html:100
|
#: assets/templates/assets/system_user_detail.html:100
|
||||||
@ -243,7 +243,7 @@ msgstr "创建日期"
|
|||||||
#: assets/models/domain.py:53 assets/models/group.py:23
|
#: assets/models/domain.py:53 assets/models/group.py:23
|
||||||
#: assets/models/label.py:23 assets/templates/assets/admin_user_detail.html:72
|
#: assets/models/label.py:23 assets/templates/assets/admin_user_detail.html:72
|
||||||
#: assets/templates/assets/admin_user_list.html:50
|
#: assets/templates/assets/admin_user_list.html:50
|
||||||
#: assets/templates/assets/asset_detail.html:132
|
#: assets/templates/assets/asset_detail.html:130
|
||||||
#: assets/templates/assets/cmd_filter_detail.html:65
|
#: assets/templates/assets/cmd_filter_detail.html:65
|
||||||
#: assets/templates/assets/cmd_filter_list.html:27
|
#: assets/templates/assets/cmd_filter_list.html:27
|
||||||
#: assets/templates/assets/cmd_filter_rule_list.html:62
|
#: assets/templates/assets/cmd_filter_rule_list.html:62
|
||||||
@ -394,7 +394,7 @@ msgstr "详情"
|
|||||||
#: assets/templates/assets/admin_user_detail.html:24
|
#: assets/templates/assets/admin_user_detail.html:24
|
||||||
#: assets/templates/assets/admin_user_list.html:26
|
#: assets/templates/assets/admin_user_list.html:26
|
||||||
#: assets/templates/assets/admin_user_list.html:111
|
#: assets/templates/assets/admin_user_list.html:111
|
||||||
#: assets/templates/assets/asset_detail.html:27
|
#: assets/templates/assets/asset_detail.html:26
|
||||||
#: assets/templates/assets/asset_list.html:78
|
#: assets/templates/assets/asset_list.html:78
|
||||||
#: assets/templates/assets/asset_list.html:167
|
#: assets/templates/assets/asset_list.html:167
|
||||||
#: assets/templates/assets/cmd_filter_detail.html:29
|
#: assets/templates/assets/cmd_filter_detail.html:29
|
||||||
@ -440,7 +440,7 @@ msgstr "更新"
|
|||||||
#: applications/templates/applications/remote_app_list.html:55
|
#: applications/templates/applications/remote_app_list.html:55
|
||||||
#: assets/templates/assets/admin_user_detail.html:28
|
#: assets/templates/assets/admin_user_detail.html:28
|
||||||
#: assets/templates/assets/admin_user_list.html:112
|
#: assets/templates/assets/admin_user_list.html:112
|
||||||
#: assets/templates/assets/asset_detail.html:31
|
#: assets/templates/assets/asset_detail.html:30
|
||||||
#: assets/templates/assets/asset_list.html:168
|
#: assets/templates/assets/asset_list.html:168
|
||||||
#: assets/templates/assets/cmd_filter_detail.html:33
|
#: assets/templates/assets/cmd_filter_detail.html:33
|
||||||
#: assets/templates/assets/cmd_filter_list.html:59
|
#: assets/templates/assets/cmd_filter_list.html:59
|
||||||
@ -572,28 +572,32 @@ msgstr "不能修改根节点名称"
|
|||||||
msgid "Deletion failed and the node contains children or assets"
|
msgid "Deletion failed and the node contains children or assets"
|
||||||
msgstr "删除失败,节点包含子节点或资产"
|
msgstr "删除失败,节点包含子节点或资产"
|
||||||
|
|
||||||
#: assets/api/node.py:276
|
#: assets/api/node.py:273
|
||||||
msgid "Update node asset hardware information: {}"
|
msgid "Update node asset hardware information: {}"
|
||||||
msgstr "更新节点资产硬件信息: {}"
|
msgstr "更新节点资产硬件信息: {}"
|
||||||
|
|
||||||
#: assets/api/node.py:290
|
#: assets/api/node.py:287
|
||||||
msgid "Test if the assets under the node are connectable: {}"
|
msgid "Test if the assets under the node are connectable: {}"
|
||||||
msgstr "测试节点下资产是否可连接: {}"
|
msgstr "测试节点下资产是否可连接: {}"
|
||||||
|
|
||||||
#: assets/forms/asset.py:18
|
#: assets/const.py:8
|
||||||
msgid "Only Numbers、letters、 chinese and characters ( {} ) are allowed"
|
msgid "Only Numbers、letters、 chinese and characters ( {} ) are allowed"
|
||||||
msgstr "只允许包含数字、字母、中文和特殊字符( {} )"
|
msgstr "只允许包含数字、字母、中文和特殊字符( {} )"
|
||||||
|
|
||||||
#: assets/forms/asset.py:28 assets/models/asset.py:140
|
#: assets/const.py:14
|
||||||
|
msgid "* The contains characters that are not allowed"
|
||||||
|
msgstr "* 包含不被允许的字符"
|
||||||
|
|
||||||
|
#: assets/forms/asset.py:25 assets/models/asset.py:140
|
||||||
#: assets/models/domain.py:50
|
#: assets/models/domain.py:50
|
||||||
#: assets/templates/assets/domain_gateway_list.html:69
|
#: assets/templates/assets/domain_gateway_list.html:69
|
||||||
#: settings/templates/settings/replay_storage_create.html:59
|
#: settings/templates/settings/replay_storage_create.html:59
|
||||||
msgid "Port"
|
msgid "Port"
|
||||||
msgstr "端口"
|
msgstr "端口"
|
||||||
|
|
||||||
#: assets/forms/asset.py:59 assets/models/asset.py:145
|
#: assets/forms/asset.py:56 assets/models/asset.py:145
|
||||||
#: assets/models/user.py:110 assets/templates/assets/asset_detail.html:190
|
#: assets/models/user.py:110 assets/templates/assets/asset_detail.html:188
|
||||||
#: assets/templates/assets/asset_detail.html:198
|
#: assets/templates/assets/asset_detail.html:196
|
||||||
#: assets/templates/assets/system_user_assets.html:83
|
#: assets/templates/assets/system_user_assets.html:83
|
||||||
#: perms/models/asset_permission.py:81
|
#: perms/models/asset_permission.py:81
|
||||||
#: xpack/plugins/change_auth_plan/models.py:74
|
#: xpack/plugins/change_auth_plan/models.py:74
|
||||||
@ -602,16 +606,16 @@ msgstr "端口"
|
|||||||
msgid "Nodes"
|
msgid "Nodes"
|
||||||
msgstr "节点"
|
msgstr "节点"
|
||||||
|
|
||||||
#: assets/forms/asset.py:62 assets/forms/asset.py:109
|
#: assets/forms/asset.py:59 assets/forms/asset.py:106
|
||||||
#: assets/models/asset.py:149 assets/models/cluster.py:19
|
#: assets/models/asset.py:149 assets/models/cluster.py:19
|
||||||
#: assets/models/user.py:68 assets/templates/assets/asset_detail.html:76
|
#: assets/models/user.py:68 assets/templates/assets/asset_detail.html:74
|
||||||
#: templates/_nav.html:44 xpack/plugins/cloud/models.py:161
|
#: templates/_nav.html:44 xpack/plugins/cloud/models.py:161
|
||||||
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_detail.html:68
|
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_detail.html:68
|
||||||
#: xpack/plugins/orgs/templates/orgs/org_list.html:19
|
#: xpack/plugins/orgs/templates/orgs/org_list.html:19
|
||||||
msgid "Admin user"
|
msgid "Admin user"
|
||||||
msgstr "管理用户"
|
msgstr "管理用户"
|
||||||
|
|
||||||
#: assets/forms/asset.py:65 assets/forms/asset.py:112 assets/forms/asset.py:152
|
#: assets/forms/asset.py:62 assets/forms/asset.py:109 assets/forms/asset.py:149
|
||||||
#: assets/templates/assets/asset_create.html:48
|
#: assets/templates/assets/asset_create.html:48
|
||||||
#: assets/templates/assets/asset_create.html:50
|
#: assets/templates/assets/asset_create.html:50
|
||||||
#: assets/templates/assets/asset_list.html:85
|
#: assets/templates/assets/asset_list.html:85
|
||||||
@ -619,16 +623,16 @@ msgstr "管理用户"
|
|||||||
msgid "Label"
|
msgid "Label"
|
||||||
msgstr "标签"
|
msgstr "标签"
|
||||||
|
|
||||||
#: assets/forms/asset.py:68 assets/forms/asset.py:115
|
#: assets/forms/asset.py:65 assets/forms/asset.py:112
|
||||||
#: assets/models/asset.py:144 assets/models/domain.py:26
|
#: assets/models/asset.py:144 assets/models/domain.py:26
|
||||||
#: assets/models/domain.py:52 assets/templates/assets/asset_detail.html:80
|
#: assets/models/domain.py:52 assets/templates/assets/asset_detail.html:78
|
||||||
#: assets/templates/assets/user_asset_list.html:53
|
#: assets/templates/assets/user_asset_list.html:53
|
||||||
#: xpack/plugins/orgs/templates/orgs/org_list.html:18
|
#: xpack/plugins/orgs/templates/orgs/org_list.html:18
|
||||||
msgid "Domain"
|
msgid "Domain"
|
||||||
msgstr "网域"
|
msgstr "网域"
|
||||||
|
|
||||||
#: assets/forms/asset.py:72 assets/forms/asset.py:106 assets/forms/asset.py:119
|
#: assets/forms/asset.py:69 assets/forms/asset.py:103 assets/forms/asset.py:116
|
||||||
#: assets/forms/asset.py:155 assets/models/node.py:409
|
#: assets/forms/asset.py:152 assets/models/node.py:409
|
||||||
#: assets/templates/assets/asset_create.html:42
|
#: assets/templates/assets/asset_create.html:42
|
||||||
#: perms/forms/asset_permission.py:83 perms/forms/asset_permission.py:90
|
#: perms/forms/asset_permission.py:83 perms/forms/asset_permission.py:90
|
||||||
#: perms/templates/perms/asset_permission_list.html:53
|
#: perms/templates/perms/asset_permission_list.html:53
|
||||||
@ -643,7 +647,7 @@ msgstr "网域"
|
|||||||
msgid "Node"
|
msgid "Node"
|
||||||
msgstr "节点"
|
msgstr "节点"
|
||||||
|
|
||||||
#: assets/forms/asset.py:77 assets/forms/asset.py:124
|
#: assets/forms/asset.py:74 assets/forms/asset.py:121
|
||||||
msgid ""
|
msgid ""
|
||||||
"root or other NOPASSWD sudo privilege user existed in asset,If asset is "
|
"root or other NOPASSWD sudo privilege user existed in asset,If asset is "
|
||||||
"windows or other set any one, more see admin user left menu"
|
"windows or other set any one, more see admin user left menu"
|
||||||
@ -651,16 +655,16 @@ msgstr ""
|
|||||||
"root或其他拥有NOPASSWD: ALL权限的用户, 如果是windows或其它硬件可以随意设置一"
|
"root或其他拥有NOPASSWD: ALL权限的用户, 如果是windows或其它硬件可以随意设置一"
|
||||||
"个, 更多信息查看左侧 `管理用户` 菜单"
|
"个, 更多信息查看左侧 `管理用户` 菜单"
|
||||||
|
|
||||||
#: assets/forms/asset.py:80 assets/forms/asset.py:127
|
#: assets/forms/asset.py:77 assets/forms/asset.py:124
|
||||||
msgid "Windows 2016 RDP protocol is different, If is window 2016, set it"
|
msgid "Windows 2016 RDP protocol is different, If is window 2016, set it"
|
||||||
msgstr "Windows 2016的RDP协议与之前不同,如果是请设置"
|
msgstr "Windows 2016的RDP协议与之前不同,如果是请设置"
|
||||||
|
|
||||||
#: assets/forms/asset.py:81 assets/forms/asset.py:128
|
#: assets/forms/asset.py:78 assets/forms/asset.py:125
|
||||||
msgid ""
|
msgid ""
|
||||||
"If your have some network not connect with each other, you can set domain"
|
"If your have some network not connect with each other, you can set domain"
|
||||||
msgstr "如果有多个的互相隔离的网络,设置资产属于的网域,使用网域网关跳转登录"
|
msgstr "如果有多个的互相隔离的网络,设置资产属于的网域,使用网域网关跳转登录"
|
||||||
|
|
||||||
#: assets/forms/asset.py:135 assets/forms/asset.py:139
|
#: assets/forms/asset.py:132 assets/forms/asset.py:136
|
||||||
#: assets/forms/domain.py:17 assets/forms/label.py:15
|
#: assets/forms/domain.py:17 assets/forms/label.py:15
|
||||||
#: perms/templates/perms/asset_permission_asset.html:78
|
#: perms/templates/perms/asset_permission_asset.html:78
|
||||||
#: xpack/plugins/change_auth_plan/forms.py:55
|
#: xpack/plugins/change_auth_plan/forms.py:55
|
||||||
@ -680,7 +684,7 @@ msgstr "不能包含特殊字符"
|
|||||||
msgid "SSH gateway support proxy SSH,RDP,VNC"
|
msgid "SSH gateway support proxy SSH,RDP,VNC"
|
||||||
msgstr "SSH网关,支持代理SSH,RDP和VNC"
|
msgstr "SSH网关,支持代理SSH,RDP和VNC"
|
||||||
|
|
||||||
#: assets/forms/domain.py:74 assets/forms/user.py:75 assets/forms/user.py:95
|
#: assets/forms/domain.py:74 assets/forms/user.py:76 assets/forms/user.py:96
|
||||||
#: assets/models/base.py:29 assets/models/gathered_user.py:16
|
#: assets/models/base.py:29 assets/models/gathered_user.py:16
|
||||||
#: assets/templates/assets/_asset_user_auth_update_modal.html:15
|
#: assets/templates/assets/_asset_user_auth_update_modal.html:15
|
||||||
#: assets/templates/assets/_asset_user_auth_view_modal.html:21
|
#: assets/templates/assets/_asset_user_auth_view_modal.html:21
|
||||||
@ -712,11 +716,11 @@ msgstr "SSH网关,支持代理SSH,RDP和VNC"
|
|||||||
msgid "Username"
|
msgid "Username"
|
||||||
msgstr "用户名"
|
msgstr "用户名"
|
||||||
|
|
||||||
#: assets/forms/user.py:25
|
#: assets/forms/user.py:26
|
||||||
msgid "Password or private key passphrase"
|
msgid "Password or private key passphrase"
|
||||||
msgstr "密码或密钥密码"
|
msgstr "密码或密钥密码"
|
||||||
|
|
||||||
#: assets/forms/user.py:26 assets/models/base.py:30
|
#: assets/forms/user.py:27 assets/models/base.py:30
|
||||||
#: assets/serializers/asset_user.py:63
|
#: assets/serializers/asset_user.py:63
|
||||||
#: assets/templates/assets/_asset_user_auth_update_modal.html:21
|
#: assets/templates/assets/_asset_user_auth_update_modal.html:21
|
||||||
#: assets/templates/assets/_asset_user_auth_view_modal.html:27
|
#: assets/templates/assets/_asset_user_auth_view_modal.html:27
|
||||||
@ -735,31 +739,31 @@ msgstr "密码或密钥密码"
|
|||||||
msgid "Password"
|
msgid "Password"
|
||||||
msgstr "密码"
|
msgstr "密码"
|
||||||
|
|
||||||
#: assets/forms/user.py:29 assets/serializers/asset_user.py:71
|
#: assets/forms/user.py:30 assets/serializers/asset_user.py:71
|
||||||
#: assets/templates/assets/_asset_user_auth_update_modal.html:27
|
#: assets/templates/assets/_asset_user_auth_update_modal.html:27
|
||||||
#: users/models/user.py:400
|
#: users/models/user.py:400
|
||||||
msgid "Private key"
|
msgid "Private key"
|
||||||
msgstr "ssh私钥"
|
msgstr "ssh私钥"
|
||||||
|
|
||||||
#: assets/forms/user.py:41
|
#: assets/forms/user.py:42
|
||||||
msgid "Invalid private key, Only support RSA/DSA format key"
|
msgid "Invalid private key, Only support RSA/DSA format key"
|
||||||
msgstr "不合法的密钥,仅支持RSA/DSA格式的密钥"
|
msgstr "不合法的密钥,仅支持RSA/DSA格式的密钥"
|
||||||
|
|
||||||
#: assets/forms/user.py:52
|
#: assets/forms/user.py:53
|
||||||
msgid "Password and private key file must be input one"
|
msgid "Password and private key file must be input one"
|
||||||
msgstr "密码和私钥, 必须输入一个"
|
msgstr "密码和私钥, 必须输入一个"
|
||||||
|
|
||||||
#: assets/forms/user.py:97 assets/models/cmd_filter.py:32
|
#: assets/forms/user.py:98 assets/models/cmd_filter.py:32
|
||||||
#: assets/models/user.py:118 assets/templates/assets/_system_user.html:66
|
#: assets/models/user.py:118 assets/templates/assets/_system_user.html:66
|
||||||
#: assets/templates/assets/system_user_detail.html:165
|
#: assets/templates/assets/system_user_detail.html:165
|
||||||
msgid "Command filter"
|
msgid "Command filter"
|
||||||
msgstr "命令过滤器"
|
msgstr "命令过滤器"
|
||||||
|
|
||||||
#: assets/forms/user.py:101
|
#: assets/forms/user.py:103
|
||||||
msgid "Auto push system user to asset"
|
msgid "Auto push system user to asset"
|
||||||
msgstr "自动推送系统用户到资产"
|
msgstr "自动推送系统用户到资产"
|
||||||
|
|
||||||
#: assets/forms/user.py:102
|
#: assets/forms/user.py:104
|
||||||
msgid ""
|
msgid ""
|
||||||
"1-100, High level will be using login asset as default, if user was granted "
|
"1-100, High level will be using login asset as default, if user was granted "
|
||||||
"more than 2 system user"
|
"more than 2 system user"
|
||||||
@ -767,13 +771,13 @@ msgstr ""
|
|||||||
"1-100, 1最低优先级,100最高优先级。授权多个用户时,高优先级的系统用户将会作为"
|
"1-100, 1最低优先级,100最高优先级。授权多个用户时,高优先级的系统用户将会作为"
|
||||||
"默认登录用户"
|
"默认登录用户"
|
||||||
|
|
||||||
#: assets/forms/user.py:104
|
#: assets/forms/user.py:106
|
||||||
msgid ""
|
msgid ""
|
||||||
"If you choose manual login mode, you do not need to fill in the username and "
|
"If you choose manual login mode, you do not need to fill in the username and "
|
||||||
"password."
|
"password."
|
||||||
msgstr "如果选择手动登录模式,用户名和密码可以不填写"
|
msgstr "如果选择手动登录模式,用户名和密码可以不填写"
|
||||||
|
|
||||||
#: assets/forms/user.py:106
|
#: assets/forms/user.py:108
|
||||||
msgid "Use comma split multi command, ex: /bin/whoami,/bin/ifconfig"
|
msgid "Use comma split multi command, ex: /bin/whoami,/bin/ifconfig"
|
||||||
msgstr "使用逗号分隔多个命令,如: /bin/whoami,/sbin/ifconfig"
|
msgstr "使用逗号分隔多个命令,如: /bin/whoami,/sbin/ifconfig"
|
||||||
|
|
||||||
@ -781,7 +785,7 @@ msgstr "使用逗号分隔多个命令,如: /bin/whoami,/sbin/ifconfig"
|
|||||||
#: assets/serializers/asset_user.py:28
|
#: assets/serializers/asset_user.py:28
|
||||||
#: assets/templates/assets/_asset_list_modal.html:47
|
#: assets/templates/assets/_asset_list_modal.html:47
|
||||||
#: assets/templates/assets/_asset_user_list.html:20
|
#: assets/templates/assets/_asset_user_list.html:20
|
||||||
#: assets/templates/assets/asset_detail.html:64
|
#: assets/templates/assets/asset_detail.html:62
|
||||||
#: assets/templates/assets/asset_list.html:97
|
#: assets/templates/assets/asset_list.html:97
|
||||||
#: assets/templates/assets/domain_gateway_list.html:68
|
#: assets/templates/assets/domain_gateway_list.html:68
|
||||||
#: assets/templates/assets/user_asset_list.html:49
|
#: assets/templates/assets/user_asset_list.html:49
|
||||||
@ -799,7 +803,7 @@ msgstr "IP"
|
|||||||
#: assets/templates/assets/_asset_user_auth_update_modal.html:9
|
#: assets/templates/assets/_asset_user_auth_update_modal.html:9
|
||||||
#: assets/templates/assets/_asset_user_auth_view_modal.html:15
|
#: assets/templates/assets/_asset_user_auth_view_modal.html:15
|
||||||
#: assets/templates/assets/_asset_user_list.html:19
|
#: assets/templates/assets/_asset_user_list.html:19
|
||||||
#: assets/templates/assets/asset_detail.html:60
|
#: assets/templates/assets/asset_detail.html:58
|
||||||
#: assets/templates/assets/asset_list.html:96
|
#: assets/templates/assets/asset_list.html:96
|
||||||
#: assets/templates/assets/user_asset_list.html:48
|
#: assets/templates/assets/user_asset_list.html:48
|
||||||
#: perms/templates/perms/asset_permission_asset.html:57
|
#: perms/templates/perms/asset_permission_asset.html:57
|
||||||
@ -811,7 +815,7 @@ msgid "Hostname"
|
|||||||
msgstr "主机名"
|
msgstr "主机名"
|
||||||
|
|
||||||
#: assets/models/asset.py:139 assets/models/domain.py:51
|
#: assets/models/asset.py:139 assets/models/domain.py:51
|
||||||
#: assets/models/user.py:113 assets/templates/assets/asset_detail.html:72
|
#: assets/models/user.py:113 assets/templates/assets/asset_detail.html:70
|
||||||
#: assets/templates/assets/domain_gateway_list.html:70
|
#: assets/templates/assets/domain_gateway_list.html:70
|
||||||
#: assets/templates/assets/system_user_detail.html:70
|
#: assets/templates/assets/system_user_detail.html:70
|
||||||
#: assets/templates/assets/system_user_list.html:53
|
#: assets/templates/assets/system_user_list.html:53
|
||||||
@ -819,41 +823,41 @@ msgstr "主机名"
|
|||||||
msgid "Protocol"
|
msgid "Protocol"
|
||||||
msgstr "协议"
|
msgstr "协议"
|
||||||
|
|
||||||
#: assets/models/asset.py:142 assets/serializers/asset.py:64
|
#: assets/models/asset.py:142 assets/serializers/asset.py:68
|
||||||
#: assets/templates/assets/asset_create.html:24
|
#: assets/templates/assets/asset_create.html:24
|
||||||
#: assets/templates/assets/user_asset_list.html:50
|
#: assets/templates/assets/user_asset_list.html:50
|
||||||
#: perms/serializers/user_permission.py:48
|
#: perms/serializers/user_permission.py:48
|
||||||
msgid "Protocols"
|
msgid "Protocols"
|
||||||
msgstr "协议组"
|
msgstr "协议组"
|
||||||
|
|
||||||
#: assets/models/asset.py:143 assets/templates/assets/asset_detail.html:104
|
#: assets/models/asset.py:143 assets/templates/assets/asset_detail.html:102
|
||||||
#: assets/templates/assets/user_asset_list.html:51
|
#: assets/templates/assets/user_asset_list.html:51
|
||||||
msgid "Platform"
|
msgid "Platform"
|
||||||
msgstr "系统平台"
|
msgstr "系统平台"
|
||||||
|
|
||||||
#: assets/models/asset.py:146 assets/models/authbook.py:27
|
#: assets/models/asset.py:146 assets/models/authbook.py:27
|
||||||
#: assets/models/cmd_filter.py:22 assets/models/domain.py:54
|
#: assets/models/cmd_filter.py:22 assets/models/domain.py:54
|
||||||
#: assets/models/label.py:22 assets/templates/assets/asset_detail.html:112
|
#: assets/models/label.py:22 assets/templates/assets/asset_detail.html:110
|
||||||
msgid "Is active"
|
msgid "Is active"
|
||||||
msgstr "激活"
|
msgstr "激活"
|
||||||
|
|
||||||
#: assets/models/asset.py:152 assets/templates/assets/asset_detail.html:68
|
#: assets/models/asset.py:152 assets/templates/assets/asset_detail.html:66
|
||||||
msgid "Public IP"
|
msgid "Public IP"
|
||||||
msgstr "公网IP"
|
msgstr "公网IP"
|
||||||
|
|
||||||
#: assets/models/asset.py:153 assets/templates/assets/asset_detail.html:120
|
#: assets/models/asset.py:153 assets/templates/assets/asset_detail.html:118
|
||||||
msgid "Asset number"
|
msgid "Asset number"
|
||||||
msgstr "资产编号"
|
msgstr "资产编号"
|
||||||
|
|
||||||
#: assets/models/asset.py:156 assets/templates/assets/asset_detail.html:84
|
#: assets/models/asset.py:156 assets/templates/assets/asset_detail.html:82
|
||||||
msgid "Vendor"
|
msgid "Vendor"
|
||||||
msgstr "制造商"
|
msgstr "制造商"
|
||||||
|
|
||||||
#: assets/models/asset.py:157 assets/templates/assets/asset_detail.html:88
|
#: assets/models/asset.py:157 assets/templates/assets/asset_detail.html:86
|
||||||
msgid "Model"
|
msgid "Model"
|
||||||
msgstr "型号"
|
msgstr "型号"
|
||||||
|
|
||||||
#: assets/models/asset.py:158 assets/templates/assets/asset_detail.html:116
|
#: assets/models/asset.py:158 assets/templates/assets/asset_detail.html:114
|
||||||
msgid "Serial number"
|
msgid "Serial number"
|
||||||
msgstr "序列号"
|
msgstr "序列号"
|
||||||
|
|
||||||
@ -874,7 +878,7 @@ msgstr "CPU核数"
|
|||||||
msgid "CPU vcpus"
|
msgid "CPU vcpus"
|
||||||
msgstr "CPU总数"
|
msgstr "CPU总数"
|
||||||
|
|
||||||
#: assets/models/asset.py:164 assets/templates/assets/asset_detail.html:96
|
#: assets/models/asset.py:164 assets/templates/assets/asset_detail.html:94
|
||||||
msgid "Memory"
|
msgid "Memory"
|
||||||
msgstr "内存"
|
msgstr "内存"
|
||||||
|
|
||||||
@ -886,7 +890,7 @@ msgstr "硬盘大小"
|
|||||||
msgid "Disk info"
|
msgid "Disk info"
|
||||||
msgstr "硬盘信息"
|
msgstr "硬盘信息"
|
||||||
|
|
||||||
#: assets/models/asset.py:168 assets/templates/assets/asset_detail.html:108
|
#: assets/models/asset.py:168 assets/templates/assets/asset_detail.html:106
|
||||||
msgid "OS"
|
msgid "OS"
|
||||||
msgstr "操作系统"
|
msgstr "操作系统"
|
||||||
|
|
||||||
@ -903,7 +907,7 @@ msgid "Hostname raw"
|
|||||||
msgstr "主机名原始"
|
msgstr "主机名原始"
|
||||||
|
|
||||||
#: assets/models/asset.py:173 assets/templates/assets/asset_create.html:46
|
#: assets/models/asset.py:173 assets/templates/assets/asset_create.html:46
|
||||||
#: assets/templates/assets/asset_detail.html:224 templates/_nav.html:46
|
#: assets/templates/assets/asset_detail.html:222 templates/_nav.html:46
|
||||||
msgid "Labels"
|
msgid "Labels"
|
||||||
msgstr "标签管理"
|
msgstr "标签管理"
|
||||||
|
|
||||||
@ -1226,31 +1230,27 @@ msgstr "可连接"
|
|||||||
msgid "Unknown"
|
msgid "Unknown"
|
||||||
msgstr "未知"
|
msgstr "未知"
|
||||||
|
|
||||||
#: assets/serializers/asset.py:22
|
#: assets/serializers/asset.py:26
|
||||||
msgid "Protocol format should {}/{}"
|
msgid "Protocol format should {}/{}"
|
||||||
msgstr "协议格式 {}/{}"
|
msgstr "协议格式 {}/{}"
|
||||||
|
|
||||||
#: assets/serializers/asset.py:39
|
#: assets/serializers/asset.py:43
|
||||||
msgid "Protocol duplicate: {}"
|
msgid "Protocol duplicate: {}"
|
||||||
msgstr "协议重复: {}"
|
msgstr "协议重复: {}"
|
||||||
|
|
||||||
#: assets/serializers/asset.py:65 assets/serializers/asset_user.py:29
|
#: assets/serializers/asset.py:69 assets/serializers/asset_user.py:29
|
||||||
#: assets/templates/assets/_asset_user_list.html:23
|
#: assets/templates/assets/_asset_user_list.html:23
|
||||||
msgid "Connectivity"
|
msgid "Connectivity"
|
||||||
msgstr "连接"
|
msgstr "连接"
|
||||||
|
|
||||||
#: assets/serializers/asset.py:91
|
#: assets/serializers/asset.py:95
|
||||||
msgid "Hardware info"
|
msgid "Hardware info"
|
||||||
msgstr "硬件信息"
|
msgstr "硬件信息"
|
||||||
|
|
||||||
#: assets/serializers/asset.py:92 orgs/mixins/serializers.py:27
|
#: assets/serializers/asset.py:96 orgs/mixins/serializers.py:27
|
||||||
msgid "Org name"
|
msgid "Org name"
|
||||||
msgstr "组织名称"
|
msgstr "组织名称"
|
||||||
|
|
||||||
#: assets/serializers/asset.py:100
|
|
||||||
msgid "* The hostname contains characters that are not allowed"
|
|
||||||
msgstr "* 主机名包含不被允许的字符"
|
|
||||||
|
|
||||||
#: assets/serializers/asset_user.py:31
|
#: assets/serializers/asset_user.py:31
|
||||||
msgid "Backend"
|
msgid "Backend"
|
||||||
msgstr "后端"
|
msgstr "后端"
|
||||||
@ -1281,15 +1281,15 @@ msgstr "值"
|
|||||||
msgid "The same level node name cannot be the same"
|
msgid "The same level node name cannot be the same"
|
||||||
msgstr "同级别节点名字不能重复"
|
msgstr "同级别节点名字不能重复"
|
||||||
|
|
||||||
#: assets/serializers/system_user.py:32
|
#: assets/serializers/system_user.py:37
|
||||||
msgid "Login mode display"
|
msgid "Login mode display"
|
||||||
msgstr "登录模式显示"
|
msgstr "登录模式显示"
|
||||||
|
|
||||||
#: assets/serializers/system_user.py:67
|
#: assets/serializers/system_user.py:81
|
||||||
msgid "* Automatic login mode must fill in the username."
|
msgid "* Automatic login mode must fill in the username."
|
||||||
msgstr "自动登录模式,必须填写用户名"
|
msgstr "自动登录模式,必须填写用户名"
|
||||||
|
|
||||||
#: assets/serializers/system_user.py:78
|
#: assets/serializers/system_user.py:92
|
||||||
msgid "Password or private key required"
|
msgid "Password or private key required"
|
||||||
msgstr "密码或密钥密码需要一个"
|
msgstr "密码或密钥密码需要一个"
|
||||||
|
|
||||||
@ -1448,7 +1448,7 @@ msgid "Please input password"
|
|||||||
msgstr "请输入密码"
|
msgstr "请输入密码"
|
||||||
|
|
||||||
#: assets/templates/assets/_asset_user_auth_update_modal.html:68
|
#: assets/templates/assets/_asset_user_auth_update_modal.html:68
|
||||||
#: assets/templates/assets/asset_detail.html:304
|
#: assets/templates/assets/asset_detail.html:302
|
||||||
#: users/templates/users/user_detail.html:313
|
#: users/templates/users/user_detail.html:313
|
||||||
#: users/templates/users/user_detail.html:340
|
#: users/templates/users/user_detail.html:340
|
||||||
#: xpack/plugins/interface/views.py:35
|
#: xpack/plugins/interface/views.py:35
|
||||||
@ -1497,7 +1497,7 @@ msgstr "查看"
|
|||||||
#: assets/templates/assets/_asset_user_list.html:75
|
#: assets/templates/assets/_asset_user_list.html:75
|
||||||
#: assets/templates/assets/admin_user_assets.html:61
|
#: assets/templates/assets/admin_user_assets.html:61
|
||||||
#: assets/templates/assets/asset_asset_user_list.html:57
|
#: assets/templates/assets/asset_asset_user_list.html:57
|
||||||
#: assets/templates/assets/asset_detail.html:178
|
#: assets/templates/assets/asset_detail.html:176
|
||||||
#: assets/templates/assets/system_user_assets.html:63
|
#: assets/templates/assets/system_user_assets.html:63
|
||||||
#: assets/templates/assets/system_user_detail.html:151
|
#: assets/templates/assets/system_user_detail.html:151
|
||||||
msgid "Test"
|
msgid "Test"
|
||||||
@ -1619,7 +1619,7 @@ msgstr "快速更新"
|
|||||||
|
|
||||||
#: assets/templates/assets/admin_user_assets.html:58
|
#: assets/templates/assets/admin_user_assets.html:58
|
||||||
#: assets/templates/assets/asset_asset_user_list.html:54
|
#: assets/templates/assets/asset_asset_user_list.html:54
|
||||||
#: assets/templates/assets/asset_detail.html:175
|
#: assets/templates/assets/asset_detail.html:173
|
||||||
msgid "Test connective"
|
msgid "Test connective"
|
||||||
msgstr "测试可连接性"
|
msgstr "测试可连接性"
|
||||||
|
|
||||||
@ -1636,7 +1636,7 @@ msgid "Select nodes"
|
|||||||
msgstr "选择节点"
|
msgstr "选择节点"
|
||||||
|
|
||||||
#: assets/templates/assets/admin_user_detail.html:100
|
#: assets/templates/assets/admin_user_detail.html:100
|
||||||
#: assets/templates/assets/asset_detail.html:204
|
#: assets/templates/assets/asset_detail.html:202
|
||||||
#: assets/templates/assets/asset_list.html:422
|
#: assets/templates/assets/asset_list.html:422
|
||||||
#: assets/templates/assets/cmd_filter_detail.html:106
|
#: assets/templates/assets/cmd_filter_detail.html:106
|
||||||
#: assets/templates/assets/system_user_assets.html:97
|
#: assets/templates/assets/system_user_assets.html:97
|
||||||
@ -1724,7 +1724,7 @@ msgid "Asset users of"
|
|||||||
msgstr "资产用户"
|
msgstr "资产用户"
|
||||||
|
|
||||||
#: assets/templates/assets/asset_asset_user_list.html:47
|
#: assets/templates/assets/asset_asset_user_list.html:47
|
||||||
#: assets/templates/assets/asset_detail.html:144
|
#: assets/templates/assets/asset_detail.html:142
|
||||||
#: terminal/templates/terminal/session_detail.html:85
|
#: terminal/templates/terminal/session_detail.html:85
|
||||||
#: users/templates/users/user_detail.html:140
|
#: users/templates/users/user_detail.html:140
|
||||||
#: users/templates/users/user_profile.html:150
|
#: users/templates/users/user_profile.html:150
|
||||||
@ -1744,21 +1744,21 @@ msgstr "选择需要修改属性"
|
|||||||
msgid "Select all"
|
msgid "Select all"
|
||||||
msgstr "全选"
|
msgstr "全选"
|
||||||
|
|
||||||
#: assets/templates/assets/asset_detail.html:92
|
#: assets/templates/assets/asset_detail.html:90
|
||||||
msgid "CPU"
|
msgid "CPU"
|
||||||
msgstr "CPU"
|
msgstr "CPU"
|
||||||
|
|
||||||
#: assets/templates/assets/asset_detail.html:100
|
#: assets/templates/assets/asset_detail.html:98
|
||||||
msgid "Disk"
|
msgid "Disk"
|
||||||
msgstr "硬盘"
|
msgstr "硬盘"
|
||||||
|
|
||||||
#: assets/templates/assets/asset_detail.html:128
|
#: assets/templates/assets/asset_detail.html:126
|
||||||
#: users/templates/users/user_detail.html:115
|
#: users/templates/users/user_detail.html:115
|
||||||
#: users/templates/users/user_profile.html:106
|
#: users/templates/users/user_profile.html:106
|
||||||
msgid "Date joined"
|
msgid "Date joined"
|
||||||
msgstr "创建日期"
|
msgstr "创建日期"
|
||||||
|
|
||||||
#: assets/templates/assets/asset_detail.html:150 authentication/models.py:15
|
#: assets/templates/assets/asset_detail.html:148 authentication/models.py:15
|
||||||
#: authentication/templates/authentication/_access_key_modal.html:32
|
#: authentication/templates/authentication/_access_key_modal.html:32
|
||||||
#: perms/models/base.py:51
|
#: perms/models/base.py:51
|
||||||
#: perms/templates/perms/asset_permission_create_update.html:55
|
#: perms/templates/perms/asset_permission_create_update.html:55
|
||||||
@ -1772,11 +1772,11 @@ msgstr "创建日期"
|
|||||||
msgid "Active"
|
msgid "Active"
|
||||||
msgstr "激活中"
|
msgstr "激活中"
|
||||||
|
|
||||||
#: assets/templates/assets/asset_detail.html:167
|
#: assets/templates/assets/asset_detail.html:165
|
||||||
msgid "Refresh hardware"
|
msgid "Refresh hardware"
|
||||||
msgstr "更新硬件信息"
|
msgstr "更新硬件信息"
|
||||||
|
|
||||||
#: assets/templates/assets/asset_detail.html:170
|
#: assets/templates/assets/asset_detail.html:168
|
||||||
msgid "Refresh"
|
msgid "Refresh"
|
||||||
msgstr "刷新"
|
msgstr "刷新"
|
||||||
|
|
||||||
|
@ -1,9 +1,13 @@
|
|||||||
|
|
||||||
|
import re
|
||||||
from rest_framework.serializers import ModelSerializer
|
from rest_framework.serializers import ModelSerializer
|
||||||
from rest_framework import serializers
|
from rest_framework import serializers
|
||||||
|
|
||||||
from users.models import User, UserGroup
|
from users.models import User, UserGroup
|
||||||
from assets.models import Asset, Domain, AdminUser, SystemUser, Label
|
from assets.models import Asset, Domain, AdminUser, SystemUser, Label
|
||||||
|
from assets.const import (
|
||||||
|
GENERAL_LIMIT_SPECIAL_CHARACTERS_PATTERN,
|
||||||
|
GENERAL_LIMIT_SPECIAL_CHARACTERS_ERROR_MSG
|
||||||
|
)
|
||||||
from perms.models import AssetPermission
|
from perms.models import AssetPermission
|
||||||
from common.serializers import AdaptedBulkListSerializer
|
from common.serializers import AdaptedBulkListSerializer
|
||||||
from .utils import set_current_org, get_current_org
|
from .utils import set_current_org, get_current_org
|
||||||
@ -18,6 +22,15 @@ class OrgSerializer(ModelSerializer):
|
|||||||
fields = '__all__'
|
fields = '__all__'
|
||||||
read_only_fields = ['created_by', 'date_created']
|
read_only_fields = ['created_by', 'date_created']
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def validate_name(name):
|
||||||
|
pattern = GENERAL_LIMIT_SPECIAL_CHARACTERS_PATTERN
|
||||||
|
res = re.match(pattern, name)
|
||||||
|
if res is None:
|
||||||
|
msg = GENERAL_LIMIT_SPECIAL_CHARACTERS_ERROR_MSG
|
||||||
|
raise serializers.ValidationError(msg)
|
||||||
|
return name
|
||||||
|
|
||||||
|
|
||||||
class OrgReadSerializer(ModelSerializer):
|
class OrgReadSerializer(ModelSerializer):
|
||||||
admins = serializers.SlugRelatedField(slug_field='name', many=True, read_only=True)
|
admins = serializers.SlugRelatedField(slug_field='name', many=True, read_only=True)
|
||||||
|
Loading…
Reference in New Issue
Block a user