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] =?UTF-8?q?perf:=20=E4=BF=AE=E6=94=B9=E5=B7=A5=E5=8D=95?= =?UTF-8?q?=E6=8E=88=E6=9D=83=E8=BF=87=E6=9C=9F=E6=97=B6=E9=97=B4=20(#9065?= =?UTF-8?q?)?= 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()