From 516cb05d69a9e59a4de72909987f6dfb251b38d0 Mon Sep 17 00:00:00 2001 From: ibuler Date: Tue, 19 Apr 2022 11:30:07 +0800 Subject: [PATCH 01/12] =?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/assets/serializers/cmd_filter.py | 14 +- apps/locale/ja/LC_MESSAGES/django.po | 193 ++++++++++++------------- apps/locale/zh/LC_MESSAGES/django.po | 199 +++++++++++++------------- 3 files changed, 198 insertions(+), 208 deletions(-) diff --git a/apps/assets/serializers/cmd_filter.py b/apps/assets/serializers/cmd_filter.py index a57fab72a..9a33dd6fa 100644 --- a/apps/assets/serializers/cmd_filter.py +++ b/apps/assets/serializers/cmd_filter.py @@ -31,24 +31,24 @@ class CommandFilterSerializer(BulkOrgResourceModelSerializer): class CommandFilterRuleSerializer(BulkOrgResourceModelSerializer): - type_display = serializers.ReadOnlyField(source='get_type_display') - action_display = serializers.ReadOnlyField(source='get_action_display') + type_display = serializers.ReadOnlyField(source='get_type_display', label=_("Type display")) + action_display = serializers.ReadOnlyField(source='get_action_display', label=_("Action display")) class Meta: model = CommandFilterRule fields_mini = ['id'] fields_small = fields_mini + [ - 'type', 'type_display', 'content', 'ignore_case', 'pattern', 'priority', - 'action', 'action_display', 'reviewers', - 'date_created', 'date_updated', - 'comment', 'created_by', + 'type', 'type_display', 'content', 'ignore_case', 'pattern', + 'priority', 'action', 'action_display', 'reviewers', + 'date_created', 'date_updated', 'comment', 'created_by', ] fields_fk = ['filter'] fields = fields_small + fields_fk extra_kwargs = { 'date_created': {'label': _("Date created")}, 'date_updated': {'label': _("Date updated")}, - 'action_display': {'label': _("Action display")} + 'action_display': {'label': _("Action display")}, + 'pattern': {'label': _("Pattern")} } def __init__(self, *args, **kwargs): diff --git a/apps/locale/ja/LC_MESSAGES/django.po b/apps/locale/ja/LC_MESSAGES/django.po index b7026603b..40ee2d43c 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-04-13 20:35+0800\n" +"POT-Creation-Date: 2022-04-19 11:24+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -33,7 +33,7 @@ msgstr "Acls" #: terminal/models/storage.py:23 terminal/models/task.py:16 #: terminal/models/terminal.py:100 users/forms/profile.py:32 #: users/models/group.py:15 users/models/user.py:661 -#: xpack/plugins/cloud/models.py:28 +#: xpack/plugins/cloud/models.py:27 msgid "Name" msgstr "名前" @@ -66,7 +66,7 @@ msgstr "アクティブ" #: tickets/models/comment.py:24 tickets/models/ticket.py:154 #: users/models/group.py:16 users/models/user.py:698 #: xpack/plugins/change_auth_plan/models/base.py:44 -#: xpack/plugins/cloud/models.py:35 xpack/plugins/cloud/models.py:116 +#: xpack/plugins/cloud/models.py:34 xpack/plugins/cloud/models.py:115 #: xpack/plugins/gathered_user/models.py:26 msgid "Comment" msgstr "コメント" @@ -92,8 +92,8 @@ msgstr "ログイン確認" #: terminal/backends/command/models.py:20 #: terminal/backends/command/serializers.py:12 terminal/models/session.py:44 #: terminal/notifications.py:91 terminal/notifications.py:139 -#: tickets/models/comment.py:17 users/const.py:14 users/models/user.py:886 -#: users/models/user.py:917 users/serializers/group.py:19 +#: tickets/models/comment.py:17 users/const.py:14 users/models/user.py:883 +#: users/models/user.py:914 users/serializers/group.py:19 msgid "User" msgstr "ユーザー" @@ -134,7 +134,7 @@ msgstr "システムユーザー" #: terminal/notifications.py:90 #: xpack/plugins/change_auth_plan/models/asset.py:199 #: xpack/plugins/change_auth_plan/serializers/asset.py:180 -#: xpack/plugins/cloud/models.py:223 +#: xpack/plugins/cloud/models.py:222 msgid "Asset" msgstr "資産" @@ -318,8 +318,8 @@ msgstr "タイプ" msgid "Domain" msgstr "ドメイン" -#: applications/models/application.py:228 xpack/plugins/cloud/models.py:33 -#: xpack/plugins/cloud/serializers/account.py:59 +#: applications/models/application.py:228 xpack/plugins/cloud/models.py:32 +#: xpack/plugins/cloud/serializers/account.py:58 msgid "Attrs" msgstr "ツールバーの" @@ -327,7 +327,7 @@ msgstr "ツールバーの" msgid "Can match application" msgstr "アプリケーションを一致させることができます" -#: applications/models/application.py:306 +#: applications/models/application.py:305 msgid "Application user" msgstr "アプリケーションユーザー" @@ -340,8 +340,8 @@ msgstr "カテゴリ表示" #: applications/serializers/application.py:71 #: applications/serializers/application.py:102 -#: assets/serializers/system_user.py:27 audits/serializers.py:29 -#: perms/serializers/application/permission.py:19 +#: assets/serializers/cmd_filter.py:34 assets/serializers/system_user.py:27 +#: audits/serializers.py:29 perms/serializers/application/permission.py:19 #: tickets/serializers/ticket/meta/ticket_type/apply_application.py:33 #: tickets/serializers/ticket/ticket.py:21 #: tickets/serializers/ticket/ticket.py:173 @@ -353,17 +353,17 @@ msgstr "タイプ表示" #: assets/models/domain.py:26 assets/models/gathered_user.py:19 #: assets/models/group.py:22 assets/models/label.py:25 #: assets/serializers/account.py:18 assets/serializers/cmd_filter.py:28 -#: assets/serializers/cmd_filter.py:49 common/db/models.py:113 +#: assets/serializers/cmd_filter.py:48 common/db/models.py:113 #: common/mixins/models.py:50 ops/models/adhoc.py:39 ops/models/command.py:30 #: orgs/models.py:67 orgs/models.py:217 perms/models/base.py:92 -#: users/models/group.py:18 users/models/user.py:918 -#: xpack/plugins/cloud/models.py:125 +#: users/models/group.py:18 users/models/user.py:915 +#: xpack/plugins/cloud/models.py:124 msgid "Date created" msgstr "作成された日付" #: applications/serializers/application.py:104 assets/models/base.py:182 #: assets/models/gathered_user.py:20 assets/serializers/account.py:21 -#: assets/serializers/cmd_filter.py:29 assets/serializers/cmd_filter.py:50 +#: assets/serializers/cmd_filter.py:29 assets/serializers/cmd_filter.py:49 #: common/db/models.py:114 common/mixins/models.py:51 ops/models/adhoc.py:40 #: orgs/models.py:218 msgid "Date updated" @@ -572,7 +572,7 @@ msgstr "ホスト名生" #: assets/models/asset.py:215 assets/serializers/account.py:16 #: assets/serializers/asset.py:65 perms/serializers/asset/user_permission.py:41 -#: xpack/plugins/cloud/models.py:107 xpack/plugins/cloud/serializers/task.py:42 +#: xpack/plugins/cloud/models.py:106 xpack/plugins/cloud/serializers/task.py:42 msgid "Protocols" msgstr "プロトコル" @@ -612,7 +612,7 @@ msgstr "ラベル" #: orgs/models.py:219 perms/models/base.py:91 users/models/user.py:706 #: users/serializers/group.py:33 #: xpack/plugins/change_auth_plan/models/base.py:48 -#: xpack/plugins/cloud/models.py:122 xpack/plugins/gathered_user/models.py:30 +#: xpack/plugins/cloud/models.py:121 xpack/plugins/gathered_user/models.py:30 msgid "Created by" msgstr "によって作成された" @@ -716,7 +716,7 @@ msgstr "トリガーモード" #: xpack/plugins/change_auth_plan/models/base.py:201 #: xpack/plugins/change_auth_plan/serializers/app.py:66 #: xpack/plugins/change_auth_plan/serializers/asset.py:179 -#: xpack/plugins/cloud/models.py:179 +#: xpack/plugins/cloud/models.py:178 msgid "Reason" msgstr "理由" @@ -744,7 +744,7 @@ msgstr "OK" #: assets/models/base.py:32 audits/models.py:116 #: xpack/plugins/change_auth_plan/serializers/app.py:88 #: xpack/plugins/change_auth_plan/serializers/asset.py:198 -#: xpack/plugins/cloud/const.py:31 +#: xpack/plugins/cloud/const.py:30 msgid "Failed" msgstr "失敗しました" @@ -815,7 +815,7 @@ msgid "Default" msgstr "デフォルト" #: assets/models/cluster.py:36 assets/models/label.py:14 rbac/const.py:6 -#: users/models/user.py:903 +#: users/models/user.py:900 msgid "System" msgstr "システム" @@ -954,7 +954,7 @@ msgid "Parent key" msgstr "親キー" #: assets/models/node.py:559 assets/serializers/system_user.py:263 -#: xpack/plugins/cloud/models.py:96 xpack/plugins/cloud/serializers/task.py:69 +#: xpack/plugins/cloud/models.py:95 xpack/plugins/cloud/serializers/task.py:69 msgid "Node" msgstr "ノード" @@ -1126,10 +1126,14 @@ msgstr "キーパスワード" msgid "private key invalid or passphrase error" msgstr "秘密鍵が無効またはpassphraseエラー" -#: assets/serializers/cmd_filter.py:51 +#: assets/serializers/cmd_filter.py:35 assets/serializers/cmd_filter.py:50 msgid "Action display" msgstr "アクション表示" +#: assets/serializers/cmd_filter.py:51 ops/models/adhoc.py:155 +msgid "Pattern" +msgstr "パターン" + #: assets/serializers/domain.py:13 assets/serializers/label.py:12 #: assets/serializers/system_user.py:59 #: perms/serializers/asset/permission.py:49 @@ -1482,8 +1486,8 @@ msgid "MFA" msgstr "MFA" #: audits/models.py:126 terminal/models/status.py:33 -#: tickets/models/ticket.py:140 xpack/plugins/cloud/models.py:175 -#: xpack/plugins/cloud/models.py:227 +#: tickets/models/ticket.py:140 xpack/plugins/cloud/models.py:174 +#: xpack/plugins/cloud/models.py:226 msgid "Status" msgstr "ステータス" @@ -1520,7 +1524,7 @@ msgid "Hosts display" msgstr "ホスト表示" #: audits/serializers.py:96 ops/models/command.py:27 -#: xpack/plugins/cloud/models.py:173 +#: xpack/plugins/cloud/models.py:172 msgid "Result" msgstr "結果" @@ -2177,7 +2181,7 @@ msgstr "コードエラー" #: authentication/templates/authentication/_msg_reset_password.html:3 #: authentication/templates/authentication/_msg_rest_password_success.html:2 #: authentication/templates/authentication/_msg_rest_public_key_success.html:2 -#: jumpserver/conf.py:298 ops/tasks.py:145 ops/tasks.py:148 +#: jumpserver/conf.py:299 ops/tasks.py:145 ops/tasks.py:148 #: perms/templates/perms/_msg_item_permissions_expire.html:3 #: perms/templates/perms/_msg_permed_items_expire.html:3 #: users/templates/users/_msg_account_expire_reminder.html:4 @@ -2638,11 +2642,11 @@ msgstr "特殊文字を含むべきではない" msgid "The mobile phone number format is incorrect" msgstr "携帯電話番号の形式が正しくありません" -#: jumpserver/conf.py:297 +#: jumpserver/conf.py:298 msgid "Create account successfully" msgstr "アカウントを正常に作成" -#: jumpserver/conf.py:299 +#: jumpserver/conf.py:300 msgid "Your account has been created successfully" msgstr "アカウントが正常に作成されました" @@ -2765,10 +2769,6 @@ msgstr "タスクモニターを表示できます" msgid "Tasks" msgstr "タスク" -#: ops/models/adhoc.py:155 -msgid "Pattern" -msgstr "パターン" - #: ops/models/adhoc.py:156 msgid "Options" msgstr "オプション" @@ -3106,15 +3106,15 @@ msgstr "質問があったら、管理者に連絡して下さい" msgid "My applications" msgstr "私のアプリケーション" -#: rbac/api/role.py:32 +#: rbac/api/role.py:33 msgid "Internal role, can't be destroy" msgstr "内部の役割は、破壊することはできません" -#: rbac/api/role.py:36 +#: rbac/api/role.py:37 msgid "The role has been bound to users, can't be destroy" msgstr "ロールはユーザーにバインドされており、破壊することはできません" -#: rbac/api/role.py:43 +#: rbac/api/role.py:44 msgid "Internal role, can't be update" msgstr "内部ロール、更新できません" @@ -3190,11 +3190,11 @@ msgstr "権限" msgid "Built-in" msgstr "内蔵" -#: rbac/models/role.py:130 +#: rbac/models/role.py:144 msgid "System role" msgstr "システムの役割" -#: rbac/models/role.py:138 +#: rbac/models/role.py:152 msgid "Organization role" msgstr "組織の役割" @@ -3202,22 +3202,22 @@ msgstr "組織の役割" msgid "Role binding" msgstr "ロールバインディング" -#: rbac/models/rolebinding.py:128 +#: rbac/models/rolebinding.py:150 msgid "" "User last role in org, can not be delete, you can remove user from org " "instead" msgstr "" "ユーザーの最後のロールは削除できません。ユーザーを組織から削除できます。" -#: rbac/models/rolebinding.py:135 +#: rbac/models/rolebinding.py:157 msgid "Organization role binding" msgstr "組織の役割バインディング" -#: rbac/models/rolebinding.py:150 +#: rbac/models/rolebinding.py:172 msgid "System role binding" msgstr "システムロールバインディング" -#: rbac/serializers/permission.py:26 users/serializers/profile.py:126 +#: rbac/serializers/permission.py:26 users/serializers/profile.py:127 msgid "Perms" msgstr "パーマ" @@ -4541,11 +4541,11 @@ msgstr "" "WindowsはクライアントをダウンロードしてSSH資産に接続する必要があり、macOSシス" "テムは独自のTerminalを採用している。" -#: templates/resource_download.html:51 +#: templates/resource_download.html:53 msgid "Windows Remote application publisher tools" msgstr "Windowsリモートアプリケーション発行者ツール" -#: templates/resource_download.html:52 +#: templates/resource_download.html:54 msgid "" "Jmservisor is the program used to pull up remote applications in Windows " "Remote Application publisher" @@ -4557,7 +4557,7 @@ msgstr "" msgid "Filters" msgstr "フィルター" -#: terminal/api/endpoint.py:65 +#: terminal/api/endpoint.py:63 msgid "Not found protocol query params" msgstr "" @@ -4953,7 +4953,7 @@ msgstr "バケット" msgid "Secret key" msgstr "秘密キー" -#: terminal/serializers/storage.py:64 xpack/plugins/cloud/models.py:220 +#: terminal/serializers/storage.py:64 xpack/plugins/cloud/models.py:219 msgid "Region" msgstr "リージョン" @@ -5546,7 +5546,7 @@ msgid "Public key should not be the same as your old one." msgstr "公開鍵は古いものと同じであってはなりません。" #: users/forms/profile.py:149 users/serializers/profile.py:95 -#: users/serializers/profile.py:176 users/serializers/profile.py:203 +#: users/serializers/profile.py:178 users/serializers/profile.py:205 msgid "Not a valid ssh public key" msgstr "有効なssh公開鍵ではありません" @@ -5590,27 +5590,27 @@ msgstr "最終更新日パスワード" msgid "Need update password" msgstr "更新パスワードが必要" -#: users/models/user.py:888 +#: users/models/user.py:885 msgid "Can invite user" msgstr "ユーザーを招待できます" -#: users/models/user.py:889 +#: users/models/user.py:886 msgid "Can remove user" msgstr "ユーザーを削除できます" -#: users/models/user.py:890 +#: users/models/user.py:887 msgid "Can match user" msgstr "ユーザーに一致できます" -#: users/models/user.py:899 +#: users/models/user.py:896 msgid "Administrator" msgstr "管理者" -#: users/models/user.py:902 +#: users/models/user.py:899 msgid "Administrator is the super user of system" msgstr "管理者はシステムのスーパーユーザーです" -#: users/models/user.py:927 +#: users/models/user.py:924 msgid "User password history" msgstr "ユーザーパスワード履歴" @@ -5649,7 +5649,7 @@ msgstr "MFAのリセット" msgid "The old password is incorrect" msgstr "古いパスワードが正しくありません" -#: users/serializers/profile.py:36 users/serializers/profile.py:190 +#: users/serializers/profile.py:36 users/serializers/profile.py:192 msgid "Password does not match security rules" msgstr "パスワードがセキュリティルールと一致しない" @@ -5661,7 +5661,7 @@ msgstr "新しいパスワードを最後の {} 個のパスワードにする msgid "The newly set password is inconsistent" msgstr "新しく設定されたパスワードが一致しない" -#: users/serializers/profile.py:142 users/serializers/user.py:140 +#: users/serializers/profile.py:144 users/serializers/user.py:140 msgid "Is first login" msgstr "最初のログインです" @@ -6225,62 +6225,58 @@ msgid "Baidu Cloud" msgstr "百度雲" #: xpack/plugins/cloud/const.py:15 -msgid "JD Cloud" -msgstr "京東雲" - -#: xpack/plugins/cloud/const.py:16 msgid "Tencent Cloud" msgstr "テンセント雲" -#: xpack/plugins/cloud/const.py:17 +#: xpack/plugins/cloud/const.py:16 msgid "VMware" msgstr "VMware" -#: xpack/plugins/cloud/const.py:18 xpack/plugins/cloud/providers/nutanix.py:13 +#: xpack/plugins/cloud/const.py:17 xpack/plugins/cloud/providers/nutanix.py:13 msgid "Nutanix" msgstr "Nutanix" -#: xpack/plugins/cloud/const.py:19 +#: xpack/plugins/cloud/const.py:18 msgid "Huawei Private Cloud" msgstr "華為私有雲" -#: xpack/plugins/cloud/const.py:20 +#: xpack/plugins/cloud/const.py:19 msgid "Qingyun Private Cloud" msgstr "青雲私有雲" -#: xpack/plugins/cloud/const.py:21 +#: xpack/plugins/cloud/const.py:20 msgid "OpenStack" msgstr "OpenStack" -#: xpack/plugins/cloud/const.py:22 +#: xpack/plugins/cloud/const.py:21 msgid "Google Cloud Platform" msgstr "谷歌雲" -#: xpack/plugins/cloud/const.py:26 +#: xpack/plugins/cloud/const.py:25 msgid "Instance name" msgstr "インスタンス名" -#: xpack/plugins/cloud/const.py:27 +#: xpack/plugins/cloud/const.py:26 msgid "Instance name and Partial IP" msgstr "インスタンス名と部分IP" -#: xpack/plugins/cloud/const.py:32 +#: xpack/plugins/cloud/const.py:31 msgid "Succeed" msgstr "成功" -#: xpack/plugins/cloud/const.py:36 +#: xpack/plugins/cloud/const.py:35 msgid "Unsync" msgstr "同期していません" -#: xpack/plugins/cloud/const.py:37 +#: xpack/plugins/cloud/const.py:36 msgid "New Sync" msgstr "新しい同期" -#: xpack/plugins/cloud/const.py:38 +#: xpack/plugins/cloud/const.py:37 msgid "Synced" msgstr "同期済み" -#: xpack/plugins/cloud/const.py:39 +#: xpack/plugins/cloud/const.py:38 msgid "Released" msgstr "リリース済み" @@ -6288,79 +6284,79 @@ msgstr "リリース済み" msgid "Cloud center" msgstr "クラウドセンター" -#: xpack/plugins/cloud/models.py:30 +#: xpack/plugins/cloud/models.py:29 msgid "Provider" msgstr "プロバイダー" -#: xpack/plugins/cloud/models.py:34 +#: xpack/plugins/cloud/models.py:33 msgid "Validity" msgstr "有効性" -#: xpack/plugins/cloud/models.py:39 +#: xpack/plugins/cloud/models.py:38 msgid "Cloud account" msgstr "クラウドアカウント" -#: xpack/plugins/cloud/models.py:41 +#: xpack/plugins/cloud/models.py:40 msgid "Test cloud account" msgstr "クラウドアカウントのテスト" -#: xpack/plugins/cloud/models.py:85 xpack/plugins/cloud/serializers/task.py:66 +#: xpack/plugins/cloud/models.py:84 xpack/plugins/cloud/serializers/task.py:66 msgid "Account" msgstr "アカウント" -#: xpack/plugins/cloud/models.py:88 xpack/plugins/cloud/serializers/task.py:37 +#: xpack/plugins/cloud/models.py:87 xpack/plugins/cloud/serializers/task.py:37 msgid "Regions" msgstr "リージョン" -#: xpack/plugins/cloud/models.py:91 +#: xpack/plugins/cloud/models.py:90 msgid "Hostname strategy" msgstr "ホスト名戦略" -#: xpack/plugins/cloud/models.py:100 xpack/plugins/cloud/serializers/task.py:67 +#: xpack/plugins/cloud/models.py:99 xpack/plugins/cloud/serializers/task.py:67 msgid "Unix admin user" msgstr "Unix adminユーザー" -#: xpack/plugins/cloud/models.py:104 xpack/plugins/cloud/serializers/task.py:68 +#: xpack/plugins/cloud/models.py:103 xpack/plugins/cloud/serializers/task.py:68 msgid "Windows admin user" msgstr "Windows管理者" -#: xpack/plugins/cloud/models.py:110 xpack/plugins/cloud/serializers/task.py:45 +#: xpack/plugins/cloud/models.py:109 xpack/plugins/cloud/serializers/task.py:45 msgid "IP network segment group" msgstr "IPネットワークセグメントグループ" -#: xpack/plugins/cloud/models.py:113 xpack/plugins/cloud/serializers/task.py:71 +#: xpack/plugins/cloud/models.py:112 xpack/plugins/cloud/serializers/task.py:71 msgid "Always update" msgstr "常に更新" -#: xpack/plugins/cloud/models.py:119 +#: xpack/plugins/cloud/models.py:118 msgid "Date last sync" msgstr "最終同期日" -#: xpack/plugins/cloud/models.py:130 xpack/plugins/cloud/models.py:171 +#: xpack/plugins/cloud/models.py:129 xpack/plugins/cloud/models.py:170 msgid "Sync instance task" msgstr "インスタンスの同期タスク" -#: xpack/plugins/cloud/models.py:182 xpack/plugins/cloud/models.py:230 +#: xpack/plugins/cloud/models.py:181 xpack/plugins/cloud/models.py:229 msgid "Date sync" msgstr "日付の同期" -#: xpack/plugins/cloud/models.py:186 +#: xpack/plugins/cloud/models.py:185 msgid "Sync instance task execution" msgstr "インスタンスタスクの同期実行" -#: xpack/plugins/cloud/models.py:210 +#: xpack/plugins/cloud/models.py:209 msgid "Sync task" msgstr "同期タスク" -#: xpack/plugins/cloud/models.py:214 +#: xpack/plugins/cloud/models.py:213 msgid "Sync instance task history" msgstr "インスタンスタスク履歴の同期" -#: xpack/plugins/cloud/models.py:217 +#: xpack/plugins/cloud/models.py:216 msgid "Instance" msgstr "インスタンス" -#: xpack/plugins/cloud/models.py:234 +#: xpack/plugins/cloud/models.py:233 msgid "Sync instance detail" msgstr "同期インスタンスの詳細" @@ -6457,13 +6453,11 @@ msgid "South America (São Paulo)" msgstr "南米 (サンパウロ)" #: xpack/plugins/cloud/providers/baiducloud.py:54 -#: xpack/plugins/cloud/providers/jdcloud.py:127 msgid "CN North-Beijing" msgstr "華北-北京" #: xpack/plugins/cloud/providers/baiducloud.py:55 #: xpack/plugins/cloud/providers/huaweicloud.py:40 -#: xpack/plugins/cloud/providers/jdcloud.py:130 msgid "CN South-Guangzhou" msgstr "華南-広州" @@ -6485,7 +6479,6 @@ msgid "CN North-Baoding" msgstr "華北-保定" #: xpack/plugins/cloud/providers/baiducloud.py:60 -#: xpack/plugins/cloud/providers/jdcloud.py:129 msgid "CN East-Shanghai" msgstr "華東-上海" @@ -6550,15 +6543,11 @@ msgstr "華北-ウランチャブ一" msgid "CN South-Guangzhou-InvitationOnly" msgstr "華南-広州-友好ユーザー環境" -#: xpack/plugins/cloud/providers/jdcloud.py:128 -msgid "CN East-Suqian" -msgstr "華東-宿遷" - -#: xpack/plugins/cloud/serializers/account.py:60 +#: xpack/plugins/cloud/serializers/account.py:59 msgid "Validity display" msgstr "有効表示" -#: xpack/plugins/cloud/serializers/account.py:61 +#: xpack/plugins/cloud/serializers/account.py:60 msgid "Provider display" msgstr "プロバイダ表示" @@ -6722,6 +6711,12 @@ msgstr "究極のエディション" msgid "Community edition" msgstr "コミュニティ版" +#~ msgid "JD Cloud" +#~ msgstr "京東雲" + +#~ msgid "CN East-Suqian" +#~ msgstr "華東-宿遷" + #~ msgid "Inherit" #~ msgstr "継承" diff --git a/apps/locale/zh/LC_MESSAGES/django.po b/apps/locale/zh/LC_MESSAGES/django.po index 5682b29ff..a7387c76f 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-04-13 20:35+0800\n" +"POT-Creation-Date: 2022-04-19 11:24+0800\n" "PO-Revision-Date: 2021-05-20 10:54+0800\n" "Last-Translator: ibuler \n" "Language-Team: JumpServer team\n" @@ -32,7 +32,7 @@ msgstr "访问控制" #: terminal/models/storage.py:23 terminal/models/task.py:16 #: terminal/models/terminal.py:100 users/forms/profile.py:32 #: users/models/group.py:15 users/models/user.py:661 -#: xpack/plugins/cloud/models.py:28 +#: xpack/plugins/cloud/models.py:27 msgid "Name" msgstr "名称" @@ -65,7 +65,7 @@ msgstr "激活中" #: tickets/models/comment.py:24 tickets/models/ticket.py:154 #: users/models/group.py:16 users/models/user.py:698 #: xpack/plugins/change_auth_plan/models/base.py:44 -#: xpack/plugins/cloud/models.py:35 xpack/plugins/cloud/models.py:116 +#: xpack/plugins/cloud/models.py:34 xpack/plugins/cloud/models.py:115 #: xpack/plugins/gathered_user/models.py:26 msgid "Comment" msgstr "备注" @@ -91,8 +91,8 @@ msgstr "登录复核" #: terminal/backends/command/models.py:20 #: terminal/backends/command/serializers.py:12 terminal/models/session.py:44 #: terminal/notifications.py:91 terminal/notifications.py:139 -#: tickets/models/comment.py:17 users/const.py:14 users/models/user.py:886 -#: users/models/user.py:917 users/serializers/group.py:19 +#: tickets/models/comment.py:17 users/const.py:14 users/models/user.py:883 +#: users/models/user.py:914 users/serializers/group.py:19 msgid "User" msgstr "用户" @@ -133,7 +133,7 @@ msgstr "系统用户" #: terminal/notifications.py:90 #: xpack/plugins/change_auth_plan/models/asset.py:199 #: xpack/plugins/change_auth_plan/serializers/asset.py:180 -#: xpack/plugins/cloud/models.py:223 +#: xpack/plugins/cloud/models.py:222 msgid "Asset" msgstr "资产" @@ -313,8 +313,8 @@ msgstr "类型" msgid "Domain" msgstr "网域" -#: applications/models/application.py:228 xpack/plugins/cloud/models.py:33 -#: xpack/plugins/cloud/serializers/account.py:59 +#: applications/models/application.py:228 xpack/plugins/cloud/models.py:32 +#: xpack/plugins/cloud/serializers/account.py:58 msgid "Attrs" msgstr "属性" @@ -322,7 +322,7 @@ msgstr "属性" msgid "Can match application" msgstr "匹配应用" -#: applications/models/application.py:306 +#: applications/models/application.py:305 msgid "Application user" msgstr "应用用户" @@ -335,8 +335,8 @@ msgstr "类别名称" #: applications/serializers/application.py:71 #: applications/serializers/application.py:102 -#: assets/serializers/system_user.py:27 audits/serializers.py:29 -#: perms/serializers/application/permission.py:19 +#: assets/serializers/cmd_filter.py:34 assets/serializers/system_user.py:27 +#: audits/serializers.py:29 perms/serializers/application/permission.py:19 #: tickets/serializers/ticket/meta/ticket_type/apply_application.py:33 #: tickets/serializers/ticket/ticket.py:21 #: tickets/serializers/ticket/ticket.py:173 @@ -348,17 +348,17 @@ msgstr "类型名称" #: assets/models/domain.py:26 assets/models/gathered_user.py:19 #: assets/models/group.py:22 assets/models/label.py:25 #: assets/serializers/account.py:18 assets/serializers/cmd_filter.py:28 -#: assets/serializers/cmd_filter.py:49 common/db/models.py:113 +#: assets/serializers/cmd_filter.py:48 common/db/models.py:113 #: common/mixins/models.py:50 ops/models/adhoc.py:39 ops/models/command.py:30 #: orgs/models.py:67 orgs/models.py:217 perms/models/base.py:92 -#: users/models/group.py:18 users/models/user.py:918 -#: xpack/plugins/cloud/models.py:125 +#: users/models/group.py:18 users/models/user.py:915 +#: xpack/plugins/cloud/models.py:124 msgid "Date created" msgstr "创建日期" #: applications/serializers/application.py:104 assets/models/base.py:182 #: assets/models/gathered_user.py:20 assets/serializers/account.py:21 -#: assets/serializers/cmd_filter.py:29 assets/serializers/cmd_filter.py:50 +#: assets/serializers/cmd_filter.py:29 assets/serializers/cmd_filter.py:49 #: common/db/models.py:114 common/mixins/models.py:51 ops/models/adhoc.py:40 #: orgs/models.py:218 msgid "Date updated" @@ -567,7 +567,7 @@ msgstr "主机名原始" #: assets/models/asset.py:215 assets/serializers/account.py:16 #: assets/serializers/asset.py:65 perms/serializers/asset/user_permission.py:41 -#: xpack/plugins/cloud/models.py:107 xpack/plugins/cloud/serializers/task.py:42 +#: xpack/plugins/cloud/models.py:106 xpack/plugins/cloud/serializers/task.py:42 msgid "Protocols" msgstr "协议组" @@ -607,7 +607,7 @@ msgstr "标签管理" #: orgs/models.py:219 perms/models/base.py:91 users/models/user.py:706 #: users/serializers/group.py:33 #: xpack/plugins/change_auth_plan/models/base.py:48 -#: xpack/plugins/cloud/models.py:122 xpack/plugins/gathered_user/models.py:30 +#: xpack/plugins/cloud/models.py:121 xpack/plugins/gathered_user/models.py:30 msgid "Created by" msgstr "创建者" @@ -711,7 +711,7 @@ msgstr "触发模式" #: xpack/plugins/change_auth_plan/models/base.py:201 #: xpack/plugins/change_auth_plan/serializers/app.py:66 #: xpack/plugins/change_auth_plan/serializers/asset.py:179 -#: xpack/plugins/cloud/models.py:179 +#: xpack/plugins/cloud/models.py:178 msgid "Reason" msgstr "原因" @@ -739,7 +739,7 @@ msgstr "成功" #: assets/models/base.py:32 audits/models.py:116 #: xpack/plugins/change_auth_plan/serializers/app.py:88 #: xpack/plugins/change_auth_plan/serializers/asset.py:198 -#: xpack/plugins/cloud/const.py:31 +#: xpack/plugins/cloud/const.py:30 msgid "Failed" msgstr "失败" @@ -810,7 +810,7 @@ msgid "Default" msgstr "默认" #: assets/models/cluster.py:36 assets/models/label.py:14 rbac/const.py:6 -#: users/models/user.py:903 +#: users/models/user.py:900 msgid "System" msgstr "系统" @@ -949,7 +949,7 @@ msgid "Parent key" msgstr "ssh私钥" #: assets/models/node.py:559 assets/serializers/system_user.py:263 -#: xpack/plugins/cloud/models.py:96 xpack/plugins/cloud/serializers/task.py:69 +#: xpack/plugins/cloud/models.py:95 xpack/plugins/cloud/serializers/task.py:69 msgid "Node" msgstr "节点" @@ -1118,9 +1118,13 @@ msgstr "密钥密码" msgid "private key invalid or passphrase error" msgstr "密钥不合法或密钥密码错误" -#: assets/serializers/cmd_filter.py:51 +#: assets/serializers/cmd_filter.py:35 assets/serializers/cmd_filter.py:50 msgid "Action display" -msgstr "动作" +msgstr "动作名称" + +#: assets/serializers/cmd_filter.py:51 ops/models/adhoc.py:155 +msgid "Pattern" +msgstr "模式" #: assets/serializers/domain.py:13 assets/serializers/label.py:12 #: assets/serializers/system_user.py:59 @@ -1470,8 +1474,8 @@ msgid "MFA" msgstr "MFA" #: audits/models.py:126 terminal/models/status.py:33 -#: tickets/models/ticket.py:140 xpack/plugins/cloud/models.py:175 -#: xpack/plugins/cloud/models.py:227 +#: tickets/models/ticket.py:140 xpack/plugins/cloud/models.py:174 +#: xpack/plugins/cloud/models.py:226 msgid "Status" msgstr "状态" @@ -1508,7 +1512,7 @@ msgid "Hosts display" msgstr "主机名称" #: audits/serializers.py:96 ops/models/command.py:27 -#: xpack/plugins/cloud/models.py:173 +#: xpack/plugins/cloud/models.py:172 msgid "Result" msgstr "结果" @@ -2156,7 +2160,7 @@ msgstr "代码错误" #: authentication/templates/authentication/_msg_reset_password.html:3 #: authentication/templates/authentication/_msg_rest_password_success.html:2 #: authentication/templates/authentication/_msg_rest_public_key_success.html:2 -#: jumpserver/conf.py:298 ops/tasks.py:145 ops/tasks.py:148 +#: jumpserver/conf.py:299 ops/tasks.py:145 ops/tasks.py:148 #: perms/templates/perms/_msg_item_permissions_expire.html:3 #: perms/templates/perms/_msg_permed_items_expire.html:3 #: users/templates/users/_msg_account_expire_reminder.html:4 @@ -2608,11 +2612,11 @@ msgstr "不能包含特殊字符" msgid "The mobile phone number format is incorrect" msgstr "手机号格式不正确" -#: jumpserver/conf.py:297 +#: jumpserver/conf.py:298 msgid "Create account successfully" msgstr "创建账号成功" -#: jumpserver/conf.py:299 +#: jumpserver/conf.py:300 msgid "Your account has been created successfully" msgstr "你的账号已创建成功" @@ -2730,10 +2734,6 @@ msgstr "可以查看任务监控" msgid "Tasks" msgstr "任务" -#: ops/models/adhoc.py:155 -msgid "Pattern" -msgstr "模式" - #: ops/models/adhoc.py:156 msgid "Options" msgstr "选项" @@ -3069,15 +3069,15 @@ msgstr "如果有疑问或需求,请联系系统管理员" msgid "My applications" msgstr "我的应用" -#: rbac/api/role.py:32 +#: rbac/api/role.py:33 msgid "Internal role, can't be destroy" msgstr "内部角色,不能删除" -#: rbac/api/role.py:36 +#: rbac/api/role.py:37 msgid "The role has been bound to users, can't be destroy" msgstr "角色已绑定用户,不能删除" -#: rbac/api/role.py:43 +#: rbac/api/role.py:44 msgid "Internal role, can't be update" msgstr "内部角色,不能更新" @@ -3153,11 +3153,11 @@ msgstr "授权" msgid "Built-in" msgstr "内置" -#: rbac/models/role.py:130 +#: rbac/models/role.py:144 msgid "System role" msgstr "系统角色" -#: rbac/models/role.py:138 +#: rbac/models/role.py:152 msgid "Organization role" msgstr "组织角色" @@ -3165,21 +3165,21 @@ msgstr "组织角色" msgid "Role binding" msgstr "角色绑定" -#: rbac/models/rolebinding.py:128 +#: rbac/models/rolebinding.py:150 msgid "" "User last role in org, can not be delete, you can remove user from org " "instead" msgstr "用户最后一个角色,不能删除,你可以将用户从组织移除" -#: rbac/models/rolebinding.py:135 +#: rbac/models/rolebinding.py:157 msgid "Organization role binding" msgstr "组织角色绑定" -#: rbac/models/rolebinding.py:150 +#: rbac/models/rolebinding.py:172 msgid "System role binding" msgstr "系统角色绑定" -#: rbac/serializers/permission.py:26 users/serializers/profile.py:126 +#: rbac/serializers/permission.py:26 users/serializers/profile.py:127 msgid "Perms" msgstr "权限" @@ -4446,8 +4446,8 @@ msgid "" "JumpServer Client, currently used to launch the client, now only support " "launch RDP SSH client, The Telnet client will next" msgstr "" -"JumpServer 客户端,目前用来唤起 特定客户端程序 连接资产, 目前仅支持 RDP SSH 客户" -"端,Telnet 会在未来支持" +"JumpServer 客户端,目前用来唤起 特定客户端程序 连接资产, 目前仅支持 RDP SSH " +"客户端,Telnet 会在未来支持" #: templates/resource_download.html:30 msgid "Microsoft" @@ -4469,11 +4469,11 @@ msgid "" "system uses its own terminal" msgstr "Windows 需要下载客户端来连接SSH资产,macOS系统采用自带的Terminal" -#: templates/resource_download.html:51 +#: templates/resource_download.html:53 msgid "Windows Remote application publisher tools" msgstr "Windows 远程应用发布服务器工具" -#: templates/resource_download.html:52 +#: templates/resource_download.html:54 msgid "" "Jmservisor is the program used to pull up remote applications in Windows " "Remote Application publisher" @@ -4483,7 +4483,7 @@ msgstr "Jmservisor 是在 windows 远程应用发布服务器中用来拉起远 msgid "Filters" msgstr "过滤" -#: terminal/api/endpoint.py:65 +#: terminal/api/endpoint.py:63 msgid "Not found protocol query params" msgstr "" @@ -4879,7 +4879,7 @@ msgstr "桶名称" msgid "Secret key" msgstr "密钥" -#: terminal/serializers/storage.py:64 xpack/plugins/cloud/models.py:220 +#: terminal/serializers/storage.py:64 xpack/plugins/cloud/models.py:219 msgid "Region" msgstr "地域" @@ -5468,7 +5468,7 @@ msgid "Public key should not be the same as your old one." msgstr "不能和原来的密钥相同" #: users/forms/profile.py:149 users/serializers/profile.py:95 -#: users/serializers/profile.py:176 users/serializers/profile.py:203 +#: users/serializers/profile.py:178 users/serializers/profile.py:205 msgid "Not a valid ssh public key" msgstr "SSH密钥不合法" @@ -5512,27 +5512,27 @@ msgstr "最后更新密码日期" msgid "Need update password" msgstr "需要更新密码" -#: users/models/user.py:888 +#: users/models/user.py:885 msgid "Can invite user" msgstr "可以邀请用户" -#: users/models/user.py:889 +#: users/models/user.py:886 msgid "Can remove user" msgstr "可以移除用户" -#: users/models/user.py:890 +#: users/models/user.py:887 msgid "Can match user" msgstr "可以匹配用户" -#: users/models/user.py:899 +#: users/models/user.py:896 msgid "Administrator" msgstr "管理员" -#: users/models/user.py:902 +#: users/models/user.py:899 msgid "Administrator is the super user of system" msgstr "Administrator是初始的超级管理员" -#: users/models/user.py:927 +#: users/models/user.py:924 msgid "User password history" msgstr "用户密码历史" @@ -5571,7 +5571,7 @@ msgstr "重置 MFA" msgid "The old password is incorrect" msgstr "旧密码错误" -#: users/serializers/profile.py:36 users/serializers/profile.py:190 +#: users/serializers/profile.py:36 users/serializers/profile.py:192 msgid "Password does not match security rules" msgstr "密码不满足安全规则" @@ -5583,7 +5583,7 @@ msgstr "新密码不能是最近 {} 次的密码" msgid "The newly set password is inconsistent" msgstr "两次密码不一致" -#: users/serializers/profile.py:142 users/serializers/user.py:140 +#: users/serializers/profile.py:144 users/serializers/user.py:140 msgid "Is first login" msgstr "首次登录" @@ -6134,62 +6134,58 @@ msgid "Baidu Cloud" msgstr "百度云" #: xpack/plugins/cloud/const.py:15 -msgid "JD Cloud" -msgstr "京东云" - -#: xpack/plugins/cloud/const.py:16 msgid "Tencent Cloud" msgstr "腾讯云" -#: xpack/plugins/cloud/const.py:17 +#: xpack/plugins/cloud/const.py:16 msgid "VMware" msgstr "VMware" -#: xpack/plugins/cloud/const.py:18 xpack/plugins/cloud/providers/nutanix.py:13 +#: xpack/plugins/cloud/const.py:17 xpack/plugins/cloud/providers/nutanix.py:13 msgid "Nutanix" msgstr "Nutanix" -#: xpack/plugins/cloud/const.py:19 +#: xpack/plugins/cloud/const.py:18 msgid "Huawei Private Cloud" msgstr "华为私有云" -#: xpack/plugins/cloud/const.py:20 +#: xpack/plugins/cloud/const.py:19 msgid "Qingyun Private Cloud" msgstr "青云私有云" -#: xpack/plugins/cloud/const.py:21 +#: xpack/plugins/cloud/const.py:20 msgid "OpenStack" msgstr "OpenStack" -#: xpack/plugins/cloud/const.py:22 +#: xpack/plugins/cloud/const.py:21 msgid "Google Cloud Platform" msgstr "谷歌云" -#: xpack/plugins/cloud/const.py:26 +#: xpack/plugins/cloud/const.py:25 msgid "Instance name" msgstr "实例名称" -#: xpack/plugins/cloud/const.py:27 +#: xpack/plugins/cloud/const.py:26 msgid "Instance name and Partial IP" msgstr "实例名称和部分IP" -#: xpack/plugins/cloud/const.py:32 +#: xpack/plugins/cloud/const.py:31 msgid "Succeed" msgstr "成功" -#: xpack/plugins/cloud/const.py:36 +#: xpack/plugins/cloud/const.py:35 msgid "Unsync" msgstr "未同步" -#: xpack/plugins/cloud/const.py:37 +#: xpack/plugins/cloud/const.py:36 msgid "New Sync" msgstr "新同步" -#: xpack/plugins/cloud/const.py:38 +#: xpack/plugins/cloud/const.py:37 msgid "Synced" msgstr "已同步" -#: xpack/plugins/cloud/const.py:39 +#: xpack/plugins/cloud/const.py:38 msgid "Released" msgstr "已释放" @@ -6197,79 +6193,79 @@ msgstr "已释放" msgid "Cloud center" msgstr "云管中心" -#: xpack/plugins/cloud/models.py:30 +#: xpack/plugins/cloud/models.py:29 msgid "Provider" msgstr "云服务商" -#: xpack/plugins/cloud/models.py:34 +#: xpack/plugins/cloud/models.py:33 msgid "Validity" msgstr "有效" -#: xpack/plugins/cloud/models.py:39 +#: xpack/plugins/cloud/models.py:38 msgid "Cloud account" msgstr "云账号" -#: xpack/plugins/cloud/models.py:41 +#: xpack/plugins/cloud/models.py:40 msgid "Test cloud account" msgstr "测试云账号" -#: xpack/plugins/cloud/models.py:85 xpack/plugins/cloud/serializers/task.py:66 +#: xpack/plugins/cloud/models.py:84 xpack/plugins/cloud/serializers/task.py:66 msgid "Account" msgstr "账号" -#: xpack/plugins/cloud/models.py:88 xpack/plugins/cloud/serializers/task.py:37 +#: xpack/plugins/cloud/models.py:87 xpack/plugins/cloud/serializers/task.py:37 msgid "Regions" msgstr "地域" -#: xpack/plugins/cloud/models.py:91 +#: xpack/plugins/cloud/models.py:90 msgid "Hostname strategy" msgstr "主机名策略" -#: xpack/plugins/cloud/models.py:100 xpack/plugins/cloud/serializers/task.py:67 +#: xpack/plugins/cloud/models.py:99 xpack/plugins/cloud/serializers/task.py:67 msgid "Unix admin user" msgstr "Unix 管理员" -#: xpack/plugins/cloud/models.py:104 xpack/plugins/cloud/serializers/task.py:68 +#: xpack/plugins/cloud/models.py:103 xpack/plugins/cloud/serializers/task.py:68 msgid "Windows admin user" msgstr "Windows 管理员" -#: xpack/plugins/cloud/models.py:110 xpack/plugins/cloud/serializers/task.py:45 +#: xpack/plugins/cloud/models.py:109 xpack/plugins/cloud/serializers/task.py:45 msgid "IP network segment group" msgstr "IP网段组" -#: xpack/plugins/cloud/models.py:113 xpack/plugins/cloud/serializers/task.py:71 +#: xpack/plugins/cloud/models.py:112 xpack/plugins/cloud/serializers/task.py:71 msgid "Always update" msgstr "总是更新" -#: xpack/plugins/cloud/models.py:119 +#: xpack/plugins/cloud/models.py:118 msgid "Date last sync" msgstr "最后同步日期" -#: xpack/plugins/cloud/models.py:130 xpack/plugins/cloud/models.py:171 +#: xpack/plugins/cloud/models.py:129 xpack/plugins/cloud/models.py:170 msgid "Sync instance task" msgstr "同步实例任务" -#: xpack/plugins/cloud/models.py:182 xpack/plugins/cloud/models.py:230 +#: xpack/plugins/cloud/models.py:181 xpack/plugins/cloud/models.py:229 msgid "Date sync" msgstr "同步日期" -#: xpack/plugins/cloud/models.py:186 +#: xpack/plugins/cloud/models.py:185 msgid "Sync instance task execution" msgstr "同步实例任务执行" -#: xpack/plugins/cloud/models.py:210 +#: xpack/plugins/cloud/models.py:209 msgid "Sync task" msgstr "同步任务" -#: xpack/plugins/cloud/models.py:214 +#: xpack/plugins/cloud/models.py:213 msgid "Sync instance task history" msgstr "同步实例任务历史" -#: xpack/plugins/cloud/models.py:217 +#: xpack/plugins/cloud/models.py:216 msgid "Instance" msgstr "实例" -#: xpack/plugins/cloud/models.py:234 +#: xpack/plugins/cloud/models.py:233 msgid "Sync instance detail" msgstr "同步实例详情" @@ -6366,13 +6362,11 @@ msgid "South America (São Paulo)" msgstr "南美洲(圣保罗)" #: xpack/plugins/cloud/providers/baiducloud.py:54 -#: xpack/plugins/cloud/providers/jdcloud.py:127 msgid "CN North-Beijing" msgstr "华北-北京" #: xpack/plugins/cloud/providers/baiducloud.py:55 #: xpack/plugins/cloud/providers/huaweicloud.py:40 -#: xpack/plugins/cloud/providers/jdcloud.py:130 msgid "CN South-Guangzhou" msgstr "华南-广州" @@ -6394,7 +6388,6 @@ msgid "CN North-Baoding" msgstr "华北-保定" #: xpack/plugins/cloud/providers/baiducloud.py:60 -#: xpack/plugins/cloud/providers/jdcloud.py:129 msgid "CN East-Shanghai" msgstr "华东-上海" @@ -6459,15 +6452,11 @@ msgstr "华北-乌兰察布一" msgid "CN South-Guangzhou-InvitationOnly" msgstr "华南-广州-友好用户环境" -#: xpack/plugins/cloud/providers/jdcloud.py:128 -msgid "CN East-Suqian" -msgstr "华东-宿迁" - -#: xpack/plugins/cloud/serializers/account.py:60 +#: xpack/plugins/cloud/serializers/account.py:59 msgid "Validity display" msgstr "有效性显示" -#: xpack/plugins/cloud/serializers/account.py:61 +#: xpack/plugins/cloud/serializers/account.py:60 msgid "Provider display" msgstr "服务商显示" @@ -6630,6 +6619,12 @@ msgstr "旗舰版" msgid "Community edition" msgstr "社区版" +#~ msgid "JD Cloud" +#~ msgstr "京东云" + +#~ msgid "CN East-Suqian" +#~ msgstr "华东-宿迁" + #~ msgid "Inherit" #~ msgstr "继承" From be2708f83de684e8079625849b56bc9b81318b18 Mon Sep 17 00:00:00 2001 From: "Jiangjie.Bai" Date: Tue, 19 Apr 2022 14:26:17 +0800 Subject: [PATCH 02/12] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dajax=E8=AF=B7?= =?UTF-8?q?=E6=B1=82=E6=90=BA=E5=B8=A6csrftoken=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/static/js/jumpserver.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/static/js/jumpserver.js b/apps/static/js/jumpserver.js index b930154ff..070c811f7 100644 --- a/apps/static/js/jumpserver.js +++ b/apps/static/js/jumpserver.js @@ -125,8 +125,9 @@ function csrfSafeMethod(method) { } function setAjaxCSRFToken() { - var csrftoken = getCookie('csrftoken'); - var sessionid = getCookie('sessionid'); + const prefix = getCookie('SESSION_COOKIE_NAME_PREFIX', '') + var csrftoken = getCookie(`${prefix}csrftoken`); + var sessionid = getCookie(`${prefix}sessionid`); $.ajaxSetup({ beforeSend: function (xhr, settings) { From f8fade4cf2d1e1f5b773dce7e790b012c41e6f06 Mon Sep 17 00:00:00 2001 From: "Jiangjie.Bai" Date: Tue, 19 Apr 2022 16:01:05 +0800 Subject: [PATCH 03/12] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E9=A1=B9=20KoKo=20SSH=20Client=20=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 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 | 158 ++++++++++++------------- apps/locale/zh/LC_MESSAGES/django.mo | 4 +- apps/locale/zh/LC_MESSAGES/django.po | 161 ++++++++++++-------------- apps/settings/api/public.py | 1 + apps/settings/serializers/terminal.py | 3 +- 8 files changed, 159 insertions(+), 174 deletions(-) diff --git a/apps/jumpserver/conf.py b/apps/jumpserver/conf.py index ec35ae6e5..fa4a211d4 100644 --- a/apps/jumpserver/conf.py +++ b/apps/jumpserver/conf.py @@ -317,6 +317,7 @@ class Config(dict): 'TERMINAL_RDP_ADDR': '', # 保留(Luna还在用) 'TERMINAL_MAGNUS_ENABLED': True, + 'TERMINAL_KOKO_SSH_ENABLED': True, # 保留(Luna还在用) 'XRDP_ENABLED': True, diff --git a/apps/jumpserver/settings/custom.py b/apps/jumpserver/settings/custom.py index cafdc1a59..ecd710a2e 100644 --- a/apps/jumpserver/settings/custom.py +++ b/apps/jumpserver/settings/custom.py @@ -140,6 +140,7 @@ CLOUD_SYNC_TASK_EXECUTION_KEEP_DAYS = CONFIG.CLOUD_SYNC_TASK_EXECUTION_KEEP_DAYS XRDP_ENABLED = CONFIG.XRDP_ENABLED TERMINAL_MAGNUS_ENABLED = CONFIG.TERMINAL_MAGNUS_ENABLED +TERMINAL_KOKO_SSH_ENABLED = CONFIG.TERMINAL_KOKO_SSH_ENABLED # SMS enabled SMS_ENABLED = CONFIG.SMS_ENABLED diff --git a/apps/locale/ja/LC_MESSAGES/django.mo b/apps/locale/ja/LC_MESSAGES/django.mo index c5ec670bb..e13ed4cfb 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:54be66877253eed7bec1db706604af83a48f1c5fbc95eef1132c7f880fef154a -size 125598 +oid sha256:4e6962699271d0f5402223321e65211f1c7ad0b7a9b43524f3a0fac7ea2541d9 +size 125623 diff --git a/apps/locale/ja/LC_MESSAGES/django.po b/apps/locale/ja/LC_MESSAGES/django.po index 40ee2d43c..5377b3dda 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-04-19 11:24+0800\n" +"POT-Creation-Date: 2022-04-19 15:57+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -33,7 +33,7 @@ msgstr "Acls" #: terminal/models/storage.py:23 terminal/models/task.py:16 #: terminal/models/terminal.py:100 users/forms/profile.py:32 #: users/models/group.py:15 users/models/user.py:661 -#: xpack/plugins/cloud/models.py:27 +#: xpack/plugins/cloud/models.py:28 msgid "Name" msgstr "名前" @@ -66,7 +66,7 @@ msgstr "アクティブ" #: tickets/models/comment.py:24 tickets/models/ticket.py:154 #: users/models/group.py:16 users/models/user.py:698 #: xpack/plugins/change_auth_plan/models/base.py:44 -#: xpack/plugins/cloud/models.py:34 xpack/plugins/cloud/models.py:115 +#: xpack/plugins/cloud/models.py:35 xpack/plugins/cloud/models.py:116 #: xpack/plugins/gathered_user/models.py:26 msgid "Comment" msgstr "コメント" @@ -88,7 +88,7 @@ msgstr "ログイン確認" #: assets/models/cmd_filter.py:30 assets/models/label.py:15 audits/models.py:37 #: audits/models.py:60 audits/models.py:85 audits/serializers.py:100 #: authentication/models.py:51 orgs/models.py:214 perms/models/base.py:84 -#: rbac/builtin.py:107 rbac/models/rolebinding.py:40 +#: rbac/builtin.py:110 rbac/models/rolebinding.py:40 #: terminal/backends/command/models.py:20 #: terminal/backends/command/serializers.py:12 terminal/models/session.py:44 #: terminal/notifications.py:91 terminal/notifications.py:139 @@ -134,7 +134,7 @@ msgstr "システムユーザー" #: terminal/notifications.py:90 #: xpack/plugins/change_auth_plan/models/asset.py:199 #: xpack/plugins/change_auth_plan/serializers/asset.py:180 -#: xpack/plugins/cloud/models.py:222 +#: xpack/plugins/cloud/models.py:223 msgid "Asset" msgstr "資産" @@ -318,8 +318,8 @@ msgstr "タイプ" msgid "Domain" msgstr "ドメイン" -#: applications/models/application.py:228 xpack/plugins/cloud/models.py:32 -#: xpack/plugins/cloud/serializers/account.py:58 +#: applications/models/application.py:228 xpack/plugins/cloud/models.py:33 +#: xpack/plugins/cloud/serializers/account.py:59 msgid "Attrs" msgstr "ツールバーの" @@ -357,7 +357,7 @@ msgstr "タイプ表示" #: common/mixins/models.py:50 ops/models/adhoc.py:39 ops/models/command.py:30 #: orgs/models.py:67 orgs/models.py:217 perms/models/base.py:92 #: users/models/group.py:18 users/models/user.py:915 -#: xpack/plugins/cloud/models.py:124 +#: xpack/plugins/cloud/models.py:125 msgid "Date created" msgstr "作成された日付" @@ -572,7 +572,7 @@ msgstr "ホスト名生" #: assets/models/asset.py:215 assets/serializers/account.py:16 #: assets/serializers/asset.py:65 perms/serializers/asset/user_permission.py:41 -#: xpack/plugins/cloud/models.py:106 xpack/plugins/cloud/serializers/task.py:42 +#: xpack/plugins/cloud/models.py:107 xpack/plugins/cloud/serializers/task.py:42 msgid "Protocols" msgstr "プロトコル" @@ -612,7 +612,7 @@ msgstr "ラベル" #: orgs/models.py:219 perms/models/base.py:91 users/models/user.py:706 #: users/serializers/group.py:33 #: xpack/plugins/change_auth_plan/models/base.py:48 -#: xpack/plugins/cloud/models.py:121 xpack/plugins/gathered_user/models.py:30 +#: xpack/plugins/cloud/models.py:122 xpack/plugins/gathered_user/models.py:30 msgid "Created by" msgstr "によって作成された" @@ -716,7 +716,7 @@ msgstr "トリガーモード" #: xpack/plugins/change_auth_plan/models/base.py:201 #: xpack/plugins/change_auth_plan/serializers/app.py:66 #: xpack/plugins/change_auth_plan/serializers/asset.py:179 -#: xpack/plugins/cloud/models.py:178 +#: xpack/plugins/cloud/models.py:179 msgid "Reason" msgstr "理由" @@ -744,7 +744,7 @@ msgstr "OK" #: assets/models/base.py:32 audits/models.py:116 #: xpack/plugins/change_auth_plan/serializers/app.py:88 #: xpack/plugins/change_auth_plan/serializers/asset.py:198 -#: xpack/plugins/cloud/const.py:30 +#: xpack/plugins/cloud/const.py:31 msgid "Failed" msgstr "失敗しました" @@ -954,7 +954,7 @@ msgid "Parent key" msgstr "親キー" #: assets/models/node.py:559 assets/serializers/system_user.py:263 -#: xpack/plugins/cloud/models.py:95 xpack/plugins/cloud/serializers/task.py:69 +#: xpack/plugins/cloud/models.py:96 xpack/plugins/cloud/serializers/task.py:69 msgid "Node" msgstr "ノード" @@ -1486,8 +1486,8 @@ msgid "MFA" msgstr "MFA" #: audits/models.py:126 terminal/models/status.py:33 -#: tickets/models/ticket.py:140 xpack/plugins/cloud/models.py:174 -#: xpack/plugins/cloud/models.py:226 +#: tickets/models/ticket.py:140 xpack/plugins/cloud/models.py:175 +#: xpack/plugins/cloud/models.py:227 msgid "Status" msgstr "ステータス" @@ -1524,7 +1524,7 @@ msgid "Hosts display" msgstr "ホスト表示" #: audits/serializers.py:96 ops/models/command.py:27 -#: xpack/plugins/cloud/models.py:172 +#: xpack/plugins/cloud/models.py:173 msgid "Result" msgstr "結果" @@ -3126,27 +3126,27 @@ msgstr "{} 少なくとも1つのシステムロール" msgid "RBAC" msgstr "RBAC" -#: rbac/builtin.py:98 +#: rbac/builtin.py:101 msgid "SystemAdmin" msgstr "システム管理者" -#: rbac/builtin.py:101 +#: rbac/builtin.py:104 msgid "SystemAuditor" msgstr "システム監査人" -#: rbac/builtin.py:104 +#: rbac/builtin.py:107 msgid "SystemComponent" msgstr "システムコンポーネント" -#: rbac/builtin.py:110 +#: rbac/builtin.py:113 msgid "OrgAdmin" msgstr "組織管理者" -#: rbac/builtin.py:113 +#: rbac/builtin.py:116 msgid "OrgAuditor" msgstr "監査員を組織する" -#: rbac/builtin.py:116 +#: rbac/builtin.py:119 msgid "OrgUser" msgstr "組織ユーザー" @@ -4225,10 +4225,10 @@ msgstr "Telnetログインregex" #: settings/serializers/terminal.py:33 msgid "" -"The login success message varies with devices. if you cannot log in to the " -"device through Telnet, set this parameter" +"Tips: The login success message varies with devices. if you cannot log in to " +"the device through Telnet, set this parameter" msgstr "" -"ログイン成功メッセージはデバイスによって異なります。Telnet経由でデバイスにロ" +"ヒント: ログイン成功メッセージはデバイスによって異なります。Telnet経由でデバイスにロ" "グインできない場合は、このパラメーターを設定します。" #: settings/serializers/terminal.py:36 @@ -4239,6 +4239,10 @@ msgstr "属性マップの有効化" msgid "Enable XRDP" msgstr "XRDPの有効化" +#: settings/serializers/terminal.py:38 +msgid "Enable KoKo SSH" +msgstr "KoKo SSHの有効化" + #: settings/utils/ldap.py:417 msgid "ldap:// or ldaps:// protocol is used." msgstr "ldap:// または ldaps:// プロトコルが使用されます。" @@ -4953,7 +4957,7 @@ msgstr "バケット" msgid "Secret key" msgstr "秘密キー" -#: terminal/serializers/storage.py:64 xpack/plugins/cloud/models.py:219 +#: terminal/serializers/storage.py:64 xpack/plugins/cloud/models.py:220 msgid "Region" msgstr "リージョン" @@ -6225,58 +6229,62 @@ msgid "Baidu Cloud" msgstr "百度雲" #: xpack/plugins/cloud/const.py:15 +msgid "JD Cloud" +msgstr "京東雲" + +#: xpack/plugins/cloud/const.py:16 msgid "Tencent Cloud" msgstr "テンセント雲" -#: xpack/plugins/cloud/const.py:16 +#: xpack/plugins/cloud/const.py:17 msgid "VMware" msgstr "VMware" -#: xpack/plugins/cloud/const.py:17 xpack/plugins/cloud/providers/nutanix.py:13 +#: xpack/plugins/cloud/const.py:18 xpack/plugins/cloud/providers/nutanix.py:13 msgid "Nutanix" msgstr "Nutanix" -#: xpack/plugins/cloud/const.py:18 +#: xpack/plugins/cloud/const.py:19 msgid "Huawei Private Cloud" msgstr "華為私有雲" -#: xpack/plugins/cloud/const.py:19 +#: xpack/plugins/cloud/const.py:20 msgid "Qingyun Private Cloud" msgstr "青雲私有雲" -#: xpack/plugins/cloud/const.py:20 +#: xpack/plugins/cloud/const.py:21 msgid "OpenStack" msgstr "OpenStack" -#: xpack/plugins/cloud/const.py:21 +#: xpack/plugins/cloud/const.py:22 msgid "Google Cloud Platform" msgstr "谷歌雲" -#: xpack/plugins/cloud/const.py:25 +#: xpack/plugins/cloud/const.py:26 msgid "Instance name" msgstr "インスタンス名" -#: xpack/plugins/cloud/const.py:26 +#: xpack/plugins/cloud/const.py:27 msgid "Instance name and Partial IP" msgstr "インスタンス名と部分IP" -#: xpack/plugins/cloud/const.py:31 +#: xpack/plugins/cloud/const.py:32 msgid "Succeed" msgstr "成功" -#: xpack/plugins/cloud/const.py:35 +#: xpack/plugins/cloud/const.py:36 msgid "Unsync" msgstr "同期していません" -#: xpack/plugins/cloud/const.py:36 +#: xpack/plugins/cloud/const.py:37 msgid "New Sync" msgstr "新しい同期" -#: xpack/plugins/cloud/const.py:37 +#: xpack/plugins/cloud/const.py:38 msgid "Synced" msgstr "同期済み" -#: xpack/plugins/cloud/const.py:38 +#: xpack/plugins/cloud/const.py:39 msgid "Released" msgstr "リリース済み" @@ -6284,79 +6292,79 @@ msgstr "リリース済み" msgid "Cloud center" msgstr "クラウドセンター" -#: xpack/plugins/cloud/models.py:29 +#: xpack/plugins/cloud/models.py:30 msgid "Provider" msgstr "プロバイダー" -#: xpack/plugins/cloud/models.py:33 +#: xpack/plugins/cloud/models.py:34 msgid "Validity" msgstr "有効性" -#: xpack/plugins/cloud/models.py:38 +#: xpack/plugins/cloud/models.py:39 msgid "Cloud account" msgstr "クラウドアカウント" -#: xpack/plugins/cloud/models.py:40 +#: xpack/plugins/cloud/models.py:41 msgid "Test cloud account" msgstr "クラウドアカウントのテスト" -#: xpack/plugins/cloud/models.py:84 xpack/plugins/cloud/serializers/task.py:66 +#: xpack/plugins/cloud/models.py:85 xpack/plugins/cloud/serializers/task.py:66 msgid "Account" msgstr "アカウント" -#: xpack/plugins/cloud/models.py:87 xpack/plugins/cloud/serializers/task.py:37 +#: xpack/plugins/cloud/models.py:88 xpack/plugins/cloud/serializers/task.py:37 msgid "Regions" msgstr "リージョン" -#: xpack/plugins/cloud/models.py:90 +#: xpack/plugins/cloud/models.py:91 msgid "Hostname strategy" msgstr "ホスト名戦略" -#: xpack/plugins/cloud/models.py:99 xpack/plugins/cloud/serializers/task.py:67 +#: xpack/plugins/cloud/models.py:100 xpack/plugins/cloud/serializers/task.py:67 msgid "Unix admin user" msgstr "Unix adminユーザー" -#: xpack/plugins/cloud/models.py:103 xpack/plugins/cloud/serializers/task.py:68 +#: xpack/plugins/cloud/models.py:104 xpack/plugins/cloud/serializers/task.py:68 msgid "Windows admin user" msgstr "Windows管理者" -#: xpack/plugins/cloud/models.py:109 xpack/plugins/cloud/serializers/task.py:45 +#: xpack/plugins/cloud/models.py:110 xpack/plugins/cloud/serializers/task.py:45 msgid "IP network segment group" msgstr "IPネットワークセグメントグループ" -#: xpack/plugins/cloud/models.py:112 xpack/plugins/cloud/serializers/task.py:71 +#: xpack/plugins/cloud/models.py:113 xpack/plugins/cloud/serializers/task.py:71 msgid "Always update" msgstr "常に更新" -#: xpack/plugins/cloud/models.py:118 +#: xpack/plugins/cloud/models.py:119 msgid "Date last sync" msgstr "最終同期日" -#: xpack/plugins/cloud/models.py:129 xpack/plugins/cloud/models.py:170 +#: xpack/plugins/cloud/models.py:130 xpack/plugins/cloud/models.py:171 msgid "Sync instance task" msgstr "インスタンスの同期タスク" -#: xpack/plugins/cloud/models.py:181 xpack/plugins/cloud/models.py:229 +#: xpack/plugins/cloud/models.py:182 xpack/plugins/cloud/models.py:230 msgid "Date sync" msgstr "日付の同期" -#: xpack/plugins/cloud/models.py:185 +#: xpack/plugins/cloud/models.py:186 msgid "Sync instance task execution" msgstr "インスタンスタスクの同期実行" -#: xpack/plugins/cloud/models.py:209 +#: xpack/plugins/cloud/models.py:210 msgid "Sync task" msgstr "同期タスク" -#: xpack/plugins/cloud/models.py:213 +#: xpack/plugins/cloud/models.py:214 msgid "Sync instance task history" msgstr "インスタンスタスク履歴の同期" -#: xpack/plugins/cloud/models.py:216 +#: xpack/plugins/cloud/models.py:217 msgid "Instance" msgstr "インスタンス" -#: xpack/plugins/cloud/models.py:233 +#: xpack/plugins/cloud/models.py:234 msgid "Sync instance detail" msgstr "同期インスタンスの詳細" @@ -6453,11 +6461,13 @@ msgid "South America (São Paulo)" msgstr "南米 (サンパウロ)" #: xpack/plugins/cloud/providers/baiducloud.py:54 +#: xpack/plugins/cloud/providers/jdcloud.py:127 msgid "CN North-Beijing" msgstr "華北-北京" #: xpack/plugins/cloud/providers/baiducloud.py:55 #: xpack/plugins/cloud/providers/huaweicloud.py:40 +#: xpack/plugins/cloud/providers/jdcloud.py:130 msgid "CN South-Guangzhou" msgstr "華南-広州" @@ -6479,6 +6489,7 @@ msgid "CN North-Baoding" msgstr "華北-保定" #: xpack/plugins/cloud/providers/baiducloud.py:60 +#: xpack/plugins/cloud/providers/jdcloud.py:129 msgid "CN East-Shanghai" msgstr "華東-上海" @@ -6543,11 +6554,15 @@ msgstr "華北-ウランチャブ一" msgid "CN South-Guangzhou-InvitationOnly" msgstr "華南-広州-友好ユーザー環境" -#: xpack/plugins/cloud/serializers/account.py:59 +#: xpack/plugins/cloud/providers/jdcloud.py:128 +msgid "CN East-Suqian" +msgstr "華東-宿遷" + +#: xpack/plugins/cloud/serializers/account.py:60 msgid "Validity display" msgstr "有効表示" -#: xpack/plugins/cloud/serializers/account.py:60 +#: xpack/plugins/cloud/serializers/account.py:61 msgid "Provider display" msgstr "プロバイダ表示" @@ -6710,26 +6725,3 @@ msgstr "究極のエディション" #: xpack/plugins/license/models.py:77 msgid "Community edition" msgstr "コミュニティ版" - -#~ msgid "JD Cloud" -#~ msgstr "京東雲" - -#~ msgid "CN East-Suqian" -#~ msgstr "華東-宿遷" - -#~ msgid "Inherit" -#~ msgstr "継承" - -#~ msgid "Include" -#~ msgstr "含める" - -#~ msgid "Exclude" -#~ msgstr "除外" - -#~ msgid "DatabaseApp" -#~ msgstr "データベースの適用" - -#, fuzzy -#~| msgid "Connection token" -#~ msgid "One time token" -#~ msgstr "接続トークン" diff --git a/apps/locale/zh/LC_MESSAGES/django.mo b/apps/locale/zh/LC_MESSAGES/django.mo index c77cc1659..c73d42f67 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:fa084dd92472110d4bea1674d1e9a96599f42f094aab92f8d34152fdf5726321 -size 103771 +oid sha256:3462a9a3eef8f372bf341f2066a33d85e1f01aca5a8fe506528a1cd0a37e98b4 +size 103951 diff --git a/apps/locale/zh/LC_MESSAGES/django.po b/apps/locale/zh/LC_MESSAGES/django.po index a7387c76f..77b7111be 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-04-19 11:24+0800\n" +"POT-Creation-Date: 2022-04-19 15:57+0800\n" "PO-Revision-Date: 2021-05-20 10:54+0800\n" "Last-Translator: ibuler \n" "Language-Team: JumpServer team\n" @@ -32,7 +32,7 @@ msgstr "访问控制" #: terminal/models/storage.py:23 terminal/models/task.py:16 #: terminal/models/terminal.py:100 users/forms/profile.py:32 #: users/models/group.py:15 users/models/user.py:661 -#: xpack/plugins/cloud/models.py:27 +#: xpack/plugins/cloud/models.py:28 msgid "Name" msgstr "名称" @@ -65,7 +65,7 @@ msgstr "激活中" #: tickets/models/comment.py:24 tickets/models/ticket.py:154 #: users/models/group.py:16 users/models/user.py:698 #: xpack/plugins/change_auth_plan/models/base.py:44 -#: xpack/plugins/cloud/models.py:34 xpack/plugins/cloud/models.py:115 +#: xpack/plugins/cloud/models.py:35 xpack/plugins/cloud/models.py:116 #: xpack/plugins/gathered_user/models.py:26 msgid "Comment" msgstr "备注" @@ -87,7 +87,7 @@ msgstr "登录复核" #: assets/models/cmd_filter.py:30 assets/models/label.py:15 audits/models.py:37 #: audits/models.py:60 audits/models.py:85 audits/serializers.py:100 #: authentication/models.py:51 orgs/models.py:214 perms/models/base.py:84 -#: rbac/builtin.py:107 rbac/models/rolebinding.py:40 +#: rbac/builtin.py:110 rbac/models/rolebinding.py:40 #: terminal/backends/command/models.py:20 #: terminal/backends/command/serializers.py:12 terminal/models/session.py:44 #: terminal/notifications.py:91 terminal/notifications.py:139 @@ -133,7 +133,7 @@ msgstr "系统用户" #: terminal/notifications.py:90 #: xpack/plugins/change_auth_plan/models/asset.py:199 #: xpack/plugins/change_auth_plan/serializers/asset.py:180 -#: xpack/plugins/cloud/models.py:222 +#: xpack/plugins/cloud/models.py:223 msgid "Asset" msgstr "资产" @@ -313,8 +313,8 @@ msgstr "类型" msgid "Domain" msgstr "网域" -#: applications/models/application.py:228 xpack/plugins/cloud/models.py:32 -#: xpack/plugins/cloud/serializers/account.py:58 +#: applications/models/application.py:228 xpack/plugins/cloud/models.py:33 +#: xpack/plugins/cloud/serializers/account.py:59 msgid "Attrs" msgstr "属性" @@ -352,7 +352,7 @@ msgstr "类型名称" #: common/mixins/models.py:50 ops/models/adhoc.py:39 ops/models/command.py:30 #: orgs/models.py:67 orgs/models.py:217 perms/models/base.py:92 #: users/models/group.py:18 users/models/user.py:915 -#: xpack/plugins/cloud/models.py:124 +#: xpack/plugins/cloud/models.py:125 msgid "Date created" msgstr "创建日期" @@ -567,7 +567,7 @@ msgstr "主机名原始" #: assets/models/asset.py:215 assets/serializers/account.py:16 #: assets/serializers/asset.py:65 perms/serializers/asset/user_permission.py:41 -#: xpack/plugins/cloud/models.py:106 xpack/plugins/cloud/serializers/task.py:42 +#: xpack/plugins/cloud/models.py:107 xpack/plugins/cloud/serializers/task.py:42 msgid "Protocols" msgstr "协议组" @@ -607,7 +607,7 @@ msgstr "标签管理" #: orgs/models.py:219 perms/models/base.py:91 users/models/user.py:706 #: users/serializers/group.py:33 #: xpack/plugins/change_auth_plan/models/base.py:48 -#: xpack/plugins/cloud/models.py:121 xpack/plugins/gathered_user/models.py:30 +#: xpack/plugins/cloud/models.py:122 xpack/plugins/gathered_user/models.py:30 msgid "Created by" msgstr "创建者" @@ -711,7 +711,7 @@ msgstr "触发模式" #: xpack/plugins/change_auth_plan/models/base.py:201 #: xpack/plugins/change_auth_plan/serializers/app.py:66 #: xpack/plugins/change_auth_plan/serializers/asset.py:179 -#: xpack/plugins/cloud/models.py:178 +#: xpack/plugins/cloud/models.py:179 msgid "Reason" msgstr "原因" @@ -739,7 +739,7 @@ msgstr "成功" #: assets/models/base.py:32 audits/models.py:116 #: xpack/plugins/change_auth_plan/serializers/app.py:88 #: xpack/plugins/change_auth_plan/serializers/asset.py:198 -#: xpack/plugins/cloud/const.py:30 +#: xpack/plugins/cloud/const.py:31 msgid "Failed" msgstr "失败" @@ -949,7 +949,7 @@ msgid "Parent key" msgstr "ssh私钥" #: assets/models/node.py:559 assets/serializers/system_user.py:263 -#: xpack/plugins/cloud/models.py:95 xpack/plugins/cloud/serializers/task.py:69 +#: xpack/plugins/cloud/models.py:96 xpack/plugins/cloud/serializers/task.py:69 msgid "Node" msgstr "节点" @@ -1474,8 +1474,8 @@ msgid "MFA" msgstr "MFA" #: audits/models.py:126 terminal/models/status.py:33 -#: tickets/models/ticket.py:140 xpack/plugins/cloud/models.py:174 -#: xpack/plugins/cloud/models.py:226 +#: tickets/models/ticket.py:140 xpack/plugins/cloud/models.py:175 +#: xpack/plugins/cloud/models.py:227 msgid "Status" msgstr "状态" @@ -1512,7 +1512,7 @@ msgid "Hosts display" msgstr "主机名称" #: audits/serializers.py:96 ops/models/command.py:27 -#: xpack/plugins/cloud/models.py:172 +#: xpack/plugins/cloud/models.py:173 msgid "Result" msgstr "结果" @@ -3089,27 +3089,27 @@ msgstr "{} 至少有一个系统角色" msgid "RBAC" msgstr "RBAC" -#: rbac/builtin.py:98 +#: rbac/builtin.py:101 msgid "SystemAdmin" msgstr "系统管理员" -#: rbac/builtin.py:101 +#: rbac/builtin.py:104 msgid "SystemAuditor" msgstr "系统审计员" -#: rbac/builtin.py:104 +#: rbac/builtin.py:107 msgid "SystemComponent" msgstr "系统组件" -#: rbac/builtin.py:110 +#: rbac/builtin.py:113 msgid "OrgAdmin" msgstr "组织管理员" -#: rbac/builtin.py:113 +#: rbac/builtin.py:116 msgid "OrgAuditor" msgstr "组织审计员" -#: rbac/builtin.py:116 +#: rbac/builtin.py:119 msgid "OrgUser" msgstr "组织用户" @@ -4165,9 +4165,9 @@ msgstr "Telnet 成功正则表达式" #: settings/serializers/terminal.py:33 msgid "" -"The login success message varies with devices. if you cannot log in to the " -"device through Telnet, set this parameter" -msgstr "不同设备登录成功提示不一样,所以如果 telnet 不能正常登录,可以这里设置" +"Tips: The login success message varies with devices. if you cannot log in to " +"the device through Telnet, set this parameter" +msgstr "提示: 不同设备登录成功提示不一样,所以如果 telnet 不能正常登录,可以这里设置" #: settings/serializers/terminal.py:36 msgid "Enable database proxy" @@ -4177,6 +4177,10 @@ msgstr "启用数据库组件" msgid "Enable XRDP" msgstr "启用 XRDP 服务" +#: settings/serializers/terminal.py:38 +msgid "Enable KoKo SSH" +msgstr "启用 KoKo SSH" + #: settings/utils/ldap.py:417 msgid "ldap:// or ldaps:// protocol is used." msgstr "使用 ldap:// 或 ldaps:// 协议" @@ -4879,7 +4883,7 @@ msgstr "桶名称" msgid "Secret key" msgstr "密钥" -#: terminal/serializers/storage.py:64 xpack/plugins/cloud/models.py:219 +#: terminal/serializers/storage.py:64 xpack/plugins/cloud/models.py:220 msgid "Region" msgstr "地域" @@ -6134,58 +6138,62 @@ msgid "Baidu Cloud" msgstr "百度云" #: xpack/plugins/cloud/const.py:15 +msgid "JD Cloud" +msgstr "京东云" + +#: xpack/plugins/cloud/const.py:16 msgid "Tencent Cloud" msgstr "腾讯云" -#: xpack/plugins/cloud/const.py:16 +#: xpack/plugins/cloud/const.py:17 msgid "VMware" msgstr "VMware" -#: xpack/plugins/cloud/const.py:17 xpack/plugins/cloud/providers/nutanix.py:13 +#: xpack/plugins/cloud/const.py:18 xpack/plugins/cloud/providers/nutanix.py:13 msgid "Nutanix" msgstr "Nutanix" -#: xpack/plugins/cloud/const.py:18 +#: xpack/plugins/cloud/const.py:19 msgid "Huawei Private Cloud" msgstr "华为私有云" -#: xpack/plugins/cloud/const.py:19 +#: xpack/plugins/cloud/const.py:20 msgid "Qingyun Private Cloud" msgstr "青云私有云" -#: xpack/plugins/cloud/const.py:20 +#: xpack/plugins/cloud/const.py:21 msgid "OpenStack" msgstr "OpenStack" -#: xpack/plugins/cloud/const.py:21 +#: xpack/plugins/cloud/const.py:22 msgid "Google Cloud Platform" msgstr "谷歌云" -#: xpack/plugins/cloud/const.py:25 +#: xpack/plugins/cloud/const.py:26 msgid "Instance name" msgstr "实例名称" -#: xpack/plugins/cloud/const.py:26 +#: xpack/plugins/cloud/const.py:27 msgid "Instance name and Partial IP" msgstr "实例名称和部分IP" -#: xpack/plugins/cloud/const.py:31 +#: xpack/plugins/cloud/const.py:32 msgid "Succeed" msgstr "成功" -#: xpack/plugins/cloud/const.py:35 +#: xpack/plugins/cloud/const.py:36 msgid "Unsync" msgstr "未同步" -#: xpack/plugins/cloud/const.py:36 +#: xpack/plugins/cloud/const.py:37 msgid "New Sync" msgstr "新同步" -#: xpack/plugins/cloud/const.py:37 +#: xpack/plugins/cloud/const.py:38 msgid "Synced" msgstr "已同步" -#: xpack/plugins/cloud/const.py:38 +#: xpack/plugins/cloud/const.py:39 msgid "Released" msgstr "已释放" @@ -6193,79 +6201,79 @@ msgstr "已释放" msgid "Cloud center" msgstr "云管中心" -#: xpack/plugins/cloud/models.py:29 +#: xpack/plugins/cloud/models.py:30 msgid "Provider" msgstr "云服务商" -#: xpack/plugins/cloud/models.py:33 +#: xpack/plugins/cloud/models.py:34 msgid "Validity" msgstr "有效" -#: xpack/plugins/cloud/models.py:38 +#: xpack/plugins/cloud/models.py:39 msgid "Cloud account" msgstr "云账号" -#: xpack/plugins/cloud/models.py:40 +#: xpack/plugins/cloud/models.py:41 msgid "Test cloud account" msgstr "测试云账号" -#: xpack/plugins/cloud/models.py:84 xpack/plugins/cloud/serializers/task.py:66 +#: xpack/plugins/cloud/models.py:85 xpack/plugins/cloud/serializers/task.py:66 msgid "Account" msgstr "账号" -#: xpack/plugins/cloud/models.py:87 xpack/plugins/cloud/serializers/task.py:37 +#: xpack/plugins/cloud/models.py:88 xpack/plugins/cloud/serializers/task.py:37 msgid "Regions" msgstr "地域" -#: xpack/plugins/cloud/models.py:90 +#: xpack/plugins/cloud/models.py:91 msgid "Hostname strategy" msgstr "主机名策略" -#: xpack/plugins/cloud/models.py:99 xpack/plugins/cloud/serializers/task.py:67 +#: xpack/plugins/cloud/models.py:100 xpack/plugins/cloud/serializers/task.py:67 msgid "Unix admin user" msgstr "Unix 管理员" -#: xpack/plugins/cloud/models.py:103 xpack/plugins/cloud/serializers/task.py:68 +#: xpack/plugins/cloud/models.py:104 xpack/plugins/cloud/serializers/task.py:68 msgid "Windows admin user" msgstr "Windows 管理员" -#: xpack/plugins/cloud/models.py:109 xpack/plugins/cloud/serializers/task.py:45 +#: xpack/plugins/cloud/models.py:110 xpack/plugins/cloud/serializers/task.py:45 msgid "IP network segment group" msgstr "IP网段组" -#: xpack/plugins/cloud/models.py:112 xpack/plugins/cloud/serializers/task.py:71 +#: xpack/plugins/cloud/models.py:113 xpack/plugins/cloud/serializers/task.py:71 msgid "Always update" msgstr "总是更新" -#: xpack/plugins/cloud/models.py:118 +#: xpack/plugins/cloud/models.py:119 msgid "Date last sync" msgstr "最后同步日期" -#: xpack/plugins/cloud/models.py:129 xpack/plugins/cloud/models.py:170 +#: xpack/plugins/cloud/models.py:130 xpack/plugins/cloud/models.py:171 msgid "Sync instance task" msgstr "同步实例任务" -#: xpack/plugins/cloud/models.py:181 xpack/plugins/cloud/models.py:229 +#: xpack/plugins/cloud/models.py:182 xpack/plugins/cloud/models.py:230 msgid "Date sync" msgstr "同步日期" -#: xpack/plugins/cloud/models.py:185 +#: xpack/plugins/cloud/models.py:186 msgid "Sync instance task execution" msgstr "同步实例任务执行" -#: xpack/plugins/cloud/models.py:209 +#: xpack/plugins/cloud/models.py:210 msgid "Sync task" msgstr "同步任务" -#: xpack/plugins/cloud/models.py:213 +#: xpack/plugins/cloud/models.py:214 msgid "Sync instance task history" msgstr "同步实例任务历史" -#: xpack/plugins/cloud/models.py:216 +#: xpack/plugins/cloud/models.py:217 msgid "Instance" msgstr "实例" -#: xpack/plugins/cloud/models.py:233 +#: xpack/plugins/cloud/models.py:234 msgid "Sync instance detail" msgstr "同步实例详情" @@ -6362,11 +6370,13 @@ msgid "South America (São Paulo)" msgstr "南美洲(圣保罗)" #: xpack/plugins/cloud/providers/baiducloud.py:54 +#: xpack/plugins/cloud/providers/jdcloud.py:127 msgid "CN North-Beijing" msgstr "华北-北京" #: xpack/plugins/cloud/providers/baiducloud.py:55 #: xpack/plugins/cloud/providers/huaweicloud.py:40 +#: xpack/plugins/cloud/providers/jdcloud.py:130 msgid "CN South-Guangzhou" msgstr "华南-广州" @@ -6388,6 +6398,7 @@ msgid "CN North-Baoding" msgstr "华北-保定" #: xpack/plugins/cloud/providers/baiducloud.py:60 +#: xpack/plugins/cloud/providers/jdcloud.py:129 msgid "CN East-Shanghai" msgstr "华东-上海" @@ -6452,11 +6463,15 @@ msgstr "华北-乌兰察布一" msgid "CN South-Guangzhou-InvitationOnly" msgstr "华南-广州-友好用户环境" -#: xpack/plugins/cloud/serializers/account.py:59 +#: xpack/plugins/cloud/providers/jdcloud.py:128 +msgid "CN East-Suqian" +msgstr "华东-宿迁" + +#: xpack/plugins/cloud/serializers/account.py:60 msgid "Validity display" msgstr "有效性显示" -#: xpack/plugins/cloud/serializers/account.py:60 +#: xpack/plugins/cloud/serializers/account.py:61 msgid "Provider display" msgstr "服务商显示" @@ -6618,29 +6633,3 @@ msgstr "旗舰版" #: xpack/plugins/license/models.py:77 msgid "Community edition" msgstr "社区版" - -#~ msgid "JD Cloud" -#~ msgstr "京东云" - -#~ msgid "CN East-Suqian" -#~ msgstr "华东-宿迁" - -#~ msgid "Inherit" -#~ msgstr "继承" - -#~ msgid "Include" -#~ msgstr "包含" - -#~ msgid "Exclude" -#~ msgstr "不包含" - -#~ msgid "DatabaseApp" -#~ msgstr "数据库应用" - -#~ msgid "Database proxy MySQL protocol listen port" -#~ msgstr "MySQL 协议监听的端口" - -#, fuzzy -#~| msgid "Database proxy PostgreSQL port" -#~ msgid "Database proxy PostgreSQL listen port" -#~ msgstr "数据库组件 PostgreSQL 协议监听的端口" diff --git a/apps/settings/api/public.py b/apps/settings/api/public.py index 5efa54319..b9076618d 100644 --- a/apps/settings/api/public.py +++ b/apps/settings/api/public.py @@ -65,6 +65,7 @@ class PublicSettingApi(generics.RetrieveAPIView): # Terminal "XRDP_ENABLED": settings.XRDP_ENABLED, "TERMINAL_MAGNUS_ENABLED": settings.TERMINAL_MAGNUS_ENABLED, + "TERMINAL_KOKO_SSH_ENABLED": settings.TERMINAL_KOKO_SSH_ENABLED, # Announcement "ANNOUNCEMENT_ENABLED": settings.ANNOUNCEMENT_ENABLED, "ANNOUNCEMENT": settings.ANNOUNCEMENT, diff --git a/apps/settings/serializers/terminal.py b/apps/settings/serializers/terminal.py index bf4b8d7a0..8cdb9e065 100644 --- a/apps/settings/serializers/terminal.py +++ b/apps/settings/serializers/terminal.py @@ -30,8 +30,9 @@ class TerminalSettingSerializer(serializers.Serializer): ) TERMINAL_TELNET_REGEX = serializers.CharField( allow_blank=True, max_length=1024, required=False, label=_('Telnet login regex'), - help_text=_("The login success message varies with devices. " + help_text=_("Tips: The login success message varies with devices. " "if you cannot log in to the device through Telnet, set this parameter") ) TERMINAL_MAGNUS_ENABLED = serializers.BooleanField(label=_("Enable database proxy")) XRDP_ENABLED = serializers.BooleanField(label=_("Enable XRDP")) + TERMINAL_KOKO_SSH_ENABLED = serializers.BooleanField(label=_("Enable KoKo SSH")) From 3b9cb2a99c74d3e4abb71b0591f513220e4a9fa5 Mon Sep 17 00:00:00 2001 From: "Jiangjie.Bai" Date: Tue, 19 Apr 2022 16:25:29 +0800 Subject: [PATCH 04/12] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E7=BF=BB?= =?UTF-8?q?=E8=AF=91=E4=B8=B4=E6=97=B6=E5=AF=86=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/locale/ja/LC_MESSAGES/django.po | 2 +- apps/locale/zh/LC_MESSAGES/django.po | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/locale/ja/LC_MESSAGES/django.po b/apps/locale/ja/LC_MESSAGES/django.po index 5377b3dda..8c5147c50 100644 --- a/apps/locale/ja/LC_MESSAGES/django.po +++ b/apps/locale/ja/LC_MESSAGES/django.po @@ -1570,7 +1570,7 @@ msgstr "DingTalk" #: audits/signal_handlers.py:73 authentication/models.py:76 msgid "Temporary token" -msgstr "一時的なトークン" +msgstr "仮パスワード" #: audits/signal_handlers.py:107 msgid "User and Group" diff --git a/apps/locale/zh/LC_MESSAGES/django.po b/apps/locale/zh/LC_MESSAGES/django.po index 77b7111be..5160cbfcf 100644 --- a/apps/locale/zh/LC_MESSAGES/django.po +++ b/apps/locale/zh/LC_MESSAGES/django.po @@ -1558,7 +1558,7 @@ msgstr "钉钉" #: audits/signal_handlers.py:73 authentication/models.py:76 msgid "Temporary token" -msgstr "临时 Token" +msgstr "临时密码" #: audits/signal_handlers.py:107 msgid "User and Group" From 500477fad17d4a02331f8407ed38be1d3338a465 Mon Sep 17 00:00:00 2001 From: halo Date: Tue, 19 Apr 2022 17:06:05 +0800 Subject: [PATCH 05/12] =?UTF-8?q?fix:=20ftp=E6=97=A5=E5=BF=97=E6=B8=85?= =?UTF-8?q?=E7=90=86bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/audits/tasks.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/audits/tasks.py b/apps/audits/tasks.py index 171fbe633..10fb67f44 100644 --- a/apps/audits/tasks.py +++ b/apps/audits/tasks.py @@ -7,7 +7,7 @@ from celery import shared_task from ops.celery.decorator import ( register_as_period_task ) -from .models import UserLoginLog, OperateLog +from .models import UserLoginLog, OperateLog, FTPLog from common.utils import get_log_keep_day @@ -29,7 +29,7 @@ def clean_ftp_log_period(): now = timezone.now() days = get_log_keep_day('FTP_LOG_KEEP_DAYS') expired_day = now - datetime.timedelta(days=days) - OperateLog.objects.filter(datetime__lt=expired_day).delete() + FTPLog.objects.filter(datetime__lt=expired_day).delete() @register_as_period_task(interval=3600*24) From b4ac24ad6df81cf051e96a109e9c3083edfeab65 Mon Sep 17 00:00:00 2001 From: "Jiangjie.Bai" Date: Tue, 19 Apr 2022 16:44:11 +0800 Subject: [PATCH 06/12] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9endpoint/rule?= =?UTF-8?q?=E6=9D=83=E9=99=90=E6=A0=91=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/rbac/tree.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/rbac/tree.py b/apps/rbac/tree.py index dfccafa8f..a585bdf5c 100644 --- a/apps/rbac/tree.py +++ b/apps/rbac/tree.py @@ -86,6 +86,8 @@ special_pid_mapper = { 'terminal.replaystorage': 'terminal_node', 'terminal.status': 'terminal_node', 'terminal.task': 'terminal_node', + 'terminal.endpoint': 'terminal_node', + 'terminal.endpointrule': 'terminal_node', 'audits.ftplog': 'terminal', 'perms.view_myassets': 'my_assets', 'perms.view_myapps': 'my_apps', From e4b0ab6a4585b1eef8db89518def30fb24d8a1d4 Mon Sep 17 00:00:00 2001 From: ibuler Date: Tue, 19 Apr 2022 16:17:16 +0800 Subject: [PATCH 07/12] =?UTF-8?q?perf:=20=E4=BF=AE=E6=94=B9=E5=91=BD?= =?UTF-8?q?=E4=BB=A4=E6=89=A7=E8=A1=8C=E5=8C=BA=E5=88=86=E7=BB=84=E7=BB=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../asset/user_permission/user_permission_nodes_with_assets.py | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/perms/api/asset/user_permission/user_permission_nodes_with_assets.py b/apps/perms/api/asset/user_permission/user_permission_nodes_with_assets.py index d65f08df6..5d3940c9f 100644 --- a/apps/perms/api/asset/user_permission/user_permission_nodes_with_assets.py +++ b/apps/perms/api/asset/user_permission/user_permission_nodes_with_assets.py @@ -65,7 +65,6 @@ class MyGrantedNodesWithAssetsAsTreeApi(SerializeToTreeNodeMixin, ListAPIView): all_assets = all_assets.annotate(parent_key=F('nodes__key')).prefetch_related('platform') data.extend(self.serialize_assets(all_assets)) - @tmp_to_root_org() def list(self, request: Request, *args, **kwargs): """ 此算法依赖 UserGrantedMappingNode From 0addba7c149248167a0fc5fc447530257e2f7506 Mon Sep 17 00:00:00 2001 From: ibuler Date: Tue, 19 Apr 2022 16:20:09 +0800 Subject: [PATCH 08/12] =?UTF-8?q?perf:=20=E4=BF=AE=E6=94=B9=20command=20?= =?UTF-8?q?=E5=91=BD=E4=BB=A4=E6=89=A7=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/perms/api/asset/user_permission/common.py | 1 - apps/perms/api/system_user_permission.py | 3 --- 2 files changed, 4 deletions(-) diff --git a/apps/perms/api/asset/user_permission/common.py b/apps/perms/api/asset/user_permission/common.py index 1594cedb9..86bff2123 100644 --- a/apps/perms/api/asset/user_permission/common.py +++ b/apps/perms/api/asset/user_permission/common.py @@ -141,7 +141,6 @@ class UserGrantedAssetSystemUsersForAdminApi(ListAPIView): return queryset_list -@method_decorator(tmp_to_root_org(), name='list') class MyGrantedAssetSystemUsersApi(UserGrantedAssetSystemUsersForAdminApi): permission_classes = (IsValidUser,) diff --git a/apps/perms/api/system_user_permission.py b/apps/perms/api/system_user_permission.py index 48d440baa..6d7569192 100644 --- a/apps/perms/api/system_user_permission.py +++ b/apps/perms/api/system_user_permission.py @@ -1,14 +1,11 @@ from rest_framework import generics -from django.utils.decorators import method_decorator from assets.models import SystemUser from common.permissions import IsValidUser -from orgs.utils import tmp_to_root_org from perms.utils.asset.user_permission import get_user_all_asset_perm_ids from .. import serializers -@method_decorator(tmp_to_root_org(), name='list') class SystemUserPermission(generics.ListAPIView): permission_classes = (IsValidUser,) serializer_class = serializers.SystemUserSerializer From f026b86a204c7193e18f44695b876e15d9c09c09 Mon Sep 17 00:00:00 2001 From: "Jiangjie.Bai" Date: Tue, 19 Apr 2022 18:06:52 +0800 Subject: [PATCH 09/12] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E7=BB=84=E7=BB=87=E7=94=A8=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/users/models/user.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/users/models/user.py b/apps/users/models/user.py index 80b938468..b69cd5726 100644 --- a/apps/users/models/user.py +++ b/apps/users/models/user.py @@ -455,7 +455,7 @@ class RoleMixin: if org is None: org = current_org if not org.is_root(): - queryset = current_org.get_members() + queryset = org.get_members() queryset = cls.filter_not_service_account(queryset) return queryset From 5f370c1c049aee1bf9b75f486aa50426a8964653 Mon Sep 17 00:00:00 2001 From: "Jiangjie.Bai" Date: Tue, 19 Apr 2022 19:10:36 +0800 Subject: [PATCH 10/12] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E5=86=85?= =?UTF-8?q?=E7=BD=AE=E7=B3=BB=E7=BB=9F=E7=94=A8=E6=88=B7=E8=A7=92=E8=89=B2?= =?UTF-8?q?=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/authentication/api/access_key.py | 4 ++-- apps/authentication/api/temp_token.py | 7 +++++-- apps/common/validators.py | 2 +- apps/rbac/builtin.py | 3 ++- apps/rbac/const.py | 1 + 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/apps/authentication/api/access_key.py b/apps/authentication/api/access_key.py index 0762d0de9..bbda04c02 100644 --- a/apps/authentication/api/access_key.py +++ b/apps/authentication/api/access_key.py @@ -2,14 +2,14 @@ # from rest_framework.viewsets import ModelViewSet - -from common.permissions import IsValidUser from .. import serializers +from rbac.permissions import RBACPermission class AccessKeyViewSet(ModelViewSet): serializer_class = serializers.AccessKeySerializer search_fields = ['^id', '^secret'] + permission_classes = [RBACPermission] def get_queryset(self): return self.request.user.access_keys.all() diff --git a/apps/authentication/api/temp_token.py b/apps/authentication/api/temp_token.py index a8fcc02af..6e640edd6 100644 --- a/apps/authentication/api/temp_token.py +++ b/apps/authentication/api/temp_token.py @@ -3,15 +3,18 @@ from rest_framework.response import Response from rest_framework.decorators import action from common.drf.api import JMSModelViewSet -from common.permissions import IsValidUser from ..models import TempToken from ..serializers import TempTokenSerializer +from rbac.permissions import RBACPermission class TempTokenViewSet(JMSModelViewSet): serializer_class = TempTokenSerializer - permission_classes = [IsValidUser] + permission_classes = [RBACPermission] http_method_names = ['post', 'get', 'options', 'patch'] + rbac_perms = { + 'expire': 'authentication.change_temptoken', + } def get_queryset(self): username = self.request.user.username diff --git a/apps/common/validators.py b/apps/common/validators.py index 352482a1b..4be90d855 100644 --- a/apps/common/validators.py +++ b/apps/common/validators.py @@ -42,7 +42,7 @@ class NoSpecialChars: class PhoneValidator: - pattern = re.compile(r"^1[356789]\d{9}$") + pattern = re.compile(r"^1[3456789]\d{9}$") message = _('The mobile phone number format is incorrect') def __call__(self, value): diff --git a/apps/rbac/builtin.py b/apps/rbac/builtin.py index a199c149c..c99181d4e 100644 --- a/apps/rbac/builtin.py +++ b/apps/rbac/builtin.py @@ -4,7 +4,8 @@ from .const import Scope, system_exclude_permissions, org_exclude_permissions system_user_perms = ( ('authentication', 'connectiontoken', 'add', 'connectiontoken'), - ('authentication', 'temptoken', 'add', 'temptoken'), + ('authentication', 'temptoken', 'add,change,view', 'temptoken'), + ('authentication', 'accesskey', '*', '*'), ('tickets', 'ticket', 'view', 'ticket'), ('orgs', 'organization', 'view', 'rootorg'), ) diff --git a/apps/rbac/const.py b/apps/rbac/const.py index 5d6ae08ec..d9b80b78a 100644 --- a/apps/rbac/const.py +++ b/apps/rbac/const.py @@ -25,6 +25,7 @@ exclude_permissions = ( ('authentication', 'connectiontoken', 'change,delete', 'connectiontoken'), ('authentication', 'ssotoken', '*', '*'), ('authentication', 'superconnectiontoken', 'change,delete', 'superconnectiontoken'), + ('authentication', 'temptoken', 'delete', 'temptoken'), ('users', 'userpasswordhistory', '*', '*'), ('applications', 'applicationuser', '*', '*'), ('applications', 'historicalaccount', '*', '*'), From 57969a4e23ed4fe27377deb3254a40fc1d799c45 Mon Sep 17 00:00:00 2001 From: "Jiangjie.Bai" Date: Tue, 19 Apr 2022 19:44:07 +0800 Subject: [PATCH 11/12] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E8=8E=B7?= =?UTF-8?q?=E5=8F=96smart=20endpoint=E7=9A=84=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/terminal/api/endpoint.py | 2 +- apps/terminal/models/endpoint.py | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/apps/terminal/api/endpoint.py b/apps/terminal/api/endpoint.py index d612db4a8..494dacbe8 100644 --- a/apps/terminal/api/endpoint.py +++ b/apps/terminal/api/endpoint.py @@ -2,7 +2,7 @@ from rest_framework.decorators import action from rest_framework.response import Response from rest_framework import status from common.drf.api import JMSBulkModelViewSet -from common.utils import get_object_or_none +from django.utils.translation import ugettext_lazy as _ from django.shortcuts import get_object_or_404 from assets.models import Asset from orgs.utils import tmp_to_root_org diff --git a/apps/terminal/models/endpoint.py b/apps/terminal/models/endpoint.py index 39f275f9a..71b79c0e3 100644 --- a/apps/terminal/models/endpoint.py +++ b/apps/terminal/models/endpoint.py @@ -31,8 +31,11 @@ class Endpoint(JMSModel): def get_port(self, protocol): return getattr(self, f'{protocol}_port', 0) + def is_default(self): + return self.id == self.default_id + def delete(self, using=None, keep_parents=False): - if self.id == self.default_id: + if self.is_default(): return return super().delete(using, keep_parents) @@ -78,6 +81,8 @@ class EndpointRule(JMSModel): continue if not endpoint_rule.endpoint: continue + if endpoint_rule.endpoint.is_default(): + return endpoint_rule if not endpoint_rule.endpoint.host: continue if endpoint_rule.endpoint.get_port(protocol) == 0: From 611a00a5fa3a84d0339175702f6f3e8c5c942bec Mon Sep 17 00:00:00 2001 From: feng626 <1304903146@qq.com> Date: Tue, 19 Apr 2022 19:50:46 +0800 Subject: [PATCH 12/12] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dsuper=20user=20p?= =?UTF-8?q?erm=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/authentication/api/connection_token.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/apps/authentication/api/connection_token.py b/apps/authentication/api/connection_token.py index 9e16d31ba..479cac98c 100644 --- a/apps/authentication/api/connection_token.py +++ b/apps/authentication/api/connection_token.py @@ -70,8 +70,6 @@ class ClientProtocolMixin: system_user = serializer.validated_data['system_user'] user = serializer.validated_data.get('user') - if not user or not self.request.user.is_superuser: - user = self.request.user return asset, application, system_user, user @staticmethod