From 34d46897f8aa8d57dd844805d06efd8b55740c72 Mon Sep 17 00:00:00 2001 From: ibuler Date: Thu, 20 May 2021 15:55:15 +0800 Subject: [PATCH 1/4] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=91=A8=E6=9C=9F?= =?UTF-8?q?=E7=9B=91=E6=B5=8B=E4=BB=BB=E5=8A=A1=E9=85=8D=E7=BD=AE=E7=9A=84?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/jumpserver/conf.py | 2 +- config_example.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/jumpserver/conf.py b/apps/jumpserver/conf.py index 7bb8dd095..68be2776b 100644 --- a/apps/jumpserver/conf.py +++ b/apps/jumpserver/conf.py @@ -279,7 +279,7 @@ class Config(dict): 'WINDOWS_SSH_DEFAULT_SHELL': 'cmd', 'FLOWER_URL': "127.0.0.1:5555", 'DEFAULT_ORG_SHOW_ALL_USERS': True, - 'PERIOD_TASK_ENABLE': True, + 'PERIOD_TASK_ENABLED': True, 'FORCE_SCRIPT_NAME': '', 'LOGIN_CONFIRM_ENABLE': False, 'WINDOWS_SKIP_ALL_MANUAL_PASSWORD': False, diff --git a/config_example.yml b/config_example.yml index c3e2ce0f5..9fa4c1814 100644 --- a/config_example.yml +++ b/config_example.yml @@ -122,7 +122,7 @@ REDIS_PORT: 6379 # USER_LOGIN_SINGLE_MACHINE_ENABLED: False # # 启用定时任务 -# PERIOD_TASK_ENABLE: True +# PERIOD_TASK_ENABLED: True # # 启用二次复合认证配置 # LOGIN_CONFIRM_ENABLE: False From c66f366446bb51aa0307a220d1e1395953d3e4a7 Mon Sep 17 00:00:00 2001 From: xinwen Date: Thu, 20 May 2021 17:25:41 +0800 Subject: [PATCH 2/4] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20default=20?= =?UTF-8?q?=E7=BB=84=E7=BB=87=E7=94=A8=E6=88=B7=E6=95=B0=E9=87=8F=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/orgs/caches.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/orgs/caches.py b/apps/orgs/caches.py index 8b5a61b51..5ca445479 100644 --- a/apps/orgs/caches.py +++ b/apps/orgs/caches.py @@ -78,12 +78,12 @@ class OrgResourceStatisticsCache(OrgRelatedCache): return self.org def compute_users_amount(self): - if self.org.is_root(): - users_amount = User.objects.exclude(role='App').count() - else: - users_amount = OrganizationMember.objects.values( - 'user_id' - ).filter(org_id=self.org.id).distinct().count() + users = User.objects.exclude(role='App') + + if not self.org.is_root(): + users = users.filter(m2m_org_members__org_id=self.org.id) + + users_amount = users.values('id').distinct().count() return users_amount def compute_assets_amount(self): From 9ccde0365686755b5178f7033bb55f149e85348e Mon Sep 17 00:00:00 2001 From: Bai Date: Fri, 21 May 2021 11:14:29 +0800 Subject: [PATCH 3/4] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9cloud=E7=BF=BB?= =?UTF-8?q?=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/locale/zh/LC_MESSAGES/django.mo | Bin 75310 -> 75321 bytes apps/locale/zh/LC_MESSAGES/django.po | 35 +++++++++++++++------------ 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/apps/locale/zh/LC_MESSAGES/django.mo b/apps/locale/zh/LC_MESSAGES/django.mo index 231c4df8c203cbe0edd5ba7271eef34414d7398b..b3bde6600c0bb872d8d1b75fc24aa8530be39c0b 100644 GIT binary patch delta 10964 zcmXxp3w)1t|Htv`lF7IiGc(LKYYjOKlQXmCILC#@!maWTIYd!Xq#p`NlD?Ef%8FES zZsB$qax5u?s7P!LY4`1{gZ{7gu1~+mU&*yu*zSm(_w^av9ZaPqMP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?DC$;jB+P?!!n12 z{Ym*D%7ZAMgJZqBna>7yCwHUw%#$4=KO&`1OWclIaj>`J$%JT+)Jqt-WCbh5Pj`LQxZ{^-u^LP8D9oB4JHaxs|pCNIBvtJt4XK;4UHFa`^w_l$V;l30e no4b70g%#^A%wCzB^Lp-r&n_<5=!_W~H)d?^`j2y`%yj+_IlAfA diff --git a/apps/locale/zh/LC_MESSAGES/django.po b/apps/locale/zh/LC_MESSAGES/django.po index 8cf941acb..a64dde7cd 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: 2021-05-20 14:56+0800\n" +"POT-Creation-Date: 2021-05-21 11:08+0800\n" "PO-Revision-Date: 2021-05-20 10:54+0800\n" "Last-Translator: ibuler \n" "Language-Team: JumpServer team\n" @@ -184,7 +184,7 @@ msgstr "格式为逗号分隔的字符串, * 表示匹配所有. " #: users/templates/users/_select_user_modal.html:14 #: xpack/plugins/change_auth_plan/models.py:47 #: xpack/plugins/change_auth_plan/models.py:278 -#: xpack/plugins/cloud/serializers.py:71 +#: xpack/plugins/cloud/serializers.py:65 msgid "Username" msgstr "用户名" @@ -285,7 +285,7 @@ msgid "Cluster" msgstr "集群" #: applications/serializers/attrs/application_category/db.py:11 -#: ops/models/adhoc.py:146 xpack/plugins/cloud/serializers.py:69 +#: ops/models/adhoc.py:146 xpack/plugins/cloud/serializers.py:63 msgid "Host" msgstr "主机" @@ -295,7 +295,7 @@ msgstr "主机" #: applications/serializers/attrs/application_type/oracle.py:11 #: applications/serializers/attrs/application_type/pgsql.py:11 #: assets/models/asset.py:188 assets/models/domain.py:53 -#: xpack/plugins/cloud/serializers.py:70 +#: xpack/plugins/cloud/serializers.py:64 msgid "Port" msgstr "端口" @@ -325,7 +325,7 @@ msgstr "目标URL" #: xpack/plugins/change_auth_plan/models.py:68 #: xpack/plugins/change_auth_plan/models.py:190 #: xpack/plugins/change_auth_plan/models.py:285 -#: xpack/plugins/cloud/serializers.py:73 +#: xpack/plugins/cloud/serializers.py:67 msgid "Password" msgstr "密码" @@ -407,7 +407,7 @@ msgstr "激活" #: assets/models/asset.py:196 assets/models/cluster.py:19 #: assets/models/user.py:66 templates/_nav.html:44 -#: xpack/plugins/cloud/models.py:92 xpack/plugins/cloud/serializers.py:166 +#: xpack/plugins/cloud/models.py:92 xpack/plugins/cloud/serializers.py:160 msgid "Admin user" msgstr "管理用户" @@ -678,7 +678,7 @@ msgstr "ssh私钥" #: users/templates/users/user_asset_permission.html:41 #: users/templates/users/user_asset_permission.html:73 #: users/templates/users/user_asset_permission.html:158 -#: xpack/plugins/cloud/models.py:89 xpack/plugins/cloud/serializers.py:167 +#: xpack/plugins/cloud/models.py:89 xpack/plugins/cloud/serializers.py:161 msgid "Node" msgstr "节点" @@ -3999,7 +3999,7 @@ msgid "Security token validation" msgstr "安全令牌验证" #: users/templates/users/_base_otp.html:14 xpack/plugins/cloud/models.py:78 -#: xpack/plugins/cloud/serializers.py:165 +#: xpack/plugins/cloud/serializers.py:159 msgid "Account" msgstr "账户" @@ -4740,7 +4740,7 @@ msgstr "云服务商" msgid "Cloud account" msgstr "云账号" -#: xpack/plugins/cloud/models.py:81 xpack/plugins/cloud/serializers.py:146 +#: xpack/plugins/cloud/models.py:81 xpack/plugins/cloud/serializers.py:140 msgid "Regions" msgstr "地域" @@ -4748,7 +4748,7 @@ msgstr "地域" msgid "Hostname strategy" msgstr "主机名策略" -#: xpack/plugins/cloud/models.py:95 xpack/plugins/cloud/serializers.py:169 +#: xpack/plugins/cloud/models.py:95 xpack/plugins/cloud/serializers.py:163 msgid "Always update" msgstr "总是更新" @@ -4940,19 +4940,19 @@ msgstr "" msgid "Subscription ID" msgstr "" -#: xpack/plugins/cloud/serializers.py:55 -msgid "{} is required" -msgstr "{} 字段是必填项" +#: xpack/plugins/cloud/serializers.py:49 +msgid "This field is required" +msgstr "这个字段是必填项" -#: xpack/plugins/cloud/serializers.py:144 +#: xpack/plugins/cloud/serializers.py:138 msgid "History count" msgstr "执行次数" -#: xpack/plugins/cloud/serializers.py:145 +#: xpack/plugins/cloud/serializers.py:139 msgid "Instance count" msgstr "实例个数" -#: xpack/plugins/cloud/serializers.py:168 +#: xpack/plugins/cloud/serializers.py:162 #: xpack/plugins/gathered_user/serializers.py:20 msgid "Periodic display" msgstr "定时执行" @@ -5045,6 +5045,9 @@ msgstr "旗舰版" msgid "Community edition" msgstr "社区版" +#~ msgid "{} is required" +#~ msgstr "{} 字段是必填项" + #~ msgid "AppSecret is required" #~ msgstr "AppSecret 是必须的" From d765e61991fe9e5608088c0c1f8d8b9b76caae3c Mon Sep 17 00:00:00 2001 From: ibuler Date: Fri, 21 May 2021 15:13:43 +0800 Subject: [PATCH 4/4] =?UTF-8?q?fix(assets):=20=E4=BF=AE=E5=A4=8D=E7=BD=91?= =?UTF-8?q?=E5=85=B3=E4=BF=A1=E6=81=AF=E6=B2=A1=E6=9C=89=E5=AF=86=E7=A0=81?= =?UTF-8?q?=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/assets/serializers/domain.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/apps/assets/serializers/domain.py b/apps/assets/serializers/domain.py index 0d9c4a6f5..5d8d0e8d8 100644 --- a/apps/assets/serializers/domain.py +++ b/apps/assets/serializers/domain.py @@ -59,7 +59,7 @@ class GatewaySerializer(AuthSerializerMixin, BulkOrgResourceModelSerializer): 'created_by', 'comment', ] fields_fk = ['domain'] - fields = fields_small + fields_fk + fields = fields_small + fields_fk extra_kwargs = { 'password': {'write_only': True, 'validators': [NoSpecialChars()]}, 'private_key': {"write_only": True}, @@ -78,12 +78,12 @@ class GatewaySerializer(AuthSerializerMixin, BulkOrgResourceModelSerializer): class GatewayWithAuthSerializer(GatewaySerializer): - def get_field_names(self, declared_fields, info): - fields = super().get_field_names(declared_fields, info) - fields.extend( - ['password', 'private_key'] - ) - return fields + class Meta(GatewaySerializer.Meta): + extra_kwargs = { + 'password': {'write_only': False, 'validators': [NoSpecialChars()]}, + 'private_key': {"write_only": False}, + 'public_key': {"write_only": False}, + } class DomainWithGatewaySerializer(BulkOrgResourceModelSerializer):