From 6f494ef09c060ec4ed5c71f85b48faa85b9056d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=81=E5=B9=BF?= Date: Fri, 27 Apr 2018 11:27:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=A1=E9=AA=8C=E7=94=A8=E6=88=B7=E5=90=8D?= =?UTF-8?q?=E9=95=BF=E5=BA=A6=E5=92=8C=E7=89=B9=E6=AE=8A=E5=AD=97=E7=AC=A6?= =?UTF-8?q?=20(#1271)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [Bugfix] 修复系统用户用户名校验问题 * [Update] 增加长度限制 --- apps/assets/models/base.py | 3 +- apps/common/validators.py | 7 + apps/i18n/zh/LC_MESSAGES/django.mo | Bin 32913 -> 33048 bytes apps/i18n/zh/LC_MESSAGES/django.po | 243 ++++++++++++----------------- 4 files changed, 107 insertions(+), 146 deletions(-) create mode 100644 apps/common/validators.py diff --git a/apps/assets/models/base.py b/apps/assets/models/base.py index 2997b1b61..eda00a79a 100644 --- a/apps/assets/models/base.py +++ b/apps/assets/models/base.py @@ -10,6 +10,7 @@ from django.utils.translation import ugettext_lazy as _ from django.conf import settings from common.utils import get_signer, ssh_key_string_to_obj, ssh_key_gen +from common.validators import alphanumeric from .utils import private_key_validator signer = get_signer() @@ -18,7 +19,7 @@ signer = get_signer() class AssetUser(models.Model): id = models.UUIDField(default=uuid.uuid4, primary_key=True) name = models.CharField(max_length=128, unique=True, verbose_name=_('Name')) - username = models.CharField(max_length=128, verbose_name=_('Username')) + username = models.CharField(max_length=32, verbose_name=_('Username'), validators=[alphanumeric]) _password = models.CharField(max_length=256, blank=True, null=True, verbose_name=_('Password')) _private_key = models.TextField(max_length=4096, blank=True, null=True, verbose_name=_('SSH private key'), validators=[private_key_validator, ]) _public_key = models.TextField(max_length=4096, blank=True, verbose_name=_('SSH public key')) diff --git a/apps/common/validators.py b/apps/common/validators.py new file mode 100644 index 000000000..9a4c1e501 --- /dev/null +++ b/apps/common/validators.py @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# +from django.core.validators import RegexValidator +from django.utils.translation import ugettext_lazy as _ + + +alphanumeric = RegexValidator(r'^[0-9a-zA-Z_-]*$', _('Special char not allowed')) \ No newline at end of file diff --git a/apps/i18n/zh/LC_MESSAGES/django.mo b/apps/i18n/zh/LC_MESSAGES/django.mo index 4da36e76e728971c74b595652700d37f1d8eae61..315bd8b8f3252fa5931e60cd25716924049e6a69 100644 GIT binary patch delta 11467 zcmaLd2XqzH_Q&xFp(dnI0-=WzIzk8}^cFfqI!Gr{q(qWHD3NjrL6jIkq=P5|f=Cq* zqzXcmB2@uJL`ABAGzH}edEZ}V=fC*B_12rU_WPW@=gc{0&fK{-vfiBJY>TF5^IXcG zeZIpHkj-(5_4tjK<5a8WILpwhIyv?CYdB62jt+C2 zQaA$};96{m*RUd%tLYkzIUUF2jHRK8Ct)sJ;+}9;m}@bB`eyXT{iyzjFhBl+x$zGy zhELHKi-f!NP%K0K0_wU>m>oxAF6MVe)8M9^30M%*&<8&-*JD2N9jJvIK|lN+E8%s_ zf%$4N2^K~zpd}W-&Zz!FP!lJj`X^yt=65_a{4os+;ZoE9Tdckh^O7G&4RpcI-#{(& z57hM;mUO^8KitNJmX{ z9!ugc$m3@Qw|^Mwd>z!CHbX7EwVm&ddenU**nf2#OhE(3VK646p7j#c`S;9^%q`{~ z)U*E*>*7h&g7ZYW69l3jSum$&&D00kJZXVmo%EziMrXu@Dry&US1MxYkZ6!qEgw4tF1dZD&t5NhCIs1=U2 z+=Ci04Rzrn)PQTvZK(dAqb59zn&<**=Psk(h6kuel(Syucpk@(hB_2Mov4Jmum)bnC~K@D6Nb>~e`6L&%_v=3_FL8yMOTAqj+cM_^!3Tk0*VF)h9+U^jjEQ^{b9M!KrYR6h*ag0Xo+;G%_6VanBnnXh%wmGN| z(^~9@@eFzLGz0$osFx zWeWNN$e8H19~@cpJ@PUf})m}M@VmrC0jST!5Y&Pb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/apps/i18n/zh/LC_MESSAGES/django.po index d586f00af..624b555b4 100644 --- a/apps/i18n/zh/LC_MESSAGES/django.po +++ b/apps/i18n/zh/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Jumpserver 0.3.3\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-04-26 19:15+0800\n" +"POT-Creation-Date: 2018-04-27 11:16+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: ibuler \n" "Language-Team: Jumpserver team\n" @@ -21,11 +21,11 @@ msgstr "" msgid "New node {}" msgstr "新节点 {}" -#: assets/api/node.py:216 +#: assets/api/node.py:217 msgid "更新节点资产硬件信息: {}" msgstr "" -#: assets/api/node.py:229 +#: assets/api/node.py:230 msgid "测试节点下资产是否可连接: {}" msgstr "" @@ -110,7 +110,7 @@ msgstr "端口" #: perms/templates/perms/asset_permission_create_update.html:40 #: perms/templates/perms/asset_permission_list.html:56 #: perms/templates/perms/asset_permission_list.html:139 -#: terminal/backends/command/models.py:11 terminal/models.py:123 +#: terminal/backends/command/models.py:11 terminal/models.py:127 #: terminal/templates/terminal/command_list.html:40 #: terminal/templates/terminal/command_list.html:73 #: terminal/templates/terminal/session_list.html:41 @@ -119,7 +119,7 @@ msgid "Asset" msgstr "资产" #: assets/forms/domain.py:54 assets/forms/user.py:79 assets/forms/user.py:120 -#: assets/models/base.py:20 assets/models/cluster.py:18 +#: assets/models/base.py:21 assets/models/cluster.py:18 #: assets/models/domain.py:17 assets/models/group.py:20 #: assets/models/label.py:17 assets/templates/assets/admin_user_detail.html:56 #: assets/templates/assets/admin_user_list.html:23 @@ -128,14 +128,14 @@ msgstr "资产" #: assets/templates/assets/domain_list.html:14 #: assets/templates/assets/label_list.html:14 #: assets/templates/assets/system_user_detail.html:58 -#: assets/templates/assets/system_user_list.html:26 common/forms.py:179 -#: common/models.py:26 common/templates/common/terminal_setting.html:70 -#: common/templates/common/terminal_setting.html:88 ops/models/adhoc.py:36 +#: assets/templates/assets/system_user_list.html:26 common/models.py:26 +#: common/templates/common/terminal_setting.html:67 +#: common/templates/common/terminal_setting.html:85 ops/models/adhoc.py:36 #: ops/templates/ops/task_detail.html:59 ops/templates/ops/task_list.html:35 #: perms/models.py:19 perms/templates/perms/asset_permission_detail.html:62 #: perms/templates/perms/asset_permission_list.html:53 #: perms/templates/perms/asset_permission_user.html:54 terminal/models.py:16 -#: terminal/models.py:149 terminal/templates/terminal/terminal_detail.html:43 +#: terminal/models.py:154 terminal/templates/terminal/terminal_detail.html:43 #: terminal/templates/terminal/terminal_list.html:29 users/models/group.py:14 #: users/models/user.py:42 users/templates/users/_select_user_modal.html:13 #: users/templates/users/user_detail.html:63 @@ -148,7 +148,7 @@ msgid "Name" msgstr "名称" #: assets/forms/domain.py:55 assets/forms/user.py:80 assets/forms/user.py:121 -#: assets/models/base.py:21 assets/templates/assets/admin_user_detail.html:60 +#: assets/models/base.py:22 assets/templates/assets/admin_user_detail.html:60 #: assets/templates/assets/admin_user_list.html:24 #: assets/templates/assets/domain_gateway_list.html:60 #: assets/templates/assets/system_user_detail.html:62 @@ -168,7 +168,7 @@ msgstr "用户名" msgid "Password or private key passphrase" msgstr "密码或密钥密码" -#: assets/forms/user.py:25 assets/models/base.py:22 common/forms.py:114 +#: assets/forms/user.py:25 assets/models/base.py:23 common/forms.py:113 #: users/forms.py:15 users/forms.py:23 users/forms.py:32 users/forms.py:44 #: users/templates/users/login.html:59 #: users/templates/users/reset_password.html:52 @@ -209,7 +209,7 @@ msgstr "高优先级的系统用户将会作为默认登录用户" #: assets/templates/assets/asset_list.html:87 #: assets/templates/assets/domain_gateway_list.html:57 #: assets/templates/assets/system_user_asset.html:50 -#: assets/templates/assets/user_asset_list.html:46 common/forms.py:145 +#: assets/templates/assets/user_asset_list.html:46 common/forms.py:144 #: perms/templates/perms/asset_permission_asset.html:55 #: users/templates/users/login_log_list.html:52 #: users/templates/users/user_granted_asset.html:45 @@ -222,7 +222,7 @@ msgstr "IP" #: assets/templates/assets/asset_detail.html:57 #: assets/templates/assets/asset_list.html:86 #: assets/templates/assets/system_user_asset.html:49 -#: assets/templates/assets/user_asset_list.html:45 common/forms.py:144 +#: assets/templates/assets/user_asset_list.html:45 common/forms.py:143 #: perms/templates/perms/asset_permission_asset.html:54 #: users/templates/users/user_granted_asset.html:44 #: users/templates/users/user_group_granted_asset.html:44 @@ -304,7 +304,7 @@ msgstr "主机名原始" msgid "Labels" msgstr "标签管理" -#: assets/models/asset.py:82 assets/models/base.py:28 +#: assets/models/asset.py:82 assets/models/base.py:29 #: assets/models/cluster.py:28 assets/models/group.py:21 #: assets/templates/assets/admin_user_detail.html:68 #: assets/templates/assets/asset_detail.html:117 @@ -329,7 +329,7 @@ msgstr "创建者" msgid "Date created" msgstr "创建日期" -#: assets/models/asset.py:84 assets/models/base.py:25 +#: assets/models/asset.py:84 assets/models/base.py:26 #: assets/models/cluster.py:29 assets/models/domain.py:18 #: assets/models/domain.py:47 assets/models/group.py:23 #: assets/models/label.py:21 assets/templates/assets/admin_user_detail.html:72 @@ -350,11 +350,11 @@ msgstr "创建日期" msgid "Comment" msgstr "备注" -#: assets/models/base.py:23 +#: assets/models/base.py:24 msgid "SSH private key" msgstr "ssh密钥" -#: assets/models/base.py:24 +#: assets/models/base.py:25 msgid "SSH public key" msgstr "ssh公钥" @@ -408,6 +408,7 @@ msgstr "集群" #: assets/templates/assets/domain_gateway_list.html:59 #: assets/templates/assets/system_user_detail.html:66 #: assets/templates/assets/system_user_list.html:28 +#: terminal/templates/terminal/session_list.html:75 msgid "Protocol" msgstr "协议" @@ -426,7 +427,7 @@ msgstr "默认资产组" #: perms/templates/perms/asset_permission_create_update.html:36 #: perms/templates/perms/asset_permission_list.html:54 #: perms/templates/perms/asset_permission_list.html:133 -#: terminal/backends/command/models.py:10 terminal/models.py:122 +#: terminal/backends/command/models.py:10 terminal/models.py:126 #: terminal/templates/terminal/command_list.html:32 #: terminal/templates/terminal/command_list.html:72 #: terminal/templates/terminal/session_list.html:33 @@ -493,7 +494,7 @@ msgstr "Shell" #: perms/templates/perms/asset_permission_detail.html:140 #: perms/templates/perms/asset_permission_list.html:58 #: perms/templates/perms/asset_permission_list.html:145 templates/_nav.html:26 -#: terminal/backends/command/models.py:12 terminal/models.py:124 +#: terminal/backends/command/models.py:12 terminal/models.py:128 #: terminal/templates/terminal/command_list.html:48 #: terminal/templates/terminal/command_list.html:74 #: terminal/templates/terminal/session_list.html:49 @@ -561,7 +562,6 @@ msgid "Select System Users" msgstr "选择系统用户" #: assets/templates/assets/_asset_group_bulk_update_modal.html:34 -#, fuzzy msgid "Enable-MFA" msgstr "启用MFA" @@ -630,11 +630,10 @@ msgstr "其它" #: assets/templates/assets/domain_create_update.html:16 #: assets/templates/assets/gateway_create_update.html:58 #: assets/templates/assets/label_create_update.html:18 -#: common/templates/common/basic_setting.html:61 -#: common/templates/common/cloud_setting.html:74 -#: common/templates/common/email_setting.html:62 -#: common/templates/common/ldap_setting.html:62 -#: common/templates/common/terminal_setting.html:104 +#: common/templates/common/basic_setting.html:58 +#: common/templates/common/email_setting.html:59 +#: common/templates/common/ldap_setting.html:59 +#: common/templates/common/terminal_setting.html:101 #: perms/templates/perms/asset_permission_create_update.html:69 #: terminal/templates/terminal/terminal_update.html:47 #: users/templates/users/_user.html:46 @@ -656,11 +655,10 @@ msgstr "重置" #: assets/templates/assets/domain_create_update.html:17 #: assets/templates/assets/gateway_create_update.html:59 #: assets/templates/assets/label_create_update.html:19 -#: common/templates/common/basic_setting.html:62 -#: common/templates/common/cloud_setting.html:76 -#: common/templates/common/email_setting.html:63 -#: common/templates/common/ldap_setting.html:63 -#: common/templates/common/terminal_setting.html:106 +#: common/templates/common/basic_setting.html:59 +#: common/templates/common/email_setting.html:60 +#: common/templates/common/ldap_setting.html:60 +#: common/templates/common/terminal_setting.html:103 #: perms/templates/perms/asset_permission_create_update.html:70 #: terminal/templates/terminal/session_list.html:120 #: terminal/templates/terminal/terminal_update.html:48 @@ -1027,8 +1025,8 @@ msgid "Create gateway" msgstr "创建网关" #: assets/templates/assets/domain_gateway_list.html:87 -#: common/templates/common/email_setting.html:61 -#: common/templates/common/ldap_setting.html:61 +#: common/templates/common/email_setting.html:58 +#: common/templates/common/ldap_setting.html:58 msgid "Test connection" msgstr "测试连接" @@ -1178,7 +1176,7 @@ msgid "System user asset" msgstr "系统用户集群资产" #: audits/models.py:10 audits/templates/audits/ftp_log_list.html:74 -#: terminal/models.py:126 terminal/templates/terminal/session_list.html:74 +#: terminal/models.py:130 terminal/templates/terminal/session_list.html:74 #: terminal/templates/terminal/terminal_detail.html:47 msgid "Remote addr" msgstr "远端地址" @@ -1201,7 +1199,7 @@ msgstr "成功" #: ops/templates/ops/adhoc_history.html:52 #: ops/templates/ops/adhoc_history_detail.html:61 #: ops/templates/ops/task_history.html:58 perms/models.py:26 -#: perms/templates/perms/asset_permission_detail.html:86 terminal/models.py:132 +#: perms/templates/perms/asset_permission_detail.html:86 terminal/models.py:137 #: terminal/templates/terminal/session_list.html:77 msgid "Date start" msgstr "开始日期" @@ -1248,84 +1246,84 @@ msgstr "不是字符类型" msgid "Encrypt field using Secret Key" msgstr "" -#: common/forms.py:71 +#: common/forms.py:70 msgid "Current SITE URL" msgstr "当前站点URL" -#: common/forms.py:75 +#: common/forms.py:74 msgid "User Guide URL" msgstr "用户向导URL" -#: common/forms.py:76 +#: common/forms.py:75 msgid "User first login update profile done redirect to it" msgstr "用户第一次登录,修改profile后重定向到地址" -#: common/forms.py:79 +#: common/forms.py:78 msgid "Email Subject Prefix" msgstr "Email主题前缀" -#: common/forms.py:86 +#: common/forms.py:85 msgid "SMTP host" msgstr "SMTP主机" -#: common/forms.py:88 +#: common/forms.py:87 msgid "SMTP port" msgstr "SMTP端口" -#: common/forms.py:90 +#: common/forms.py:89 msgid "SMTP user" msgstr "SMTP账号" -#: common/forms.py:93 +#: common/forms.py:92 msgid "SMTP password" msgstr "SMTP密码" -#: common/forms.py:94 +#: common/forms.py:93 msgid "Some provider use token except password" msgstr "一些邮件提供商需要输入的是Token" -#: common/forms.py:97 common/forms.py:137 +#: common/forms.py:96 common/forms.py:136 msgid "Use SSL" msgstr "使用SSL" -#: common/forms.py:98 +#: common/forms.py:97 msgid "If SMTP port is 465, may be select" msgstr "如果SMTP端口是465,通常需要启用SSL" -#: common/forms.py:101 +#: common/forms.py:100 msgid "Use TLS" msgstr "使用TLS" -#: common/forms.py:102 +#: common/forms.py:101 msgid "If SMTP port is 587, may be select" msgstr "如果SMTP端口是587,通常需要启用TLS" -#: common/forms.py:108 +#: common/forms.py:107 msgid "LDAP server" msgstr "LDAP地址" -#: common/forms.py:111 +#: common/forms.py:110 msgid "Bind DN" msgstr "绑定DN" -#: common/forms.py:118 +#: common/forms.py:117 msgid "User OU" msgstr "用户OU" -#: common/forms.py:121 +#: common/forms.py:120 msgid "User search filter" msgstr "用户过滤器" -#: common/forms.py:122 +#: common/forms.py:121 #, python-format msgid "Choice may be (cn|uid|sAMAccountName)=%(user)s)" msgstr "可能的选项是(cn或uid或sAMAccountName=%(user)s)" -#: common/forms.py:125 +#: common/forms.py:124 msgid "User attr map" msgstr "LDAP属性映射" -#: common/forms.py:132 +#: common/forms.py:131 msgid "" "User attr map present how to map LDAP user attr to jumpserver, username,name," "email is jumpserver attr" @@ -1333,80 +1331,52 @@ msgstr "" "用户属性映射代表怎样将LDAP中用户属性映射到jumpserver用户上,username, name," "email 是jumpserver的属性" -#: common/forms.py:139 +#: common/forms.py:138 msgid "Enable LDAP auth" msgstr "启用LDAP认证" -#: common/forms.py:148 +#: common/forms.py:147 msgid "List sort by" msgstr "资产列表排序" -#: common/forms.py:151 +#: common/forms.py:150 msgid "Heartbeat interval" msgstr "心跳间隔" -#: common/forms.py:151 ops/models/adhoc.py:37 +#: common/forms.py:150 ops/models/adhoc.py:37 msgid "Units: seconds" msgstr "单位: 秒" -#: common/forms.py:154 +#: common/forms.py:153 msgid "Password auth" msgstr "密码认证" -#: common/forms.py:157 +#: common/forms.py:156 msgid "Public key auth" msgstr "密钥认证" -#: common/forms.py:160 common/templates/common/terminal_setting.html:66 +#: common/forms.py:159 common/templates/common/terminal_setting.html:63 #: terminal/forms.py:30 terminal/models.py:20 msgid "Command storage" msgstr "命令存储" -#: common/forms.py:161 +#: common/forms.py:160 msgid "" "Set terminal storage setting, `default` is the using as default,You can set " "other storage and some terminal using" msgstr "设置终端命令存储,default是默认用的存储方式" -#: common/forms.py:166 common/templates/common/terminal_setting.html:84 +#: common/forms.py:165 common/templates/common/terminal_setting.html:81 #: terminal/forms.py:35 terminal/models.py:21 msgid "Replay storage" msgstr "录像存储" -#: common/forms.py:167 +#: common/forms.py:166 msgid "" "Set replay storage setting, `default` is the using as default,You can set " "other storage and some terminal using" msgstr "设置终端录像存储,default是默认用的存储方式" -#: common/forms.py:175 -msgid "Aliyun" -msgstr "" - -#: common/forms.py:176 -msgid "AWS" -msgstr "" - -#: common/forms.py:183 -msgid "Cloud provider" -msgstr "" - -#: common/forms.py:186 -msgid "Access key id" -msgstr "" - -#: common/forms.py:187 -msgid "Enter the access key id for the cloud service" -msgstr "" - -#: common/forms.py:190 -msgid "Access key secret" -msgstr "" - -#: common/forms.py:191 -msgid "Enter the access key secret for the cloud service" -msgstr "" - #: common/mixins.py:29 msgid "is discard" msgstr "" @@ -1420,62 +1390,50 @@ msgid "Enabled" msgstr "启用" #: common/templates/common/basic_setting.html:15 -#: common/templates/common/cloud_setting.html:16 -#: common/templates/common/cloud_setting.html:49 #: common/templates/common/email_setting.html:15 #: common/templates/common/ldap_setting.html:15 #: common/templates/common/terminal_setting.html:16 -#: common/templates/common/terminal_setting.html:45 common/views.py:34 +#: common/templates/common/terminal_setting.html:42 common/views.py:22 msgid "Basic setting" msgstr "基本设置" #: common/templates/common/basic_setting.html:18 -#: common/templates/common/cloud_setting.html:20 #: common/templates/common/email_setting.html:18 #: common/templates/common/ldap_setting.html:18 -#: common/templates/common/terminal_setting.html:20 common/views.py:60 +#: common/templates/common/terminal_setting.html:20 common/views.py:48 msgid "Email setting" msgstr "邮件设置" #: common/templates/common/basic_setting.html:21 -#: common/templates/common/cloud_setting.html:24 #: common/templates/common/email_setting.html:21 #: common/templates/common/ldap_setting.html:21 -#: common/templates/common/terminal_setting.html:24 common/views.py:86 +#: common/templates/common/terminal_setting.html:24 common/views.py:74 msgid "LDAP setting" msgstr "LDAP设置" #: common/templates/common/basic_setting.html:24 -#: common/templates/common/cloud_setting.html:28 #: common/templates/common/email_setting.html:24 #: common/templates/common/ldap_setting.html:24 -#: common/templates/common/terminal_setting.html:28 common/views.py:116 +#: common/templates/common/terminal_setting.html:28 common/views.py:104 msgid "Terminal setting" msgstr "终端设置" -#: common/templates/common/basic_setting.html:27 -#: common/templates/common/cloud_setting.html:32 -#: common/templates/common/email_setting.html:27 -#: common/templates/common/ldap_setting.html:27 -#: common/templates/common/terminal_setting.html:31 common/views.py:144 -#, fuzzy -#| msgid "Email setting" -msgid "Cloud setting" -msgstr "邮件设置" - -#: common/templates/common/terminal_setting.html:71 -#: common/templates/common/terminal_setting.html:89 +#: common/templates/common/terminal_setting.html:68 +#: common/templates/common/terminal_setting.html:86 #: users/templates/users/login_log_list.html:50 msgid "Type" msgstr "类型" -#: common/views.py:33 common/views.py:59 common/views.py:85 common/views.py:115 -#: common/views.py:143 templates/_nav.html:81 +#: common/validators.py:7 +msgid "Special char not allowed" +msgstr "不能包含特殊字符" + +#: common/views.py:21 common/views.py:47 common/views.py:73 common/views.py:103 +#: templates/_nav.html:81 msgid "Settings" msgstr "系统设置" -#: common/views.py:44 common/views.py:70 common/views.py:98 common/views.py:128 -#: common/views.py:155 +#: common/views.py:32 common/views.py:58 common/views.py:86 common/views.py:116 msgid "Update setting successfully, please restart program" msgstr "更新设置成功, 请手动重启程序" @@ -1962,7 +1920,7 @@ msgstr "关闭" #: templates/_nav.html:10 users/views/group.py:28 users/views/group.py:44 #: users/views/group.py:62 users/views/group.py:79 users/views/group.py:95 -#: users/views/login.py:264 users/views/login.py:325 users/views/user.py:64 +#: users/views/login.py:263 users/views/login.py:321 users/views/user.py:64 #: users/views/user.py:79 users/views/user.py:99 users/views/user.py:155 #: users/views/user.py:310 users/views/user.py:357 users/views/user.py:379 msgid "Users" @@ -1996,11 +1954,10 @@ msgstr "命令记录" msgid "Web terminal" msgstr "Web终端" -#: templates/_nav.html:51 terminal/templates/terminal/session_list.html:75 -#: terminal/views/command.py:47 terminal/views/session.py:75 -#: terminal/views/session.py:93 terminal/views/session.py:115 -#: terminal/views/terminal.py:31 terminal/views/terminal.py:46 -#: terminal/views/terminal.py:58 +#: templates/_nav.html:51 terminal/views/command.py:47 +#: terminal/views/session.py:75 terminal/views/session.py:93 +#: terminal/views/session.py:115 terminal/views/terminal.py:31 +#: terminal/views/terminal.py:46 terminal/views/terminal.py:58 msgid "Terminal" msgstr "终端管理" @@ -2079,26 +2036,26 @@ msgstr "线程数" msgid "Boot Time" msgstr "运行时间" -#: terminal/models.py:128 terminal/templates/terminal/session_list.html:102 +#: terminal/models.py:132 terminal/templates/terminal/session_list.html:102 msgid "Replay" msgstr "回放" -#: terminal/models.py:129 terminal/templates/terminal/command_list.html:55 +#: terminal/models.py:133 terminal/templates/terminal/command_list.html:55 #: terminal/templates/terminal/command_list.html:71 #: terminal/templates/terminal/session_detail.html:48 #: terminal/templates/terminal/session_list.html:76 msgid "Command" msgstr "命令" -#: terminal/models.py:131 +#: terminal/models.py:136 msgid "Date last active" msgstr "最后活跃日期" -#: terminal/models.py:133 +#: terminal/models.py:138 msgid "Date end" msgstr "结束日期" -#: terminal/models.py:150 +#: terminal/models.py:155 msgid "Args" msgstr "参数" @@ -2898,56 +2855,56 @@ msgstr "更新用户组" msgid "User group granted asset" msgstr "用户组授权资产" -#: users/views/login.py:60 +#: users/views/login.py:59 msgid "Please enable cookies and try again." msgstr "设置你的浏览器支持cookie" -#: users/views/login.py:126 users/views/user.py:464 users/views/user.py:489 +#: users/views/login.py:125 users/views/user.py:464 users/views/user.py:489 msgid "MFA code invalid" msgstr "MFA码认证失败" -#: users/views/login.py:152 +#: users/views/login.py:151 msgid "Logout success" msgstr "退出登录成功" -#: users/views/login.py:153 +#: users/views/login.py:152 msgid "Logout success, return login page" msgstr "退出登录成功,返回到登录页面" -#: users/views/login.py:169 +#: users/views/login.py:168 msgid "Email address invalid, please input again" msgstr "邮箱地址错误,重新输入" -#: users/views/login.py:182 +#: users/views/login.py:181 msgid "Send reset password message" msgstr "发送重置密码邮件" -#: users/views/login.py:183 +#: users/views/login.py:182 msgid "Send reset password mail success, login your mail box and follow it " msgstr "" "发送重置邮件成功, 请登录邮箱查看, 按照提示操作 (如果没收到,请等待3-5分钟)" -#: users/views/login.py:196 +#: users/views/login.py:195 msgid "Reset password success" msgstr "重置密码成功" -#: users/views/login.py:197 +#: users/views/login.py:196 msgid "Reset password success, return to login page" msgstr "重置密码成功,返回到登录页面" -#: users/views/login.py:214 users/views/login.py:227 +#: users/views/login.py:213 users/views/login.py:226 msgid "Token invalid or expired" msgstr "Token错误或失效" -#: users/views/login.py:223 +#: users/views/login.py:222 msgid "Password not same" msgstr "密码不一致" -#: users/views/login.py:264 +#: users/views/login.py:263 msgid "First login" msgstr "首次登陆" -#: users/views/login.py:326 +#: users/views/login.py:322 msgid "Login log list" msgstr "登录日志" @@ -2995,8 +2952,4 @@ msgstr "MFA 解绑成功" msgid "MFA disable success, return login page" msgstr "MFA 解绑成功,返回登录页面" -#~ msgid "Step" -#~ msgstr "Step" -#~ msgid "Add asset" -#~ msgstr "添加资产到节点"