From 8558204450719c2dc0a16b1f39ffea7f2a1ca556 Mon Sep 17 00:00:00 2001 From: fit2bot <68588906+fit2bot@users.noreply.github.com> Date: Tue, 15 Nov 2022 17:30:29 +0800 Subject: [PATCH 1/7] =?UTF-8?q?perf:=20=E4=BF=AE=E6=94=B9=E5=B7=A5?= =?UTF-8?q?=E5=8D=95=E6=8E=88=E6=9D=83=E8=BF=87=E6=9C=9F=E6=97=B6=E9=97=B4?= =?UTF-8?q?=20(#9065)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: feng <1304903146@qq.com> --- apps/jumpserver/conf.py | 1 + apps/jumpserver/settings/custom.py | 1 + apps/locale/ja/LC_MESSAGES/django.mo | 4 +- apps/locale/ja/LC_MESSAGES/django.po | 100 +++++++++++++-------------- apps/locale/zh/LC_MESSAGES/django.mo | 4 +- apps/locale/zh/LC_MESSAGES/django.po | 97 +++++++++++++------------- apps/settings/serializers/other.py | 10 +-- apps/settings/serializers/public.py | 1 + 8 files changed, 113 insertions(+), 105 deletions(-) diff --git a/apps/jumpserver/conf.py b/apps/jumpserver/conf.py index dd8d132a4..fdc2746a8 100644 --- a/apps/jumpserver/conf.py +++ b/apps/jumpserver/conf.py @@ -520,6 +520,7 @@ class Config(dict): 'PERM_SINGLE_ASSET_TO_UNGROUP_NODE': False, 'TICKET_AUTHORIZE_DEFAULT_TIME': 7, + 'TICKET_AUTHORIZE_DEFAULT_TIME_UNIT': 'day', 'WINDOWS_SSH_DEFAULT_SHELL': 'cmd', 'PERIOD_TASK_ENABLED': True, diff --git a/apps/jumpserver/settings/custom.py b/apps/jumpserver/settings/custom.py index 5cf0bc95c..37bb073c6 100644 --- a/apps/jumpserver/settings/custom.py +++ b/apps/jumpserver/settings/custom.py @@ -89,6 +89,7 @@ BACKEND_ASSET_USER_AUTH_VAULT = False PERM_SINGLE_ASSET_TO_UNGROUP_NODE = CONFIG.PERM_SINGLE_ASSET_TO_UNGROUP_NODE TICKET_AUTHORIZE_DEFAULT_TIME = CONFIG.TICKET_AUTHORIZE_DEFAULT_TIME +TICKET_AUTHORIZE_DEFAULT_TIME_UNIT = CONFIG.TICKET_AUTHORIZE_DEFAULT_TIME_UNIT PERM_EXPIRED_CHECK_PERIODIC = CONFIG.PERM_EXPIRED_CHECK_PERIODIC WINDOWS_SSH_DEFAULT_SHELL = CONFIG.WINDOWS_SSH_DEFAULT_SHELL FLOWER_URL = CONFIG.FLOWER_URL diff --git a/apps/locale/ja/LC_MESSAGES/django.mo b/apps/locale/ja/LC_MESSAGES/django.mo index 0b1bfab48..36745934b 100644 --- a/apps/locale/ja/LC_MESSAGES/django.mo +++ b/apps/locale/ja/LC_MESSAGES/django.mo @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b21e8af3ad29606b9ff36bbf5da8dd03a041b25e046c3cedabb8650390c0a4c7 -size 132358 +oid sha256:0a6fa767ad61ceb6e28454df27a050549f9e093577e93a5878b29740689c46b5 +size 132544 diff --git a/apps/locale/ja/LC_MESSAGES/django.po b/apps/locale/ja/LC_MESSAGES/django.po index 2db11ff18..a1b37e2c4 100644 --- a/apps/locale/ja/LC_MESSAGES/django.po +++ b/apps/locale/ja/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-14 17:07+0800\n" +"POT-Creation-Date: 2022-11-15 16:44+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1436,11 +1436,11 @@ msgstr "文章の内容が長すぎる。Elasticsearchで操作履歴を保存 msgid "Tips" msgstr "謎々" -#: audits/handler.py:126 +#: audits/handler.py:134 msgid "Yes" msgstr "是" -#: audits/handler.py:126 +#: audits/handler.py:134 msgid "No" msgstr "否" @@ -1678,8 +1678,8 @@ msgstr "この操作には、MFAを検証する必要があります" msgid "Current user not support mfa type: {}" msgstr "現在のユーザーはmfaタイプをサポートしていません: {}" -#: authentication/api/password.py:31 terminal/api/session.py:224 -#: users/views/profile/reset.py:44 +#: authentication/api/password.py:30 terminal/api/session.py:224 +#: users/views/profile/reset.py:45 users/views/profile/reset.py:119 msgid "User does not exist: {}" msgstr "ユーザーが存在しない: {}" @@ -1695,7 +1695,7 @@ msgstr "" "ユーザーは {}からです。対応するシステムにアクセスしてパスワードを変更してくだ" "さい。" -#: authentication/api/password.py:59 +#: authentication/api/password.py:54 #: authentication/templates/authentication/login.html:256 #: users/templates/users/forgot_password.html:27 #: users/templates/users/forgot_password.html:28 @@ -2019,8 +2019,9 @@ msgstr "メッセージ検証コードが無効" #: authentication/mfa/sms.py:12 authentication/serializers/password_mfa.py:16 #: authentication/serializers/password_mfa.py:24 #: settings/serializers/auth/sms.py:27 users/forms/profile.py:103 -#: users/forms/profile.py:106 users/templates/users/forgot_password.html:111 -#: users/views/profile/reset.py:74 +#: users/forms/profile.py:106 users/templates/users/forgot_password.html:61 +#: users/templates/users/forgot_password.html:111 +#: users/views/profile/reset.py:75 msgid "SMS" msgstr "メッセージ" @@ -2158,6 +2159,7 @@ msgstr "アセットまたはアプリが必要" #: notifications/backends/__init__.py:10 settings/serializers/email.py:19 #: settings/serializers/email.py:50 users/forms/profile.py:102 #: users/forms/profile.py:106 users/models/user.py:675 +#: users/templates/users/forgot_password.html:57 #: users/templates/users/forgot_password.html:116 #: users/views/profile/reset.py:68 msgid "Email" @@ -4007,7 +4009,7 @@ msgstr "ログインログは日数を保持します" #: settings/serializers/cleaning.py:12 settings/serializers/cleaning.py:16 #: settings/serializers/cleaning.py:20 settings/serializers/cleaning.py:24 -#: settings/serializers/cleaning.py:28 settings/serializers/other.py:37 +#: settings/serializers/cleaning.py:28 msgid "Unit: day" msgstr "単位: 日" @@ -4184,19 +4186,31 @@ msgstr "" msgid "Ticket authorize default time" msgstr "デフォルト製造オーダ承認時間" +#: settings/serializers/other.py:40 +msgid "day" +msgstr "日" + +#: settings/serializers/other.py:40 +msgid "hour" +msgstr "時" + #: settings/serializers/other.py:41 +msgid "Ticket authorize default time unit" +msgstr "デフォルト製造オーダ承認時間単位" + +#: settings/serializers/other.py:44 msgid "Help Docs URL" msgstr "ドキュメントリンク" -#: settings/serializers/other.py:42 +#: settings/serializers/other.py:45 msgid "default: http://docs.jumpserver.org" msgstr "デフォルト: http://docs.jumpserver.org" -#: settings/serializers/other.py:46 +#: settings/serializers/other.py:49 msgid "Help Support URL" msgstr "サポートリンク" -#: settings/serializers/other.py:47 +#: settings/serializers/other.py:50 msgid "default: http://www.jumpserver.org/support/" msgstr "デフォルト: http://www.jumpserver.org/support/" @@ -4520,7 +4534,9 @@ msgstr "デフォルトのグラフィック解像度" #: settings/serializers/terminal.py:52 msgid "" "Tip: Default resolution to use when connecting graphical assets in Luna pages" -msgstr "ヒント: Luna ページでグラフィック アセットを接続するときに使用するデフォルトの解像度" +msgstr "" +"ヒント: Luna ページでグラフィック アセットを接続するときに使用するデフォルト" +"の解像度" #: settings/utils/ldap.py:467 msgid "ldap:// or ldaps:// protocol is used." @@ -4709,8 +4725,8 @@ msgstr "期限切れです。" #, python-format msgid "" "\n" -" Your password has expired, please click this link update password.\n" +" Your password has expired, please click this link update password.\n" " " msgstr "" "\n" @@ -4731,37 +4747,38 @@ msgid "" " " msgstr "" "\n" -" クリックしてください リンク パスワードの更新\n" +" クリックしてください リンク パスワードの更新\n" " " #: templates/_message.html:43 #, python-format msgid "" "\n" -" Your information was incomplete. Please click this link to complete your information.\n" +" Your information was incomplete. Please click this link to complete your information.\n" " " msgstr "" "\n" -" あなたの情報が不完全なので、クリックしてください。 リンク 補完\n" +" あなたの情報が不完全なので、クリックしてください。 リンク 補完\n" " " #: templates/_message.html:56 #, python-format msgid "" "\n" -" Your ssh public key not set or expired. Please click this link to update\n" +" Your ssh public key not set or expired. Please click this link to update\n" " " msgstr "" "\n" -" SSHキーが設定されていないか無効になっている場合は、 リンク 更新\n" +" SSHキーが設定されていないか無効になっている場合は、 リンク 更新\n" " " #: templates/_mfa_login_field.html:28 +#: users/templates/users/forgot_password.html:68 msgid "Send verification code" msgstr "確認コードを送信" @@ -5887,7 +5904,7 @@ msgstr "ユーザーパスワード履歴" msgid "Reset password" msgstr "パスワードのリセット" -#: users/notifications.py:85 users/views/profile/reset.py:189 +#: users/notifications.py:85 users/views/profile/reset.py:184 msgid "Reset password success" msgstr "パスワードのリセット成功" @@ -6080,25 +6097,8 @@ msgid "click here to set your password" msgstr "ここをクリックしてパスワードを設定してください" #: users/templates/users/forgot_password.html:32 -msgid "Input your email account, that will send a email to your" -msgstr "電子メールアカウントを入力し、メールをメールアドレスに送信します" - -#: users/templates/users/forgot_password.html:35 -msgid "" -"Enter your mobile number and a verification code will be sent to your phone" -msgstr "携帯電話番号を入力すると認証コードが送信されます" - -#: users/templates/users/forgot_password.html:57 -msgid "Email account" -msgstr "メールアドレスアカウント" - -#: users/templates/users/forgot_password.html:61 -msgid "Mobile number" -msgstr "携帯番号" - -#: users/templates/users/forgot_password.html:68 -msgid "Send" -msgstr "送信" +msgid "Input your email, that will send a mail to your" +msgstr "あなたのメールを入力し、それはあなたにメールを送信します" #: users/templates/users/forgot_password.html:72 #: users/templates/users/forgot_password_previewing.html:30 @@ -6251,23 +6251,23 @@ msgstr "OTP無効化成功、ログインページを返す" msgid "Password invalid" msgstr "パスワード無効" -#: users/views/profile/reset.py:144 users/views/profile/reset.py:155 +#: users/views/profile/reset.py:141 users/views/profile/reset.py:152 msgid "Token invalid or expired" msgstr "トークンが無効または期限切れ" -#: users/views/profile/reset.py:160 +#: users/views/profile/reset.py:157 msgid "User auth from {}, go there change password" msgstr "ユーザー認証ソース {}, 対応するシステムにパスワードを変更してください" -#: users/views/profile/reset.py:167 +#: users/views/profile/reset.py:164 msgid "* Your password does not meet the requirements" msgstr "* パスワードが要件を満たしていない" -#: users/views/profile/reset.py:173 +#: users/views/profile/reset.py:170 msgid "* The new password cannot be the last {} passwords" msgstr "* 新しいパスワードを最後の {} パスワードにすることはできません" -#: users/views/profile/reset.py:190 +#: users/views/profile/reset.py:185 msgid "Reset password success, return to login page" msgstr "パスワードの成功をリセットし、ログインページに戻る" diff --git a/apps/locale/zh/LC_MESSAGES/django.mo b/apps/locale/zh/LC_MESSAGES/django.mo index 40b94f6d7..51e40357d 100644 --- a/apps/locale/zh/LC_MESSAGES/django.mo +++ b/apps/locale/zh/LC_MESSAGES/django.mo @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f9dbc8ef62e3746cebd07177934c7d68c373ff0ecceff4a83aeeb9e96829359b -size 108613 +oid sha256:cd5b2c234f9f4e545b3b95459c26aa729ce30e261f09c49446b0cf4261709343 +size 108827 diff --git a/apps/locale/zh/LC_MESSAGES/django.po b/apps/locale/zh/LC_MESSAGES/django.po index f2255f996..e4b885939 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: 2022-11-14 17:07+0800\n" +"POT-Creation-Date: 2022-11-15 16:44+0800\n" "PO-Revision-Date: 2021-05-20 10:54+0800\n" "Last-Translator: ibuler \n" "Language-Team: JumpServer team\n" @@ -1424,11 +1424,11 @@ msgstr "文字内容太长。请使用 Elasticsearch 存储操作日志" msgid "Tips" msgstr "提示" -#: audits/handler.py:126 +#: audits/handler.py:134 msgid "Yes" msgstr "是" -#: audits/handler.py:126 +#: audits/handler.py:134 msgid "No" msgstr "否" @@ -1666,8 +1666,8 @@ msgstr "此操作需要验证您的 MFA" msgid "Current user not support mfa type: {}" msgstr "当前用户不支持 MFA 类型: {}" -#: authentication/api/password.py:31 terminal/api/session.py:224 -#: users/views/profile/reset.py:44 +#: authentication/api/password.py:30 terminal/api/session.py:224 +#: users/views/profile/reset.py:45 users/views/profile/reset.py:119 msgid "User does not exist: {}" msgstr "用户不存在: {}" @@ -1681,7 +1681,7 @@ msgid "" "password" msgstr "用户来自 {} 请去相应系统修改密码" -#: authentication/api/password.py:59 +#: authentication/api/password.py:54 #: authentication/templates/authentication/login.html:256 #: users/templates/users/forgot_password.html:27 #: users/templates/users/forgot_password.html:28 @@ -1995,8 +1995,9 @@ msgstr "短信验证码校验失败" #: authentication/mfa/sms.py:12 authentication/serializers/password_mfa.py:16 #: authentication/serializers/password_mfa.py:24 #: settings/serializers/auth/sms.py:27 users/forms/profile.py:103 -#: users/forms/profile.py:106 users/templates/users/forgot_password.html:111 -#: users/views/profile/reset.py:74 +#: users/forms/profile.py:106 users/templates/users/forgot_password.html:61 +#: users/templates/users/forgot_password.html:111 +#: users/views/profile/reset.py:75 msgid "SMS" msgstr "短信" @@ -2130,6 +2131,7 @@ msgstr "资产或应用必填" #: notifications/backends/__init__.py:10 settings/serializers/email.py:19 #: settings/serializers/email.py:50 users/forms/profile.py:102 #: users/forms/profile.py:106 users/models/user.py:675 +#: users/templates/users/forgot_password.html:57 #: users/templates/users/forgot_password.html:116 #: users/views/profile/reset.py:68 msgid "Email" @@ -2140,6 +2142,11 @@ msgstr "邮箱" msgid "The {} cannot be empty" msgstr "{} 不能为空" +#: authentication/serializers/password_mfa.py:29 +#: users/templates/users/forgot_password.html:107 +msgid "The {} cannot be empty" +msgstr "{} 不能为空" + #: authentication/serializers/token.py:79 #: perms/serializers/application/permission.py:20 #: perms/serializers/application/permission.py:41 @@ -3959,7 +3966,7 @@ msgstr "登录日志" #: settings/serializers/cleaning.py:12 settings/serializers/cleaning.py:16 #: settings/serializers/cleaning.py:20 settings/serializers/cleaning.py:24 -#: settings/serializers/cleaning.py:28 settings/serializers/other.py:37 +#: settings/serializers/cleaning.py:28 msgid "Unit: day" msgstr "单位: 天" @@ -4128,19 +4135,31 @@ msgstr "" msgid "Ticket authorize default time" msgstr "默认工单授权时间" +#: settings/serializers/other.py:40 +msgid "day" +msgstr "天" + +#: settings/serializers/other.py:40 +msgid "hour" +msgstr "时" + #: settings/serializers/other.py:41 +msgid "Ticket authorize default time unit" +msgstr "默认工单授权时间单位" + +#: settings/serializers/other.py:44 msgid "Help Docs URL" msgstr "文档链接" -#: settings/serializers/other.py:42 +#: settings/serializers/other.py:45 msgid "default: http://docs.jumpserver.org" msgstr "默认: http://dev.jumpserver.org:8080" -#: settings/serializers/other.py:46 +#: settings/serializers/other.py:49 msgid "Help Support URL" msgstr "支持链接" -#: settings/serializers/other.py:47 +#: settings/serializers/other.py:50 msgid "default: http://www.jumpserver.org/support/" msgstr "默认: http://www.jumpserver.org/support/" @@ -4634,13 +4653,13 @@ msgstr "过期。" #, python-format msgid "" "\n" -" Your password has expired, please click this link update password.\n" +" Your password has expired, please click this link update password.\n" " " msgstr "" "\n" -" 您的密码已经过期,请点击 链接 更新密码\n" +" 您的密码已经过期,请点击 链接 更新密码\n" " " #: templates/_message.html:30 @@ -4664,8 +4683,8 @@ msgstr "" #, python-format msgid "" "\n" -" Your information was incomplete. Please click this link to complete your information.\n" +" Your information was incomplete. Please click this link to complete your information.\n" " " msgstr "" "\n" @@ -4677,16 +4696,17 @@ msgstr "" #, python-format msgid "" "\n" -" Your ssh public key not set or expired. Please click this link to update\n" +" Your ssh public key not set or expired. Please click this link to update\n" " " msgstr "" "\n" -" 您的SSH密钥没有设置或已失效,请点击 链接 更新\n" +" 您的SSH密钥没有设置或已失效,请点击 链接 更新\n" " " #: templates/_mfa_login_field.html:28 +#: users/templates/users/forgot_password.html:68 msgid "Send verification code" msgstr "发送验证码" @@ -5796,7 +5816,7 @@ msgstr "用户密码历史" msgid "Reset password" msgstr "重置密码" -#: users/notifications.py:85 users/views/profile/reset.py:189 +#: users/notifications.py:85 users/views/profile/reset.py:184 msgid "Reset password success" msgstr "重置密码成功" @@ -5987,25 +6007,8 @@ msgid "click here to set your password" msgstr "点击这里设置密码" #: users/templates/users/forgot_password.html:32 -msgid "Input your email account, that will send a email to your" -msgstr "输入您的邮箱账号, 将会发一封重置邮件到您的邮箱中" - -#: users/templates/users/forgot_password.html:35 -msgid "" -"Enter your mobile number and a verification code will be sent to your phone" -msgstr "输入您的手机号码,验证码将发送到您的手机" - -#: users/templates/users/forgot_password.html:57 -msgid "Email account" -msgstr "邮箱账号" - -#: users/templates/users/forgot_password.html:61 -msgid "Mobile number" -msgstr "手机号码" - -#: users/templates/users/forgot_password.html:68 -msgid "Send" -msgstr "发送" +msgid "Input your email, that will send a mail to your" +msgstr "输入您的邮箱, 将会发一封重置邮件到您的邮箱中" #: users/templates/users/forgot_password.html:72 #: users/templates/users/forgot_password_previewing.html:30 @@ -6150,23 +6153,23 @@ msgstr "MFA(OTP) 禁用成功,返回登录页面" msgid "Password invalid" msgstr "用户名或密码无效" -#: users/views/profile/reset.py:144 users/views/profile/reset.py:155 +#: users/views/profile/reset.py:141 users/views/profile/reset.py:152 msgid "Token invalid or expired" msgstr "Token错误或失效" -#: users/views/profile/reset.py:160 +#: users/views/profile/reset.py:157 msgid "User auth from {}, go there change password" msgstr "用户认证源来自 {}, 请去相应系统修改密码" -#: users/views/profile/reset.py:167 +#: users/views/profile/reset.py:164 msgid "* Your password does not meet the requirements" msgstr "* 您的密码不符合要求" -#: users/views/profile/reset.py:173 +#: users/views/profile/reset.py:170 msgid "* The new password cannot be the last {} passwords" msgstr "* 新密码不能是最近 {} 次的密码" -#: users/views/profile/reset.py:190 +#: users/views/profile/reset.py:185 msgid "Reset password success, return to login page" msgstr "重置密码成功,返回到登录页面" diff --git a/apps/settings/serializers/other.py b/apps/settings/serializers/other.py index 1eb57a673..c3d2f6b50 100644 --- a/apps/settings/serializers/other.py +++ b/apps/settings/serializers/other.py @@ -33,10 +33,13 @@ class OtherSettingSerializer(serializers.Serializer): ) TICKET_AUTHORIZE_DEFAULT_TIME = serializers.IntegerField( - min_value=7, max_value=9999, required=False, - label=_("Ticket authorize default time"), help_text=_("Unit: day") + min_value=1, max_value=999999, required=False, + label=_("Ticket authorize default time") + ) + TICKET_AUTHORIZE_DEFAULT_TIME_UNIT = serializers.ChoiceField( + choices=[('day', _("day")), ('hour', _("hour"))], + label=_("Ticket authorize default time unit"), required=False, ) - HELP_DOCUMENT_URL = serializers.URLField( required=False, allow_blank=True, allow_null=True, label=_("Help Docs URL"), help_text=_('default: http://docs.jumpserver.org') @@ -51,4 +54,3 @@ class OtherSettingSerializer(serializers.Serializer): # PERIOD_TASK_ENABLED = serializers.BooleanField( # required=False, label=_("Enable period task") # ) - diff --git a/apps/settings/serializers/public.py b/apps/settings/serializers/public.py index 7768375e4..d0eafd018 100644 --- a/apps/settings/serializers/public.py +++ b/apps/settings/serializers/public.py @@ -15,6 +15,7 @@ class PrivateSettingSerializer(PublicSettingSerializer): WINDOWS_SKIP_ALL_MANUAL_PASSWORD = serializers.BooleanField() OLD_PASSWORD_HISTORY_LIMIT_COUNT = serializers.IntegerField() TICKET_AUTHORIZE_DEFAULT_TIME = serializers.IntegerField() + TICKET_AUTHORIZE_DEFAULT_TIME_UNIT = serializers.CharField() SECURITY_MAX_IDLE_TIME = serializers.IntegerField() SECURITY_VIEW_AUTH_NEED_MFA = serializers.BooleanField() SECURITY_MFA_VERIFY_TTL = serializers.IntegerField() From 157d81f1178d7072ae8654e518113b5d60ad186d Mon Sep 17 00:00:00 2001 From: fit2bot <68588906+fit2bot@users.noreply.github.com> Date: Tue, 15 Nov 2022 18:09:06 +0800 Subject: [PATCH 2/7] =?UTF-8?q?fix:=20=E7=BF=BB=E8=AF=91=20(#9067)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: feng <1304903146@qq.com> --- apps/locale/ja/LC_MESSAGES/django.mo | 4 +-- apps/locale/ja/LC_MESSAGES/django.po | 46 ++++++++++++++++--------- apps/locale/zh/LC_MESSAGES/django.mo | 4 +-- apps/locale/zh/LC_MESSAGES/django.po | 51 ++++++++++++++++------------ 4 files changed, 64 insertions(+), 41 deletions(-) diff --git a/apps/locale/ja/LC_MESSAGES/django.mo b/apps/locale/ja/LC_MESSAGES/django.mo index 36745934b..ef4ae4516 100644 --- a/apps/locale/ja/LC_MESSAGES/django.mo +++ b/apps/locale/ja/LC_MESSAGES/django.mo @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0a6fa767ad61ceb6e28454df27a050549f9e093577e93a5878b29740689c46b5 -size 132544 +oid sha256:c612630da01a1ec5265966e044f6cf98d557f7db507e9d23c8ba15d409adfbed +size 132739 diff --git a/apps/locale/ja/LC_MESSAGES/django.po b/apps/locale/ja/LC_MESSAGES/django.po index a1b37e2c4..da2a4cfca 100644 --- a/apps/locale/ja/LC_MESSAGES/django.po +++ b/apps/locale/ja/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-15 16:44+0800\n" +"POT-Creation-Date: 2022-11-15 18:06+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1678,8 +1678,8 @@ msgstr "この操作には、MFAを検証する必要があります" msgid "Current user not support mfa type: {}" msgstr "現在のユーザーはmfaタイプをサポートしていません: {}" -#: authentication/api/password.py:30 terminal/api/session.py:224 -#: users/views/profile/reset.py:45 users/views/profile/reset.py:119 +#: authentication/api/password.py:31 terminal/api/session.py:224 +#: users/views/profile/reset.py:44 msgid "User does not exist: {}" msgstr "ユーザーが存在しない: {}" @@ -1695,7 +1695,7 @@ msgstr "" "ユーザーは {}からです。対応するシステムにアクセスしてパスワードを変更してくだ" "さい。" -#: authentication/api/password.py:54 +#: authentication/api/password.py:59 #: authentication/templates/authentication/login.html:256 #: users/templates/users/forgot_password.html:27 #: users/templates/users/forgot_password.html:28 @@ -2019,9 +2019,8 @@ msgstr "メッセージ検証コードが無効" #: authentication/mfa/sms.py:12 authentication/serializers/password_mfa.py:16 #: authentication/serializers/password_mfa.py:24 #: settings/serializers/auth/sms.py:27 users/forms/profile.py:103 -#: users/forms/profile.py:106 users/templates/users/forgot_password.html:61 -#: users/templates/users/forgot_password.html:111 -#: users/views/profile/reset.py:75 +#: users/forms/profile.py:106 users/templates/users/forgot_password.html:111 +#: users/views/profile/reset.py:74 msgid "SMS" msgstr "メッセージ" @@ -2159,7 +2158,6 @@ msgstr "アセットまたはアプリが必要" #: notifications/backends/__init__.py:10 settings/serializers/email.py:19 #: settings/serializers/email.py:50 users/forms/profile.py:102 #: users/forms/profile.py:106 users/models/user.py:675 -#: users/templates/users/forgot_password.html:57 #: users/templates/users/forgot_password.html:116 #: users/views/profile/reset.py:68 msgid "Email" @@ -4778,7 +4776,6 @@ msgstr "" " " #: templates/_mfa_login_field.html:28 -#: users/templates/users/forgot_password.html:68 msgid "Send verification code" msgstr "確認コードを送信" @@ -5904,7 +5901,7 @@ msgstr "ユーザーパスワード履歴" msgid "Reset password" msgstr "パスワードのリセット" -#: users/notifications.py:85 users/views/profile/reset.py:184 +#: users/notifications.py:85 users/views/profile/reset.py:189 msgid "Reset password success" msgstr "パスワードのリセット成功" @@ -6097,9 +6094,26 @@ msgid "click here to set your password" msgstr "ここをクリックしてパスワードを設定してください" #: users/templates/users/forgot_password.html:32 -msgid "Input your email, that will send a mail to your" +msgid "Input your email account, that will send a email to your" msgstr "あなたのメールを入力し、それはあなたにメールを送信します" +#: users/templates/users/forgot_password.html:35 +msgid "" +"Enter your mobile number and a verification code will be sent to your phone" +msgstr "" + +#: users/templates/users/forgot_password.html:57 +msgid "Email account" +msgstr "アカウント" + +#: users/templates/users/forgot_password.html:61 +msgid "Mobile number" +msgstr "シリアル番号" + +#: users/templates/users/forgot_password.html:68 +msgid "Send" +msgstr "ユーザーを送信" + #: users/templates/users/forgot_password.html:72 #: users/templates/users/forgot_password_previewing.html:30 msgid "Submit" @@ -6251,23 +6265,23 @@ msgstr "OTP無効化成功、ログインページを返す" msgid "Password invalid" msgstr "パスワード無効" -#: users/views/profile/reset.py:141 users/views/profile/reset.py:152 +#: users/views/profile/reset.py:144 users/views/profile/reset.py:155 msgid "Token invalid or expired" msgstr "トークンが無効または期限切れ" -#: users/views/profile/reset.py:157 +#: users/views/profile/reset.py:160 msgid "User auth from {}, go there change password" msgstr "ユーザー認証ソース {}, 対応するシステムにパスワードを変更してください" -#: users/views/profile/reset.py:164 +#: users/views/profile/reset.py:167 msgid "* Your password does not meet the requirements" msgstr "* パスワードが要件を満たしていない" -#: users/views/profile/reset.py:170 +#: users/views/profile/reset.py:173 msgid "* The new password cannot be the last {} passwords" msgstr "* 新しいパスワードを最後の {} パスワードにすることはできません" -#: users/views/profile/reset.py:185 +#: users/views/profile/reset.py:190 msgid "Reset password success, return to login page" msgstr "パスワードの成功をリセットし、ログインページに戻る" diff --git a/apps/locale/zh/LC_MESSAGES/django.mo b/apps/locale/zh/LC_MESSAGES/django.mo index 51e40357d..3b4c0a0d2 100644 --- a/apps/locale/zh/LC_MESSAGES/django.mo +++ b/apps/locale/zh/LC_MESSAGES/django.mo @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:cd5b2c234f9f4e545b3b95459c26aa729ce30e261f09c49446b0cf4261709343 -size 108827 +oid sha256:a77697e0f3332c8679c554fdbd1579b2337cc641a7e42cca2c039360c9056d95 +size 108944 diff --git a/apps/locale/zh/LC_MESSAGES/django.po b/apps/locale/zh/LC_MESSAGES/django.po index e4b885939..c42f82c85 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: 2022-11-15 16:44+0800\n" +"POT-Creation-Date: 2022-11-15 18:06+0800\n" "PO-Revision-Date: 2021-05-20 10:54+0800\n" "Last-Translator: ibuler \n" "Language-Team: JumpServer team\n" @@ -1666,8 +1666,8 @@ msgstr "此操作需要验证您的 MFA" msgid "Current user not support mfa type: {}" msgstr "当前用户不支持 MFA 类型: {}" -#: authentication/api/password.py:30 terminal/api/session.py:224 -#: users/views/profile/reset.py:45 users/views/profile/reset.py:119 +#: authentication/api/password.py:31 terminal/api/session.py:224 +#: users/views/profile/reset.py:44 msgid "User does not exist: {}" msgstr "用户不存在: {}" @@ -1681,7 +1681,7 @@ msgid "" "password" msgstr "用户来自 {} 请去相应系统修改密码" -#: authentication/api/password.py:54 +#: authentication/api/password.py:59 #: authentication/templates/authentication/login.html:256 #: users/templates/users/forgot_password.html:27 #: users/templates/users/forgot_password.html:28 @@ -1995,9 +1995,8 @@ msgstr "短信验证码校验失败" #: authentication/mfa/sms.py:12 authentication/serializers/password_mfa.py:16 #: authentication/serializers/password_mfa.py:24 #: settings/serializers/auth/sms.py:27 users/forms/profile.py:103 -#: users/forms/profile.py:106 users/templates/users/forgot_password.html:61 -#: users/templates/users/forgot_password.html:111 -#: users/views/profile/reset.py:75 +#: users/forms/profile.py:106 users/templates/users/forgot_password.html:111 +#: users/views/profile/reset.py:74 msgid "SMS" msgstr "短信" @@ -2131,7 +2130,6 @@ msgstr "资产或应用必填" #: notifications/backends/__init__.py:10 settings/serializers/email.py:19 #: settings/serializers/email.py:50 users/forms/profile.py:102 #: users/forms/profile.py:106 users/models/user.py:675 -#: users/templates/users/forgot_password.html:57 #: users/templates/users/forgot_password.html:116 #: users/views/profile/reset.py:68 msgid "Email" @@ -2142,11 +2140,6 @@ msgstr "邮箱" msgid "The {} cannot be empty" msgstr "{} 不能为空" -#: authentication/serializers/password_mfa.py:29 -#: users/templates/users/forgot_password.html:107 -msgid "The {} cannot be empty" -msgstr "{} 不能为空" - #: authentication/serializers/token.py:79 #: perms/serializers/application/permission.py:20 #: perms/serializers/application/permission.py:41 @@ -4706,7 +4699,6 @@ msgstr "" " " #: templates/_mfa_login_field.html:28 -#: users/templates/users/forgot_password.html:68 msgid "Send verification code" msgstr "发送验证码" @@ -5816,7 +5808,7 @@ msgstr "用户密码历史" msgid "Reset password" msgstr "重置密码" -#: users/notifications.py:85 users/views/profile/reset.py:184 +#: users/notifications.py:85 users/views/profile/reset.py:189 msgid "Reset password success" msgstr "重置密码成功" @@ -6007,9 +5999,26 @@ msgid "click here to set your password" msgstr "点击这里设置密码" #: users/templates/users/forgot_password.html:32 -msgid "Input your email, that will send a mail to your" +msgid "Input your email account, that will send a email to your" msgstr "输入您的邮箱, 将会发一封重置邮件到您的邮箱中" +#: users/templates/users/forgot_password.html:35 +msgid "" +"Enter your mobile number and a verification code will be sent to your phone" +msgstr "" + +#: users/templates/users/forgot_password.html:57 +msgid "Email account" +msgstr "账号" + +#: users/templates/users/forgot_password.html:61 +msgid "Mobile number" +msgstr "序列号" + +#: users/templates/users/forgot_password.html:68 +msgid "Send" +msgstr "发件人" + #: users/templates/users/forgot_password.html:72 #: users/templates/users/forgot_password_previewing.html:30 msgid "Submit" @@ -6153,23 +6162,23 @@ msgstr "MFA(OTP) 禁用成功,返回登录页面" msgid "Password invalid" msgstr "用户名或密码无效" -#: users/views/profile/reset.py:141 users/views/profile/reset.py:152 +#: users/views/profile/reset.py:144 users/views/profile/reset.py:155 msgid "Token invalid or expired" msgstr "Token错误或失效" -#: users/views/profile/reset.py:157 +#: users/views/profile/reset.py:160 msgid "User auth from {}, go there change password" msgstr "用户认证源来自 {}, 请去相应系统修改密码" -#: users/views/profile/reset.py:164 +#: users/views/profile/reset.py:167 msgid "* Your password does not meet the requirements" msgstr "* 您的密码不符合要求" -#: users/views/profile/reset.py:170 +#: users/views/profile/reset.py:173 msgid "* The new password cannot be the last {} passwords" msgstr "* 新密码不能是最近 {} 次的密码" -#: users/views/profile/reset.py:185 +#: users/views/profile/reset.py:190 msgid "Reset password success, return to login page" msgstr "重置密码成功,返回到登录页面" From 18986bc8055aec45ecd218c5e2cc07a0b3e9d5df Mon Sep 17 00:00:00 2001 From: jiangweidong Date: Wed, 16 Nov 2022 09:37:08 +0800 Subject: [PATCH 3/7] =?UTF-8?q?perf:=20=E5=A2=9E=E5=8A=A0clickhouse?= =?UTF-8?q?=E7=AB=AF=E5=8F=A3=E5=B8=AE=E5=8A=A9=E6=96=87=E6=A1=88=E5=8F=8A?= =?UTF-8?q?=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../attrs/application_type/clickhouse.py | 8 +++++++- apps/locale/ja/LC_MESSAGES/django.po | 18 ++++++++++++------ apps/locale/zh/LC_MESSAGES/django.po | 18 ++++++++++++------ 3 files changed, 31 insertions(+), 13 deletions(-) diff --git a/apps/applications/serializers/attrs/application_type/clickhouse.py b/apps/applications/serializers/attrs/application_type/clickhouse.py index 5593f0fb1..a4a942710 100644 --- a/apps/applications/serializers/attrs/application_type/clickhouse.py +++ b/apps/applications/serializers/attrs/application_type/clickhouse.py @@ -7,4 +7,10 @@ __all__ = ['ClickHouseSerializer'] class ClickHouseSerializer(DBSerializer): - port = serializers.IntegerField(default=9000, label=_('Port'), allow_null=True) + port = serializers.IntegerField( + default=9000, label=_('Port'), allow_null=True, + help_text=_( + 'Typically, the port is 9000,' + 'the HTTP interface and the native interface use different ports' + ), + ) diff --git a/apps/locale/ja/LC_MESSAGES/django.po b/apps/locale/ja/LC_MESSAGES/django.po index da2a4cfca..0b68759b8 100644 --- a/apps/locale/ja/LC_MESSAGES/django.po +++ b/apps/locale/ja/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-15 18:06+0800\n" +"POT-Creation-Date: 2022-11-16 09:29+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -398,7 +398,7 @@ msgid "Host" msgstr "ホスト" #: applications/serializers/attrs/application_category/db.py:12 -#: applications/serializers/attrs/application_type/clickhouse.py:10 +#: applications/serializers/attrs/application_type/clickhouse.py:11 #: applications/serializers/attrs/application_type/mongodb.py:10 #: applications/serializers/attrs/application_type/mysql.py:10 #: applications/serializers/attrs/application_type/mysql_workbench.py:22 @@ -470,6 +470,12 @@ msgstr "Chromeユーザー名" msgid "Chrome password" msgstr "Chromeパスワード" +#: applications/serializers/attrs/application_type/clickhouse.py:13 +msgid "" +"Typically, the port is 9000,the HTTP interface and the native interface use " +"different ports" +msgstr "デフォルトポートは9000で、HTTPインタフェースとネイティブインタフェースは異なるポートを使用する" + #: applications/serializers/attrs/application_type/custom.py:12 msgid "Operating parameter" msgstr "操作パラメータ" @@ -6100,19 +6106,19 @@ msgstr "あなたのメールを入力し、それはあなたにメールを送 #: users/templates/users/forgot_password.html:35 msgid "" "Enter your mobile number and a verification code will be sent to your phone" -msgstr "" +msgstr "携帯電話番号を入力すると、認証コードが携帯電話に送信されます" #: users/templates/users/forgot_password.html:57 msgid "Email account" -msgstr "アカウント" +msgstr "メールアドレス" #: users/templates/users/forgot_password.html:61 msgid "Mobile number" -msgstr "シリアル番号" +msgstr "携帯番号" #: users/templates/users/forgot_password.html:68 msgid "Send" -msgstr "ユーザーを送信" +msgstr "送信" #: users/templates/users/forgot_password.html:72 #: users/templates/users/forgot_password_previewing.html:30 diff --git a/apps/locale/zh/LC_MESSAGES/django.po b/apps/locale/zh/LC_MESSAGES/django.po index c42f82c85..097dda878 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: 2022-11-15 18:06+0800\n" +"POT-Creation-Date: 2022-11-16 09:32+0800\n" "PO-Revision-Date: 2021-05-20 10:54+0800\n" "Last-Translator: ibuler \n" "Language-Team: JumpServer team\n" @@ -393,7 +393,7 @@ msgid "Host" msgstr "主机" #: applications/serializers/attrs/application_category/db.py:12 -#: applications/serializers/attrs/application_type/clickhouse.py:10 +#: applications/serializers/attrs/application_type/clickhouse.py:11 #: applications/serializers/attrs/application_type/mongodb.py:10 #: applications/serializers/attrs/application_type/mysql.py:10 #: applications/serializers/attrs/application_type/mysql_workbench.py:22 @@ -465,6 +465,12 @@ msgstr "Chrome 用户名" msgid "Chrome password" msgstr "Chrome 密码" +#: applications/serializers/attrs/application_type/clickhouse.py:13 +msgid "" +"Typically, the port is 9000,the HTTP interface and the native interface use " +"different ports" +msgstr "默认端口为9000, HTTP接口和本机接口使用不同的端口" + #: applications/serializers/attrs/application_type/custom.py:12 msgid "Operating parameter" msgstr "运行参数" @@ -6005,19 +6011,19 @@ msgstr "输入您的邮箱, 将会发一封重置邮件到您的邮箱中" #: users/templates/users/forgot_password.html:35 msgid "" "Enter your mobile number and a verification code will be sent to your phone" -msgstr "" +msgstr "输入您的手机号码,验证码将发送到您的手机" #: users/templates/users/forgot_password.html:57 msgid "Email account" -msgstr "账号" +msgstr "邮箱账号" #: users/templates/users/forgot_password.html:61 msgid "Mobile number" -msgstr "序列号" +msgstr "手机号码" #: users/templates/users/forgot_password.html:68 msgid "Send" -msgstr "发件人" +msgstr "发送" #: users/templates/users/forgot_password.html:72 #: users/templates/users/forgot_password_previewing.html:30 From ad7647c0cc31c05b3949ee96ef26cb249fa6a1d5 Mon Sep 17 00:00:00 2001 From: "Jiangjie.Bai" Date: Wed, 16 Nov 2022 20:34:52 +0800 Subject: [PATCH 4/7] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=AC=AC=E4=B8=89?= =?UTF-8?q?=E6=96=B9=E7=94=A8=E6=88=B7=E5=BF=98=E8=AE=B0=E5=AF=86=E7=A0=81?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E7=9A=84=E6=8F=90=E7=A4=BA=EF=BC=8C=E4=B8=8D?= =?UTF-8?q?=E5=85=81=E8=AE=B8=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/locale/ja/LC_MESSAGES/django.mo | 4 +- apps/locale/ja/LC_MESSAGES/django.po | 55 ++++++++++++++++------------ apps/locale/zh/LC_MESSAGES/django.mo | 4 +- apps/locale/zh/LC_MESSAGES/django.po | 46 +++++++++++++---------- apps/users/views/profile/reset.py | 5 +++ 5 files changed, 67 insertions(+), 47 deletions(-) diff --git a/apps/locale/ja/LC_MESSAGES/django.mo b/apps/locale/ja/LC_MESSAGES/django.mo index ef4ae4516..a922b4d2e 100644 --- a/apps/locale/ja/LC_MESSAGES/django.mo +++ b/apps/locale/ja/LC_MESSAGES/django.mo @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c612630da01a1ec5265966e044f6cf98d557f7db507e9d23c8ba15d409adfbed -size 132739 +oid sha256:7db985efdf818137dafe489f339955f4d71a245ffd6becc8f6efac539a625682 +size 133463 diff --git a/apps/locale/ja/LC_MESSAGES/django.po b/apps/locale/ja/LC_MESSAGES/django.po index 0b68759b8..c7b3c58a2 100644 --- a/apps/locale/ja/LC_MESSAGES/django.po +++ b/apps/locale/ja/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-16 09:29+0800\n" +"POT-Creation-Date: 2022-11-16 20:24+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -474,7 +474,9 @@ msgstr "Chromeパスワード" msgid "" "Typically, the port is 9000,the HTTP interface and the native interface use " "different ports" -msgstr "デフォルトポートは9000で、HTTPインタフェースとネイティブインタフェースは異なるポートを使用する" +msgstr "" +"デフォルトポートは9000で、HTTPインタフェースとネイティブインタフェースは異な" +"るポートを使用する" #: applications/serializers/attrs/application_type/custom.py:12 msgid "Operating parameter" @@ -1689,7 +1691,7 @@ msgstr "現在のユーザーはmfaタイプをサポートしていません: { msgid "User does not exist: {}" msgstr "ユーザーが存在しない: {}" -#: authentication/api/password.py:31 users/views/profile/reset.py:122 +#: authentication/api/password.py:31 users/views/profile/reset.py:127 msgid "No user matched" msgstr "ユーザーにマッチしなかった" @@ -2026,7 +2028,7 @@ msgstr "メッセージ検証コードが無効" #: authentication/serializers/password_mfa.py:24 #: settings/serializers/auth/sms.py:27 users/forms/profile.py:103 #: users/forms/profile.py:106 users/templates/users/forgot_password.html:111 -#: users/views/profile/reset.py:74 +#: users/views/profile/reset.py:79 msgid "SMS" msgstr "メッセージ" @@ -2165,7 +2167,7 @@ msgstr "アセットまたはアプリが必要" #: settings/serializers/email.py:50 users/forms/profile.py:102 #: users/forms/profile.py:106 users/models/user.py:675 #: users/templates/users/forgot_password.html:116 -#: users/views/profile/reset.py:68 +#: users/views/profile/reset.py:73 msgid "Email" msgstr "メール" @@ -4729,8 +4731,8 @@ msgstr "期限切れです。" #, python-format msgid "" "\n" -" Your password has expired, please click this link update password.\n" +" Your password has expired, please click this link update password.\n" " " msgstr "" "\n" @@ -4751,34 +4753,34 @@ msgid "" " " msgstr "" "\n" -" クリックしてください リンク パスワードの更新\n" +" クリックしてください リンク パスワードの更新\n" " " #: templates/_message.html:43 #, python-format msgid "" "\n" -" Your information was incomplete. Please click this link to complete your information.\n" +" Your information was incomplete. Please click this link to complete your information.\n" " " msgstr "" "\n" -" あなたの情報が不完全なので、クリックしてください。 リンク 補完\n" +" あなたの情報が不完全なので、クリックしてください。 リンク 補完\n" " " #: templates/_message.html:56 #, python-format msgid "" "\n" -" Your ssh public key not set or expired. Please click this link to update\n" +" Your ssh public key not set or expired. Please click this link to update\n" " " msgstr "" "\n" -" SSHキーが設定されていないか無効になっている場合は、 リンク 更新\n" +" SSHキーが設定されていないか無効になっている場合は、 リンク 更新\n" " " #: templates/_mfa_login_field.html:28 @@ -5907,7 +5909,7 @@ msgstr "ユーザーパスワード履歴" msgid "Reset password" msgstr "パスワードのリセット" -#: users/notifications.py:85 users/views/profile/reset.py:189 +#: users/notifications.py:85 users/views/profile/reset.py:194 msgid "Reset password success" msgstr "パスワードのリセット成功" @@ -6271,23 +6273,30 @@ msgstr "OTP無効化成功、ログインページを返す" msgid "Password invalid" msgstr "パスワード無効" -#: users/views/profile/reset.py:144 users/views/profile/reset.py:155 +#: users/views/profile/reset.py:47 +msgid "" +"Non-local users can log in only from third-party platforms and cannot change " +"their passwords: {}" +msgstr "ローカル以外のユーザーは、サードパーティ プラットフォームからのログインのみが許可され、" +"パスワードの変更はサポートされていません: {}" + +#: users/views/profile/reset.py:149 users/views/profile/reset.py:160 msgid "Token invalid or expired" msgstr "トークンが無効または期限切れ" -#: users/views/profile/reset.py:160 +#: users/views/profile/reset.py:165 msgid "User auth from {}, go there change password" msgstr "ユーザー認証ソース {}, 対応するシステムにパスワードを変更してください" -#: users/views/profile/reset.py:167 +#: users/views/profile/reset.py:172 msgid "* Your password does not meet the requirements" msgstr "* パスワードが要件を満たしていない" -#: users/views/profile/reset.py:173 +#: users/views/profile/reset.py:178 msgid "* The new password cannot be the last {} passwords" msgstr "* 新しいパスワードを最後の {} パスワードにすることはできません" -#: users/views/profile/reset.py:190 +#: users/views/profile/reset.py:195 msgid "Reset password success, return to login page" msgstr "パスワードの成功をリセットし、ログインページに戻る" diff --git a/apps/locale/zh/LC_MESSAGES/django.mo b/apps/locale/zh/LC_MESSAGES/django.mo index 3b4c0a0d2..a06c70b86 100644 --- a/apps/locale/zh/LC_MESSAGES/django.mo +++ b/apps/locale/zh/LC_MESSAGES/django.mo @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a77697e0f3332c8679c554fdbd1579b2337cc641a7e42cca2c039360c9056d95 -size 108944 +oid sha256:b143c62843946c3e18b623d05065f12e9d3c578efe5cd0d2016056d2b8448ae8 +size 109495 diff --git a/apps/locale/zh/LC_MESSAGES/django.po b/apps/locale/zh/LC_MESSAGES/django.po index 097dda878..ac9bd433c 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: 2022-11-16 09:32+0800\n" +"POT-Creation-Date: 2022-11-16 20:24+0800\n" "PO-Revision-Date: 2021-05-20 10:54+0800\n" "Last-Translator: ibuler \n" "Language-Team: JumpServer team\n" @@ -1677,7 +1677,7 @@ msgstr "当前用户不支持 MFA 类型: {}" msgid "User does not exist: {}" msgstr "用户不存在: {}" -#: authentication/api/password.py:31 users/views/profile/reset.py:122 +#: authentication/api/password.py:31 users/views/profile/reset.py:127 msgid "No user matched" msgstr "没有匹配到用户" @@ -2002,7 +2002,7 @@ msgstr "短信验证码校验失败" #: authentication/serializers/password_mfa.py:24 #: settings/serializers/auth/sms.py:27 users/forms/profile.py:103 #: users/forms/profile.py:106 users/templates/users/forgot_password.html:111 -#: users/views/profile/reset.py:74 +#: users/views/profile/reset.py:79 msgid "SMS" msgstr "短信" @@ -2137,7 +2137,7 @@ msgstr "资产或应用必填" #: settings/serializers/email.py:50 users/forms/profile.py:102 #: users/forms/profile.py:106 users/models/user.py:675 #: users/templates/users/forgot_password.html:116 -#: users/views/profile/reset.py:68 +#: users/views/profile/reset.py:73 msgid "Email" msgstr "邮箱" @@ -4652,13 +4652,13 @@ msgstr "过期。" #, python-format msgid "" "\n" -" Your password has expired, please click this link update password.\n" +" Your password has expired, please click this link update password.\n" " " msgstr "" "\n" -" 您的密码已经过期,请点击 链接 更新密码\n" +" 您的密码已经过期,请点击 链接 更新密码\n" " " #: templates/_message.html:30 @@ -4682,8 +4682,8 @@ msgstr "" #, python-format msgid "" "\n" -" Your information was incomplete. Please click this link to complete your information.\n" +" Your information was incomplete. Please click this link to complete your information.\n" " " msgstr "" "\n" @@ -4695,13 +4695,13 @@ msgstr "" #, python-format msgid "" "\n" -" Your ssh public key not set or expired. Please click this link to update\n" +" Your ssh public key not set or expired. Please click this link to update\n" " " msgstr "" "\n" -" 您的SSH密钥没有设置或已失效,请点击 链接 更新\n" +" 您的SSH密钥没有设置或已失效,请点击 链接 更新\n" " " #: templates/_mfa_login_field.html:28 @@ -5814,7 +5814,7 @@ msgstr "用户密码历史" msgid "Reset password" msgstr "重置密码" -#: users/notifications.py:85 users/views/profile/reset.py:189 +#: users/notifications.py:85 users/views/profile/reset.py:194 msgid "Reset password success" msgstr "重置密码成功" @@ -6168,23 +6168,29 @@ msgstr "MFA(OTP) 禁用成功,返回登录页面" msgid "Password invalid" msgstr "用户名或密码无效" -#: users/views/profile/reset.py:144 users/views/profile/reset.py:155 +#: users/views/profile/reset.py:47 +msgid "" +"Non-local users can log in only from third-party platforms and cannot change " +"their passwords: {}" +msgstr "非本地用户仅允许从第三方平台登录,不支持修改密码: {}" + +#: users/views/profile/reset.py:149 users/views/profile/reset.py:160 msgid "Token invalid or expired" msgstr "Token错误或失效" -#: users/views/profile/reset.py:160 +#: users/views/profile/reset.py:165 msgid "User auth from {}, go there change password" msgstr "用户认证源来自 {}, 请去相应系统修改密码" -#: users/views/profile/reset.py:167 +#: users/views/profile/reset.py:172 msgid "* Your password does not meet the requirements" msgstr "* 您的密码不符合要求" -#: users/views/profile/reset.py:173 +#: users/views/profile/reset.py:178 msgid "* The new password cannot be the last {} passwords" msgstr "* 新密码不能是最近 {} 次的密码" -#: users/views/profile/reset.py:190 +#: users/views/profile/reset.py:195 msgid "Reset password success, return to login page" msgstr "重置密码成功,返回到登录页面" diff --git a/apps/users/views/profile/reset.py b/apps/users/views/profile/reset.py index fd68efb87..2972225ef 100644 --- a/apps/users/views/profile/reset.py +++ b/apps/users/views/profile/reset.py @@ -43,6 +43,11 @@ class UserForgotPasswordPreviewingView(FormView): if not user: form.add_error('username', _('User does not exist: {}').format(username)) return super().form_invalid(form) + if settings.ONLY_ALLOW_AUTH_FROM_SOURCE and not user.is_local: + error = _('Non-local users can log in only from third-party platforms ' + 'and cannot change their passwords: {}').format(username) + form.add_error('username', error) + return super().form_invalid(form) token = random_string(36) user_map = {'username': user.username, 'phone': user.phone, 'email': user.email} From 2454a07d38b6e430fbd757c94510cbe6a669c5b4 Mon Sep 17 00:00:00 2001 From: jiangweidong Date: Fri, 11 Nov 2022 16:54:38 +0800 Subject: [PATCH 5/7] =?UTF-8?q?feat:=20=E6=94=AF=E6=8C=81=E5=85=B7?= =?UTF-8?q?=E6=9C=89=E8=B6=85=E7=BA=A7=E5=B7=A5=E5=8D=95=E6=9D=83=E9=99=90?= =?UTF-8?q?=E7=9A=84=E7=94=A8=E6=88=B7=E7=94=B3=E8=AF=B7=E5=B7=A5=E5=8D=95?= =?UTF-8?q?=E5=8F=AF=E4=BB=A5=E6=8C=87=E5=AE=9A=E7=94=B3=E8=AF=B7=E4=BA=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/tickets/api/ticket.py | 2 -- apps/tickets/serializers/ticket/ticket.py | 13 +++++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/apps/tickets/api/ticket.py b/apps/tickets/api/ticket.py index d6e623892..e4dc94852 100644 --- a/apps/tickets/api/ticket.py +++ b/apps/tickets/api/ticket.py @@ -63,8 +63,6 @@ class TicketViewSet(CommonApiMixin, viewsets.ModelViewSet): def perform_create(self, serializer): instance = serializer.save() - instance.applicant = self.request.user - instance.save(update_fields=['applicant']) instance.open() @action(detail=False, methods=[POST], permission_classes=[RBACPermission, ]) diff --git a/apps/tickets/serializers/ticket/ticket.py b/apps/tickets/serializers/ticket/ticket.py index a0760e4d0..007be5aa8 100644 --- a/apps/tickets/serializers/ticket/ticket.py +++ b/apps/tickets/serializers/ticket/ticket.py @@ -3,6 +3,7 @@ from django.utils.translation import ugettext_lazy as _ from rest_framework import serializers +from users.models import User from orgs.models import Organization from orgs.mixins.serializers import OrgResourceModelSerializerMixin from tickets.models import Ticket, TicketFlow @@ -70,6 +71,7 @@ class TicketApplySerializer(TicketSerializer): org_id = serializers.CharField( required=True, max_length=36, allow_blank=True, label=_("Organization") ) + applicant = serializers.CharField(required=False, allow_blank=True) class Meta: model = Ticket @@ -78,6 +80,15 @@ class TicketApplySerializer(TicketSerializer): 'type': {'required': True} } + def get_applicant(self, applicant_id): + current_user = self.context['request'].user + want_applicant = User.objects.filter(id=applicant_id).first() + if want_applicant and current_user.has_perm('tickets.add_superticket'): + applicant = want_applicant + else: + applicant = current_user + return applicant + @staticmethod def validate_org_id(org_id): org = Organization.get_instance(org_id) @@ -98,4 +109,6 @@ class TicketApplySerializer(TicketSerializer): else: error = _('The ticket flow `{}` does not exist'.format(ticket_type)) raise serializers.ValidationError(error) + + attrs['applicant'] = self.get_applicant(attrs.get('applicant')) return attrs From 9e80b70c12dd86fc18a076ba56c0ce760b3ddf9a Mon Sep 17 00:00:00 2001 From: "Jiangjie.Bai" Date: Wed, 16 Nov 2022 20:47:06 +0800 Subject: [PATCH 6/7] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E5=89=8D=E4=B8=80=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../0002_auto_20171225_1157_squashed_0019_auto_20190304_1459.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/users/migrations/0002_auto_20171225_1157_squashed_0019_auto_20190304_1459.py b/apps/users/migrations/0002_auto_20171225_1157_squashed_0019_auto_20190304_1459.py index 399605915..d4bc961ef 100644 --- a/apps/users/migrations/0002_auto_20171225_1157_squashed_0019_auto_20190304_1459.py +++ b/apps/users/migrations/0002_auto_20171225_1157_squashed_0019_auto_20190304_1459.py @@ -49,7 +49,7 @@ class Migration(migrations.Migration): migrations.AlterField( model_name='user', name='is_first_login', - field=models.BooleanField(default=True), + field=models.BooleanField(default=True, verbose_name='Is first login'), ), migrations.AlterField( model_name='usergroup', From a2b9a5cee32121c76ef076af09b690569a3c13ee Mon Sep 17 00:00:00 2001 From: "Jiangjie.Bai" Date: Wed, 16 Nov 2022 20:57:41 +0800 Subject: [PATCH 7/7] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BA=93=E7=94=B1=E4=BA=8E=E7=AB=AF=E5=8F=A3?= =?UTF-8?q?=E6=95=B0=E9=87=8F=E9=99=90=E5=88=B6=E5=AF=BC=E8=87=B4=E4=B8=8D?= =?UTF-8?q?=E8=83=BD=E5=88=A0=E9=99=A4=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/terminal/utils/db_port_mapper.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/apps/terminal/utils/db_port_mapper.py b/apps/terminal/utils/db_port_mapper.py index 9a47150f7..973e25c2a 100644 --- a/apps/terminal/utils/db_port_mapper.py +++ b/apps/terminal/utils/db_port_mapper.py @@ -51,22 +51,23 @@ class DBPortManager(object): def pop(self, db: Application): mapper = self.get_mapper() - to_delete_port = self.get_port_by_db(db) + to_delete_port = self.get_port_by_db(db, raise_exception=False) mapper.pop(to_delete_port, None) self.set_mapper(mapper) - def get_port_by_db(self, db): + def get_port_by_db(self, db, raise_exception=True): mapper = self.get_mapper() for port, db_id in mapper.items(): if db_id == str(db.id): return port - error = _( - 'No available port is matched. ' - 'The number of databases may have exceeded the number of ports ' - 'open to the database agent service, ' - 'Contact the administrator to open more ports.' - ) - raise JMSException(error) + if raise_exception: + error = _( + 'No available port is matched. ' + 'The number of databases may have exceeded the number of ports ' + 'open to the database agent service, ' + 'Contact the administrator to open more ports.' + ) + raise JMSException(error) def get_db_by_port(self, port): try: