From f5531b6065662431ee8e5ddea2a988cd9b36b493 Mon Sep 17 00:00:00 2001 From: BaiJiangJie <32935519+BaiJiangJie@users.noreply.github.com> Date: Mon, 6 Aug 2018 16:08:05 +0800 Subject: [PATCH] =?UTF-8?q?=20[Update]=20xpack/orgs=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=88=A0=E9=99=A4=E5=8A=9F=E8=83=BD-js;=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8DLabel=E7=BB=A7=E6=89=BFOrg=E5=90=8Ebug;=20(#1?= =?UTF-8?q?644)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [Update] 更新xpack下orgs的翻译信息 * [Update] 更新model Label,继承OrgModelMixin; * [Update] xpack/orgs组织添加删除功能-js; 修复Label继承Org后bug; * [Bugfix] 修复小bug --- apps/assets/api/label.py | 5 +- apps/assets/models/label.py | 3 +- apps/i18n/zh/LC_MESSAGES/django.mo | Bin 37050 -> 37547 bytes apps/i18n/zh/LC_MESSAGES/django.po | 152 ++++++++++++++---- apps/static/js/jumpserver.js | 36 +++++ .../users/user_otp_authentication.html | 2 +- 6 files changed, 167 insertions(+), 31 deletions(-) diff --git a/apps/assets/api/label.py b/apps/assets/api/label.py index 3466c3ec3..e5391c76a 100644 --- a/apps/assets/api/label.py +++ b/apps/assets/api/label.py @@ -27,7 +27,6 @@ __all__ = ['LabelViewSet'] class LabelViewSet(BulkModelViewSet): - queryset = Label.objects.annotate(asset_count=Count("assets")) permission_classes = (IsOrgAdmin,) serializer_class = serializers.LabelSerializer @@ -36,3 +35,7 @@ class LabelViewSet(BulkModelViewSet): self.serializer_class = serializers.LabelDistinctSerializer self.queryset = self.queryset.values("name").distinct() return super().list(request, *args, **kwargs) + + def get_queryset(self): + self.queryset = Label.objects.annotate(asset_count=Count("assets")) + return self.queryset diff --git a/apps/assets/models/label.py b/apps/assets/models/label.py index 41f0f8724..7f1d08fa1 100644 --- a/apps/assets/models/label.py +++ b/apps/assets/models/label.py @@ -4,9 +4,10 @@ import uuid from django.db import models from django.utils.translation import ugettext_lazy as _ +from orgs.mixins import OrgModelMixin -class Label(models.Model): +class Label(OrgModelMixin): SYSTEM_CATEGORY = "S" USER_CATEGORY = "U" CATEGORY_CHOICES = ( diff --git a/apps/i18n/zh/LC_MESSAGES/django.mo b/apps/i18n/zh/LC_MESSAGES/django.mo index 903763d9bba7f3375f3f335e30acdc234491726a..da76112fc347e87489519ac854b2c5ef457817c3 100644 GIT binary patch delta 12952 zcmZwNdwh@e|Htubn{5u;9EN1ZoaeO0Fz3UZ&ygImVmWR(Z4Mz^=6sA8Ip&y+{(*27%!juV5;F&amBy3QLEf~Yu%+CUZtak zsD&<~Hhve?|1S(dKh8T0!>}+$qQ+OZ`bMaJ9njT8iPj+nb%!HS6QrY#cphrNQq;-3 zg%P+5^~{fBQM`PnNHr>y-V>JeT?y(9Nf{r^I(6WD;qg-@W`V;gY(>QJ2u*}!aRc0#>O ziOAz~`l2?n61C8J)JC_W`hAE`;X%|L-b3B_L)38OQfqV9CQ<*QJSXankzypMWW5223y3~JmZ)I2v(kL&^JBnmh3)^npN=vmc3oj^O( zLS0b{^hIrKIO^k-j=G}^)PgHf6YfB@A3$y32UPt9RR4RZ4f!|rHk=z-&vhaw=%~t~ z7OIHaalGY?P!qO8-D!8!gem3-RR0O61!tfZT828wwWv=`ChE~0M9r7wYj=5htl=_h z;0@G-_fZ4=6TA%;Mx9UuY6E343S+T2c0}FCP}D*rP$xMSHP1}c!f&AF--H!e-^sL! zpHMGJHtJ}vVg>YX;!RW;HE|u(Ni;@nq!Vi6&!Z;pi|RKR^$15;{bbbqb5Q*kpsS9{ zC}^i^FbcP$COU@dcnY=ibEy8;EWcy=HT51{C~BUfs7DcvdIWV)^Rz}i;!cppI;~0d+TX+kVMQx-S?#2eF4gHCM z_%~|f0WG}^#<^CghdR1us5^fKwbTBn2~$zedYt9cEzdwLuoCr7th4r=s5{?}S~v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$kEpLlgi+Sjgm}TqlPQlRb`cZlvj@i$2Z*VJ zuIltHO51)Sorok~=QcS<$loBY>gzk5$_6A}gsv`F*cKW~c{~wsZN;hohw?R|q1)YQ zY;DtUC3U{^IcaUPtj&k~1IoYS25gIE>6go!^N*lny>+~W?P+|G(3RK4DM9^YVjB5n ztWGqdoP_I$qlB)y__bSf0$D&;ZEL$sc^l>XSd_N5lV3L0Pp^pZaAbx9b>~mDz2! zUtnC7*qD+rb>d@cXVvT7(SO160SmGc2S)g3jTzoKD9g|DrC-+W*DnQReKqHS@BaY} Ct*O8O diff --git a/apps/i18n/zh/LC_MESSAGES/django.po b/apps/i18n/zh/LC_MESSAGES/django.po index 12310b65f..46cf77ef9 100644 --- a/apps/i18n/zh/LC_MESSAGES/django.po +++ b/apps/i18n/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: 2018-07-31 19:18+0800\n" +"POT-Creation-Date: 2018-08-03 15:14+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: ibuler \n" "Language-Team: Jumpserver team\n" @@ -96,7 +96,7 @@ msgid "Port" msgstr "端口" #: assets/forms/domain.py:15 assets/forms/label.py:13 -#: assets/models/asset.py:225 assets/templates/assets/admin_user_list.html:25 +#: assets/models/asset.py:231 assets/templates/assets/admin_user_list.html:25 #: assets/templates/assets/domain_detail.html:60 #: assets/templates/assets/domain_list.html:23 #: assets/templates/assets/label_list.html:16 @@ -142,6 +142,9 @@ msgstr "资产" #: users/templates/users/user_list.html:23 #: users/templates/users/user_profile.html:51 #: users/templates/users/user_pubkey_update.html:53 +#: xpack/plugins/orgs/templates/orgs/org_detail.html:52 +#: xpack/plugins/orgs/templates/orgs/org_list.html:12 +#: xpack/templates/orgs/org_list.html:12 msgid "Name" msgstr "名称" @@ -349,6 +352,7 @@ msgstr "创建者" #: perms/templates/perms/asset_permission_detail.html:94 #: terminal/templates/terminal/terminal_detail.html:59 users/models/group.py:17 #: users/templates/users/user_group_detail.html:63 +#: xpack/plugins/orgs/templates/orgs/org_detail.html:60 msgid "Date created" msgstr "创建日期" @@ -372,6 +376,9 @@ msgstr "创建日期" #: users/templates/users/user_group_detail.html:67 #: users/templates/users/user_group_list.html:14 #: users/templates/users/user_profile.html:130 +#: xpack/plugins/orgs/templates/orgs/org_detail.html:64 +#: xpack/plugins/orgs/templates/orgs/org_list.html:15 +#: xpack/templates/orgs/org_list.html:14 msgid "Comment" msgstr "备注" @@ -452,6 +459,10 @@ msgstr "默认资产组" #: users/models/user.py:33 users/models/user.py:348 #: users/templates/users/user_group_detail.html:78 #: users/templates/users/user_group_list.html:13 users/views/user.py:380 +#: xpack/plugins/orgs/forms.py:26 +#: xpack/plugins/orgs/templates/orgs/org_detail.html:113 +#: xpack/plugins/orgs/templates/orgs/org_list.html:14 +#: xpack/templates/orgs/org_list.html:13 msgid "User" msgstr "用户" @@ -787,6 +798,9 @@ msgstr "测试" #: users/templates/users/user_list.html:77 #: users/templates/users/user_profile.html:151 #: users/templates/users/user_profile.html:180 +#: xpack/plugins/orgs/templates/orgs/org_detail.html:25 +#: xpack/plugins/orgs/templates/orgs/org_list.html:48 +#: xpack/templates/orgs/org_list.html:43 msgid "Update" msgstr "更新" @@ -810,6 +824,9 @@ msgstr "更新" #: users/templates/users/user_group_list.html:45 #: users/templates/users/user_list.html:81 #: users/templates/users/user_list.html:85 +#: xpack/plugins/orgs/templates/orgs/org_detail.html:29 +#: xpack/plugins/orgs/templates/orgs/org_list.html:50 +#: xpack/templates/orgs/org_list.html:45 msgid "Delete" msgstr "删除" @@ -836,6 +853,8 @@ msgstr "选择节点" #: users/templates/users/user_group_list.html:86 #: users/templates/users/user_list.html:200 #: users/templates/users/user_profile.html:222 +#: xpack/plugins/orgs/templates/orgs/org_create_update.html:33 +#: xpack/templates/orgs/org_list.html:86 msgid "Confirm" msgstr "确认" @@ -869,6 +888,8 @@ msgstr "比例" #: terminal/templates/terminal/terminal_list.html:36 #: users/templates/users/user_group_list.html:15 #: users/templates/users/user_list.html:29 +#: xpack/plugins/orgs/templates/orgs/org_list.html:16 +#: xpack/templates/orgs/org_list.html:15 msgid "Action" msgstr "动作" @@ -1021,6 +1042,7 @@ msgstr "存在资产,不能删除" #: users/templates/users/user_detail.html:461 #: users/templates/users/user_group_list.html:81 #: users/templates/users/user_list.html:195 +#: xpack/templates/orgs/org_list.html:81 msgid "Are you sure?" msgstr "你确认吗?" @@ -1576,7 +1598,7 @@ msgid "Special char not allowed" msgstr "不能包含特殊字符" #: common/views.py:19 common/views.py:45 common/views.py:71 common/views.py:101 -#: common/views.py:129 templates/_nav.html:86 +#: common/views.py:129 templates/_nav.html:98 msgid "Settings" msgstr "系统设置" @@ -1638,6 +1660,7 @@ msgid "Become" msgstr "Become" #: ops/models/adhoc.py:161 users/templates/users/user_group_detail.html:59 +#: xpack/plugins/orgs/templates/orgs/org_detail.html:56 msgid "Create by" msgstr "创建者" @@ -1857,7 +1880,7 @@ msgid "Task run history" msgstr "执行历史" #: perms/forms.py:20 users/forms.py:265 users/forms.py:270 users/forms.py:282 -#: users/forms.py:316 +#: users/forms.py:316 xpack/plugins/orgs/forms.py:30 msgid "Select users" msgstr "选择用户" @@ -1911,6 +1934,8 @@ msgstr "添加资产" #: perms/templates/perms/asset_permission_user.html:97 #: perms/templates/perms/asset_permission_user.html:125 #: users/templates/users/user_group_detail.html:95 +#: xpack/plugins/orgs/templates/orgs/org_detail.html:93 +#: xpack/plugins/orgs/templates/orgs/org_detail.html:130 msgid "Add" msgstr "添加" @@ -2114,6 +2139,10 @@ msgstr "终端管理" msgid "Job Center" msgstr "作业中心" +#: templates/_nav.html:86 +msgid "XPack" +msgstr "" + #: templates/captcha/image.html:3 msgid "Play CAPTCHA as audio file" msgstr "语言播放验证码" @@ -2738,6 +2767,42 @@ msgstr "再次输入密码" msgid "Setting" msgstr "设置" +#: users/templates/users/reset_password.html:105 +#: users/templates/users/user_password_update.html:98 +#: users/templates/users/user_update.html:34 +msgid "Very weak" +msgstr "很弱" + +#: users/templates/users/reset_password.html:106 +#: users/templates/users/user_password_update.html:99 +#: users/templates/users/user_update.html:35 +msgid "Weak" +msgstr "弱" + +#: users/templates/users/reset_password.html:107 +#: users/templates/users/user_password_update.html:100 +#: users/templates/users/user_update.html:36 +msgid "Normal" +msgstr "正常" + +#: users/templates/users/reset_password.html:108 +#: users/templates/users/user_password_update.html:101 +#: users/templates/users/user_update.html:37 +msgid "Medium" +msgstr "一般" + +#: users/templates/users/reset_password.html:109 +#: users/templates/users/user_password_update.html:102 +#: users/templates/users/user_update.html:38 +msgid "Strong" +msgstr "强" + +#: users/templates/users/reset_password.html:110 +#: users/templates/users/user_password_update.html:103 +#: users/templates/users/user_update.html:39 +msgid "Very strong" +msgstr "很强" + #: users/templates/users/user_create.html:4 #: users/templates/users/user_list.html:16 users/views/user.py:83 msgid "Create user" @@ -2837,6 +2902,7 @@ msgid "After unlocking the user, the user can log in normally." msgstr "解除用户登录限制后,此用户即可正常登录" #: users/templates/users/user_group_create_update.html:31 +#: xpack/plugins/orgs/templates/orgs/org_create_update.html:32 msgid "Cancel" msgstr "取消" @@ -2847,27 +2913,33 @@ msgid "User group detail" msgstr "用户组详情" #: users/templates/users/user_group_detail.html:86 +#: xpack/plugins/orgs/templates/orgs/org_detail.html:121 msgid "Add user" msgstr "添加用户" #: users/templates/users/user_group_list.html:5 users/views/group.py:44 +#: xpack/templates/orgs/org_list.html:5 msgid "Create user group" msgstr "创建用户组" #: users/templates/users/user_group_list.html:82 +#: xpack/templates/orgs/org_list.html:82 msgid "This will delete the selected groups !!!" msgstr "删除选择组" #: users/templates/users/user_group_list.html:90 +#: xpack/templates/orgs/org_list.html:90 msgid "UserGroups Deleted." msgstr "用户组删除" #: users/templates/users/user_group_list.html:91 #: users/templates/users/user_group_list.html:96 +#: xpack/templates/orgs/org_list.html:91 xpack/templates/orgs/org_list.html:96 msgid "UserGroups Delete" msgstr "用户组删除" #: users/templates/users/user_group_list.html:95 +#: xpack/templates/orgs/org_list.html:95 msgid "UserGroup Deleting failed." msgstr "用户组删除失败" @@ -2943,30 +3015,6 @@ msgstr "新的公钥已设置成功,请下载对应的私钥" msgid "Update user" msgstr "更新用户" -#: users/templates/users/user_update.html:34 -msgid "Very weak" -msgstr "很弱" - -#: users/templates/users/user_update.html:35 -msgid "Weak" -msgstr "弱" - -#: users/templates/users/user_update.html:36 -msgid "Normal" -msgstr "正常" - -#: users/templates/users/user_update.html:37 -msgid "Medium" -msgstr "一般" - -#: users/templates/users/user_update.html:38 -msgid "Strong" -msgstr "强" - -#: users/templates/users/user_update.html:39 -msgid "Very strong" -msgstr "很强" - #: users/utils.py:41 msgid "Create account successfully" msgstr "创建账户成功" @@ -3218,6 +3266,54 @@ msgstr "MFA 解绑成功" msgid "MFA disable success, return login page" msgstr "MFA 解绑成功,返回登录页面" +#: xpack/plugins/orgs/forms.py:14 +#: xpack/plugins/orgs/templates/orgs/org_detail.html:76 +#: xpack/plugins/orgs/templates/orgs/org_list.html:13 +msgid "Admin" +msgstr "管理员" + +#: xpack/plugins/orgs/forms.py:18 +msgid "Select admins" +msgstr "选择管理员" + +#: xpack/plugins/orgs/meta.py:7 +msgid "Organization" +msgstr "组织管理" + +#: xpack/plugins/orgs/templates/orgs/org_detail.html:22 +#: xpack/plugins/orgs/views.py:73 +msgid "Org detail" +msgstr "组织详情" + +#: xpack/plugins/orgs/templates/orgs/org_detail.html:84 +msgid "Add admin" +msgstr "添加管理员" + +#: xpack/plugins/orgs/templates/orgs/org_list.html:5 +msgid "Create organization " +msgstr "创建组织" + +#: xpack/plugins/orgs/views.py:24 +msgid "Org" +msgstr "组织" + +#: xpack/plugins/orgs/views.py:25 +msgid "Org list" +msgstr "组织列表" + +#: xpack/plugins/orgs/views.py:40 xpack/plugins/orgs/views.py:56 +#: xpack/plugins/orgs/views.py:72 +msgid "Orgs" +msgstr "组织" + +#: xpack/plugins/orgs/views.py:41 +msgid "Create org" +msgstr "创建组织" + +#: xpack/plugins/orgs/views.py:57 +msgid "Update org" +msgstr "更新组织" + #~ msgid "* required Must set exact system platform, Windows, Linux ..." #~ msgstr "* required 必须准确设置操作系统平台,如Windows, Linux ..." diff --git a/apps/static/js/jumpserver.js b/apps/static/js/jumpserver.js index 72128fa2b..859d399e8 100644 --- a/apps/static/js/jumpserver.js +++ b/apps/static/js/jumpserver.js @@ -224,6 +224,42 @@ function objectDelete(obj, name, url, redirectTo) { }); } +function orgDelete(obj, name, url, redirectTo){ + function doDelete() { + var body = {}; + var success = function() { + if (!redirectTo) { + $(obj).parent().parent().remove(); + } else { + window.location.href=redirectTo; + } + }; + var fail = function() { + swal("错误", "[ " + name + " ] 组织中存在未删除信息,请删除后重试", "error"); + }; + APIUpdateAttr({ + url: url, + body: JSON.stringify(body), + method: 'DELETE', + success_message: "删除成功", + success: success, + error: fail + }); + } + swal({ + title: "请先删除组织内的以下信息:", + text: "用户列表、用户组、资产列表、网域列表、管理用户、系统用户、标签管理、资产授权规则", + type: "warning", + showCancelButton: true, + cancelButtonText: '取消', + confirmButtonColor: "#ed5565", + confirmButtonText: '确认', + closeOnConfirm: true + }, function () { + doDelete(); + }); +} + $.fn.serializeObject = function() { var o = {}; diff --git a/apps/users/templates/users/user_otp_authentication.html b/apps/users/templates/users/user_otp_authentication.html index 502707874..8d7101475 100644 --- a/apps/users/templates/users/user_otp_authentication.html +++ b/apps/users/templates/users/user_otp_authentication.html @@ -6,7 +6,7 @@

账号保护已开启,请根据提示完成以下操作

-

请在手机中打开Google Authenticator应用,输入6为动态码

+

请在手机中打开Google Authenticator应用,输入6位动态码