Merge pull request #6155 from jumpserver/dev

Merge dev to master
pull/6160/head v2.10.0
Jiangjie.Bai 2021-05-20 15:02:28 +08:00 committed by GitHub
commit 0380be51dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 49 additions and 34 deletions

View File

@ -250,7 +250,7 @@ JumpServer 采纳分布式架构,支持多机房跨区域部署,支持横向
- [Lina](https://github.com/jumpserver/lina) JumpServer Web UI 项目
- [Luna](https://github.com/jumpserver/luna) JumpServer Web Terminal 项目
- [KoKo](https://github.com/jumpserver/koko) JumpServer 字符协议 Connector 项目,替代原来 Python 版本的 [Coco](https://github.com/jumpserver/coco)
- [Guacamole](https://github.com/jumpserver/docker-guacamole) JumpServer 图形协议 Connector 项目,依赖 [Apache Guacamole](https://guacamole.apache.org/)
- [Lion](https://github.com/jumpserver/lion-release) JumpServer 图形协议 Connector 项目,依赖 [Apache Guacamole](https://guacamole.apache.org/)
## 贡献
如果有你好的想法创意,或者帮助我们修复了 Bug, 欢迎提交 Pull Request
@ -263,7 +263,7 @@ JumpServer 采纳分布式架构,支持多机房跨区域部署,支持横向
## 致谢
- [Apache Guacamole](https://guacamole.apache.org/) Web页面连接 RDP, SSH, VNC协议设备JumpServer 图形化连接依赖
- [Apache Guacamole](https://guacamole.apache.org/) Web页面连接 RDP, SSH, VNC协议设备JumpServer 图形化组件 Lion 依赖
- [OmniDB](https://omnidb.org/) Web页面连接使用数据库JumpServer Web数据库依赖

View File

@ -4,7 +4,7 @@ import re
from rest_framework import serializers
from common.drf.serializers import AdaptedBulkListSerializer
from ..models import CommandFilter, CommandFilterRule, SystemUser
from ..models import CommandFilter, CommandFilterRule
from orgs.mixins.serializers import BulkOrgResourceModelSerializer
from orgs.utils import tmp_to_root_org
from common.utils import get_object_or_none, lazyproperty
@ -50,6 +50,20 @@ class CommandFilterRuleSerializer(BulkOrgResourceModelSerializer):
fields = '__all__'
list_serializer_class = AdaptedBulkListSerializer
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.set_action_choices()
def set_action_choices(self):
from django.conf import settings
action = self.fields.get('action')
if not action:
return
choices = action._choices
if not settings.XPACK_ENABLED:
choices.pop(CommandFilterRule.ActionChoices.confirm, None)
action._choices = choices
# def validate_content(self, content):
# tp = self.initial_data.get("type")
# if tp == CommandFilterRule.TYPE_REGEX:

Binary file not shown.

View File

@ -3,19 +3,19 @@
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: JumpServer 0.3.3\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-05-19 16:27+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"POT-Creation-Date: 2021-05-20 14:56+0800\n"
"PO-Revision-Date: 2021-05-20 10:54+0800\n"
"Last-Translator: ibuler <ibuler@qq.com>\n"
"Language-Team: JumpServer team<ibuler@qq.com>\n"
"Language: zh_CN\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.4.3\n"
#: acls/models/base.py:25 acls/serializers/login_asset_acl.py:47
#: applications/models/application.py:11 assets/models/asset.py:142
@ -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:51
#: xpack/plugins/cloud/serializers.py:71
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:49
#: ops/models/adhoc.py:146 xpack/plugins/cloud/serializers.py:69
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:50
#: xpack/plugins/cloud/serializers.py:70
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:53
#: xpack/plugins/cloud/serializers.py:73
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:146
#: xpack/plugins/cloud/models.py:92 xpack/plugins/cloud/serializers.py:166
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:147
#: xpack/plugins/cloud/models.py:89 xpack/plugins/cloud/serializers.py:167
msgid "Node"
msgstr "节点"
@ -949,7 +949,7 @@ msgid ""
msgstr "自检程序已经在运行,不能重复启动"
#: assets/tasks/push_system_user.py:193
#: assets/tasks/system_user_connectivity.py:89
#: assets/tasks/system_user_connectivity.py:90
msgid "System user is dynamic: {}"
msgstr "系统用户是动态的: {}"
@ -958,7 +958,7 @@ msgid "Start push system user for platform: [{}]"
msgstr "推送系统用户到平台: [{}]"
#: assets/tasks/push_system_user.py:234
#: assets/tasks/system_user_connectivity.py:81
#: assets/tasks/system_user_connectivity.py:82
msgid "Hosts count: {}"
msgstr "主机数量: {}"
@ -970,19 +970,19 @@ msgstr "推送系统用户到入资产: {}"
msgid "Push system users to asset: {}({}) => {}"
msgstr "推送系统用户到入资产: {}({}) => {}"
#: assets/tasks/system_user_connectivity.py:80
#: assets/tasks/system_user_connectivity.py:81
msgid "Start test system user connectivity for platform: [{}]"
msgstr "开始测试系统用户在该系统平台的可连接性: [{}]"
#: assets/tasks/system_user_connectivity.py:100
#: assets/tasks/system_user_connectivity.py:101
msgid "Test system user connectivity: {}"
msgstr "测试系统用户可连接性: {}"
#: assets/tasks/system_user_connectivity.py:108
#: assets/tasks/system_user_connectivity.py:112
msgid "Test system user connectivity: {} => {}"
msgstr "测试系统用户可连接性: {} => {}"
#: assets/tasks/system_user_connectivity.py:121
#: assets/tasks/system_user_connectivity.py:125
msgid "Test system user connectivity period: {}"
msgstr "定期测试系统用户可连接性: {}"
@ -2111,15 +2111,15 @@ msgstr "用户名"
#: perms/serializers/asset/permission.py:47
msgid "User groups name"
msgstr "用户组数量"
msgstr "用户组名称"
#: perms/serializers/asset/permission.py:48
msgid "Assets name"
msgstr "资产名"
msgstr "资产名"
#: perms/serializers/asset/permission.py:50
msgid "System users name"
msgstr "系统用户名"
msgstr "系统用户名"
#: perms/serializers/asset/permission.py:70 users/serializers/user.py:81
msgid "Is valid"
@ -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:145
#: xpack/plugins/cloud/serializers.py:165
msgid "Account"
msgstr "账户"
@ -4740,7 +4740,7 @@ msgstr "云服务商"
msgid "Cloud account"
msgstr "云账号"
#: xpack/plugins/cloud/models.py:81 xpack/plugins/cloud/serializers.py:126
#: xpack/plugins/cloud/models.py:81 xpack/plugins/cloud/serializers.py:146
msgid "Regions"
msgstr "地域"
@ -4748,7 +4748,7 @@ msgstr "地域"
msgid "Hostname strategy"
msgstr "主机名策略"
#: xpack/plugins/cloud/models.py:95 xpack/plugins/cloud/serializers.py:149
#: xpack/plugins/cloud/models.py:95 xpack/plugins/cloud/serializers.py:169
msgid "Always update"
msgstr "总是更新"
@ -4940,20 +4940,24 @@ msgstr ""
msgid "Subscription ID"
msgstr ""
#: xpack/plugins/cloud/serializers.py:124
#: xpack/plugins/cloud/serializers.py:55
msgid "{} is required"
msgstr "{} 字段是必填项"
#: xpack/plugins/cloud/serializers.py:144
msgid "History count"
msgstr "执行次数"
#: xpack/plugins/cloud/serializers.py:125
#: xpack/plugins/cloud/serializers.py:145
msgid "Instance count"
msgstr "实例个数"
#: xpack/plugins/cloud/serializers.py:148
#: xpack/plugins/cloud/serializers.py:168
#: xpack/plugins/gathered_user/serializers.py:20
msgid "Periodic display"
msgstr "定时执行"
#: xpack/plugins/cloud/utils.py:64
#: xpack/plugins/cloud/utils.py:65
msgid "Account unavailable"
msgstr "账户无效"
@ -5044,9 +5048,6 @@ msgstr "社区版"
#~ msgid "AppSecret is required"
#~ msgstr "AppSecret 是必须的"
#~ msgid "Secret is required"
#~ msgstr "Secret 是必须的"
#~ msgid "Corporation ID(corpid)"
#~ msgstr "企业 ID(CorpId)"

View File

@ -79,7 +79,7 @@ class OrgResourceStatisticsCache(OrgRelatedCache):
def compute_users_amount(self):
if self.org.is_root():
users_amount = User.objects.exclude(role='APP').count()
users_amount = User.objects.exclude(role='App').count()
else:
users_amount = OrganizationMember.objects.values(
'user_id'

View File

@ -1,2 +1,2 @@
{% load i18n %}
<strong>Copyright</strong> {{ COPYRIGHT }}
{#{% load i18n %}#}
{#<strong>Copyright</strong> {{ COPYRIGHT }}#}