diff --git a/apps/assets/api/asset_user.py b/apps/assets/api/asset_user.py index d3824f676..a07544e57 100644 --- a/apps/assets/api/asset_user.py +++ b/apps/assets/api/asset_user.py @@ -7,6 +7,7 @@ from rest_framework import filters from rest_framework_bulk import BulkModelViewSet from django.shortcuts import get_object_or_404 from django.http import Http404 +from django.conf import settings from common.permissions import IsOrgAdminOrAppUser, NeedMFAVerify from common.utils import get_object_or_none, get_logger @@ -110,12 +111,22 @@ class AssetUserViewSet(CommonApiMixin, BulkModelViewSet): class AssetUserExportViewSet(AssetUserViewSet): serializer_class = serializers.AssetUserExportSerializer http_method_names = ['get'] - permission_classes = [IsOrgAdminOrAppUser, NeedMFAVerify] + permission_classes = [IsOrgAdminOrAppUser] + + def get_permissions(self): + if settings.CONFIG.SECURITY_VIEW_AUTH_NEED_MFA: + self.permission_classes = [IsOrgAdminOrAppUser, NeedMFAVerify] + return super().get_permissions() class AssetUserAuthInfoApi(generics.RetrieveAPIView): serializer_class = serializers.AssetUserAuthInfoSerializer - permission_classes = [IsOrgAdminOrAppUser, NeedMFAVerify] + permission_classes = [IsOrgAdminOrAppUser] + + def get_permissions(self): + if settings.CONFIG.SECURITY_VIEW_AUTH_NEED_MFA: + self.permission_classes = [IsOrgAdminOrAppUser, NeedMFAVerify] + return super().get_permissions() def get_object(self): query_params = self.request.query_params diff --git a/apps/assets/backends/manager.py b/apps/assets/backends/manager.py index 201f19d43..75b9c38b8 100644 --- a/apps/assets/backends/manager.py +++ b/apps/assets/backends/manager.py @@ -41,8 +41,8 @@ class AssetUserManager: instances_map = {} instances = [] for name, backend in self.backends: - if name != "db" and self._prefer != name: - continue + # if name != "db": + # continue _instances = backend.filter( username=username, assets=assets, latest=latest, prefer=self._prefer, prefer_id=prefer_id, diff --git a/apps/assets/templates/assets/_asset_user_list.html b/apps/assets/templates/assets/_asset_user_list.html index a85a3056d..3321e2578 100644 --- a/apps/assets/templates/assets/_asset_user_list.html +++ b/apps/assets/templates/assets/_asset_user_list.html @@ -40,6 +40,7 @@ var prefer = null; var lastMFATime = "{{ request.session.MFA_VERIFY_TIME }}"; var testDatetime = "{% trans 'Test datetime: ' %}"; var mfaVerifyTTL = "{{ SECURITY_MFA_VERIFY_TTL }}"; +var mfaNeedCheck = "{{ SECURITY_VIEW_AUTH_NEED_MFA }}" === "True"; function initAssetUserTable() { var options = { @@ -112,6 +113,10 @@ $(document).ready(function(){ authAssetId = $(this).data("asset") ; authHostname = $(this).data("hostname"); authUsername = $(this).data('user'); + if (!mfaNeedCheck){ + $("#asset_user_auth_view").modal('show'); + return + } var now = new Date(); var nowTime = now.getTime() / 1000; if ( !lastMFATime || nowTime - lastMFATime > mfaVerifyTTL ) { diff --git a/apps/assets/templates/assets/admin_user_list.html b/apps/assets/templates/assets/admin_user_list.html index 9568ceb30..7a4b2a2dc 100644 --- a/apps/assets/templates/assets/admin_user_list.html +++ b/apps/assets/templates/assets/admin_user_list.html @@ -70,43 +70,6 @@ function initTable() { var detail_btn = '' + cellData + ''; return detail_btn.replace('{{ DEFAULT_PK }}', rowData.id); }}, - {#{targets: 4, createdCell: function (td, cellData) {#} - {# var innerHtml = "";#} - {# var data = cellData.reachable;#} - {# if (data !== 0) {#} - {# innerHtml = "" + data + "";#} - {# } else {#} - {# innerHtml = "" + data + "";#} - {# }#} - {# $(td).html(innerHtml)#} - {#}},#} - {#{targets: 5, createdCell: function (td, cellData) {#} - {# var data = cellData.unreachable;#} - {# var innerHtml = "";#} - {# if (data !== 0) {#} - {# innerHtml = "" + data + "";#} - {# } else {#} - {# innerHtml = "" + data + "";#} - {# }#} - {# $(td).html('' + innerHtml + '');#} - {#}},#} - {#{targets: 6, createdCell: function (td, cellData, rowData) {#} - {# var val = 0;#} - {# var innerHtml = "";#} - {# var total = rowData.assets_amount;#} - {# var reachable = cellData.reachable;#} - {# if (total !== 0) {#} - {# val = reachable/total * 100;#} - {# }#} - {##} - {# if (val === 100) {#} - {# innerHtml = "" + val + "% ";#} - {# } else {#} - {# var num = new Number(val);#} - {# innerHtml = "" + num.toFixed(1) + "% ";#} - {# }#} - {# $(td).html('' + innerHtml + '');#} - {#}},#} {targets: 5, createdCell: function (td, cellData, rowData) { var update_btn = '{% trans "Update" %}'.replace('{{ DEFAULT_PK }}', cellData); var del_btn = '{% trans "Delete" %}'.replace('{{ DEFAULT_PK }}', cellData); @@ -116,7 +79,7 @@ function initTable() { columns: [ {data: function(){return ""}}, {data: "name"}, {data: "username" }, {data: "assets_amount", orderable: false}, {#{data: "connectivity_amount"}, {data: "connectivity_amount"}, {data: "connectivity_amount"},#} - {data: "comment"}, {data: "id", orderable: false} + {data: "comment"}, {data: "id", orderable: false, width: "100px"} ] }; admin_user_table = jumpserver.initServerSideDataTable(options); diff --git a/apps/assets/templates/assets/asset_list.html b/apps/assets/templates/assets/asset_list.html index da0a6bd5d..be267cc4d 100644 --- a/apps/assets/templates/assets/asset_list.html +++ b/apps/assets/templates/assets/asset_list.html @@ -177,7 +177,7 @@ function initTable() { data: "connectivity", orderable: false, width: '60px' - }, {data: "id", orderable: false} + }, {data: "id", orderable: false, width: "100px"} ], op_html: $('#actions').html() }; diff --git a/apps/assets/templates/assets/cmd_filter_detail.html b/apps/assets/templates/assets/cmd_filter_detail.html index e68cba47c..8ef5d5b75 100644 --- a/apps/assets/templates/assets/cmd_filter_detail.html +++ b/apps/assets/templates/assets/cmd_filter_detail.html @@ -144,7 +144,9 @@ function updateCMDFilterSystemUsers(system_users) { }); } $(document).ready(function () { - $(".select2").select2(); + $(".select2").select2({ + closeOnSelect: false + }); }).on('click', '#btn-binding-system-users', function () { var origin_system_users = $.map($(".bdg-system-users"), function (s) { return $(s).data('gid') diff --git a/apps/assets/templates/assets/cmd_filter_list.html b/apps/assets/templates/assets/cmd_filter_list.html index b6d46a2c8..0582363c4 100644 --- a/apps/assets/templates/assets/cmd_filter_list.html +++ b/apps/assets/templates/assets/cmd_filter_list.html @@ -63,7 +63,8 @@ function initTable() { ajax_url: '{% url "api-assets:cmd-filter-list" %}', columns: [ {data: "id"}, {data: "name" }, {data: "rules", orderable: false}, - {data: "system_users", orderable: false}, {data: "comment"}, {data: "id", orderable: false} + {data: "system_users", orderable: false}, {data: "comment"}, + {data: "id", orderable: false, width: "100px"} ], op_html: $('#actions').html() }; diff --git a/apps/assets/templates/assets/domain_list.html b/apps/assets/templates/assets/domain_list.html index 6a0f36f40..2b82826a0 100644 --- a/apps/assets/templates/assets/domain_list.html +++ b/apps/assets/templates/assets/domain_list.html @@ -59,7 +59,7 @@ function initTable() { ajax_url: '{% url "api-assets:domain-list" %}', columns: [ {data: "id"}, {data: "name" }, {data: "asset_count", orderable: false }, - {data: "gateway_count", orderable: false }, {data: "comment" }, {data: "id", orderable: false} + {data: "gateway_count", orderable: false }, {data: "comment" }, {data: "id", orderable: false, width: "100px"} ], op_html: $('#actions').html() }; diff --git a/apps/assets/templates/assets/label_list.html b/apps/assets/templates/assets/label_list.html index 7d780deed..9ab735f7a 100644 --- a/apps/assets/templates/assets/label_list.html +++ b/apps/assets/templates/assets/label_list.html @@ -44,7 +44,8 @@ function initTable() { ajax_url: '{% url "api-assets:label-list" %}?sort=name', columns: [ {data: "id"}, {data: "name" }, {data: "value" }, - {data: "asset_count", orderable: false}, {data: "id", orderable: false} + {data: "asset_count", orderable: false}, + {data: "id", orderable: false, width: "100px"} ], op_html: $('#actions').html() }; diff --git a/apps/assets/templates/assets/system_user_list.html b/apps/assets/templates/assets/system_user_list.html index dcfaac8cc..e6b259585 100644 --- a/apps/assets/templates/assets/system_user_list.html +++ b/apps/assets/templates/assets/system_user_list.html @@ -3,10 +3,6 @@ {% block help_message %}
-{# 系统用户是 Jumpserver跳转登录资产时使用的用户,可以理解为登录资产用户,如 web, sa, dba(`ssh web@some-host`), 而不是使用某个用户的用户名跳转登录服务器(`ssh xiaoming@some-host`);#} -{# 简单来说是 用户使用自己的用户名登录Jumpserver, Jumpserver使用系统用户登录资产。#} -{# 系统用户创建时,如果选择了自动推送 Jumpserver会使用ansible自动推送系统用户到资产中,如果资产(交换机、windows)不支持ansible, 请手动填写账号密码。#} -{# 目前还不支持Windows的自动推送#} {% trans '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 web@some-host `), rather than using a user the username login server jump (` ssh xiaoming@some-host `); '%} {% trans 'In simple terms, users log into Jumpserver using their own username, and Jumpserver uses system users to log into assets. '%} {% trans '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 support ansible, please manually fill in the account password.' %} @@ -91,7 +87,7 @@ function initTable() { columns: [ {data: "id" }, {data: "name" }, {data: "username" }, {data: "protocol"}, {data: "login_mode"}, {data: "assets_amount", orderable: false }, - {data: "comment" }, {data: "id", orderable: false } + {data: "comment" }, {data: "id", orderable: false, width: "100px"} ], op_html: $('#actions').html() }; diff --git a/apps/audits/models.py b/apps/audits/models.py index 397aac955..31471edbe 100644 --- a/apps/audits/models.py +++ b/apps/audits/models.py @@ -88,11 +88,13 @@ class UserLoginLog(models.Model): datetime = models.DateTimeField(default=timezone.now, verbose_name=_('Date login')) @classmethod - def get_login_logs(cls, date_form=None, date_to=None, user=None, keyword=None): + def get_login_logs(cls, date_from=None, date_to=None, user=None, keyword=None): login_logs = cls.objects.all() - if date_form and date_to: + if date_from and date_to: + date_from = "{} {}".format(date_from, '00:00:00') + date_to = "{} {}".format(date_to, '23:59:59') login_logs = login_logs.filter( - datetime__gt=date_form, datetime__lt=date_to + datetime__gte=date_from, datetime__lte=date_to ) if user: login_logs = login_logs.filter(username=user) diff --git a/apps/audits/templates/audits/login_log_list.html b/apps/audits/templates/audits/login_log_list.html index e67b792b0..151fccb13 100644 --- a/apps/audits/templates/audits/login_log_list.html +++ b/apps/audits/templates/audits/login_log_list.html @@ -121,7 +121,7 @@ }); }) .on('click', '.btn_export', function () { - var date_form = $('#id_date_from').val(); + var date_from = $('#id_date_from').val(); var date_to = $('#id_date_to').val(); var user = $('.select2 option:selected').val(); var keyword = $('#search').val(); @@ -129,7 +129,7 @@ url: "{% url "audits:login-log-export" %}", method: 'POST', data: JSON.stringify({ - 'date_form':date_form, + 'date_from':date_from, 'date_to':date_to, 'user':user, 'keyword':keyword diff --git a/apps/audits/views.py b/apps/audits/views.py index 13b0031d0..7bc6f6880 100644 --- a/apps/audits/views.py +++ b/apps/audits/views.py @@ -267,19 +267,22 @@ class LoginLogExportView(PermissionsMixin, View): header = [field.verbose_name for field in fields] login_logs = cache.get(request.GET.get('spm', ''), []) - response = write_content_to_excel(excel_response, login_logs=login_logs, - header=header, fields=fields) + response = write_content_to_excel( + excel_response, login_logs=login_logs, header=header, fields=fields + ) return response def post(self, request): try: - date_form = json.loads(request.body).get('date_form', []) + date_from = json.loads(request.body).get('date_from', []) date_to = json.loads(request.body).get('date_to', []) user = json.loads(request.body).get('user', []) keyword = json.loads(request.body).get('keyword', []) login_logs = UserLoginLog.get_login_logs( - date_form=date_form, date_to=date_to, user=user, keyword=keyword) + date_from=date_from, date_to=date_to, user=user, + keyword=keyword, + ) except ValueError: return HttpResponse('Json object not valid', status=400) spm = uuid.uuid4().hex diff --git a/apps/common/utils/encode.py b/apps/common/utils/encode.py index fc9467cba..d4e9c4cbe 100644 --- a/apps/common/utils/encode.py +++ b/apps/common/utils/encode.py @@ -182,3 +182,7 @@ def encrypt_password(password, salt=None): def get_signer(): signer = Signer(settings.SECRET_KEY) return signer + + +def ensure_last_char_is_ascii(data): + remain = '' diff --git a/apps/jumpserver/conf.py b/apps/jumpserver/conf.py index 0df26d149..29dfeabbe 100644 --- a/apps/jumpserver/conf.py +++ b/apps/jumpserver/conf.py @@ -361,6 +361,7 @@ defaults = { 'TERMINAL_COMMAND_STORAGE': {}, 'SECURITY_MFA_AUTH': False, 'SECURITY_SERVICE_ACCOUNT_REGISTRATION': True, + 'SECURITY_VIEW_AUTH_NEED_MFA': True, 'SECURITY_LOGIN_LIMIT_COUNT': 7, 'SECURITY_LOGIN_LIMIT_TIME': 30, 'SECURITY_MAX_IDLE_TIME': 30, diff --git a/apps/jumpserver/context_processor.py b/apps/jumpserver/context_processor.py index 91a720fd7..0bd5186dd 100644 --- a/apps/jumpserver/context_processor.py +++ b/apps/jumpserver/context_processor.py @@ -18,6 +18,7 @@ def jumpserver_processor(request): 'COPYRIGHT': 'FIT2CLOUD 飞致云' + ' © 2014-2019', 'SECURITY_COMMAND_EXECUTION': settings.SECURITY_COMMAND_EXECUTION, 'SECURITY_MFA_VERIFY_TTL': settings.SECURITY_MFA_VERIFY_TTL, + 'SECURITY_VIEW_AUTH_NEED_MFA': settings.CONFIG.SECURITY_VIEW_AUTH_NEED_MFA, } return context diff --git a/apps/locale/zh/LC_MESSAGES/django.mo b/apps/locale/zh/LC_MESSAGES/django.mo index 62707d108..3c2a395cb 100644 Binary files a/apps/locale/zh/LC_MESSAGES/django.mo and b/apps/locale/zh/LC_MESSAGES/django.mo differ diff --git a/apps/locale/zh/LC_MESSAGES/django.po b/apps/locale/zh/LC_MESSAGES/django.po index f282f0c22..d9e60b04a 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-17 16:09+0800\n" +"POT-Creation-Date: 2019-10-21 17:00+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: ibuler \n" "Language-Team: Jumpserver team\n" @@ -95,7 +95,7 @@ msgstr "运行参数" #: terminal/templates/terminal/command_list.html:66 #: terminal/templates/terminal/session_list.html:28 #: terminal/templates/terminal/session_list.html:72 -#: xpack/plugins/change_auth_plan/forms.py:64 +#: xpack/plugins/change_auth_plan/forms.py:73 #: xpack/plugins/change_auth_plan/models.py:412 #: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_create_update.html:46 #: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_execution_list.html:54 @@ -112,7 +112,7 @@ msgstr "资产" #: applications/templates/applications/remote_app_detail.html:53 #: applications/templates/applications/remote_app_list.html:20 #: applications/templates/applications/user_remote_app_list.html:16 -#: assets/forms/asset.py:21 assets/forms/domain.py:73 assets/forms/user.py:75 +#: assets/forms/asset.py:21 assets/forms/domain.py:77 assets/forms/user.py:75 #: assets/forms/user.py:95 assets/models/base.py:28 assets/models/cluster.py:18 #: assets/models/cmd_filter.py:21 assets/models/domain.py:20 #: assets/models/group.py:20 assets/models/label.py:18 @@ -151,7 +151,7 @@ msgstr "资产" #: users/templates/users/user_list.html:35 #: users/templates/users/user_profile.html:51 #: users/templates/users/user_pubkey_update.html:57 -#: xpack/plugins/change_auth_plan/forms.py:47 +#: xpack/plugins/change_auth_plan/forms.py:56 #: xpack/plugins/change_auth_plan/models.py:63 #: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_detail.html:61 #: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_list.html:12 @@ -322,6 +322,7 @@ msgstr "远程应用" #: xpack/plugins/cloud/templates/cloud/sync_instance_task_create_update.html:53 #: xpack/plugins/gathered_user/templates/gathered_user/task_create_update.html:44 #: xpack/plugins/interface/templates/interface/interface.html:72 +#: xpack/plugins/orgs/templates/orgs/org_create_update.html:33 #: xpack/plugins/vault/templates/vault/vault_create.html:45 msgid "Reset" msgstr "重置" @@ -639,7 +640,7 @@ msgstr "网域" #: perms/templates/perms/asset_permission_list.html:53 #: perms/templates/perms/asset_permission_list.html:74 #: perms/templates/perms/asset_permission_list.html:124 -#: xpack/plugins/change_auth_plan/forms.py:65 +#: xpack/plugins/change_auth_plan/forms.py:74 #: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_execution_list.html:55 #: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_list.html:15 #: xpack/plugins/cloud/models.py:157 @@ -668,7 +669,7 @@ msgstr "如果有多个的互相隔离的网络,设置资产属于的网域, #: assets/forms/asset.py:132 assets/forms/asset.py:136 #: assets/forms/domain.py:17 assets/forms/label.py:15 #: perms/templates/perms/asset_permission_asset.html:78 -#: xpack/plugins/change_auth_plan/forms.py:55 +#: xpack/plugins/change_auth_plan/forms.py:64 #: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_asset_list.html:74 msgid "Select assets" msgstr "选择资产" @@ -677,15 +678,15 @@ msgstr "选择资产" msgid "Content should not be contain: {}" msgstr "内容不能包含: {}" -#: assets/forms/domain.py:51 +#: assets/forms/domain.py:55 msgid "Password should not contain special characters" msgstr "不能包含特殊字符" -#: assets/forms/domain.py:70 +#: assets/forms/domain.py:74 msgid "SSH gateway support proxy SSH,RDP,VNC" msgstr "SSH网关,支持代理SSH,RDP和VNC" -#: assets/forms/domain.py:74 assets/forms/user.py:76 assets/forms/user.py:96 +#: assets/forms/domain.py:78 assets/forms/user.py:76 assets/forms/user.py:96 #: assets/models/base.py:29 assets/models/gathered_user.py:16 #: assets/templates/assets/_asset_user_auth_update_modal.html:15 #: assets/templates/assets/_asset_user_auth_view_modal.html:21 @@ -706,7 +707,7 @@ msgstr "SSH网关,支持代理SSH,RDP和VNC" #: users/templates/users/user_detail.html:67 #: users/templates/users/user_list.html:36 #: users/templates/users/user_profile.html:47 -#: xpack/plugins/change_auth_plan/forms.py:49 +#: xpack/plugins/change_auth_plan/forms.py:58 #: xpack/plugins/change_auth_plan/models.py:65 #: xpack/plugins/change_auth_plan/models.py:408 #: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_detail.html:65 @@ -1451,7 +1452,7 @@ msgid "Update asset user auth" msgstr "更新资产用户认证信息" #: assets/templates/assets/_asset_user_auth_update_modal.html:23 -#: xpack/plugins/change_auth_plan/forms.py:51 +#: xpack/plugins/change_auth_plan/forms.py:60 msgid "Please input password" msgstr "请输入密码" @@ -1637,7 +1638,7 @@ msgstr "替换资产的管理员" #: assets/templates/assets/admin_user_detail.html:91 #: perms/templates/perms/asset_permission_asset.html:103 -#: xpack/plugins/change_auth_plan/forms.py:59 +#: xpack/plugins/change_auth_plan/forms.py:68 #: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_asset_list.html:99 #: xpack/plugins/gathered_user/forms.py:36 msgid "Select nodes" @@ -1877,7 +1878,6 @@ msgstr "删除选择资产" #: users/templates/users/user_group_list.html:118 #: users/templates/users/user_list.html:254 #: xpack/plugins/interface/templates/interface/interface.html:101 -#: xpack/plugins/orgs/templates/orgs/org_create_update.html:33 msgid "Cancel" msgstr "取消" @@ -3394,33 +3394,33 @@ msgstr "远程应用授权用户列表" msgid "RemoteApp permission RemoteApp list" msgstr "远程应用授权远程应用列表" -#: settings/api.py:27 +#: settings/api.py:28 msgid "Test mail sent to {}, please check" msgstr "邮件已经发送{}, 请检查" -#: settings/api.py:55 +#: settings/api.py:67 msgid "Test ldap success" msgstr "连接LDAP成功" -#: settings/api.py:92 +#: settings/api.py:104 msgid "Match {} s users" msgstr "匹配 {} 个用户" -#: settings/api.py:151 +#: settings/api.py:163 msgid "succeed: {} failed: {} total: {}" msgstr "成功:{} 失败:{} 总数:{}" -#: settings/api.py:173 settings/api.py:209 +#: settings/api.py:185 settings/api.py:221 msgid "" "Error: Account invalid (Please make sure the information such as Access key " "or Secret key is correct)" msgstr "错误:账户无效 (请确保 Access key 或 Secret key 等信息正确)" -#: settings/api.py:179 settings/api.py:215 +#: settings/api.py:191 settings/api.py:227 msgid "Create succeed" msgstr "创建成功" -#: settings/api.py:197 settings/api.py:235 +#: settings/api.py:209 settings/api.py:247 #: settings/templates/settings/terminal_setting.html:154 msgid "Delete succeed" msgstr "删除成功" @@ -4536,7 +4536,7 @@ msgid "" "You should use your ssh client tools connect terminal: {}

{}" msgstr "你可以使用ssh客户端工具连接终端" -#: users/api/user.py:176 +#: users/api/user.py:173 msgid "Could not reset self otp, use profile reset instead" msgstr "不能再该页面重置MFA, 请去个人信息页面重置" @@ -4874,7 +4874,7 @@ msgid "Always young, always with tears in my eyes. Stay foolish Stay hungry" msgstr "永远年轻,永远热泪盈眶 stay foolish stay hungry" #: users/templates/users/reset_password.html:46 -#: users/templates/users/user_detail.html:379 users/utils.py:84 +#: users/templates/users/user_detail.html:379 users/utils.py:83 msgid "Reset password" msgstr "重置密码" @@ -5190,61 +5190,57 @@ msgid "" "corresponding private key." msgstr "新的公钥已设置成功,请下载对应的私钥" +# msgid "Update user" +# msgstr "更新用户" #: users/utils.py:24 #, python-format msgid "" "\n" -" \n" -"

\n" -" \n" -" Username: %(username)s.\n" -" \n" -" \n" -" click here to set your password\n" -" \n" -" \n" -" This link is valid for 1 hour. After it expires, request new one\n" -" \n" -" \n" +"

\n" +"

Your account has been created successfully

\n" +"
\n" +" Username: %(username)s\n" +"
\n" +" Password: \n" +" click here to set your password \n" +" (This link is valid for 1 hour. After it expires, request new one)\n" +"
\n" +"
\n" +"

---

\n" " Login direct\n" -" \n" -"

\n" +"
\n" +"
\n" " " msgstr "" "\n" -" \n" -"

\n" -" \n" -" 用户名: %(username)s.\n" -" \n" -" \n" -" " -"请点击这里设置密码\n" -" \n" -" \n" -" 这个链接有效期1小时, 超过时间您可以 重新申请\n" -" \n" -" \n" -" ---登录页面\n" -" \n" -"

\n" -" " +"
\n" +"

您的账户已创建成功

\n" +"
\n" +" 用户名: %(username)s\n" +"
\n" +" 密码: 请点击这里设置密码 (这个链接有效期1小时, 超过时" +"间您可以 重新申请)\n" +"
\n" +"
\n" +"

---

\n" +" 直接登录\n" +"
\n" +"
\n" +" " -#: users/utils.py:59 +#: users/utils.py:58 msgid "Create account successfully" msgstr "创建账户成功" -#: users/utils.py:63 +#: users/utils.py:62 #, python-format msgid "Hello %(name)s" msgstr "您好 %(name)s" -#: users/utils.py:86 +#: users/utils.py:85 #, python-format msgid "" "\n" @@ -5288,11 +5284,11 @@ msgstr "" "
\n" " " -#: users/utils.py:117 +#: users/utils.py:116 msgid "Security notice" msgstr "安全通知" -#: users/utils.py:119 +#: users/utils.py:118 #, python-format msgid "" "\n" @@ -5341,11 +5337,11 @@ msgstr "" "
\n" " " -#: users/utils.py:155 +#: users/utils.py:154 msgid "Expiration notice" msgstr "过期通知" -#: users/utils.py:157 +#: users/utils.py:156 #, python-format msgid "" "\n" @@ -5367,11 +5363,11 @@ msgstr "" "
\n" " " -#: users/utils.py:176 +#: users/utils.py:175 msgid "SSH Key Reset" msgstr "重置ssh密钥" -#: users/utils.py:178 +#: users/utils.py:177 #, python-format msgid "" "\n" @@ -5485,7 +5481,7 @@ msgstr "MFA 解绑成功,返回登录页面" msgid "Password length" msgstr "密码长度" -#: xpack/plugins/change_auth_plan/forms.py:66 +#: xpack/plugins/change_auth_plan/forms.py:75 #: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_create_update.html:60 #: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_detail.html:81 #: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_list.html:17 @@ -5499,7 +5495,7 @@ msgstr "密码长度" msgid "Periodic perform" msgstr "定时执行" -#: xpack/plugins/change_auth_plan/forms.py:70 +#: xpack/plugins/change_auth_plan/forms.py:79 msgid "" "Tips: The username of the user on the asset to be modified. if the user " "exists, change the password; If the user does not exist, create the user." @@ -5507,12 +5503,12 @@ msgstr "" "提示:用户名为将要修改的资产上的用户的用户名。如果用户存在,则修改密码;如果" "用户不存在,则创建用户。" -#: xpack/plugins/change_auth_plan/forms.py:74 xpack/plugins/cloud/forms.py:90 +#: xpack/plugins/change_auth_plan/forms.py:83 xpack/plugins/cloud/forms.py:90 #: xpack/plugins/gathered_user/forms.py:44 msgid "Tips: (Units: hour)" msgstr "提示:(单位: 时)" -#: xpack/plugins/change_auth_plan/forms.py:75 xpack/plugins/cloud/forms.py:91 +#: xpack/plugins/change_auth_plan/forms.py:84 xpack/plugins/cloud/forms.py:91 #: xpack/plugins/gathered_user/forms.py:45 msgid "" "eg: Every Sunday 03:05 run <5 3 * * 0>
Tips: Using 5 digits linux " @@ -6307,45 +6303,6 @@ msgstr "创建" #~ msgid "Update user groups" #~ msgstr "更新用户组" -# msgid "Update user" -# msgstr "更新用户" -#~ msgid "" -#~ "\n" -#~ " \n" -#~ "

\n" -#~ " \n" -#~ " click here to set your password\n" -#~ " \n" -#~ " \n" -#~ " This link is valid for 1 hour. After it expires, request new one\n" -#~ " \n" -#~ " \n" -#~ " Login direct\n" -#~ " \n" -#~ "

\n" -#~ " " -#~ msgstr "" -#~ "\n" -#~ " \n" -#~ "

\n" -#~ " \n" -#~ " 请点击这里设置密码\n" -#~ " \n" -#~ " \n" -#~ " 这个链接有效期1小时, 超过时间您可以, 重新申请\n" -#~ " \n" -#~ " \n" -#~ " Login direct\n" -#~ " \n" -#~ "

\n" -#~ " " - #~ msgid "Template" #~ msgstr "模板" diff --git a/apps/ops/templates/ops/celery_task_log.html b/apps/ops/templates/ops/celery_task_log.html index 8e99c356d..c7f177c6e 100644 --- a/apps/ops/templates/ops/celery_task_log.html +++ b/apps/ops/templates/ops/celery_task_log.html @@ -4,6 +4,7 @@ {% trans 'Task log' %} +