From 2c2c3eb21a19e932cd038faa6cfd7519ed6d5a94 Mon Sep 17 00:00:00 2001 From: fit2bot <68588906+fit2bot@users.noreply.github.com> Date: Wed, 17 Jan 2024 19:18:00 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E7=BF=BB=E8=AF=91=20(#12564)?= 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 | 72 ++++++++++++++-------------- apps/locale/zh/LC_MESSAGES/django.mo | 4 +- apps/locale/zh/LC_MESSAGES/django.po | 72 ++++++++++++++-------------- apps/users/signal_handlers.py | 4 +- 5 files changed, 80 insertions(+), 76 deletions(-) diff --git a/apps/locale/ja/LC_MESSAGES/django.mo b/apps/locale/ja/LC_MESSAGES/django.mo index ba844d417..0f74a7c63 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:18c4618e0d0470e25d99b143e83de9a439ac691e5cb1d92ea5406cc32338e8f8 -size 170813 +oid sha256:7879f4eeb499e920ad6c4bfdb0b1f334936ca344c275be056f12fcf7485f2bf6 +size 170948 diff --git a/apps/locale/ja/LC_MESSAGES/django.po b/apps/locale/ja/LC_MESSAGES/django.po index 54a52ff27..c6a6dfe37 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: 2024-01-11 18:58+0800\n" +"POT-Creation-Date: 2024-01-17 19:11+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -363,7 +363,7 @@ msgstr "アカウントバックアップ計画" #: ops/models/base.py:55 ops/models/celery.py:63 ops/models/job.py:235 #: ops/templates/ops/celery_task_log.html:75 #: perms/models/asset_permission.py:78 -#: settings/templates/ldap/_msg_import_ldap_user.html:25 +#: settings/templates/ldap/_msg_import_ldap_user.html:5 #: terminal/models/applet/host.py:141 terminal/models/session/session.py:44 #: tickets/models/ticket/apply_application.py:30 #: tickets/models/ticket/apply_asset.py:19 @@ -373,7 +373,7 @@ msgstr "開始日" #: accounts/models/automations/backup_account.py:122 #: authentication/templates/authentication/_msg_oauth_bind.html:11 #: notifications/notifications.py:186 -#: settings/templates/ldap/_msg_import_ldap_user.html:23 +#: settings/templates/ldap/_msg_import_ldap_user.html:3 msgid "Time" msgstr "時間" @@ -495,7 +495,7 @@ msgstr "ステータス" #: authentication/templates/authentication/passkey.html:173 #: authentication/views/base.py:42 authentication/views/base.py:43 #: authentication/views/base.py:44 common/const/choices.py:20 -#: settings/templates/ldap/_msg_import_ldap_user.html:16 +#: settings/templates/ldap/_msg_import_ldap_user.html:22 msgid "Error" msgstr "間違い" @@ -873,7 +873,7 @@ msgid "Key password" msgstr "キーパスワード" #: accounts/serializers/account/base.py:78 -#: assets/serializers/asset/common.py:381 +#: assets/serializers/asset/common.py:384 msgid "Spec info" msgstr "特別情報" @@ -989,17 +989,17 @@ msgstr "自動タスク実行履歴" msgid "Success" msgstr "成功" -#: accounts/signal_handlers.py:46 +#: accounts/signal_handlers.py:47 #, python-format msgid "Push related accounts to assets: %s, by system" msgstr "関連するアカウントをアセットにプッシュ: %s, by system" -#: accounts/signal_handlers.py:55 +#: accounts/signal_handlers.py:56 #, python-format msgid "Add account: %s" msgstr "アカウントを追加: %s" -#: accounts/signal_handlers.py:57 +#: accounts/signal_handlers.py:58 #, python-format msgid "Delete account: %s" msgstr "アカウントを削除: %s" @@ -1750,7 +1750,7 @@ msgstr "ドメイン" msgid "Node" msgstr "ノード" -#: assets/models/asset/common.py:167 assets/serializers/asset/common.py:382 +#: assets/models/asset/common.py:167 assets/serializers/asset/common.py:385 #: assets/serializers/asset/host.py:11 msgid "Gathered info" msgstr "資産ハードウェア情報の収集" @@ -2085,23 +2085,23 @@ msgid "Node path" msgstr "ノードパスです" #: assets/serializers/asset/common.py:148 -#: assets/serializers/asset/common.py:383 +#: assets/serializers/asset/common.py:386 msgid "Auto info" msgstr "自動情報" -#: assets/serializers/asset/common.py:242 +#: assets/serializers/asset/common.py:245 msgid "Platform not exist" msgstr "プラットフォームが存在しません" -#: assets/serializers/asset/common.py:278 +#: assets/serializers/asset/common.py:281 msgid "port out of range (0-65535)" msgstr "ポート番号が範囲外です (0-65535)" -#: assets/serializers/asset/common.py:285 +#: assets/serializers/asset/common.py:288 msgid "Protocol is required: {}" msgstr "プロトコルが必要です: {}" -#: assets/serializers/asset/common.py:313 +#: assets/serializers/asset/common.py:316 msgid "Invalid data" msgstr "無効なデータ" @@ -2611,8 +2611,8 @@ msgstr "認証トークン" #: audits/signal_handlers/login_log.py:37 authentication/notifications.py:73 #: authentication/views/login.py:77 notifications/backends/__init__.py:11 -#: settings/notifications.py:68 settings/serializers/auth/wecom.py:10 -#: users/models/user.py:749 users/models/user.py:855 +#: settings/serializers/auth/wecom.py:10 users/models/user.py:749 +#: users/models/user.py:855 msgid "WeCom" msgstr "企業微信" @@ -2648,9 +2648,9 @@ msgstr "仮パスワード" msgid "Passkey" msgstr "Passkey" -#: audits/tasks.py:101 users/signal_handlers.py:166 +#: audits/tasks.py:101 msgid "Clean audits session task log" -msgstr "監査セッション タスク ログのクリーンアップ" +msgstr "資産監査セッションタスクログのクリーンアップ" #: audits/tasks.py:114 msgid "Upload FTP file to external storage" @@ -3176,7 +3176,7 @@ msgstr "確認済み" msgid "Different city login reminder" msgstr "異なる都市ログインのリマインダー" -#: authentication/notifications.py:52 settings/notifications.py:47 +#: authentication/notifications.py:52 msgid "binding reminder" msgstr "バインディングリマインダー" @@ -4387,7 +4387,7 @@ msgid "Is finished" msgstr "終了しました" #: ops/serializers/job.py:66 -#: settings/templates/ldap/_msg_import_ldap_user.html:27 +#: settings/templates/ldap/_msg_import_ldap_user.html:7 msgid "Time cost" msgstr "時を過ごす" @@ -4976,7 +4976,7 @@ msgstr "他の設定を変えることができます" msgid "Chat prompt" msgstr "チャットのヒント" -#: settings/notifications.py:22 +#: settings/notifications.py:23 msgid "Notification of Synchronized LDAP User Task Results" msgstr "LDAPユーザータスクの結果通知を同期する" @@ -5639,10 +5639,8 @@ msgid "Enable virtual app" msgstr "仮想アプリケーションの有効化" #: settings/serializers/msg.py:25 -#, fuzzy -#| msgid "SMTP host" msgid "SMTP" -msgstr "SMTPホスト" +msgstr "SMTP" #: settings/serializers/msg.py:26 msgid "EXCHANGE" @@ -6089,7 +6087,7 @@ msgstr "Razor の有効化" msgid "Enable SSH Client" msgstr "SSH Clientの有効化" -#: settings/tasks/ldap.py:29 +#: settings/tasks/ldap.py:28 msgid "Periodic import ldap user" msgstr "LDAP ユーザーを定期的にインポートする" @@ -6101,19 +6099,19 @@ msgstr "登録サイクルLDAPユーザータスクのインポート" msgid "Sync task Finish" msgstr "同期タスクが完了しました" -#: settings/templates/ldap/_msg_import_ldap_user.html:3 -msgid "Synced Organization" -msgstr "組織が同期されました" - -#: settings/templates/ldap/_msg_import_ldap_user.html:9 -msgid "Synced User" -msgstr "同期されたユーザー" - -#: settings/templates/ldap/_msg_import_ldap_user.html:26 +#: settings/templates/ldap/_msg_import_ldap_user.html:6 #: terminal/models/session/session.py:45 msgid "Date end" msgstr "終了日" +#: settings/templates/ldap/_msg_import_ldap_user.html:9 +msgid "Synced Organization" +msgstr "組織が同期されました" + +#: settings/templates/ldap/_msg_import_ldap_user.html:15 +msgid "Synced User" +msgstr "同期されたユーザー" + #: settings/utils/ldap.py:494 msgid "ldap:// or ldaps:// protocol is used." msgstr "ldap:// または ldaps:// プロトコルが使用されます。" @@ -8078,6 +8076,10 @@ msgstr "" "管理者は「既存のユーザーのみログインを許可」をオンにしており、現在のユーザー" "はユーザーリストにありません。管理者に連絡してください。" +#: users/signal_handlers.py:166 +msgid "Clean up expired user sessions" +msgstr "期限切れのユーザー・セッションのパージ" + #: users/tasks.py:25 msgid "Check password expired" msgstr "パスワードの有効期限が切れていることを確認する" @@ -8509,7 +8511,7 @@ msgstr "そして" msgid "Or" msgstr "または" -#: xpack/plugins/cloud/manager.py:57 +#: xpack/plugins/cloud/manager.py:56 msgid "Account unavailable" msgstr "利用できないアカウント" diff --git a/apps/locale/zh/LC_MESSAGES/django.mo b/apps/locale/zh/LC_MESSAGES/django.mo index efb8daa9d..bf09fbd89 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:933315b682ee1387f7433b5a870d8597c07634f4fede4c56a42b4cab540e4208 -size 140012 +oid sha256:19d3a111cc245f9a9d36b860fd95447df916ad66c918bef672bacdad6bc77a8f +size 140119 diff --git a/apps/locale/zh/LC_MESSAGES/django.po b/apps/locale/zh/LC_MESSAGES/django.po index aabbbb733..73f1032a6 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: 2024-01-11 18:58+0800\n" +"POT-Creation-Date: 2024-01-17 19:11+0800\n" "PO-Revision-Date: 2021-05-20 10:54+0800\n" "Last-Translator: ibuler \n" "Language-Team: JumpServer team\n" @@ -362,7 +362,7 @@ msgstr "账号备份计划" #: ops/models/base.py:55 ops/models/celery.py:63 ops/models/job.py:235 #: ops/templates/ops/celery_task_log.html:75 #: perms/models/asset_permission.py:78 -#: settings/templates/ldap/_msg_import_ldap_user.html:25 +#: settings/templates/ldap/_msg_import_ldap_user.html:5 #: terminal/models/applet/host.py:141 terminal/models/session/session.py:44 #: tickets/models/ticket/apply_application.py:30 #: tickets/models/ticket/apply_asset.py:19 @@ -372,7 +372,7 @@ msgstr "开始日期" #: accounts/models/automations/backup_account.py:122 #: authentication/templates/authentication/_msg_oauth_bind.html:11 #: notifications/notifications.py:186 -#: settings/templates/ldap/_msg_import_ldap_user.html:23 +#: settings/templates/ldap/_msg_import_ldap_user.html:3 msgid "Time" msgstr "时间" @@ -494,7 +494,7 @@ msgstr "状态" #: authentication/templates/authentication/passkey.html:173 #: authentication/views/base.py:42 authentication/views/base.py:43 #: authentication/views/base.py:44 common/const/choices.py:20 -#: settings/templates/ldap/_msg_import_ldap_user.html:16 +#: settings/templates/ldap/_msg_import_ldap_user.html:22 msgid "Error" msgstr "错误" @@ -871,7 +871,7 @@ msgid "Key password" msgstr "密钥密码" #: accounts/serializers/account/base.py:78 -#: assets/serializers/asset/common.py:381 +#: assets/serializers/asset/common.py:384 msgid "Spec info" msgstr "特殊信息" @@ -986,17 +986,17 @@ msgstr "自动化任务执行历史" msgid "Success" msgstr "成功" -#: accounts/signal_handlers.py:46 +#: accounts/signal_handlers.py:47 #, python-format msgid "Push related accounts to assets: %s, by system" msgstr "推送账号到资产: %s, 由系统执行" -#: accounts/signal_handlers.py:55 +#: accounts/signal_handlers.py:56 #, python-format msgid "Add account: %s" msgstr "添加账号: %s" -#: accounts/signal_handlers.py:57 +#: accounts/signal_handlers.py:58 #, python-format msgid "Delete account: %s" msgstr "删除账号: %s" @@ -1742,7 +1742,7 @@ msgstr "网域" msgid "Node" msgstr "节点" -#: assets/models/asset/common.py:167 assets/serializers/asset/common.py:382 +#: assets/models/asset/common.py:167 assets/serializers/asset/common.py:385 #: assets/serializers/asset/host.py:11 msgid "Gathered info" msgstr "收集资产硬件信息" @@ -2075,23 +2075,23 @@ msgid "Node path" msgstr "节点路径" #: assets/serializers/asset/common.py:148 -#: assets/serializers/asset/common.py:383 +#: assets/serializers/asset/common.py:386 msgid "Auto info" msgstr "自动化信息" -#: assets/serializers/asset/common.py:242 +#: assets/serializers/asset/common.py:245 msgid "Platform not exist" msgstr "平台不存在" -#: assets/serializers/asset/common.py:278 +#: assets/serializers/asset/common.py:281 msgid "port out of range (0-65535)" msgstr "端口超出范围 (0-65535)" -#: assets/serializers/asset/common.py:285 +#: assets/serializers/asset/common.py:288 msgid "Protocol is required: {}" msgstr "协议是必填的: {}" -#: assets/serializers/asset/common.py:313 +#: assets/serializers/asset/common.py:316 msgid "Invalid data" msgstr "无效的数据" @@ -2594,8 +2594,8 @@ msgstr "认证令牌" #: audits/signal_handlers/login_log.py:37 authentication/notifications.py:73 #: authentication/views/login.py:77 notifications/backends/__init__.py:11 -#: settings/notifications.py:68 settings/serializers/auth/wecom.py:10 -#: users/models/user.py:749 users/models/user.py:855 +#: settings/serializers/auth/wecom.py:10 users/models/user.py:749 +#: users/models/user.py:855 msgid "WeCom" msgstr "企业微信" @@ -2631,9 +2631,9 @@ msgstr "临时密码" msgid "Passkey" msgstr "Passkey" -#: audits/tasks.py:101 users/signal_handlers.py:166 +#: audits/tasks.py:101 msgid "Clean audits session task log" -msgstr "清理审计会话任务日志" +msgstr "清理资产审计会话任务日志" #: audits/tasks.py:114 msgid "Upload FTP file to external storage" @@ -3144,7 +3144,7 @@ msgstr "已校验" msgid "Different city login reminder" msgstr "异地登录提醒" -#: authentication/notifications.py:52 settings/notifications.py:47 +#: authentication/notifications.py:52 msgid "binding reminder" msgstr "绑定提醒" @@ -4336,7 +4336,7 @@ msgid "Is finished" msgstr "是否完成" #: ops/serializers/job.py:66 -#: settings/templates/ldap/_msg_import_ldap_user.html:27 +#: settings/templates/ldap/_msg_import_ldap_user.html:7 msgid "Time cost" msgstr "花费时间" @@ -4921,7 +4921,7 @@ msgstr "其它设置" msgid "Chat prompt" msgstr "聊天提示" -#: settings/notifications.py:22 +#: settings/notifications.py:23 msgid "Notification of Synchronized LDAP User Task Results" msgstr "同步LDAP用户任务结果通知" @@ -5579,10 +5579,8 @@ msgid "Enable virtual app" msgstr "启用虚拟应用" #: settings/serializers/msg.py:25 -#, fuzzy -#| msgid "SMTP host" msgid "SMTP" -msgstr "SMTP 主机" +msgstr "SMTP" #: settings/serializers/msg.py:26 msgid "EXCHANGE" @@ -6005,7 +6003,7 @@ msgstr "启用 Razor 服务" msgid "Enable SSH Client" msgstr "启用 SSH Client" -#: settings/tasks/ldap.py:29 +#: settings/tasks/ldap.py:28 msgid "Periodic import ldap user" msgstr "周期导入 LDAP 用户" @@ -6017,19 +6015,19 @@ msgstr "注册周期导入 LDAP 用户 任务" msgid "Sync task Finish" msgstr "同步任务完成" -#: settings/templates/ldap/_msg_import_ldap_user.html:3 -msgid "Synced Organization" -msgstr "已同步组织" - -#: settings/templates/ldap/_msg_import_ldap_user.html:9 -msgid "Synced User" -msgstr "已同步用户" - -#: settings/templates/ldap/_msg_import_ldap_user.html:26 +#: settings/templates/ldap/_msg_import_ldap_user.html:6 #: terminal/models/session/session.py:45 msgid "Date end" msgstr "结束日期" +#: settings/templates/ldap/_msg_import_ldap_user.html:9 +msgid "Synced Organization" +msgstr "已同步组织" + +#: settings/templates/ldap/_msg_import_ldap_user.html:15 +msgid "Synced User" +msgstr "已同步用户" + #: settings/utils/ldap.py:494 msgid "ldap:// or ldaps:// protocol is used." msgstr "使用 ldap:// 或 ldaps:// 协议" @@ -7966,6 +7964,10 @@ msgid "" msgstr "" "管理员已开启'仅允许已存在用户登录',当前用户不在用户列表中,请联系管理员。" +#: users/signal_handlers.py:166 +msgid "Clean up expired user sessions" +msgstr "清除过期的用户会话" + #: users/tasks.py:25 msgid "Check password expired" msgstr "校验密码已过期" @@ -8385,7 +8387,7 @@ msgstr "与" msgid "Or" msgstr "或" -#: xpack/plugins/cloud/manager.py:57 +#: xpack/plugins/cloud/manager.py:56 msgid "Account unavailable" msgstr "账号无效" diff --git a/apps/users/signal_handlers.py b/apps/users/signal_handlers.py index 6e53bb87b..8e1f92254 100644 --- a/apps/users/signal_handlers.py +++ b/apps/users/signal_handlers.py @@ -163,9 +163,9 @@ def on_openid_create_or_update_user(sender, request, user, created, name, userna user.save() -@shared_task(verbose_name=_('Clean audits session task log')) +@shared_task(verbose_name=_('Clean up expired user sessions')) @register_as_period_task(crontab=CRONTAB_AT_PM_TWO) -def clean_audits_log_period(): +def clean_expired_user_session_period(): UserSession.clear_expired_sessions()