From 36d98a237f617c439581c7958fda378d9971913a Mon Sep 17 00:00:00 2001 From: BaiJiangJie <32935519+BaiJiangJie@users.noreply.github.com> Date: Thu, 24 Oct 2019 18:35:03 +0800 Subject: [PATCH 1/9] =?UTF-8?q?[Update]=20=E8=B5=84=E4=BA=A7=E6=8E=88?= =?UTF-8?q?=E6=9D=83=20Action=20=E6=B7=BB=E5=8A=A0=20Help=20text=20(#3383)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [Update] 资产授权 Action 添加 Help text * [Update] 资产授权 Action 添加 Help text(修改翻译) --- apps/locale/zh/LC_MESSAGES/django.mo | Bin 80782 -> 80782 bytes apps/locale/zh/LC_MESSAGES/django.po | 145 ++++++++++++++------------- apps/perms/forms/asset_permission.py | 8 +- 3 files changed, 77 insertions(+), 76 deletions(-) diff --git a/apps/locale/zh/LC_MESSAGES/django.mo b/apps/locale/zh/LC_MESSAGES/django.mo index 3c2a395cb88e66e85f4d74cc057378acebb9e6dd..f6f15fd93f644e269b568b272c06909a755951e8 100644 GIT binary patch delta 22 dcmeDC&eHdtWkcI}b`u3d3oB#8&AsOta{zEF2=)K~ delta 22 dcmeDC&eHdtWkcI}c0&b2b1MUb&AsOta{zDS2<`v? diff --git a/apps/locale/zh/LC_MESSAGES/django.po b/apps/locale/zh/LC_MESSAGES/django.po index d9e60b04a..1b88cc884 100644 --- a/apps/locale/zh/LC_MESSAGES/django.po +++ b/apps/locale/zh/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Jumpserver 0.3.3\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-10-21 17:00+0800\n" +"POT-Creation-Date: 2019-10-24 18:31+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: ibuler \n" "Language-Team: Jumpserver team\n" @@ -78,15 +78,15 @@ msgstr "运行参数" #: assets/forms/domain.py:15 assets/forms/label.py:13 #: assets/models/asset.py:295 assets/models/authbook.py:24 #: assets/models/gathered_user.py:14 assets/serializers/admin_user.py:32 -#: assets/serializers/asset_user.py:82 assets/serializers/system_user.py:36 +#: assets/serializers/asset_user.py:82 assets/serializers/system_user.py:37 #: assets/templates/assets/admin_user_list.html:46 #: assets/templates/assets/domain_detail.html:60 #: assets/templates/assets/domain_list.html:26 #: assets/templates/assets/label_list.html:16 -#: assets/templates/assets/system_user_list.html:55 audits/models.py:19 +#: assets/templates/assets/system_user_list.html:51 audits/models.py:19 #: audits/templates/audits/ftp_log_list.html:44 #: audits/templates/audits/ftp_log_list.html:74 -#: perms/forms/asset_permission.py:80 perms/models/asset_permission.py:80 +#: perms/forms/asset_permission.py:84 perms/models/asset_permission.py:80 #: perms/templates/perms/asset_permission_create_update.html:45 #: perms/templates/perms/asset_permission_list.html:52 #: perms/templates/perms/asset_permission_list.html:121 @@ -125,7 +125,7 @@ msgstr "资产" #: assets/templates/assets/domain_list.html:25 #: assets/templates/assets/label_list.html:14 #: assets/templates/assets/system_user_detail.html:58 -#: assets/templates/assets/system_user_list.html:51 ops/models/adhoc.py:37 +#: assets/templates/assets/system_user_list.html:47 ops/models/adhoc.py:37 #: ops/templates/ops/task_detail.html:60 ops/templates/ops/task_list.html:11 #: orgs/models.py:12 perms/models/base.py:48 #: perms/templates/perms/asset_permission_detail.html:62 @@ -252,7 +252,7 @@ msgstr "创建日期" #: assets/templates/assets/domain_gateway_list.html:72 #: assets/templates/assets/domain_list.html:28 #: assets/templates/assets/system_user_detail.html:104 -#: assets/templates/assets/system_user_list.html:59 ops/models/adhoc.py:43 +#: assets/templates/assets/system_user_list.html:55 ops/models/adhoc.py:43 #: orgs/models.py:18 perms/models/base.py:56 #: perms/templates/perms/asset_permission_detail.html:102 #: perms/templates/perms/remote_app_permission_detail.html:94 @@ -393,10 +393,10 @@ msgstr "详情" #: applications/templates/applications/remote_app_detail.html:21 #: applications/templates/applications/remote_app_list.html:54 -#: assets/templates/assets/_asset_user_list.html:74 +#: assets/templates/assets/_asset_user_list.html:75 #: assets/templates/assets/admin_user_detail.html:24 #: assets/templates/assets/admin_user_list.html:26 -#: assets/templates/assets/admin_user_list.html:111 +#: assets/templates/assets/admin_user_list.html:74 #: assets/templates/assets/asset_detail.html:26 #: assets/templates/assets/asset_list.html:78 #: assets/templates/assets/asset_list.html:167 @@ -409,8 +409,8 @@ msgstr "详情" #: assets/templates/assets/domain_list.html:54 #: assets/templates/assets/label_list.html:39 #: assets/templates/assets/system_user_detail.html:26 -#: assets/templates/assets/system_user_list.html:33 -#: assets/templates/assets/system_user_list.html:85 audits/models.py:33 +#: assets/templates/assets/system_user_list.html:29 +#: assets/templates/assets/system_user_list.html:81 audits/models.py:33 #: perms/templates/perms/asset_permission_detail.html:30 #: perms/templates/perms/asset_permission_list.html:178 #: perms/templates/perms/remote_app_permission_detail.html:30 @@ -442,7 +442,7 @@ msgstr "更新" #: applications/templates/applications/remote_app_detail.html:25 #: applications/templates/applications/remote_app_list.html:55 #: assets/templates/assets/admin_user_detail.html:28 -#: assets/templates/assets/admin_user_list.html:112 +#: assets/templates/assets/admin_user_list.html:75 #: assets/templates/assets/asset_detail.html:30 #: assets/templates/assets/asset_list.html:168 #: assets/templates/assets/cmd_filter_detail.html:33 @@ -454,7 +454,7 @@ msgstr "更新" #: assets/templates/assets/domain_list.html:55 #: assets/templates/assets/label_list.html:40 #: assets/templates/assets/system_user_detail.html:30 -#: assets/templates/assets/system_user_list.html:86 audits/models.py:34 +#: assets/templates/assets/system_user_list.html:82 audits/models.py:34 #: authentication/templates/authentication/_access_key_modal.html:65 #: ops/templates/ops/task_list.html:69 #: perms/templates/perms/asset_permission_detail.html:34 @@ -510,7 +510,7 @@ msgstr "创建远程应用" #: assets/templates/assets/domain_gateway_list.html:73 #: assets/templates/assets/domain_list.html:29 #: assets/templates/assets/label_list.html:17 -#: assets/templates/assets/system_user_list.html:60 audits/models.py:38 +#: assets/templates/assets/system_user_list.html:56 audits/models.py:38 #: audits/templates/audits/operate_log_list.html:47 #: audits/templates/audits/operate_log_list.html:73 #: authentication/templates/authentication/_access_key_modal.html:34 @@ -635,8 +635,9 @@ msgstr "网域" #: assets/forms/asset.py:69 assets/forms/asset.py:103 assets/forms/asset.py:116 #: assets/forms/asset.py:152 assets/models/node.py:421 +#: assets/serializers/system_user.py:36 #: assets/templates/assets/asset_create.html:42 -#: perms/forms/asset_permission.py:83 perms/forms/asset_permission.py:90 +#: perms/forms/asset_permission.py:87 perms/forms/asset_permission.py:94 #: perms/templates/perms/asset_permission_list.html:53 #: perms/templates/perms/asset_permission_list.html:74 #: perms/templates/perms/asset_permission_list.html:124 @@ -695,7 +696,7 @@ msgstr "SSH网关,支持代理SSH,RDP和VNC" #: assets/templates/assets/admin_user_list.html:45 #: assets/templates/assets/domain_gateway_list.html:71 #: assets/templates/assets/system_user_detail.html:62 -#: assets/templates/assets/system_user_list.html:52 audits/models.py:80 +#: assets/templates/assets/system_user_list.html:48 audits/models.py:80 #: audits/templates/audits/login_log_list.html:57 authentication/forms.py:13 #: authentication/templates/authentication/login.html:65 #: authentication/templates/authentication/new_login.html:92 @@ -820,7 +821,7 @@ msgstr "主机名" #: assets/models/user.py:113 assets/templates/assets/asset_detail.html:70 #: assets/templates/assets/domain_gateway_list.html:70 #: assets/templates/assets/system_user_detail.html:70 -#: assets/templates/assets/system_user_list.html:53 +#: assets/templates/assets/system_user_list.html:49 #: terminal/templates/terminal/session_list.html:31 #: terminal/templates/terminal/session_list.html:75 msgid "Protocol" @@ -1098,7 +1099,7 @@ msgstr "默认资产组" #: audits/templates/audits/password_change_log_list.html:56 #: ops/templates/ops/command_execution_list.html:38 #: ops/templates/ops/command_execution_list.html:63 -#: perms/forms/asset_permission.py:74 perms/forms/remote_app_permission.py:34 +#: perms/forms/asset_permission.py:78 perms/forms/remote_app_permission.py:34 #: perms/models/base.py:49 #: perms/templates/perms/asset_permission_create_update.html:41 #: perms/templates/perms/asset_permission_list.html:50 @@ -1194,14 +1195,14 @@ msgid "Shell" msgstr "Shell" #: assets/models/user.py:117 assets/templates/assets/system_user_detail.html:66 -#: assets/templates/assets/system_user_list.html:54 +#: assets/templates/assets/system_user_list.html:50 msgid "Login mode" msgstr "登录模式" -#: assets/models/user.py:162 assets/templates/assets/user_asset_list.html:79 +#: assets/models/user.py:166 assets/templates/assets/user_asset_list.html:79 #: audits/models.py:20 audits/templates/audits/ftp_log_list.html:52 #: audits/templates/audits/ftp_log_list.html:75 -#: perms/forms/asset_permission.py:86 perms/forms/remote_app_permission.py:43 +#: perms/forms/asset_permission.py:90 perms/forms/remote_app_permission.py:43 #: perms/models/asset_permission.py:82 perms/models/remote_app_permission.py:16 #: perms/templates/perms/asset_permission_detail.html:140 #: perms/templates/perms/asset_permission_list.html:54 @@ -1290,15 +1291,15 @@ msgstr "值" msgid "The same level node name cannot be the same" msgstr "同级别节点名字不能重复" -#: assets/serializers/system_user.py:37 +#: assets/serializers/system_user.py:38 msgid "Login mode display" msgstr "登录模式显示" -#: assets/serializers/system_user.py:81 +#: assets/serializers/system_user.py:82 msgid "* Automatic login mode must fill in the username." msgstr "自动登录模式,必须填写用户名" -#: assets/serializers/system_user.py:92 +#: assets/serializers/system_user.py:93 msgid "Password or private key required" msgstr "密码或密钥密码需要一个" @@ -1436,8 +1437,8 @@ msgstr "资产列表" #: assets/templates/assets/_asset_list_modal.html:33 #: assets/templates/assets/_node_tree.html:40 -#: ops/templates/ops/command_execution_create.html:49 -#: ops/templates/ops/command_execution_create.html:143 +#: ops/templates/ops/command_execution_create.html:70 +#: ops/templates/ops/command_execution_create.html:127 #: users/templates/users/_granted_assets.html:7 #: xpack/plugins/cloud/templates/cloud/sync_instance_task_create_update.html:66 msgid "Loading" @@ -1499,11 +1500,11 @@ msgstr "日期" msgid "Test datetime: " msgstr "测试日期: " -#: assets/templates/assets/_asset_user_list.html:73 +#: assets/templates/assets/_asset_user_list.html:74 msgid "View" msgstr "查看" -#: assets/templates/assets/_asset_user_list.html:75 +#: assets/templates/assets/_asset_user_list.html:76 #: assets/templates/assets/admin_user_assets.html:61 #: assets/templates/assets/asset_asset_user_list.html:57 #: assets/templates/assets/asset_detail.html:176 @@ -1512,7 +1513,7 @@ msgstr "查看" msgid "Test" msgstr "测试" -#: assets/templates/assets/_asset_user_list.html:76 +#: assets/templates/assets/_asset_user_list.html:77 #: assets/templates/assets/system_user_assets.html:72 #: assets/templates/assets/system_user_detail.html:142 msgid "Push" @@ -1646,11 +1647,11 @@ msgstr "选择节点" #: assets/templates/assets/admin_user_detail.html:100 #: assets/templates/assets/asset_detail.html:202 -#: assets/templates/assets/asset_list.html:422 +#: assets/templates/assets/asset_list.html:423 #: assets/templates/assets/cmd_filter_detail.html:106 #: assets/templates/assets/system_user_assets.html:97 #: assets/templates/assets/system_user_detail.html:182 -#: assets/templates/assets/system_user_list.html:139 +#: assets/templates/assets/system_user_list.html:135 #: authentication/templates/authentication/_mfa_confirm_modal.html:20 #: settings/templates/settings/terminal_setting.html:168 #: templates/_modal.html:23 terminal/templates/terminal/session_detail.html:112 @@ -1684,7 +1685,7 @@ msgstr "Jumpserver 使用该用户来 `推送系统用户`、`获取资产硬件 #: assets/templates/assets/admin_user_list.html:16 #: assets/templates/assets/asset_list.html:68 -#: assets/templates/assets/system_user_list.html:23 +#: assets/templates/assets/system_user_list.html:19 #: audits/templates/audits/login_log_list.html:91 #: users/templates/users/user_group_list.html:10 #: users/templates/users/user_list.html:10 @@ -1695,7 +1696,7 @@ msgstr "导出" #: assets/templates/assets/admin_user_list.html:21 #: assets/templates/assets/asset_list.html:73 -#: assets/templates/assets/system_user_list.html:28 +#: assets/templates/assets/system_user_list.html:24 #: settings/templates/settings/_ldap_list_users_modal.html:93 #: users/templates/users/user_group_list.html:15 #: users/templates/users/user_list.html:15 @@ -1709,12 +1710,12 @@ msgstr "导入" msgid "Create admin user" msgstr "创建管理用户" -#: assets/templates/assets/admin_user_list.html:162 -#: assets/templates/assets/admin_user_list.html:193 -#: assets/templates/assets/asset_list.html:303 -#: assets/templates/assets/asset_list.html:340 -#: assets/templates/assets/system_user_list.html:192 -#: assets/templates/assets/system_user_list.html:223 +#: assets/templates/assets/admin_user_list.html:125 +#: assets/templates/assets/admin_user_list.html:156 +#: assets/templates/assets/asset_list.html:304 +#: assets/templates/assets/asset_list.html:341 +#: assets/templates/assets/system_user_list.html:188 +#: assets/templates/assets/system_user_list.html:219 #: users/templates/users/user_group_list.html:164 #: users/templates/users/user_group_list.html:195 #: users/templates/users/user_list.html:165 @@ -1854,8 +1855,8 @@ msgstr "仅显示当前节点资产" msgid "Displays all child node assets" msgstr "显示所有子节点资产" -#: assets/templates/assets/asset_list.html:416 -#: assets/templates/assets/system_user_list.html:133 +#: assets/templates/assets/asset_list.html:417 +#: assets/templates/assets/system_user_list.html:129 #: users/templates/users/user_detail.html:388 #: users/templates/users/user_detail.html:414 #: users/templates/users/user_detail.html:482 @@ -1865,12 +1866,12 @@ msgstr "显示所有子节点资产" msgid "Are you sure?" msgstr "你确认吗?" -#: assets/templates/assets/asset_list.html:417 +#: assets/templates/assets/asset_list.html:418 msgid "This will delete the selected assets !!!" msgstr "删除选择资产" -#: assets/templates/assets/asset_list.html:420 -#: assets/templates/assets/system_user_list.html:137 +#: assets/templates/assets/asset_list.html:421 +#: assets/templates/assets/system_user_list.html:133 #: settings/templates/settings/terminal_setting.html:166 #: users/templates/users/user_detail.html:392 #: users/templates/users/user_detail.html:418 @@ -1881,16 +1882,16 @@ msgstr "删除选择资产" msgid "Cancel" msgstr "取消" -#: assets/templates/assets/asset_list.html:433 +#: assets/templates/assets/asset_list.html:434 msgid "Asset Deleted." msgstr "已被删除" -#: assets/templates/assets/asset_list.html:434 -#: assets/templates/assets/asset_list.html:438 +#: assets/templates/assets/asset_list.html:435 +#: assets/templates/assets/asset_list.html:439 msgid "Asset Delete" msgstr "删除" -#: assets/templates/assets/asset_list.html:437 +#: assets/templates/assets/asset_list.html:438 msgid "Asset Deleting failed." msgstr "删除失败" @@ -2037,7 +2038,7 @@ msgstr "Uid" msgid "Binding command filters" msgstr "绑定命令过滤器" -#: assets/templates/assets/system_user_list.html:10 +#: assets/templates/assets/system_user_list.html:6 msgid "" "System user is Jumpserver jump login assets used by the users, can be " "understood as the user login assets, such as web, sa, the dba (` ssh " @@ -2048,7 +2049,7 @@ msgstr "" "web,sa,dba(`ssh web@some-host`),而不是使用某个用户的用户名跳转登录服务器" "(`ssh xiaoming@some-host`);" -#: assets/templates/assets/system_user_list.html:11 +#: assets/templates/assets/system_user_list.html:7 msgid "" "In simple terms, users log into Jumpserver using their own username, and " "Jumpserver uses system users to log into assets. " @@ -2056,7 +2057,7 @@ msgstr "" "简单来说是用户使用自己的用户名登录 Jumpserver,Jumpserver 使用系统用户登录资" "产。" -#: assets/templates/assets/system_user_list.html:12 +#: assets/templates/assets/system_user_list.html:8 msgid "" "When system users are created, if you choose auto push Jumpserver to use " "Ansible push system users into the asset, if the asset (Switch) does not " @@ -2065,25 +2066,25 @@ msgstr "" "系统用户创建时,如果选择了自动推送,Jumpserver 会使用 Ansible 自动推送系统用" "户到资产中,如果资产(交换机)不支持 Ansible,请手动填写账号密码。" -#: assets/templates/assets/system_user_list.html:43 +#: assets/templates/assets/system_user_list.html:39 #: assets/views/system_user.py:47 msgid "Create system user" msgstr "创建系统用户" -#: assets/templates/assets/system_user_list.html:134 +#: assets/templates/assets/system_user_list.html:130 msgid "This will delete the selected System Users !!!" msgstr "删除选择系统用户" -#: assets/templates/assets/system_user_list.html:143 +#: assets/templates/assets/system_user_list.html:139 msgid "System Users Deleted." msgstr "已被删除" -#: assets/templates/assets/system_user_list.html:144 -#: assets/templates/assets/system_user_list.html:149 +#: assets/templates/assets/system_user_list.html:140 +#: assets/templates/assets/system_user_list.html:145 msgid "System Users Delete" msgstr "删除系统用户" -#: assets/templates/assets/system_user_list.html:148 +#: assets/templates/assets/system_user_list.html:144 msgid "System Users Deleting failed." msgstr "系统用户删除失败" @@ -2995,39 +2996,39 @@ msgstr "成功资产" msgid "Task log" msgstr "任务列表" -#: ops/templates/ops/command_execution_create.html:90 +#: ops/templates/ops/command_execution_create.html:109 #: terminal/templates/terminal/session_detail.html:95 #: terminal/templates/terminal/session_detail.html:104 msgid "Go" msgstr "" -#: ops/templates/ops/command_execution_create.html:216 +#: ops/templates/ops/command_execution_create.html:194 msgid "Selected assets" msgstr "已选择资产" -#: ops/templates/ops/command_execution_create.html:219 +#: ops/templates/ops/command_execution_create.html:197 msgid "In total" msgstr "总共" -#: ops/templates/ops/command_execution_create.html:256 +#: ops/templates/ops/command_execution_create.html:234 msgid "" "Select the left asset, select the running system user, execute command in " "batch" msgstr "选择左侧资产, 选择运行的系统用户,批量执行命令" -#: ops/templates/ops/command_execution_create.html:299 +#: ops/templates/ops/command_execution_create.html:278 msgid "Unselected assets" msgstr "没有选中资产" -#: ops/templates/ops/command_execution_create.html:303 +#: ops/templates/ops/command_execution_create.html:282 msgid "No input command" msgstr "没有输入命令" -#: ops/templates/ops/command_execution_create.html:307 +#: ops/templates/ops/command_execution_create.html:286 msgid "No system user was selected" msgstr "没有选择系统用户" -#: ops/templates/ops/command_execution_create.html:317 +#: ops/templates/ops/command_execution_create.html:296 msgid "Pending" msgstr "等待" @@ -3123,7 +3124,13 @@ msgstr "未分组" msgid "Empty" msgstr "空" -#: perms/forms/asset_permission.py:77 perms/forms/remote_app_permission.py:37 +#: perms/forms/asset_permission.py:24 +msgid "" +"Tips: The RDP protocol does not support separate controls for uploading or " +"downloading files" +msgstr "提示:RDP 协议不支持单独控制上传或下载文件" + +#: perms/forms/asset_permission.py:81 perms/forms/remote_app_permission.py:37 #: perms/models/base.py:50 perms/templates/perms/asset_permission_list.html:51 #: perms/templates/perms/asset_permission_list.html:71 #: perms/templates/perms/asset_permission_list.html:118 @@ -3136,12 +3143,6 @@ msgstr "空" msgid "User group" msgstr "用户组" -#: perms/forms/asset_permission.py:93 -msgid "" -"Tips: The RDP protocol does not support separate controls for uploading or " -"downloading files" -msgstr "提示:RDP 协议不支持单独控制上传或下载文件" - #: perms/forms/asset_permission.py:103 perms/forms/remote_app_permission.py:53 msgid "User or group at least one required" msgstr "用户和用户组至少选一个" @@ -3218,7 +3219,7 @@ msgstr "添加资产" #: perms/templates/perms/remote_app_permission_user.html:124 #: settings/templates/settings/terminal_setting.html:98 #: settings/templates/settings/terminal_setting.html:120 -#: users/templates/users/user_group_detail.html:95 +#: users/templates/users/user_group_detail.html:92 #: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_asset_list.html:80 #: xpack/plugins/orgs/templates/orgs/org_detail.html:93 #: xpack/plugins/orgs/templates/orgs/org_detail.html:130 diff --git a/apps/perms/forms/asset_permission.py b/apps/perms/forms/asset_permission.py index a04efc767..8282f0880 100644 --- a/apps/perms/forms/asset_permission.py +++ b/apps/perms/forms/asset_permission.py @@ -20,6 +20,10 @@ class ActionField(forms.MultipleChoiceField): kwargs['initial'] = Action.ALL kwargs['label'] = _("Action") kwargs['widget'] = forms.CheckboxSelectMultiple() + kwargs['help_text'] = _( + 'Tips: The RDP protocol does not support separate controls ' + 'for uploading or downloading files' + ) super().__init__(*args, **kwargs) def to_python(self, value): @@ -89,10 +93,6 @@ class AssetPermissionForm(OrgModelForm): labels = { 'nodes': _("Node"), } - help_texts = { - 'actions': _('Tips: The RDP protocol does not support separate ' - 'controls for uploading or downloading files') - } def clean_user_groups(self): users = self.cleaned_data.get('users') From a57df0e05fcfa90716b5cdc9f0b1a03b4ec41df4 Mon Sep 17 00:00:00 2001 From: BaiJiangJie Date: Fri, 25 Oct 2019 10:55:28 +0800 Subject: [PATCH 2/9] =?UTF-8?q?[Update]=20=E4=BF=AE=E6=94=B9=E4=B8=BB?= =?UTF-8?q?=E6=9C=BA=E5=90=8D/=E7=B3=BB=E7=BB=9F=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E5=90=8D=E7=A7=B0/=E7=BB=84=E7=BB=87=E5=90=8D=E7=A7=B0?= =?UTF-8?q?=E7=9A=84=E7=89=B9=E6=AE=8A=E5=AD=97=E7=AC=A6=E9=99=90=E5=88=B6?= =?UTF-8?q?=EF=BC=88=E4=BF=AE=E6=94=B9=E4=B8=BA=E7=89=B9=E6=AE=8A=E5=AD=97?= =?UTF-8?q?=E7=AC=A6=E9=BB=91=E5=90=8D=E5=8D=95=EF=BC=89[/=20\]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/assets/const.py | 10 +++++----- apps/assets/forms/asset.py | 6 +++--- apps/assets/forms/user.py | 4 ++-- apps/assets/serializers/asset.py | 12 ++++++------ apps/assets/serializers/system_user.py | 12 ++++++------ apps/locale/zh/LC_MESSAGES/django.mo | Bin 80782 -> 80725 bytes apps/locale/zh/LC_MESSAGES/django.po | 6 +++--- apps/orgs/serializers.py | 12 ++++++------ 8 files changed, 31 insertions(+), 31 deletions(-) diff --git a/apps/assets/const.py b/apps/assets/const.py index c23b700ba..7786d8f13 100644 --- a/apps/assets/const.py +++ b/apps/assets/const.py @@ -4,11 +4,11 @@ from django.utils.translation import ugettext_lazy as _ -GENERAL_LIMIT_SPECIAL_CHARACTERS_HELP_TEXT = _( - 'Only Numbers、letters、 chinese and characters ( {} ) are allowed' -).format(" ".join(['.', '_', '@', '-'])) +GENERAL_FORBIDDEN_SPECIAL_CHARACTERS_HELP_TEXT = _( + 'Cannot contain special characters: [ {} ]' +).format(" ".join(['/', '\\'])) -GENERAL_LIMIT_SPECIAL_CHARACTERS_PATTERN = r"^[\._@\w-]+$" +GENERAL_FORBIDDEN_SPECIAL_CHARACTERS_PATTERN = r"[/\\]" -GENERAL_LIMIT_SPECIAL_CHARACTERS_ERROR_MSG = \ +GENERAL_FORBIDDEN_SPECIAL_CHARACTERS_ERROR_MSG = \ _("* The contains characters that are not allowed") diff --git a/apps/assets/forms/asset.py b/apps/assets/forms/asset.py index b6e5d3a42..805f49f24 100644 --- a/apps/assets/forms/asset.py +++ b/apps/assets/forms/asset.py @@ -7,7 +7,7 @@ from common.utils import get_logger from orgs.mixins.forms import OrgModelForm from ..models import Asset, Node -from ..const import GENERAL_LIMIT_SPECIAL_CHARACTERS_HELP_TEXT +from ..const import GENERAL_FORBIDDEN_SPECIAL_CHARACTERS_HELP_TEXT logger = get_logger(__file__) @@ -69,7 +69,7 @@ class AssetCreateForm(OrgModelForm): 'nodes': _("Node"), } help_texts = { - 'hostname': GENERAL_LIMIT_SPECIAL_CHARACTERS_HELP_TEXT, + 'hostname': GENERAL_FORBIDDEN_SPECIAL_CHARACTERS_HELP_TEXT, 'admin_user': _( 'root or other NOPASSWD sudo privilege user existed in asset,' 'If asset is windows or other set any one, more see admin user left menu' @@ -116,7 +116,7 @@ class AssetUpdateForm(OrgModelForm): 'nodes': _("Node"), } help_texts = { - 'hostname': GENERAL_LIMIT_SPECIAL_CHARACTERS_HELP_TEXT, + 'hostname': GENERAL_FORBIDDEN_SPECIAL_CHARACTERS_HELP_TEXT, 'admin_user': _( 'root or other NOPASSWD sudo privilege user existed in asset,' 'If asset is windows or other set any one, more see admin user left menu' diff --git a/apps/assets/forms/user.py b/apps/assets/forms/user.py index b50639684..21626f4f6 100644 --- a/apps/assets/forms/user.py +++ b/apps/assets/forms/user.py @@ -6,7 +6,7 @@ from django.utils.translation import gettext_lazy as _ from common.utils import validate_ssh_private_key, ssh_pubkey_gen, get_logger from orgs.mixins.forms import OrgModelForm from ..models import AdminUser, SystemUser -from ..const import GENERAL_LIMIT_SPECIAL_CHARACTERS_HELP_TEXT +from ..const import GENERAL_FORBIDDEN_SPECIAL_CHARACTERS_HELP_TEXT logger = get_logger(__file__) __all__ = [ @@ -99,7 +99,7 @@ class SystemUserForm(OrgModelForm, PasswordAndKeyAuthForm): }), } help_texts = { - 'name': GENERAL_LIMIT_SPECIAL_CHARACTERS_HELP_TEXT, + 'name': GENERAL_FORBIDDEN_SPECIAL_CHARACTERS_HELP_TEXT, 'auto_push': _('Auto push system user to asset'), 'priority': _('1-100, High level will be using login asset as default, ' 'if user was granted more than 2 system user'), diff --git a/apps/assets/serializers/asset.py b/apps/assets/serializers/asset.py index f198aee76..a24374c13 100644 --- a/apps/assets/serializers/asset.py +++ b/apps/assets/serializers/asset.py @@ -9,8 +9,8 @@ from orgs.mixins.serializers import BulkOrgResourceModelSerializer from common.serializers import AdaptedBulkListSerializer from ..models import Asset, Node, Label from ..const import ( - GENERAL_LIMIT_SPECIAL_CHARACTERS_PATTERN, - GENERAL_LIMIT_SPECIAL_CHARACTERS_ERROR_MSG + GENERAL_FORBIDDEN_SPECIAL_CHARACTERS_PATTERN, + GENERAL_FORBIDDEN_SPECIAL_CHARACTERS_ERROR_MSG ) from .base import ConnectivitySerializer @@ -98,10 +98,10 @@ class AssetSerializer(BulkOrgResourceModelSerializer): @staticmethod def validate_hostname(hostname): - pattern = GENERAL_LIMIT_SPECIAL_CHARACTERS_PATTERN - res = re.match(pattern, hostname) - if res is None: - msg = GENERAL_LIMIT_SPECIAL_CHARACTERS_ERROR_MSG + pattern = GENERAL_FORBIDDEN_SPECIAL_CHARACTERS_PATTERN + res = re.search(pattern, hostname) + if res is not None: + msg = GENERAL_FORBIDDEN_SPECIAL_CHARACTERS_ERROR_MSG raise serializers.ValidationError(msg) return hostname diff --git a/apps/assets/serializers/system_user.py b/apps/assets/serializers/system_user.py index 1340741e6..648af01a7 100644 --- a/apps/assets/serializers/system_user.py +++ b/apps/assets/serializers/system_user.py @@ -8,8 +8,8 @@ from common.utils import ssh_pubkey_gen from orgs.mixins.serializers import BulkOrgResourceModelSerializer from ..models import SystemUser from ..const import ( - GENERAL_LIMIT_SPECIAL_CHARACTERS_PATTERN, - GENERAL_LIMIT_SPECIAL_CHARACTERS_ERROR_MSG + GENERAL_FORBIDDEN_SPECIAL_CHARACTERS_PATTERN, + GENERAL_FORBIDDEN_SPECIAL_CHARACTERS_ERROR_MSG ) from .base import AuthSerializer, AuthSerializerMixin @@ -41,10 +41,10 @@ class SystemUserSerializer(AuthSerializerMixin, BulkOrgResourceModelSerializer): @staticmethod def validate_name(name): - pattern = GENERAL_LIMIT_SPECIAL_CHARACTERS_PATTERN - res = re.match(pattern, name) - if res is None: - msg = GENERAL_LIMIT_SPECIAL_CHARACTERS_ERROR_MSG + pattern = GENERAL_FORBIDDEN_SPECIAL_CHARACTERS_PATTERN + res = re.search(pattern, name) + if res is not None: + msg = GENERAL_FORBIDDEN_SPECIAL_CHARACTERS_ERROR_MSG raise serializers.ValidationError(msg) return name diff --git a/apps/locale/zh/LC_MESSAGES/django.mo b/apps/locale/zh/LC_MESSAGES/django.mo index f6f15fd93f644e269b568b272c06909a755951e8..a6510ca5a41597f874d262fab0c92cdb24ef153b 100644 GIT binary patch delta 19928 zcmZA737C#m+{f`}%)(#{27_4{4932%*)rC#@1c+^6^Y3D5S8rQWvQ$oSwo4kmSkU& zJw&o)Uz6?q{+{#idf)54uj}?X|NlAnxz9QG@;ozU(!-D=4??~U3G)~6`FsZk`F!c| z5k_LryFOnA%!XMpFXqJ*%#W#<2YX>Sj>Zx=5liAm48dy{inlQWA7W+<9qi7ReX!5( z%Sa-xB?_WWP#jaS8D_&7mckm_y8iNECgO6a0n|kG zmu9y1Q&7j9Eb#{BBOZVn;dIo2b5R{F$FjH{!|)nvKzA_)Lx#DPNJRBp4wbKiTFIAD z{q@6W^pBvRYd9UXwDT}8u0yTFA=FA-Ms@fA)j{ZRH^c0xOIQ%K0;NzVs*4(MTU5W@ zEFO&N=Y7n>`F$U|f^Q}266{1Bc*?wF^>@vP5$*)ZsE#Y62GA6>v>i|@(iOEr{ZaS8 z5Y$A*p(Z>NGjV?30;^bw8u>=l2=`lj8g)0{M9usj>e2*ptm2HQ0Y{@woP>d;M-8kF zYDJq^+zT~;0hpQHH-dlE;ds;lK1R)CF>2&1QFr%d)Qo;b&Ey2?#FtR*?xIc{JksZ@ zgxOI8Z-hFo8E(Y3sQz<|V*NFPSPHTTY9JL*C#-?$pe1U=?NBr7ii!9p#^WSxh%4|G z{)6i0%6snkJE#FXL=F5Is{hQRS%1wSakS4@4~wDh)&Z!7Q!p0iU~T-t;%8WsIA)AH zQAgB_x}#n=Z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Imou7E z&Z9GNE$*S+C)k2>9+HdZ_)ztHDp1}+`8;j%P=1;68~8nSZ7E-~b}Oh)5AggQI>lE{ zCHD^Tbkx5P>GK`OZO+rDD)~~B_v0fDeSXK${?9u_mwiOEoMR;|Zj#MTPopV6$L!LG zFA(d~7I*s}b}FA3Lv2NBzOWkArc;h3x5aW%{uZ61y9ANZXARjSuILq@-z4(CaO9w; zY2>R}yGR^O+gGh^Aocoe=V)d<=cY{?;-(pUJBJp@cr@%pY`p>f-;QfJ=oBzKu^j&2KRVHHF2flM!pkQIfd1>7= q3cqh!duh(3%vtYUPTzd#vnk{+ule-mw#gdd=C<^&ehLooRr-Gr5jolb diff --git a/apps/locale/zh/LC_MESSAGES/django.po b/apps/locale/zh/LC_MESSAGES/django.po index 1b88cc884..fdc37654f 100644 --- a/apps/locale/zh/LC_MESSAGES/django.po +++ b/apps/locale/zh/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Jumpserver 0.3.3\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-10-24 18:31+0800\n" +"POT-Creation-Date: 2019-10-25 10:52+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: ibuler \n" "Language-Team: Jumpserver team\n" @@ -583,8 +583,8 @@ msgid "Test if the assets under the node are connectable: {}" msgstr "测试节点下资产是否可连接: {}" #: assets/const.py:8 -msgid "Only Numbers、letters、 chinese and characters ( {} ) are allowed" -msgstr "只允许包含数字、字母、中文和特殊字符( {} )" +msgid "Cannot contain special characters: [ {} ]" +msgstr "不能包含特殊字符:[ {} ]" #: assets/const.py:14 msgid "* The contains characters that are not allowed" diff --git a/apps/orgs/serializers.py b/apps/orgs/serializers.py index 8f4df1e10..3ac7da732 100644 --- a/apps/orgs/serializers.py +++ b/apps/orgs/serializers.py @@ -5,8 +5,8 @@ from rest_framework import serializers from users.models import User, UserGroup from assets.models import Asset, Domain, AdminUser, SystemUser, Label from assets.const import ( - GENERAL_LIMIT_SPECIAL_CHARACTERS_PATTERN, - GENERAL_LIMIT_SPECIAL_CHARACTERS_ERROR_MSG + GENERAL_FORBIDDEN_SPECIAL_CHARACTERS_PATTERN, + GENERAL_FORBIDDEN_SPECIAL_CHARACTERS_ERROR_MSG ) from perms.models import AssetPermission from common.serializers import AdaptedBulkListSerializer @@ -24,10 +24,10 @@ class OrgSerializer(ModelSerializer): @staticmethod def validate_name(name): - pattern = GENERAL_LIMIT_SPECIAL_CHARACTERS_PATTERN - res = re.match(pattern, name) - if res is None: - msg = GENERAL_LIMIT_SPECIAL_CHARACTERS_ERROR_MSG + pattern = GENERAL_FORBIDDEN_SPECIAL_CHARACTERS_PATTERN + res = re.search(pattern, name) + if res is not None: + msg = GENERAL_FORBIDDEN_SPECIAL_CHARACTERS_ERROR_MSG raise serializers.ValidationError(msg) return name From d2c65dd78332e2ed9b8a0b3ebac3ce89ba9b3af1 Mon Sep 17 00:00:00 2001 From: ibuler Date: Fri, 25 Oct 2019 12:08:49 +0800 Subject: [PATCH 3/9] =?UTF-8?q?[Update]=20=E4=BF=AE=E6=94=B9table=E8=BF=87?= =?UTF-8?q?=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/static/js/jumpserver.js | 78 +++++++++++++++++++++++++++--------- 1 file changed, 60 insertions(+), 18 deletions(-) diff --git a/apps/static/js/jumpserver.js b/apps/static/js/jumpserver.js index 4dceb01bf..460489fd9 100644 --- a/apps/static/js/jumpserver.js +++ b/apps/static/js/jumpserver.js @@ -409,6 +409,46 @@ function makeLabel(data) { return "" + data[1] + "
" } +function parseTableFilter(value) { + var cleanValues = []; + var valuesArray = value.split(':'); + console.log(valuesArray); + for (var i=0; i Date: Fri, 25 Oct 2019 12:09:27 +0800 Subject: [PATCH 4/9] =?UTF-8?q?[Update]=20=E5=8E=BB=E6=8E=89debug=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/static/js/jumpserver.js | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/apps/static/js/jumpserver.js b/apps/static/js/jumpserver.js index 460489fd9..2ef2397d6 100644 --- a/apps/static/js/jumpserver.js +++ b/apps/static/js/jumpserver.js @@ -412,7 +412,6 @@ function makeLabel(data) { function parseTableFilter(value) { var cleanValues = []; var valuesArray = value.split(':'); - console.log(valuesArray); for (var i=0; i Date: Fri, 25 Oct 2019 12:49:22 +0800 Subject: [PATCH 5/9] =?UTF-8?q?[Update]=20=E4=BF=AE=E6=94=B9js?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/static/js/jumpserver.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/apps/static/js/jumpserver.js b/apps/static/js/jumpserver.js index 2ef2397d6..0a031384b 100644 --- a/apps/static/js/jumpserver.js +++ b/apps/static/js/jumpserver.js @@ -646,9 +646,13 @@ jumpserver.initServerSideDataTable = function (options) { if (data.search !== null) { var searchValue = data.search.value; var searchFilter = parseTableFilter(searchValue); - $.each(searchFilter, function (k, v) { - data[k] = v - }) + if (Object.keys(searchFilter).length === 0) { + data.search = searchValue; + } else { + $.each(searchFilter, function (k, v) { + data[k] = v + }) + } } if (data.order !== null && data.order.length === 1) { var col = data.order[0].column; From 90321ab68ccff1752f4ea895deb5e7ff401c23ad Mon Sep 17 00:00:00 2001 From: ibuler Date: Fri, 25 Oct 2019 12:50:48 +0800 Subject: [PATCH 6/9] =?UTF-8?q?[Update]=20=E4=BF=AE=E6=94=B9js?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/static/js/jumpserver.js | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/static/js/jumpserver.js b/apps/static/js/jumpserver.js index 0a031384b..42fd06f70 100644 --- a/apps/static/js/jumpserver.js +++ b/apps/static/js/jumpserver.js @@ -443,7 +443,6 @@ function parseTableFilter(value) { filter[key] = value } } - console.log(filter); return filter; } From d22f60364a55925bc868cb19c0d36d2c739a49e8 Mon Sep 17 00:00:00 2001 From: ibuler Date: Fri, 25 Oct 2019 12:52:21 +0800 Subject: [PATCH 7/9] =?UTF-8?q?[Update]=20=E4=BF=AE=E6=94=B9js?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/static/js/jumpserver.js | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/static/js/jumpserver.js b/apps/static/js/jumpserver.js index 42fd06f70..879640ec6 100644 --- a/apps/static/js/jumpserver.js +++ b/apps/static/js/jumpserver.js @@ -648,6 +648,7 @@ jumpserver.initServerSideDataTable = function (options) { if (Object.keys(searchFilter).length === 0) { data.search = searchValue; } else { + data.search = ''; $.each(searchFilter, function (k, v) { data[k] = v }) From ef41ba3117aeaf8de59ba5977d9b824e99f7e74c Mon Sep 17 00:00:00 2001 From: BaiJiangJie Date: Fri, 25 Oct 2019 17:09:22 +0800 Subject: [PATCH 8/9] =?UTF-8?q?[Update]=20LDAP=20=E8=AE=A4=E8=AF=81?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=85=8D=E7=BD=AE=E9=A1=B9=20OPT=5FREFERRALS?= =?UTF-8?q?=EF=BC=88=E8=A7=A3=E5=86=B3=E9=97=AE=E9=A2=98:=20In=20order=20t?= =?UTF-8?q?o=20perform=20this=20operation=20a=20successful=20bind=20must?= =?UTF-8?q?=20be=20completed=20on=20the=20connection)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/jumpserver/conf.py | 1 + apps/jumpserver/settings.py | 1 + config_example.yml | 4 ++++ 3 files changed, 6 insertions(+) diff --git a/apps/jumpserver/conf.py b/apps/jumpserver/conf.py index 29dfeabbe..58ca170c6 100644 --- a/apps/jumpserver/conf.py +++ b/apps/jumpserver/conf.py @@ -380,6 +380,7 @@ defaults = { 'AUTH_LDAP_SYNC_INTERVAL': None, 'AUTH_LDAP_SYNC_CRONTAB': None, 'AUTH_LDAP_USER_LOGIN_ONLY_IN_USERS': False, + 'AUTH_LDAP_OPTIONS_OPT_REFERRALS': -1, 'HTTP_BIND_HOST': '0.0.0.0', 'HTTP_LISTEN_PORT': 8080, 'WS_LISTEN_PORT': 8070, diff --git a/apps/jumpserver/settings.py b/apps/jumpserver/settings.py index 6088358f1..f6b81e877 100644 --- a/apps/jumpserver/settings.py +++ b/apps/jumpserver/settings.py @@ -440,6 +440,7 @@ AUTH_LDAP_START_TLS = False AUTH_LDAP_USER_ATTR_MAP = {"username": "cn", "name": "sn", "email": "mail"} AUTH_LDAP_GLOBAL_OPTIONS = { ldap.OPT_X_TLS_REQUIRE_CERT: ldap.OPT_X_TLS_NEVER, + ldap.OPT_REFERRALS: CONFIG.AUTH_LDAP_OPTIONS_OPT_REFERRALS } LDAP_CERT_FILE = os.path.join(PROJECT_DIR, "data", "certs", "ldap_ca.pem") if os.path.isfile(LDAP_CERT_FILE): diff --git a/config_example.yml b/config_example.yml index 786de3257..4cfcdafed 100644 --- a/config_example.yml +++ b/config_example.yml @@ -83,6 +83,10 @@ REDIS_PORT: 6379 # # LDAP 用户登录时仅允许在用户列表中的用户执行 LDAP Server 认证 # AUTH_LDAP_USER_LOGIN_ONLY_IN_USERS: False +# +# LDAP 认证时如果出现以下信息将参数设置为 0 (详情参见:https://www.python-ldap.org/en/latest/faq.html) +# In order to perform this operation a successful bind must be completed on the connection +# AUTH_LDAP_OPTIONS_OPT_REFERRALS: -1 # OTP settings From 98a8ef1526dd0d2cf7593524a9dea132775a15b4 Mon Sep 17 00:00:00 2001 From: BaiJiangJie Date: Fri, 25 Oct 2019 17:46:22 +0800 Subject: [PATCH 9/9] =?UTF-8?q?[Update]=20=E4=BC=98=E5=8C=96=20config=5Fex?= =?UTF-8?q?ample.py=20=E4=B8=AD=20AUTH=5FLDAP=20=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config_example.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/config_example.yml b/config_example.yml index 4cfcdafed..4b01fd10f 100644 --- a/config_example.yml +++ b/config_example.yml @@ -73,10 +73,13 @@ REDIS_PORT: 6379 # RADIUS_SECRET: # LDAP/AD settings +# LDAP 搜索分页数量 +# AUTH_LDAP_SEARCH_PAGED_SIZE: 1000 +# # 定时同步用户 -# 启用/禁用 +# 启用 / 禁用 # AUTH_LDAP_SYNC_IS_PERIODIC: True -# 单位: 时 +# 同步间隔 (单位: 时) (优先) # AUTH_LDAP_SYNC_INTERVAL: 12 # Crontab 表达式 # AUTH_LDAP_SYNC_CRONTAB: * 6 * * * @@ -84,7 +87,7 @@ REDIS_PORT: 6379 # LDAP 用户登录时仅允许在用户列表中的用户执行 LDAP Server 认证 # AUTH_LDAP_USER_LOGIN_ONLY_IN_USERS: False # -# LDAP 认证时如果出现以下信息将参数设置为 0 (详情参见:https://www.python-ldap.org/en/latest/faq.html) +# LDAP 认证时如果日志中出现以下信息将参数设置为 0 (详情参见:https://www.python-ldap.org/en/latest/faq.html) # In order to perform this operation a successful bind must be completed on the connection # AUTH_LDAP_OPTIONS_OPT_REFERRALS: -1