From 962354c50d83b29a35308b99eda21b3f77d532ad Mon Sep 17 00:00:00 2001 From: ibuler Date: Fri, 28 Jul 2023 10:41:37 +0800 Subject: [PATCH 1/4] =?UTF-8?q?perf:=20=E4=BF=AE=E6=94=B9=E5=BA=94?= =?UTF-8?q?=E7=94=A8=E5=8F=91=E5=B8=83=E6=9C=BA=E8=B4=A6=E5=8F=B7=E5=88=9B?= =?UTF-8?q?=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../migrations/0121_auto_20230725_1458.py | 5 +- apps/jumpserver/settings/custom.py | 1 - apps/locale/ja/LC_MESSAGES/django.po | 95 +++++++++++-------- apps/locale/zh/LC_MESSAGES/django.po | 95 +++++++++++-------- .../migrations/0015_auto_20200929_1728.py | 4 +- .../migrations/0064_auto_20230728_1001.py | 23 +++++ apps/terminal/models/applet/host.py | 8 +- apps/terminal/serializers/applet_host.py | 1 + apps/terminal/signal_handlers/applet.py | 6 +- 9 files changed, 149 insertions(+), 89 deletions(-) create mode 100644 apps/terminal/migrations/0064_auto_20230728_1001.py diff --git a/apps/assets/migrations/0121_auto_20230725_1458.py b/apps/assets/migrations/0121_auto_20230725_1458.py index d32eb86a1..65a115cce 100644 --- a/apps/assets/migrations/0121_auto_20230725_1458.py +++ b/apps/assets/migrations/0121_auto_20230725_1458.py @@ -6,7 +6,10 @@ from django.db import migrations def migrate_platforms_sftp_protocol(apps, schema_editor): platform_protocol_cls = apps.get_model('assets', 'PlatformProtocol') platform_cls = apps.get_model('assets', 'Platform') - ssh_protocols = platform_protocol_cls.objects.filter(name='ssh', setting__sftp_enabled=True) + ssh_protocols = platform_protocol_cls.objects \ + .filter(name='ssh', setting__sftp_enabled=True) \ + .exclude(name__in=('Gateway', 'RemoteAppHost')) \ + .filter(type='linux') platforms_has_sftp = platform_cls.objects.filter(protocols__name='sftp') new_protocols = [] diff --git a/apps/jumpserver/settings/custom.py b/apps/jumpserver/settings/custom.py index b9be9c75b..16d503f1c 100644 --- a/apps/jumpserver/settings/custom.py +++ b/apps/jumpserver/settings/custom.py @@ -86,7 +86,6 @@ TERMINAL_TELNET_REGEX = CONFIG.TERMINAL_TELNET_REGEX # 默认图形化分辨率 TERMINAL_GRAPHICAL_RESOLUTION = CONFIG.TERMINAL_GRAPHICAL_RESOLUTION - # Asset user auth external backend, default AuthBook backend BACKEND_ASSET_USER_AUTH_VAULT = False diff --git a/apps/locale/ja/LC_MESSAGES/django.po b/apps/locale/ja/LC_MESSAGES/django.po index 424fbf22b..a87020f10 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: 2023-07-25 15:37+0800\n" +"POT-Creation-Date: 2023-07-28 10:38+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -288,7 +288,7 @@ msgstr "アカウントバックアップ計画" #: assets/models/automations/base.py:115 audits/models.py:60 #: ops/models/base.py:55 ops/models/celery.py:63 ops/models/job.py:194 #: ops/templates/ops/celery_task_log.html:75 -#: perms/models/asset_permission.py:72 terminal/models/applet/host.py:137 +#: perms/models/asset_permission.py:72 terminal/models/applet/host.py:139 #: terminal/models/session/session.py:44 #: tickets/models/ticket/apply_application.py:30 #: tickets/models/ticket/apply_asset.py:19 @@ -411,7 +411,7 @@ msgstr "開始日" #: accounts/models/automations/change_secret.py:91 #: assets/models/automations/base.py:116 ops/models/base.py:56 #: ops/models/celery.py:64 ops/models/job.py:195 -#: terminal/models/applet/host.py:138 +#: terminal/models/applet/host.py:140 msgid "Date finished" msgstr "終了日" @@ -696,7 +696,7 @@ msgid "Key password" msgstr "キーパスワード" #: accounts/serializers/account/base.py:80 -#: assets/serializers/asset/common.py:309 +#: assets/serializers/asset/common.py:311 msgid "Spec info" msgstr "特別情報" @@ -839,7 +839,7 @@ msgid "Users" msgstr "ユーザー" #: acls/models/base.py:98 assets/models/automations/base.py:17 -#: assets/models/cmd_filter.py:38 assets/serializers/asset/common.py:308 +#: assets/models/cmd_filter.py:38 assets/serializers/asset/common.py:310 #: rbac/tree.py:35 msgid "Accounts" msgstr "アカウント" @@ -1080,7 +1080,7 @@ msgstr "無効" msgid "Basic" msgstr "基本" -#: assets/const/base.py:35 assets/const/protocol.py:193 +#: assets/const/base.py:35 assets/const/protocol.py:201 #: assets/models/asset/web.py:13 msgid "Script" msgstr "脚本" @@ -1152,10 +1152,6 @@ msgstr "" msgid "Other" msgstr "その他" -#: assets/const/protocol.py:43 -msgid "SFTP enabled" -msgstr "SFTP が有効" - #: assets/const/protocol.py:48 msgid "SFTP home" msgstr "SFTP ルート パス" @@ -1189,28 +1185,36 @@ msgstr "AD ドメイン" msgid "Use SSL" msgstr "SSLの使用" -#: assets/const/protocol.py:149 +#: assets/const/protocol.py:127 +msgid "SYSDBA" +msgstr "" + +#: assets/const/protocol.py:128 +msgid "Connect as SYSDBA" +msgstr "" + +#: assets/const/protocol.py:157 msgid "Auth username" msgstr "ユーザー名で認証する" -#: assets/const/protocol.py:170 assets/models/asset/web.py:9 +#: assets/const/protocol.py:178 assets/models/asset/web.py:9 #: assets/serializers/asset/info/spec.py:16 msgid "Autofill" msgstr "自動充填" -#: assets/const/protocol.py:178 assets/models/asset/web.py:10 +#: assets/const/protocol.py:186 assets/models/asset/web.py:10 msgid "Username selector" msgstr "ユーザー名ピッカー" -#: assets/const/protocol.py:183 assets/models/asset/web.py:11 +#: assets/const/protocol.py:191 assets/models/asset/web.py:11 msgid "Password selector" msgstr "パスワードセレクター" -#: assets/const/protocol.py:188 assets/models/asset/web.py:12 +#: assets/const/protocol.py:196 assets/models/asset/web.py:12 msgid "Submit selector" msgstr "ボタンセレクターを確認する" -#: assets/const/protocol.py:211 +#: assets/const/protocol.py:219 msgid "API mode" msgstr "APIモード" @@ -1239,7 +1243,7 @@ msgstr "SSHパブリックキー" #: common/db/models.py:36 ops/models/adhoc.py:26 ops/models/job.py:113 #: ops/models/playbook.py:26 rbac/models/role.py:37 settings/models.py:37 #: terminal/models/applet/applet.py:44 terminal/models/applet/applet.py:248 -#: terminal/models/applet/host.py:139 terminal/models/component/endpoint.py:24 +#: terminal/models/applet/host.py:141 terminal/models/component/endpoint.py:24 #: terminal/models/component/endpoint.py:102 #: terminal/models/session/session.py:46 tickets/models/comment.py:32 #: tickets/models/ticket/general.py:297 users/models/user.py:792 @@ -1368,7 +1372,7 @@ msgstr "ドメイン" msgid "Labels" msgstr "ラベル" -#: assets/models/asset/common.py:158 assets/serializers/asset/common.py:310 +#: assets/models/asset/common.py:158 assets/serializers/asset/common.py:312 #: assets/serializers/asset/host.py:11 msgid "Gathered info" msgstr "資産ハードウェア情報の収集" @@ -1432,9 +1436,9 @@ msgstr "アセットの自動化タスク" #: assets/models/automations/base.py:113 audits/models.py:199 #: audits/serializers.py:50 ops/models/base.py:49 ops/models/job.py:186 -#: terminal/models/applet/applet.py:247 terminal/models/applet/host.py:136 +#: terminal/models/applet/applet.py:247 terminal/models/applet/host.py:138 #: terminal/models/component/status.py:30 terminal/serializers/applet.py:18 -#: terminal/serializers/applet_host.py:107 tickets/models/ticket/general.py:283 +#: terminal/serializers/applet_host.py:108 tickets/models/ticket/general.py:283 #: tickets/serializers/super_ticket.py:13 #: tickets/serializers/ticket/ticket.py:20 xpack/plugins/cloud/models.py:164 #: xpack/plugins/cloud/models.py:216 @@ -1702,19 +1706,19 @@ msgid "Node path" msgstr "ノードパスです" #: assets/serializers/asset/common.py:145 -#: assets/serializers/asset/common.py:311 +#: assets/serializers/asset/common.py:313 msgid "Auto info" msgstr "自動情報" -#: assets/serializers/asset/common.py:234 +#: assets/serializers/asset/common.py:236 msgid "Platform not exist" msgstr "プラットフォームが存在しません" -#: assets/serializers/asset/common.py:270 +#: assets/serializers/asset/common.py:272 msgid "port out of range (0-65535)" msgstr "ポート番号が範囲外です (0-65535)" -#: assets/serializers/asset/common.py:277 +#: assets/serializers/asset/common.py:279 msgid "Protocol is required: {}" msgstr "プロトコルが必要です: {}" @@ -2022,7 +2026,7 @@ msgid "Change password" msgstr "パスワードを変更する" #: audits/const.py:35 settings/serializers/terminal.py:6 -#: terminal/models/applet/host.py:25 terminal/models/component/terminal.py:163 +#: terminal/models/applet/host.py:26 terminal/models/component/terminal.py:163 #: terminal/serializers/session.py:46 terminal/serializers/session.py:55 msgid "Terminal" msgstr "ターミナル" @@ -2039,7 +2043,7 @@ msgstr "セッションログ" msgid "Login log" msgstr "ログインログ" -#: audits/const.py:43 terminal/models/applet/host.py:140 +#: audits/const.py:43 terminal/models/applet/host.py:142 #: terminal/models/component/task.py:24 msgid "Task" msgstr "タスク" @@ -2250,19 +2254,19 @@ msgstr "" msgid "Anonymous account is not supported for this asset" msgstr "匿名アカウントはこのプロパティではサポートされていません" -#: authentication/api/connection_token.py:323 +#: authentication/api/connection_token.py:320 msgid "Account not found" msgstr "アカウントが見つかりません" -#: authentication/api/connection_token.py:326 +#: authentication/api/connection_token.py:323 msgid "Permission expired" msgstr "承認の有効期限が切れています" -#: authentication/api/connection_token.py:340 +#: authentication/api/connection_token.py:337 msgid "ACL action is reject: {}({})" msgstr "ACL アクションは拒否です: {}({})" -#: authentication/api/connection_token.py:344 +#: authentication/api/connection_token.py:341 msgid "ACL action is review" msgstr "ACL アクションはレビューです" @@ -2718,11 +2722,11 @@ msgstr "ユーザーなしまたは期限切れのユーザー" msgid "No asset or inactive asset" msgstr "アセットがないか、有効化されていないアセット" -#: authentication/models/connection_token.py:269 +#: authentication/models/connection_token.py:280 msgid "Can view super connection token secret" msgstr "スーパー接続トークンのシークレットを表示できます" -#: authentication/models/connection_token.py:271 +#: authentication/models/connection_token.py:282 msgid "Super connection token" msgstr "スーパー接続トークン" @@ -4243,7 +4247,7 @@ msgid "My assets" msgstr "私の資産" #: rbac/tree.py:56 terminal/models/applet/applet.py:51 -#: terminal/models/applet/applet.py:244 terminal/models/applet/host.py:28 +#: terminal/models/applet/applet.py:244 terminal/models/applet/host.py:29 #: terminal/serializers/applet.py:15 msgid "Applet" msgstr "リモートアプリケーション" @@ -5742,7 +5746,7 @@ msgstr "出力" msgid "Risk level" msgstr "リスクレベル" -#: terminal/connect_methods.py:34 +#: terminal/connect_methods.py:35 msgid "DB Client" msgstr "データベース クライアント" @@ -5847,28 +5851,36 @@ msgstr "カスタムプラットフォームのみをサポート" msgid "Missing type in platform.yml" msgstr "platform.ymlにタイプがありません" -#: terminal/models/applet/applet.py:246 terminal/models/applet/host.py:34 -#: terminal/models/applet/host.py:134 +#: terminal/models/applet/applet.py:246 terminal/models/applet/host.py:35 +#: terminal/models/applet/host.py:136 msgid "Hosting" msgstr "ホスト マシン" -#: terminal/models/applet/host.py:19 terminal/serializers/applet_host.py:57 +#: terminal/models/applet/host.py:18 terminal/serializers/applet_host.py:57 msgid "Deploy options" msgstr "展開パラメーター" +#: terminal/models/applet/host.py:19 +msgid "Auto create accounts" +msgstr "アカウントの自動作成" + #: terminal/models/applet/host.py:20 +msgid "Accounts create amount" +msgstr "作成するアカウント数" + +#: terminal/models/applet/host.py:21 msgid "Inited" msgstr "初期化された" -#: terminal/models/applet/host.py:21 +#: terminal/models/applet/host.py:22 msgid "Date inited" msgstr "" -#: terminal/models/applet/host.py:22 +#: terminal/models/applet/host.py:23 msgid "Date synced" msgstr "同期日" -#: terminal/models/applet/host.py:135 +#: terminal/models/applet/host.py:137 msgid "Initial" msgstr "初期化" @@ -7892,6 +7904,9 @@ msgstr "究極のエディション" msgid "Community edition" msgstr "コミュニティ版" +#~ msgid "SFTP enabled" +#~ msgstr "SFTP が有効" + #~ msgid "Item" #~ msgstr "アイテム" diff --git a/apps/locale/zh/LC_MESSAGES/django.po b/apps/locale/zh/LC_MESSAGES/django.po index 10fd864cc..388a31294 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: 2023-07-25 15:37+0800\n" +"POT-Creation-Date: 2023-07-28 10:38+0800\n" "PO-Revision-Date: 2021-05-20 10:54+0800\n" "Last-Translator: ibuler \n" "Language-Team: JumpServer team\n" @@ -287,7 +287,7 @@ msgstr "账号备份计划" #: assets/models/automations/base.py:115 audits/models.py:60 #: ops/models/base.py:55 ops/models/celery.py:63 ops/models/job.py:194 #: ops/templates/ops/celery_task_log.html:75 -#: perms/models/asset_permission.py:72 terminal/models/applet/host.py:137 +#: perms/models/asset_permission.py:72 terminal/models/applet/host.py:139 #: terminal/models/session/session.py:44 #: tickets/models/ticket/apply_application.py:30 #: tickets/models/ticket/apply_asset.py:19 @@ -410,7 +410,7 @@ msgstr "开始日期" #: accounts/models/automations/change_secret.py:91 #: assets/models/automations/base.py:116 ops/models/base.py:56 #: ops/models/celery.py:64 ops/models/job.py:195 -#: terminal/models/applet/host.py:138 +#: terminal/models/applet/host.py:140 msgid "Date finished" msgstr "结束日期" @@ -692,7 +692,7 @@ msgid "Key password" msgstr "密钥密码" #: accounts/serializers/account/base.py:80 -#: assets/serializers/asset/common.py:309 +#: assets/serializers/asset/common.py:311 msgid "Spec info" msgstr "特殊信息" @@ -835,7 +835,7 @@ msgid "Users" msgstr "用户管理" #: acls/models/base.py:98 assets/models/automations/base.py:17 -#: assets/models/cmd_filter.py:38 assets/serializers/asset/common.py:308 +#: assets/models/cmd_filter.py:38 assets/serializers/asset/common.py:310 #: rbac/tree.py:35 msgid "Accounts" msgstr "账号管理" @@ -1073,7 +1073,7 @@ msgstr "禁用" msgid "Basic" msgstr "基本" -#: assets/const/base.py:35 assets/const/protocol.py:193 +#: assets/const/base.py:35 assets/const/protocol.py:201 #: assets/models/asset/web.py:13 msgid "Script" msgstr "脚本" @@ -1145,10 +1145,6 @@ msgstr "ChatGPT" msgid "Other" msgstr "其它" -#: assets/const/protocol.py:43 -msgid "SFTP enabled" -msgstr "SFTP 已启用" - #: assets/const/protocol.py:48 msgid "SFTP home" msgstr "SFTP 根路径" @@ -1182,28 +1178,36 @@ msgstr "AD 网域" msgid "Use SSL" msgstr "使用 SSL" -#: assets/const/protocol.py:149 +#: assets/const/protocol.py:127 +msgid "SYSDBA" +msgstr "" + +#: assets/const/protocol.py:128 +msgid "Connect as SYSDBA" +msgstr "" + +#: assets/const/protocol.py:157 msgid "Auth username" msgstr "使用用户名认证" -#: assets/const/protocol.py:170 assets/models/asset/web.py:9 +#: assets/const/protocol.py:178 assets/models/asset/web.py:9 #: assets/serializers/asset/info/spec.py:16 msgid "Autofill" msgstr "自动代填" -#: assets/const/protocol.py:178 assets/models/asset/web.py:10 +#: assets/const/protocol.py:186 assets/models/asset/web.py:10 msgid "Username selector" msgstr "用户名选择器" -#: assets/const/protocol.py:183 assets/models/asset/web.py:11 +#: assets/const/protocol.py:191 assets/models/asset/web.py:11 msgid "Password selector" msgstr "密码选择器" -#: assets/const/protocol.py:188 assets/models/asset/web.py:12 +#: assets/const/protocol.py:196 assets/models/asset/web.py:12 msgid "Submit selector" msgstr "确认按钮选择器" -#: assets/const/protocol.py:211 +#: assets/const/protocol.py:219 msgid "API mode" msgstr "API 模式" @@ -1232,7 +1236,7 @@ msgstr "SSH公钥" #: common/db/models.py:36 ops/models/adhoc.py:26 ops/models/job.py:113 #: ops/models/playbook.py:26 rbac/models/role.py:37 settings/models.py:37 #: terminal/models/applet/applet.py:44 terminal/models/applet/applet.py:248 -#: terminal/models/applet/host.py:139 terminal/models/component/endpoint.py:24 +#: terminal/models/applet/host.py:141 terminal/models/component/endpoint.py:24 #: terminal/models/component/endpoint.py:102 #: terminal/models/session/session.py:46 tickets/models/comment.py:32 #: tickets/models/ticket/general.py:297 users/models/user.py:792 @@ -1361,7 +1365,7 @@ msgstr "网域" msgid "Labels" msgstr "标签管理" -#: assets/models/asset/common.py:158 assets/serializers/asset/common.py:310 +#: assets/models/asset/common.py:158 assets/serializers/asset/common.py:312 #: assets/serializers/asset/host.py:11 msgid "Gathered info" msgstr "收集资产硬件信息" @@ -1425,9 +1429,9 @@ msgstr "资产自动化任务" #: assets/models/automations/base.py:113 audits/models.py:199 #: audits/serializers.py:50 ops/models/base.py:49 ops/models/job.py:186 -#: terminal/models/applet/applet.py:247 terminal/models/applet/host.py:136 +#: terminal/models/applet/applet.py:247 terminal/models/applet/host.py:138 #: terminal/models/component/status.py:30 terminal/serializers/applet.py:18 -#: terminal/serializers/applet_host.py:107 tickets/models/ticket/general.py:283 +#: terminal/serializers/applet_host.py:108 tickets/models/ticket/general.py:283 #: tickets/serializers/super_ticket.py:13 #: tickets/serializers/ticket/ticket.py:20 xpack/plugins/cloud/models.py:164 #: xpack/plugins/cloud/models.py:216 @@ -1693,19 +1697,19 @@ msgid "Node path" msgstr "节点路径" #: assets/serializers/asset/common.py:145 -#: assets/serializers/asset/common.py:311 +#: assets/serializers/asset/common.py:313 msgid "Auto info" msgstr "自动化信息" -#: assets/serializers/asset/common.py:234 +#: assets/serializers/asset/common.py:236 msgid "Platform not exist" msgstr "平台不存在" -#: assets/serializers/asset/common.py:270 +#: assets/serializers/asset/common.py:272 msgid "port out of range (0-65535)" msgstr "端口超出范围 (0-65535)" -#: assets/serializers/asset/common.py:277 +#: assets/serializers/asset/common.py:279 msgid "Protocol is required: {}" msgstr "协议是必填的: {}" @@ -2006,7 +2010,7 @@ msgid "Change password" msgstr "改密" #: audits/const.py:35 settings/serializers/terminal.py:6 -#: terminal/models/applet/host.py:25 terminal/models/component/terminal.py:163 +#: terminal/models/applet/host.py:26 terminal/models/component/terminal.py:163 #: terminal/serializers/session.py:46 terminal/serializers/session.py:55 msgid "Terminal" msgstr "终端" @@ -2023,7 +2027,7 @@ msgstr "会话日志" msgid "Login log" msgstr "登录日志" -#: audits/const.py:43 terminal/models/applet/host.py:140 +#: audits/const.py:43 terminal/models/applet/host.py:142 #: terminal/models/component/task.py:24 msgid "Task" msgstr "任务" @@ -2232,19 +2236,19 @@ msgstr "不允许使用可重复使用的连接令牌,未启用全局设置" msgid "Anonymous account is not supported for this asset" msgstr "匿名账号不支持当前资产" -#: authentication/api/connection_token.py:323 +#: authentication/api/connection_token.py:320 msgid "Account not found" msgstr "账号未找到" -#: authentication/api/connection_token.py:326 +#: authentication/api/connection_token.py:323 msgid "Permission expired" msgstr "授权已过期" -#: authentication/api/connection_token.py:340 +#: authentication/api/connection_token.py:337 msgid "ACL action is reject: {}({})" msgstr "ACL 动作是拒绝: {}({})" -#: authentication/api/connection_token.py:344 +#: authentication/api/connection_token.py:341 msgid "ACL action is review" msgstr "ACL 动作是复核" @@ -2686,11 +2690,11 @@ msgstr "没有用户或用户失效" msgid "No asset or inactive asset" msgstr "没有资产或资产未激活" -#: authentication/models/connection_token.py:269 +#: authentication/models/connection_token.py:280 msgid "Can view super connection token secret" msgstr "可以查看超级连接令牌密文" -#: authentication/models/connection_token.py:271 +#: authentication/models/connection_token.py:282 msgid "Super connection token" msgstr "超级连接令牌" @@ -4194,7 +4198,7 @@ msgid "My assets" msgstr "我的资产" #: rbac/tree.py:56 terminal/models/applet/applet.py:51 -#: terminal/models/applet/applet.py:244 terminal/models/applet/host.py:28 +#: terminal/models/applet/applet.py:244 terminal/models/applet/host.py:29 #: terminal/serializers/applet.py:15 msgid "Applet" msgstr "远程应用" @@ -5655,7 +5659,7 @@ msgstr "输出" msgid "Risk level" msgstr "风险等级" -#: terminal/connect_methods.py:34 +#: terminal/connect_methods.py:35 msgid "DB Client" msgstr "数据库客户端" @@ -5760,28 +5764,36 @@ msgstr "只支持自定义平台" msgid "Missing type in platform.yml" msgstr "在 platform.yml 中缺少类型" -#: terminal/models/applet/applet.py:246 terminal/models/applet/host.py:34 -#: terminal/models/applet/host.py:134 +#: terminal/models/applet/applet.py:246 terminal/models/applet/host.py:35 +#: terminal/models/applet/host.py:136 msgid "Hosting" msgstr "宿主机" -#: terminal/models/applet/host.py:19 terminal/serializers/applet_host.py:57 +#: terminal/models/applet/host.py:18 terminal/serializers/applet_host.py:57 msgid "Deploy options" msgstr "部署参数" +#: terminal/models/applet/host.py:19 +msgid "Auto create accounts" +msgstr "自动创建账号" + #: terminal/models/applet/host.py:20 +msgid "Accounts create amount" +msgstr "创建账号数量" + +#: terminal/models/applet/host.py:21 msgid "Inited" msgstr "已初始化" -#: terminal/models/applet/host.py:21 +#: terminal/models/applet/host.py:22 msgid "Date inited" msgstr "初始化日期" -#: terminal/models/applet/host.py:22 +#: terminal/models/applet/host.py:23 msgid "Date synced" msgstr "同步日期" -#: terminal/models/applet/host.py:135 +#: terminal/models/applet/host.py:137 msgid "Initial" msgstr "初始化" @@ -7778,6 +7790,9 @@ msgstr "旗舰版" msgid "Community edition" msgstr "社区版" +#~ msgid "SFTP enabled" +#~ msgstr "SFTP 已启用" + #~ msgid "Item" #~ msgstr "项目" diff --git a/apps/perms/migrations/0015_auto_20200929_1728.py b/apps/perms/migrations/0015_auto_20200929_1728.py index c241a2f71..9b8388c3b 100644 --- a/apps/perms/migrations/0015_auto_20200929_1728.py +++ b/apps/perms/migrations/0015_auto_20200929_1728.py @@ -14,12 +14,12 @@ class Migration(migrations.Migration): migrations.AlterField( model_name='assetpermission', name='user_groups', - field=models.ManyToManyField(blank=True, related_name='assetpermissions', to='users.UserGroup', verbose_name='User group'), + field=models.ManyToManyField(blank=True, related_name='%(class)ss', to='users.usergroup', verbose_name='User group'), ), migrations.AlterField( model_name='assetpermission', name='users', - field=models.ManyToManyField(blank=True, related_name='assetpermissions', to=settings.AUTH_USER_MODEL, verbose_name='User'), + field=models.ManyToManyField(blank=True, related_name='%(class)ss', to=settings.AUTH_USER_MODEL, verbose_name='User'), ), migrations.AlterField( model_name='databaseapppermission', diff --git a/apps/terminal/migrations/0064_auto_20230728_1001.py b/apps/terminal/migrations/0064_auto_20230728_1001.py new file mode 100644 index 000000000..0610f174f --- /dev/null +++ b/apps/terminal/migrations/0064_auto_20230728_1001.py @@ -0,0 +1,23 @@ +# Generated by Django 4.1.10 on 2023-07-28 02:01 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('terminal', '0063_auto_20230621_1133'), + ] + + operations = [ + migrations.AddField( + model_name='applethost', + name='accounts_create_amount', + field=models.IntegerField(default=100, verbose_name='Accounts create amount'), + ), + migrations.AddField( + model_name='applethost', + name='auto_create_accounts', + field=models.BooleanField(default=True, verbose_name='Auto create accounts'), + ), + ] diff --git a/apps/terminal/models/applet/host.py b/apps/terminal/models/applet/host.py index b0e7c478c..a4945a890 100644 --- a/apps/terminal/models/applet/host.py +++ b/apps/terminal/models/applet/host.py @@ -1,4 +1,3 @@ -import os from collections import defaultdict from django.db import models @@ -17,6 +16,8 @@ __all__ = ['AppletHost', 'AppletHostDeployment'] class AppletHost(Host): deploy_options = models.JSONField(default=dict, verbose_name=_('Deploy options')) + auto_create_accounts = models.BooleanField(default=True, verbose_name=_('Auto create accounts')) + accounts_create_amount = models.IntegerField(default=100, verbose_name=_('Accounts create amount')) inited = models.BooleanField(default=False, verbose_name=_('Inited')) date_inited = models.DateTimeField(null=True, blank=True, verbose_name=_('Date inited')) date_synced = models.DateTimeField(null=True, blank=True, verbose_name=_('Date synced')) @@ -84,13 +85,14 @@ class AppletHost(Host): return random_string(16, special_char=True) def generate_accounts(self): + if not self.auto_create_accounts: + return self.generate_public_accounts() self.generate_private_accounts() def generate_public_accounts(self): - public_amount = int(os.getenv('TERMINAL_ACCOUNTS_AMOUNT', 100)) now_count = self.accounts.filter(privileged=False, username__startswith='jms').count() - need = public_amount - now_count + need = self.accounts_create_amount - now_count accounts = [] account_model = self.accounts.model diff --git a/apps/terminal/serializers/applet_host.py b/apps/terminal/serializers/applet_host.py index 392b2e2e3..59b87ca9d 100644 --- a/apps/terminal/serializers/applet_host.py +++ b/apps/terminal/serializers/applet_host.py @@ -62,6 +62,7 @@ class AppletHostSerializer(HostSerializer): class Meta(HostSerializer.Meta): model = AppletHost fields = HostSerializer.Meta.fields + [ + 'auto_create_accounts', 'accounts_create_amount', 'load', 'date_synced', 'deploy_options' ] extra_kwargs = { diff --git a/apps/terminal/signal_handlers/applet.py b/apps/terminal/signal_handlers/applet.py index 4fe390b8e..912510901 100644 --- a/apps/terminal/signal_handlers/applet.py +++ b/apps/terminal/signal_handlers/applet.py @@ -23,8 +23,9 @@ def on_applet_host_create(sender, instance, created=False, **kwargs): applets = Applet.objects.all() instance.applets.set(applets) - applet_host_generate_accounts.delay(instance.id) applet_host_change_pub_sub.publish(True) + if instance.auto_create_accounts: + applet_host_generate_accounts.delay(instance.id) @receiver(post_save, sender=User) @@ -35,6 +36,8 @@ def on_user_create_create_account(sender, instance, created=False, **kwargs): with tmp_to_builtin_org(system=1): applet_hosts = AppletHost.objects.all() for host in applet_hosts: + if not host.auto_create_accounts: + continue host.generate_private_accounts_by_usernames([instance.username]) @@ -57,7 +60,6 @@ def on_applet_create(sender, instance, created=False, **kwargs): return hosts = AppletHost.objects.all() instance.hosts.set(hosts) - applet_host_change_pub_sub.publish(True) From 2c22396093e35066fb8d8404b031b5c0018ef1d3 Mon Sep 17 00:00:00 2001 From: ibuler Date: Fri, 28 Jul 2023 10:49:33 +0800 Subject: [PATCH 2/4] =?UTF-8?q?perf:=20=E4=BF=AE=E6=94=B9=E5=8E=BB?= =?UTF-8?q?=E6=8E=89=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../migrations/0064_auto_20230728_1001.py | 5 +++++ .../migrations/0064_sessionsharing_origin.py | 18 ------------------ 2 files changed, 5 insertions(+), 18 deletions(-) delete mode 100644 apps/terminal/migrations/0064_sessionsharing_origin.py diff --git a/apps/terminal/migrations/0064_auto_20230728_1001.py b/apps/terminal/migrations/0064_auto_20230728_1001.py index 0610f174f..264bcde38 100644 --- a/apps/terminal/migrations/0064_auto_20230728_1001.py +++ b/apps/terminal/migrations/0064_auto_20230728_1001.py @@ -20,4 +20,9 @@ class Migration(migrations.Migration): name='auto_create_accounts', field=models.BooleanField(default=True, verbose_name='Auto create accounts'), ), + migrations.AddField( + model_name='sessionsharing', + name='origin', + field=models.URLField(blank=True, null=True, verbose_name='Origin'), + ), ] diff --git a/apps/terminal/migrations/0064_sessionsharing_origin.py b/apps/terminal/migrations/0064_sessionsharing_origin.py deleted file mode 100644 index 91886fc16..000000000 --- a/apps/terminal/migrations/0064_sessionsharing_origin.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 4.1.10 on 2023-07-26 10:55 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('terminal', '0063_auto_20230621_1133'), - ] - - operations = [ - migrations.AddField( - model_name='sessionsharing', - name='origin', - field=models.URLField(blank=True, null=True, verbose_name='Origin'), - ), - ] From 5380dc0c2de3d6e094f8cd407ddd8adfe7ac6c7c Mon Sep 17 00:00:00 2001 From: ibuler Date: Fri, 28 Jul 2023 11:02:21 +0800 Subject: [PATCH 3/4] =?UTF-8?q?perf:=20=E4=BF=AE=E6=94=B9=E7=BF=BB?= =?UTF-8?q?=E8=AF=91?= 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 | 51 ++++++++++++++--------- apps/locale/zh/LC_MESSAGES/django.mo | 4 +- apps/locale/zh/LC_MESSAGES/django.po | 52 +++++++++++++++--------- apps/terminal/serializers/applet_host.py | 9 +++- 5 files changed, 77 insertions(+), 43 deletions(-) diff --git a/apps/locale/ja/LC_MESSAGES/django.mo b/apps/locale/ja/LC_MESSAGES/django.mo index 62fb28861..e2cc899ec 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:bd82a00953513f7ddd38f6f1d45f770e3a02d1c4a2467bfd791218c10c8d717c -size 148960 +oid sha256:538beabe7c224b203bbc0ebaf191509a8f407f6b3e8194038fc203bde10d6d5a +size 150250 diff --git a/apps/locale/ja/LC_MESSAGES/django.po b/apps/locale/ja/LC_MESSAGES/django.po index 389fc66e5..bfd6cee82 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: 2023-07-25 15:37+0800\n" +"POT-Creation-Date: 2023-07-28 10:57+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -316,7 +316,7 @@ msgid "Trigger mode" msgstr "トリガーモード" #: accounts/models/automations/backup_account.py:97 audits/models.py:194 -#: terminal/models/session/sharing.py:117 xpack/plugins/cloud/models.py:168 +#: terminal/models/session/sharing.py:121 xpack/plugins/cloud/models.py:168 msgid "Reason" msgstr "理由" @@ -748,7 +748,7 @@ msgstr "自動タスク実行履歴" #: accounts/serializers/automations/change_secret.py:155 audits/const.py:53 #: audits/models.py:59 audits/signal_handlers/activity_log.py:33 #: common/const/choices.py:18 ops/const.py:56 ops/serializers/celery.py:40 -#: terminal/const.py:76 terminal/models/session/sharing.py:113 +#: terminal/const.py:76 terminal/models/session/sharing.py:117 #: tickets/views/approve.py:115 msgid "Success" msgstr "成功" @@ -1441,7 +1441,7 @@ msgstr "アセットの自動化タスク" #: audits/serializers.py:50 ops/models/base.py:49 ops/models/job.py:186 #: terminal/models/applet/applet.py:247 terminal/models/applet/host.py:138 #: terminal/models/component/status.py:30 terminal/serializers/applet.py:18 -#: terminal/serializers/applet_host.py:108 tickets/models/ticket/general.py:283 +#: terminal/serializers/applet_host.py:115 tickets/models/ticket/general.py:283 #: tickets/serializers/super_ticket.py:13 #: tickets/serializers/ticket/ticket.py:20 xpack/plugins/cloud/models.py:164 #: xpack/plugins/cloud/models.py:216 @@ -2069,7 +2069,7 @@ msgid "Job audit log" msgstr "ジョブ監査ログ" #: audits/models.py:51 audits/models.py:95 audits/models.py:166 -#: terminal/models/session/session.py:38 terminal/models/session/sharing.py:105 +#: terminal/models/session/session.py:38 terminal/models/session/sharing.py:109 msgid "Remote addr" msgstr "リモートaddr" @@ -2087,7 +2087,7 @@ msgstr "書類" #: audits/models.py:62 terminal/backends/command/models.py:21 #: terminal/models/session/replay.py:9 terminal/models/session/sharing.py:19 -#: terminal/models/session/sharing.py:87 +#: terminal/models/session/sharing.py:91 #: terminal/templates/terminal/_msg_command_alert.html:10 #: terminal/templates/terminal/_msg_command_warning.html:17 #: tickets/models/ticket/command_confirm.py:15 @@ -2948,7 +2948,7 @@ msgid "request new one" msgstr "新しいものを要求する" #: authentication/templates/authentication/_msg_reset_password_code.html:12 -#: terminal/models/session/sharing.py:26 terminal/models/session/sharing.py:89 +#: terminal/models/session/sharing.py:26 terminal/models/session/sharing.py:93 #: terminal/templates/terminal/_msg_session_sharing.html:12 #: users/forms/profile.py:107 users/templates/users/forgot_password.html:66 msgid "Verify code" @@ -3738,7 +3738,7 @@ msgstr "タスクモニターを表示できます" msgid "Kwargs" msgstr "クワーグ" -#: ops/models/celery.py:61 terminal/models/session/sharing.py:120 +#: ops/models/celery.py:61 terminal/models/session/sharing.py:124 #: tickets/const.py:25 msgid "Finished" msgstr "終了" @@ -6016,7 +6016,7 @@ msgstr "セッション再生をダウンロードできます" msgid "Account id" msgstr "アカウント ID" -#: terminal/models/session/session.py:36 terminal/models/session/sharing.py:110 +#: terminal/models/session/session.py:36 terminal/models/session/sharing.py:114 msgid "Login from" msgstr "ログイン元" @@ -6061,7 +6061,7 @@ msgstr "アクションパーミッション" msgid "Origin" msgstr "ソース" -#: terminal/models/session/sharing.py:41 terminal/models/session/sharing.py:92 +#: terminal/models/session/sharing.py:41 terminal/models/session/sharing.py:96 #: terminal/notifications.py:261 msgid "Session sharing" msgstr "セッション共有" @@ -6070,39 +6070,39 @@ msgstr "セッション共有" msgid "Can add super session sharing" msgstr "スーパーセッション共有を追加できます" -#: terminal/models/session/sharing.py:75 +#: terminal/models/session/sharing.py:79 msgid "Link not active" msgstr "リンクがアクティブでない" -#: terminal/models/session/sharing.py:77 +#: terminal/models/session/sharing.py:81 msgid "Link expired" msgstr "リンク期限切れ" -#: terminal/models/session/sharing.py:79 +#: terminal/models/session/sharing.py:83 msgid "User not allowed to join" msgstr "ユーザーはセッションに参加できません" -#: terminal/models/session/sharing.py:96 terminal/serializers/sharing.py:71 +#: terminal/models/session/sharing.py:100 terminal/serializers/sharing.py:71 msgid "Joiner" msgstr "ジョイナー" -#: terminal/models/session/sharing.py:99 +#: terminal/models/session/sharing.py:103 msgid "Date joined" msgstr "参加日" -#: terminal/models/session/sharing.py:102 +#: terminal/models/session/sharing.py:106 msgid "Date left" msgstr "日付が残っています" -#: terminal/models/session/sharing.py:125 +#: terminal/models/session/sharing.py:129 msgid "Session join record" msgstr "セッション参加記録" -#: terminal/models/session/sharing.py:141 +#: terminal/models/session/sharing.py:145 msgid "Invalid verification code" msgstr "検証コードが無効" -#: terminal/models/session/sharing.py:148 +#: terminal/models/session/sharing.py:152 msgid "You have already joined this session" msgstr "すでにこのセッションに参加しています" @@ -6206,6 +6206,19 @@ msgstr "RDS 远程应用注销时间限制" msgid "Load status" msgstr "ロードステータス" +#: terminal/serializers/applet_host.py:72 +msgid "" +"These accounts are used to connect to the published application, the account " +"is now divided into two types, one is dedicated to each account, each user " +"has a private account, the other is public, when the application does not " +"support multiple open and the special has been used, the public account will " +"be used to connect" +msgstr "これらのアカウントは、公開されたアプリケーションに接続するために使用されます。アカウントは現在、2つのタイプに分類されています。1つは、各アカウントに専用のアカウントで、各ユーザーにはプライベートアカウントがあります。もう1つは公開されています。アプリケーションが複数のオープンをサポートしていない場合、および特別なものが使用されている場合、公開アカウントが使用されます。" + +#: terminal/serializers/applet_host.py:77 +msgid "The number of public accounts created automatically" +msgstr "自動的に作成される公開アカウントの数" + #: terminal/serializers/command.py:19 msgid "Session ID" msgstr "セッションID" diff --git a/apps/locale/zh/LC_MESSAGES/django.mo b/apps/locale/zh/LC_MESSAGES/django.mo index 145af8511..00fe60499 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:859c812ee67cc9b5f79da96d5e72445a60bdd19af7db4a8b71196a065adefeab -size 121844 +oid sha256:2cf5749656bd07818b67191c2f665246e903d74e76c49ebcdec6004322f75314 +size 122767 diff --git a/apps/locale/zh/LC_MESSAGES/django.po b/apps/locale/zh/LC_MESSAGES/django.po index bdea576a2..ade0170ab 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: 2023-07-28 10:38+0800\n" +"POT-Creation-Date: 2023-07-28 10:57+0800\n" "PO-Revision-Date: 2021-05-20 10:54+0800\n" "Last-Translator: ibuler \n" "Language-Team: JumpServer team\n" @@ -315,7 +315,7 @@ msgid "Trigger mode" msgstr "触发模式" #: accounts/models/automations/backup_account.py:97 audits/models.py:194 -#: terminal/models/session/sharing.py:117 xpack/plugins/cloud/models.py:168 +#: terminal/models/session/sharing.py:121 xpack/plugins/cloud/models.py:168 msgid "Reason" msgstr "原因" @@ -744,7 +744,7 @@ msgstr "自动化任务执行历史" #: accounts/serializers/automations/change_secret.py:155 audits/const.py:53 #: audits/models.py:59 audits/signal_handlers/activity_log.py:33 #: common/const/choices.py:18 ops/const.py:56 ops/serializers/celery.py:40 -#: terminal/const.py:76 terminal/models/session/sharing.py:113 +#: terminal/const.py:76 terminal/models/session/sharing.py:117 #: tickets/views/approve.py:115 msgid "Success" msgstr "成功" @@ -1434,7 +1434,7 @@ msgstr "资产自动化任务" #: audits/serializers.py:50 ops/models/base.py:49 ops/models/job.py:186 #: terminal/models/applet/applet.py:247 terminal/models/applet/host.py:138 #: terminal/models/component/status.py:30 terminal/serializers/applet.py:18 -#: terminal/serializers/applet_host.py:108 tickets/models/ticket/general.py:283 +#: terminal/serializers/applet_host.py:115 tickets/models/ticket/general.py:283 #: tickets/serializers/super_ticket.py:13 #: tickets/serializers/ticket/ticket.py:20 xpack/plugins/cloud/models.py:164 #: xpack/plugins/cloud/models.py:216 @@ -2053,7 +2053,7 @@ msgid "Job audit log" msgstr "作业审计日志" #: audits/models.py:51 audits/models.py:95 audits/models.py:166 -#: terminal/models/session/session.py:38 terminal/models/session/sharing.py:105 +#: terminal/models/session/session.py:38 terminal/models/session/sharing.py:109 msgid "Remote addr" msgstr "远端地址" @@ -2071,7 +2071,7 @@ msgstr "文件" #: audits/models.py:62 terminal/backends/command/models.py:21 #: terminal/models/session/replay.py:9 terminal/models/session/sharing.py:19 -#: terminal/models/session/sharing.py:87 +#: terminal/models/session/sharing.py:91 #: terminal/templates/terminal/_msg_command_alert.html:10 #: terminal/templates/terminal/_msg_command_warning.html:17 #: tickets/models/ticket/command_confirm.py:15 @@ -2912,7 +2912,7 @@ msgid "request new one" msgstr "重新申请" #: authentication/templates/authentication/_msg_reset_password_code.html:12 -#: terminal/models/session/sharing.py:26 terminal/models/session/sharing.py:89 +#: terminal/models/session/sharing.py:26 terminal/models/session/sharing.py:93 #: terminal/templates/terminal/_msg_session_sharing.html:12 #: users/forms/profile.py:107 users/templates/users/forgot_password.html:66 msgid "Verify code" @@ -3691,7 +3691,7 @@ msgstr "可以查看任务监控" msgid "Kwargs" msgstr "其它参数" -#: ops/models/celery.py:61 terminal/models/session/sharing.py:120 +#: ops/models/celery.py:61 terminal/models/session/sharing.py:124 #: tickets/const.py:25 msgid "Finished" msgstr "结束" @@ -5929,7 +5929,7 @@ msgstr "可以下载会话录像" msgid "Account id" msgstr "账号 ID" -#: terminal/models/session/session.py:36 terminal/models/session/sharing.py:110 +#: terminal/models/session/session.py:36 terminal/models/session/sharing.py:114 msgid "Login from" msgstr "登录来源" @@ -5974,7 +5974,7 @@ msgstr "操作权限" msgid "Origin" msgstr "来源" -#: terminal/models/session/sharing.py:41 terminal/models/session/sharing.py:92 +#: terminal/models/session/sharing.py:41 terminal/models/session/sharing.py:96 #: terminal/notifications.py:261 msgid "Session sharing" msgstr "会话分享" @@ -5983,39 +5983,39 @@ msgstr "会话分享" msgid "Can add super session sharing" msgstr "可以创建超级会话分享" -#: terminal/models/session/sharing.py:75 +#: terminal/models/session/sharing.py:79 msgid "Link not active" msgstr "链接失效" -#: terminal/models/session/sharing.py:77 +#: terminal/models/session/sharing.py:81 msgid "Link expired" msgstr "链接过期" -#: terminal/models/session/sharing.py:79 +#: terminal/models/session/sharing.py:83 msgid "User not allowed to join" msgstr "该用户无权加入会话" -#: terminal/models/session/sharing.py:96 terminal/serializers/sharing.py:71 +#: terminal/models/session/sharing.py:100 terminal/serializers/sharing.py:71 msgid "Joiner" msgstr "加入者" -#: terminal/models/session/sharing.py:99 +#: terminal/models/session/sharing.py:103 msgid "Date joined" msgstr "加入日期" -#: terminal/models/session/sharing.py:102 +#: terminal/models/session/sharing.py:106 msgid "Date left" msgstr "结束日期" -#: terminal/models/session/sharing.py:125 +#: terminal/models/session/sharing.py:129 msgid "Session join record" msgstr "会话加入记录" -#: terminal/models/session/sharing.py:141 +#: terminal/models/session/sharing.py:145 msgid "Invalid verification code" msgstr "验证码不正确" -#: terminal/models/session/sharing.py:148 +#: terminal/models/session/sharing.py:152 msgid "You have already joined this session" msgstr "您已经加入过此会话" @@ -6117,6 +6117,20 @@ msgstr "RDS 远程应用注销时间限制" msgid "Load status" msgstr "负载状态" +#: terminal/serializers/applet_host.py:72 +msgid "" +"These accounts are used to connect to the published application, the account " +"is now divided into two types, one is dedicated to each account, each user " +"has a private account, the other is public, when the application does not " +"support multiple open and the special has been used, the public account will " +"be used to connect" +msgstr "这些账号用于连接发布的应用,账号现在分为两种类型,一种是专用的,每个用户都有一个专用账号。 " +"另一种是公共的,当应用不支持多开且专用的已经被使用时,会使用公共账号连接" + +#: terminal/serializers/applet_host.py:77 +msgid "The number of public accounts created automatically" +msgstr "公用账号自动创建的数量" + #: terminal/serializers/command.py:19 msgid "Session ID" msgstr "会话ID" diff --git a/apps/terminal/serializers/applet_host.py b/apps/terminal/serializers/applet_host.py index 59b87ca9d..1c65315b7 100644 --- a/apps/terminal/serializers/applet_host.py +++ b/apps/terminal/serializers/applet_host.py @@ -67,7 +67,14 @@ class AppletHostSerializer(HostSerializer): ] extra_kwargs = { **HostSerializer.Meta.extra_kwargs, - 'date_synced': {'read_only': True} + 'date_synced': {'read_only': True}, + 'auto_create_accounts': {'help_text': _( + 'These accounts are used to connect to the published application, ' + 'the account is now divided into two types, one is dedicated to each account, ' + 'each user has a private account, the other is public, ' + 'when the application does not support multiple open and the special has been used, ' + 'the public account will be used to connect')}, + 'accounts_create_amount': {'help_text': _('The number of public accounts created automatically')}, } def __init__(self, *args, data=None, **kwargs): From 1a4c5dca33289091faa77ccc0e371111c1d6624a Mon Sep 17 00:00:00 2001 From: ibuler Date: Fri, 28 Jul 2023 11:06:01 +0800 Subject: [PATCH 4/4] =?UTF-8?q?perf:=20=E4=BF=AE=E6=94=B9=E7=BF=BB?= =?UTF-8?q?=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/locale/ja/LC_MESSAGES/django.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/locale/ja/LC_MESSAGES/django.po b/apps/locale/ja/LC_MESSAGES/django.po index bfd6cee82..04c99f607 100644 --- a/apps/locale/ja/LC_MESSAGES/django.po +++ b/apps/locale/ja/LC_MESSAGES/django.po @@ -5880,7 +5880,7 @@ msgstr "初期化された" #: terminal/models/applet/host.py:22 msgid "Date inited" -msgstr "" +msgstr "初期化日" #: terminal/models/applet/host.py:23 msgid "Date synced"