diff --git a/apps/assets/models/domain.py b/apps/assets/models/domain.py index a7ce738c7..47d39f643 100644 --- a/apps/assets/models/domain.py +++ b/apps/assets/models/domain.py @@ -79,7 +79,13 @@ class Gateway(BaseUser): paramiko.SSHException, paramiko.ssh_exception.NoValidConnectionsError, socket.gaierror) as e: - return False, str(e) + err = str(e) + if err.startswith('[Errno None] Unable to connect to port'): + err = _('Unable to connect to port {port} on {ip}') + err = err.format(port=self.port, ip=self.ip) + elif err == 'Authentication failed.': + err = _('Authentication failed') + return False, err try: sock = proxy.get_transport().open_channel( diff --git a/apps/locale/zh/LC_MESSAGES/django.mo b/apps/locale/zh/LC_MESSAGES/django.mo index d18e7ef34..07fed0963 100644 Binary files a/apps/locale/zh/LC_MESSAGES/django.mo and b/apps/locale/zh/LC_MESSAGES/django.mo differ diff --git a/apps/locale/zh/LC_MESSAGES/django.po b/apps/locale/zh/LC_MESSAGES/django.po index 089eb3b3b..013697fec 100644 --- a/apps/locale/zh/LC_MESSAGES/django.po +++ b/apps/locale/zh/LC_MESSAGES/django.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: JumpServer 0.3.3\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-07-23 16:38+0800\n" +"POT-Creation-Date: 2021-07-26 15:48+0800\n" "PO-Revision-Date: 2021-05-20 10:54+0800\n" "Last-Translator: ibuler \n" "Language-Team: JumpServer team\n" @@ -19,7 +19,7 @@ msgstr "" #: acls/models/base.py:25 acls/serializers/login_asset_acl.py:47 #: applications/models/application.py:11 assets/models/asset.py:139 -#: assets/models/base.py:172 assets/models/cluster.py:18 +#: assets/models/base.py:175 assets/models/cluster.py:18 #: assets/models/cmd_filter.py:21 assets/models/domain.py:21 #: assets/models/group.py:20 assets/models/label.py:18 ops/mixin.py:24 #: orgs/models.py:23 perms/models/base.py:49 settings/models.py:29 @@ -54,7 +54,7 @@ msgstr "激活中" # msgstr "创建日期" #: acls/models/base.py:32 applications/models/application.py:24 #: assets/models/asset.py:144 assets/models/asset.py:220 -#: assets/models/base.py:177 assets/models/cluster.py:29 +#: assets/models/base.py:180 assets/models/cluster.py:29 #: assets/models/cmd_filter.py:23 assets/models/cmd_filter.py:64 #: assets/models/domain.py:22 assets/models/domain.py:53 #: assets/models/group.py:23 assets/models/label.py:23 ops/models/adhoc.py:37 @@ -62,7 +62,7 @@ msgstr "激活中" #: terminal/models/storage.py:26 terminal/models/terminal.py:114 #: tickets/models/ticket.py:73 users/models/group.py:16 #: users/models/user.py:584 xpack/plugins/change_auth_plan/models.py:77 -#: xpack/plugins/cloud/models.py:35 xpack/plugins/cloud/models.py:116 +#: xpack/plugins/cloud/models.py:35 xpack/plugins/cloud/models.py:108 #: xpack/plugins/gathered_user/models.py:26 msgid "Comment" msgstr "备注" @@ -127,7 +127,7 @@ msgstr "系统用户" #: users/templates/users/user_asset_permission.html:40 #: users/templates/users/user_asset_permission.html:70 #: xpack/plugins/change_auth_plan/models.py:282 -#: xpack/plugins/cloud/models.py:220 +#: xpack/plugins/cloud/models.py:212 msgid "Asset" msgstr "资产" @@ -176,7 +176,7 @@ msgstr "格式为逗号分隔的字符串, * 表示匹配所有. " #: applications/serializers/attrs/application_type/custom.py:21 #: applications/serializers/attrs/application_type/mysql_workbench.py:30 #: applications/serializers/attrs/application_type/vmware_client.py:26 -#: assets/models/base.py:173 assets/models/gathered_user.py:15 +#: assets/models/base.py:176 assets/models/gathered_user.py:15 #: audits/models.py:100 authentication/forms.py:15 authentication/forms.py:17 #: ops/models/adhoc.py:148 users/forms/profile.py:31 users/models/user.py:549 #: users/templates/users/_select_user_modal.html:14 @@ -330,7 +330,7 @@ msgstr "目标URL" #: applications/serializers/attrs/application_type/custom.py:25 #: applications/serializers/attrs/application_type/mysql_workbench.py:34 #: applications/serializers/attrs/application_type/vmware_client.py:30 -#: assets/models/base.py:174 audits/signals_handler.py:58 +#: assets/models/base.py:177 audits/signals_handler.py:58 #: authentication/forms.py:22 #: authentication/templates/authentication/login.html:164 #: settings/serializers/settings.py:94 users/forms/profile.py:21 @@ -392,7 +392,7 @@ msgstr "系统平台" #: assets/models/asset.py:186 assets/serializers/asset.py:65 #: perms/serializers/asset/user_permission.py:41 -#: xpack/plugins/cloud/models.py:107 xpack/plugins/cloud/serializers.py:182 +#: xpack/plugins/cloud/models.py:99 xpack/plugins/cloud/serializers.py:182 msgid "Protocols" msgstr "协议组" @@ -483,25 +483,25 @@ msgstr "主机名原始" msgid "Labels" msgstr "标签管理" -#: assets/models/asset.py:218 assets/models/base.py:180 +#: assets/models/asset.py:218 assets/models/base.py:183 #: assets/models/cluster.py:28 assets/models/cmd_filter.py:26 #: assets/models/cmd_filter.py:67 assets/models/group.py:21 #: common/db/models.py:70 common/mixins/models.py:49 orgs/models.py:24 #: orgs/models.py:422 perms/models/base.py:55 users/models/user.py:592 #: users/serializers/group.py:33 xpack/plugins/change_auth_plan/models.py:81 -#: xpack/plugins/cloud/models.py:122 xpack/plugins/gathered_user/models.py:30 +#: xpack/plugins/cloud/models.py:114 xpack/plugins/gathered_user/models.py:30 msgid "Created by" msgstr "创建者" # msgid "Created by" # msgstr "创建者" -#: assets/models/asset.py:219 assets/models/base.py:178 +#: assets/models/asset.py:219 assets/models/base.py:181 #: assets/models/cluster.py:26 assets/models/domain.py:24 #: assets/models/gathered_user.py:19 assets/models/group.py:22 #: assets/models/label.py:25 common/db/models.py:72 common/mixins/models.py:50 #: ops/models/adhoc.py:38 ops/models/command.py:29 orgs/models.py:25 #: orgs/models.py:420 perms/models/base.py:56 users/models/group.py:18 -#: users/models/user.py:774 xpack/plugins/cloud/models.py:125 +#: users/models/user.py:774 xpack/plugins/cloud/models.py:117 msgid "Date created" msgstr "创建日期" @@ -547,19 +547,19 @@ msgstr "可连接性" msgid "Date verified" msgstr "校验日期" -#: assets/models/base.py:175 xpack/plugins/change_auth_plan/models.py:72 +#: assets/models/base.py:178 xpack/plugins/change_auth_plan/models.py:72 #: xpack/plugins/change_auth_plan/models.py:197 #: xpack/plugins/change_auth_plan/models.py:292 msgid "SSH private key" msgstr "SSH密钥" -#: assets/models/base.py:176 xpack/plugins/change_auth_plan/models.py:75 +#: assets/models/base.py:179 xpack/plugins/change_auth_plan/models.py:75 #: xpack/plugins/change_auth_plan/models.py:193 #: xpack/plugins/change_auth_plan/models.py:288 msgid "SSH public key" msgstr "SSH公钥" -#: assets/models/base.py:179 assets/models/gathered_user.py:20 +#: assets/models/base.py:182 assets/models/gathered_user.py:20 #: common/db/models.py:73 common/mixins/models.py:51 ops/models/adhoc.py:39 #: orgs/models.py:421 msgid "Date updated" @@ -652,6 +652,15 @@ msgstr "命令复核" msgid "Gateway" msgstr "网关" +#: assets/models/domain.py:84 +#, python-brace-format +msgid "Unable to connect to port {port} on {ip}" +msgstr "无法连接到 {ip} 上的端口 {port}" + +#: assets/models/domain.py:87 +msgid "Authentication failed" +msgstr "认证失败" + #: assets/models/gathered_user.py:16 msgid "Present" msgstr "存在" @@ -1130,12 +1139,12 @@ msgid "MFA" msgstr "多因子认证" #: audits/models.py:106 xpack/plugins/change_auth_plan/models.py:303 -#: xpack/plugins/cloud/models.py:179 +#: xpack/plugins/cloud/models.py:171 msgid "Reason" msgstr "原因" #: audits/models.py:107 tickets/models/ticket.py:47 -#: xpack/plugins/cloud/models.py:175 xpack/plugins/cloud/models.py:224 +#: xpack/plugins/cloud/models.py:167 xpack/plugins/cloud/models.py:216 msgid "Status" msgstr "状态" @@ -1169,7 +1178,7 @@ msgid "Hosts display" msgstr "主机名称" #: audits/serializers.py:89 ops/models/command.py:26 -#: xpack/plugins/cloud/models.py:173 +#: xpack/plugins/cloud/models.py:165 msgid "Result" msgstr "结果" @@ -3382,7 +3391,7 @@ msgstr "" msgid "Endpoint" msgstr "端点" -#: terminal/serializers/storage.py:66 xpack/plugins/cloud/models.py:217 +#: terminal/serializers/storage.py:66 xpack/plugins/cloud/models.py:209 msgid "Region" msgstr "地域" @@ -4797,35 +4806,35 @@ msgstr "地域" msgid "Hostname strategy" msgstr "主机名策略" -#: xpack/plugins/cloud/models.py:110 xpack/plugins/cloud/serializers.py:185 +#: xpack/plugins/cloud/models.py:102 xpack/plugins/cloud/serializers.py:185 msgid "IP network segment group" msgstr "IP网段组" -#: xpack/plugins/cloud/models.py:113 xpack/plugins/cloud/serializers.py:207 +#: xpack/plugins/cloud/models.py:105 xpack/plugins/cloud/serializers.py:207 msgid "Always update" msgstr "总是更新" -#: xpack/plugins/cloud/models.py:119 +#: xpack/plugins/cloud/models.py:111 msgid "Date last sync" msgstr "最后同步日期" -#: xpack/plugins/cloud/models.py:130 xpack/plugins/cloud/models.py:171 +#: xpack/plugins/cloud/models.py:122 xpack/plugins/cloud/models.py:163 msgid "Sync instance task" msgstr "同步实例任务" -#: xpack/plugins/cloud/models.py:182 xpack/plugins/cloud/models.py:227 +#: xpack/plugins/cloud/models.py:174 xpack/plugins/cloud/models.py:219 msgid "Date sync" msgstr "同步日期" -#: xpack/plugins/cloud/models.py:207 +#: xpack/plugins/cloud/models.py:199 msgid "Sync task" msgstr "同步任务" -#: xpack/plugins/cloud/models.py:211 +#: xpack/plugins/cloud/models.py:203 msgid "Sync instance task history" msgstr "同步实例任务历史" -#: xpack/plugins/cloud/models.py:214 +#: xpack/plugins/cloud/models.py:206 msgid "Instance" msgstr "实例"