Commit 3260ceaa authored by ibuler's avatar ibuler

[Update] Merge with dev

parents e9705889 b5aa69db
......@@ -5,3 +5,5 @@ data/*
tmp/*
django.db
celerybeat.pid
### Vagrant ###
.vagrant/
\ No newline at end of file
......@@ -34,3 +34,5 @@ data/static
docs/_build/
xpack
logs/*
### Vagrant ###
.vagrant/
\ No newline at end of file
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
# https://docs.vagrantup.com.
# Every Vagrant development environment requires a box. You can search for
# boxes at https://vagrantcloud.com/search.
config.vm.box_check_update = false
config.vm.box = "centos/7"
config.vm.hostname = "jumpserver"
config.vm.network "private_network", ip: "172.17.8.101"
config.vm.provider "virtualbox" do |vb|
vb.memory = "4096"
vb.cpus = 2
vb.name = "jumpserver"
end
config.vm.synced_folder ".", "/vagrant", type: "rsync",
rsync__verbose: true,
rsync__exclude: ['.git*', 'node_modules*','*.log','*.box','Vagrantfile']
config.vm.provision "shell", inline: <<-SHELL
## 设置yum的阿里云源
sudo curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
sudo sed -i -e '/mirrors.cloud.aliyuncs.com/d' -e '/mirrors.aliyuncs.com/d' /etc/yum.repos.d/CentOS-Base.repo
sudo curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
sudo yum makecache
## 安装依赖包
sudo yum install -y python36 python36-devel python36-pip \
libtiff-devel libjpeg-devel libzip-devel freetype-devel \
lcms2-devel libwebp-devel tcl-devel tk-devel sshpass \
openldap-devel mariadb-devel mysql-devel libffi-devel \
openssh-clients telnet openldap-clients gcc
## 配置pip阿里云源
mkdir /home/vagrant/.pip
cat << EOF | sudo tee -a /home/vagrant/.pip/pip.conf
[global]
timeout = 6000
index-url = https://mirrors.aliyun.com/pypi/simple/
[install]
use-mirrors = true
mirrors = https://mirrors.aliyun.com/pypi/simple/
trusted-host=mirrors.aliyun.com
EOF
python3.6 -m venv /home/vagrant/venv
source /home/vagrant/venv/bin/activate
echo 'source /home/vagrant/venv/bin/activate' >> /home/vagrant/.bash_profile
SHELL
end
......@@ -82,7 +82,7 @@ class AssetUserViewSet(IDInCacheFilterMixin, BulkModelViewSet):
manager = AssetUserManager()
if system_user_id:
system_user = get_object_or_404(SystemUser, id=system_user_id)
assets = system_user.assets.all()
assets = system_user.get_all_assets()
username = system_user.username
elif admin_user_id:
admin_user = get_object_or_404(AdminUser, id=admin_user_id)
......
......@@ -12,7 +12,6 @@ from django.core.cache import cache
from django.db import models
from django.utils.translation import ugettext_lazy as _
from .user import AdminUser, SystemUser
from .utils import Connectivity
from orgs.mixins import OrgModelMixin, OrgManager
......@@ -320,6 +319,7 @@ class Asset(ProtocolsMixin, NodesRelationMixin, OrgModelMixin):
@classmethod
def generate_fake(cls, count=100):
from .user import AdminUser, SystemUser
from random import seed, choice
from django.db import IntegrityError
from .node import Node
......
......@@ -4,12 +4,15 @@
import logging
from functools import reduce
from django.db import models
from django.db.models import Q
from django.utils.translation import ugettext_lazy as _
from django.core.validators import MinValueValidator, MaxValueValidator
from common.utils import get_signer
from .base import AssetUser
from .asset import Asset
__all__ = ['AdminUser', 'SystemUser']
......@@ -144,6 +147,19 @@ class SystemUser(AssetUser):
return False, matched_cmd
return True, None
def get_all_assets(self):
args = [Q(systemuser=self)]
pattern = set()
nodes_keys = self.nodes.all().values_list('key', flat=True)
for key in nodes_keys:
pattern.add(r'^{0}$|^{0}:'.format(key))
pattern = '|'.join(list(pattern))
if pattern:
args.append(Q(nodes__key__regex=pattern))
args = reduce(lambda x, y: x | y, args)
assets = Asset.objects.filter(args).distinct()
return assets
class Meta:
ordering = ['name']
unique_together = [('name', 'org_id')]
......
......@@ -57,16 +57,16 @@ def on_system_user_update(sender, instance=None, created=True, **kwargs):
push_system_user_to_assets.delay(instance, assets)
@receiver(m2m_changed, sender=SystemUser.nodes.through)
def on_system_user_nodes_change(sender, instance=None, **kwargs):
if instance and kwargs["action"] == "post_add":
logger.info("System user `{}` nodes update signal received".format(instance))
assets = set()
nodes = kwargs['model'].objects.filter(pk__in=kwargs['pk_set'])
for node in nodes:
assets.update(set(node.get_all_assets()))
instance.assets.add(*tuple(assets))
# @receiver(m2m_changed, sender=SystemUser.nodes.through)
# def on_system_user_nodes_change(sender, instance=None, **kwargs):
# if instance and kwargs["action"] == "post_add":
# logger.info("System user `{}` nodes update signal received".format(instance))
# assets = set()
# nodes = kwargs['model'].objects.filter(pk__in=kwargs['pk_set'])
# for node in nodes:
# assets.update(set(node.get_all_assets()))
# instance.assets.add(*tuple(assets))
#
@receiver(m2m_changed, sender=SystemUser.assets.through)
def on_system_user_assets_change(sender, instance=None, **kwargs):
......
......@@ -347,7 +347,7 @@ def test_system_user_connectivity_util(system_user, assets, task_name):
@shared_task
def test_system_user_connectivity_manual(system_user):
task_name = _("Test system user connectivity: {}").format(system_user)
assets = system_user.get_related_assets()
assets = system_user.get_all_assets()
return test_system_user_connectivity_util(system_user, assets, task_name)
......@@ -367,7 +367,7 @@ def test_system_user_connectivity_period():
system_users = SystemUser.objects.all()
for system_user in system_users:
task_name = _("Test system user connectivity period: {}").format(system_user)
assets = system_user.get_related_assets()
assets = system_user.get_all_assets()
test_system_user_connectivity_util(system_user, assets, task_name)
......@@ -513,7 +513,7 @@ def push_system_user_util(system_user, assets, task_name):
@shared_task
def push_system_user_to_assets_manual(system_user):
assets = system_user.get_related_assets()
assets = system_user.get_all_assets()
task_name = _("Push system users to assets: {}").format(system_user.name)
return push_system_user_util(system_user, assets, task_name=task_name)
......
......@@ -68,10 +68,12 @@ var treeUrl = '{% url 'api-assets:node-children-tree' %}?assets=0';
// "otherMenu": "",
// "showAssets": false,
// }
var inited = false;
function initNodeTree(options) {
if (options.showAssets) {
treeUrl = setUrlParam(treeUrl, 'assets', '1')
}
var asyncTreeUrl = setUrlParam(treeUrl, 'refresh', '0');
var setting = {
view: {
dblClickExpand: false,
......@@ -84,7 +86,7 @@ function initNodeTree(options) {
},
async: {
enable: true,
url: treeUrl,
url: asyncTreeUrl,
autoParam: ["id=key", "name=n", "level=lv"],
type: 'get'
},
......@@ -109,16 +111,20 @@ function initNodeTree(options) {
beforeAsync: options.beforeAsync || defaultCallback("Before async")
}
};
$.get(treeUrl, function(data, status){
zNodes = data;
zTree = $.fn.zTree.init($("#nodeTree"), setting, zNodes);
$.get(treeUrl, function (data, status) {
zTree = $.fn.zTree.init($("#nodeTree"), setting, data);
rootNodeAddDom(zTree, function () {
treeUrl = setUrlParam(treeUrl, 'refresh', '1');
initTree();
treeUrl = setUrlParam(treeUrl, 'refresh', '0')
initNodeTree(options);
treeUrl = setUrlParam(treeUrl, 'refresh', '0');
});
inited = true;
});
if (inited) {
return
}
if (options.showMenu) {
showMenu = true;
rMenu = $("#rMenu");
......
......@@ -8,6 +8,7 @@ from django_auth_ldap.backend import _LDAPUser, LDAPBackend
from django_auth_ldap.config import _LDAPConfig, LDAPSearch, LDAPSearchUnion
from users.utils import construct_user_email
from common.const import LDAP_AD_ACCOUNT_DISABLE
logger = _LDAPConfig.get_logger()
......@@ -17,6 +18,15 @@ class LDAPAuthorizationBackend(LDAPBackend):
Override this class to override _LDAPUser to LDAPUser
"""
@staticmethod
def user_can_authenticate(user):
"""
Reject users with is_active=False. Custom user models that don't have
that attribute are allowed.
"""
is_valid = getattr(user, 'is_valid', None)
return is_valid or is_valid is None
def authenticate(self, request=None, username=None, password=None, **kwargs):
logger.info('Authentication LDAP backend')
if not username:
......@@ -25,34 +35,29 @@ class LDAPAuthorizationBackend(LDAPBackend):
ldap_user = LDAPUser(self, username=username.strip(), request=request)
user = self.authenticate_ldap_user(ldap_user, password)
logger.info('Authenticate user: {}'.format(user))
return user
return user if self.user_can_authenticate(user) else None
def get_user(self, user_id):
user = None
try:
user = self.get_user_model().objects.get(pk=user_id)
LDAPUser(self, user=user) # This sets user.ldap_user
except ObjectDoesNotExist:
pass
return user
def get_group_permissions(self, user, obj=None):
if not hasattr(user, 'ldap_user') and self.settings.AUTHORIZE_ALL_USERS:
LDAPUser(self, user=user) # This sets user.ldap_user
if hasattr(user, 'ldap_user'):
permissions = user.ldap_user.get_group_permissions()
else:
permissions = set()
return permissions
def populate_user(self, username):
ldap_user = LDAPUser(self, username=username)
user = ldap_user.populate_user()
return user
......@@ -91,13 +96,19 @@ class LDAPUser(_LDAPUser):
for field, attr in self.settings.USER_ATTR_MAP.items():
try:
value = self.attrs[attr][0]
if attr.lower() == 'useraccountcontrol' \
and field == 'is_active' and value:
value = int(value) & LDAP_AD_ACCOUNT_DISABLE \
!= LDAP_AD_ACCOUNT_DISABLE
except LookupError:
logger.warning("{} does not have a value for the attribute {}".format(self.dn, attr))
else:
if not hasattr(self._user, field):
continue
if isinstance(getattr(self._user, field), bool):
value = value.lower() in ['true', '1']
if isinstance(value, str):
value = value.lower()
value = value in ['true', '1', True]
setattr(self._user, field, value)
email = getattr(self._user, 'email', '')
......
......@@ -26,8 +26,8 @@ class BaseOpenIDAuthorizationBackend(object):
Reject users with is_active=False. Custom user models that don't have
that attribute are allowed.
"""
is_active = getattr(user, 'is_active', None)
return is_active or is_active is None
is_valid = getattr(user, 'is_valid', None)
return is_valid or is_valid is None
def get_user(self, user_id):
try:
......
from rest_framework.request import Request
from django.http.request import QueryDict
from django.conf import settings
from django.dispatch import receiver
......@@ -52,14 +53,15 @@ def on_ldap_create_user(sender, user, ldap_user, **kwargs):
def generate_data(username, request):
if not request.user.is_anonymous and request.user.is_app:
user_agent = request.META.get('HTTP_USER_AGENT', '')
if isinstance(request, Request):
login_ip = request.data.get('remote_addr', None)
login_type = request.data.get('login_type', '')
user_agent = request.data.get('HTTP_USER_AGENT', '')
else:
login_ip = get_request_ip(request)
user_agent = request.META.get('HTTP_USER_AGENT', '')
login_type = 'W'
data = {
'username': username,
'ip': login_ip,
......
......@@ -8,3 +8,7 @@ update_success_msg = _("%(name)s was updated successfully")
FILE_END_GUARD = ">>> Content End <<<"
celery_task_pre_key = "CELERY_"
KEY_CACHE_RESOURCES_ID = "RESOURCES_ID_{}"
# AD User AccountDisable
# https://blog.csdn.net/bytxl/article/details/17763975
LDAP_AD_ACCOUNT_DISABLE = 2
......@@ -137,6 +137,16 @@ class PermissionsMixin(UserPassesTestMixin):
return True
class UserCanUpdatePassword:
def has_permission(self, request, view):
return request.user.can_update_password()
class UserCanUpdateSSHKey:
def has_permission(self, request, view):
return request.user.can_update_ssh_key()
class NeedMFAVerify(permissions.BasePermission):
def has_permission(self, request, view):
mfa_verify_time = request.session.get('MFA_VERIFY_TIME', 0)
......
......@@ -58,8 +58,8 @@ class JMSCSVRender(BaseRenderer):
template = request.query_params.get('template', 'export')
view = renderer_context['view']
if isinstance(data, dict) and data.get("count"):
data = data["results"]
if isinstance(data, dict):
data = data.get("results", [])
if template == 'import':
data = [data[0]] if data else data
......
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Jumpserver 0.3.3\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-07-29 16:27+0800\n"
"POT-Creation-Date: 2019-07-29 18:24+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: ibuler <ibuler@qq.com>\n"
"Language-Team: Jumpserver team<ibuler@qq.com>\n"
......@@ -76,7 +76,7 @@ msgstr "运行参数"
#: applications/templates/applications/remote_app_list.html:22
#: applications/templates/applications/user_remote_app_list.html:18
#: assets/forms/domain.py:15 assets/forms/label.py:13
#: assets/models/asset.py:319 assets/models/authbook.py:24
#: assets/models/asset.py:318 assets/models/authbook.py:24
#: assets/serializers/admin_user.py:32 assets/serializers/asset_user.py:81
#: assets/serializers/system_user.py:30
#: assets/templates/assets/admin_user_list.html:46
......@@ -88,8 +88,8 @@ msgstr "运行参数"
#: audits/templates/audits/ftp_log_list.html:71
#: perms/forms/asset_permission.py:69 perms/models/asset_permission.py:78
#: perms/templates/perms/asset_permission_create_update.html:45
#: perms/templates/perms/asset_permission_list.html:48
#: perms/templates/perms/asset_permission_list.html:117
#: perms/templates/perms/asset_permission_list.html:52
#: perms/templates/perms/asset_permission_list.html:121
#: terminal/backends/command/models.py:13 terminal/models.py:155
#: terminal/templates/terminal/command_list.html:30
#: terminal/templates/terminal/command_list.html:66
......@@ -101,7 +101,7 @@ msgstr "运行参数"
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_execution_list.html:54
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_execution_subtask_list.html:13
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_list.html:14
#: xpack/plugins/cloud/models.py:187
#: xpack/plugins/cloud/models.py:310
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_instance.html:63
#: xpack/plugins/orgs/templates/orgs/org_list.html:16
#: xpack/plugins/vault/forms.py:13 xpack/plugins/vault/forms.py:15
......@@ -112,15 +112,15 @@ msgstr "资产"
#: applications/templates/applications/remote_app_detail.html:61
#: applications/templates/applications/remote_app_list.html:23
#: applications/templates/applications/user_remote_app_list.html:19
#: assets/models/user.py:150 assets/templates/assets/user_asset_list.html:52
#: assets/models/user.py:166 assets/templates/assets/user_asset_list.html:52
#: audits/models.py:20 audits/templates/audits/ftp_log_list.html:49
#: audits/templates/audits/ftp_log_list.html:72
#: perms/forms/asset_permission.py:75 perms/models/asset_permission.py:80
#: perms/models/asset_permission.py:114
#: perms/templates/perms/asset_permission_detail.html:140
#: perms/templates/perms/asset_permission_list.html:50
#: perms/templates/perms/asset_permission_list.html:71
#: perms/templates/perms/asset_permission_list.html:123 templates/_nav.html:25
#: perms/templates/perms/asset_permission_list.html:54
#: perms/templates/perms/asset_permission_list.html:75
#: perms/templates/perms/asset_permission_list.html:127 templates/_nav.html:25
#: terminal/backends/command/models.py:14 terminal/models.py:156
#: terminal/templates/terminal/command_list.html:31
#: terminal/templates/terminal/command_list.html:67
......@@ -152,8 +152,8 @@ msgstr "系统用户"
#: ops/templates/ops/task_detail.html:60 ops/templates/ops/task_list.html:27
#: orgs/models.py:11 perms/models/base.py:35
#: perms/templates/perms/asset_permission_detail.html:62
#: perms/templates/perms/asset_permission_list.html:45
#: perms/templates/perms/asset_permission_list.html:64
#: perms/templates/perms/asset_permission_list.html:49
#: perms/templates/perms/asset_permission_list.html:68
#: perms/templates/perms/asset_permission_user.html:54
#: perms/templates/perms/remote_app_permission_detail.html:62
#: perms/templates/perms/remote_app_permission_list.html:14
......@@ -167,21 +167,21 @@ msgstr "系统用户"
#: settings/templates/settings/terminal_setting.html:105 terminal/models.py:22
#: terminal/models.py:258 terminal/templates/terminal/terminal_detail.html:43
#: terminal/templates/terminal/terminal_list.html:29 users/models/group.py:14
#: users/models/user.py:325 users/templates/users/_select_user_modal.html:13
#: users/models/user.py:330 users/templates/users/_select_user_modal.html:13
#: users/templates/users/user_detail.html:63
#: users/templates/users/user_group_detail.html:55
#: users/templates/users/user_group_list.html:35
#: users/templates/users/user_list.html:35
#: users/templates/users/user_profile.html:51
#: users/templates/users/user_pubkey_update.html:53
#: users/templates/users/user_pubkey_update.html:57
#: xpack/plugins/change_auth_plan/forms.py:98
#: xpack/plugins/change_auth_plan/models.py:61
#: 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
#: xpack/plugins/cloud/models.py:49 xpack/plugins/cloud/models.py:119
#: xpack/plugins/cloud/models.py:59 xpack/plugins/cloud/models.py:144
#: xpack/plugins/cloud/templates/cloud/account_detail.html:50
#: xpack/plugins/cloud/templates/cloud/account_list.html:12
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_detail.html:53
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_detail.html:56
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_list.html:12
#: xpack/plugins/orgs/templates/orgs/org_detail.html:52
#: xpack/plugins/orgs/templates/orgs/org_list.html:12
......@@ -206,7 +206,7 @@ msgstr "参数"
#: applications/models/remote_app.py:43
#: applications/templates/applications/remote_app_detail.html:77
#: assets/models/asset.py:198 assets/models/base.py:36
#: assets/models/asset.py:197 assets/models/base.py:36
#: assets/models/cluster.py:28 assets/models/cmd_filter.py:25
#: assets/models/cmd_filter.py:58 assets/models/group.py:21
#: assets/templates/assets/admin_user_detail.html:68
......@@ -218,11 +218,11 @@ msgstr "参数"
#: perms/models/asset_permission.py:117 perms/models/base.py:41
#: perms/templates/perms/asset_permission_detail.html:98
#: perms/templates/perms/remote_app_permission_detail.html:90
#: users/models/user.py:366 users/serializers/v1.py:119
#: users/models/user.py:371 users/serializers/v1.py:120
#: users/templates/users/user_detail.html:111
#: xpack/plugins/change_auth_plan/models.py:106
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_detail.html:113
#: xpack/plugins/cloud/models.py:55 xpack/plugins/cloud/models.py:127
#: xpack/plugins/cloud/models.py:80 xpack/plugins/cloud/models.py:179
msgid "Created by"
msgstr "创建者"
......@@ -230,7 +230,7 @@ msgstr "创建者"
# msgstr "创建者"
#: applications/models/remote_app.py:46
#: applications/templates/applications/remote_app_detail.html:73
#: assets/models/asset.py:199 assets/models/base.py:34
#: assets/models/asset.py:198 assets/models/base.py:34
#: assets/models/cluster.py:26 assets/models/domain.py:23
#: assets/models/group.py:22 assets/models/label.py:25
#: assets/templates/assets/admin_user_detail.html:64
......@@ -245,9 +245,9 @@ msgstr "创建者"
#: terminal/templates/terminal/terminal_detail.html:59 users/models/group.py:17
#: users/templates/users/user_group_detail.html:63
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_detail.html:105
#: xpack/plugins/cloud/models.py:56 xpack/plugins/cloud/models.py:128
#: xpack/plugins/cloud/models.py:83 xpack/plugins/cloud/models.py:182
#: xpack/plugins/cloud/templates/cloud/account_detail.html:66
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_detail.html:77
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_detail.html:101
#: xpack/plugins/orgs/templates/orgs/org_detail.html:60
msgid "Date created"
msgstr "创建日期"
......@@ -258,7 +258,7 @@ msgstr "创建日期"
#: applications/templates/applications/remote_app_detail.html:81
#: applications/templates/applications/remote_app_list.html:24
#: applications/templates/applications/user_remote_app_list.html:20
#: assets/models/asset.py:200 assets/models/base.py:33
#: assets/models/asset.py:199 assets/models/base.py:33
#: assets/models/cluster.py:29 assets/models/cmd_filter.py:22
#: assets/models/cmd_filter.py:55 assets/models/domain.py:21
#: assets/models/domain.py:53 assets/models/group.py:23
......@@ -279,18 +279,18 @@ msgstr "创建日期"
#: perms/templates/perms/remote_app_permission_detail.html:94
#: settings/models.py:34 terminal/models.py:32
#: terminal/templates/terminal/terminal_detail.html:63 users/models/group.py:15
#: users/models/user.py:358 users/templates/users/user_detail.html:127
#: users/models/user.py:363 users/templates/users/user_detail.html:129
#: users/templates/users/user_group_detail.html:67
#: users/templates/users/user_group_list.html:37
#: users/templates/users/user_profile.html:134
#: users/templates/users/user_profile.html:138
#: xpack/plugins/change_auth_plan/models.py:102
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_detail.html:117
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_list.html:19
#: xpack/plugins/cloud/models.py:54 xpack/plugins/cloud/models.py:125
#: xpack/plugins/cloud/models.py:77 xpack/plugins/cloud/models.py:173
#: xpack/plugins/cloud/templates/cloud/account_detail.html:70
#: xpack/plugins/cloud/templates/cloud/account_list.html:15
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_detail.html:69
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_list.html:16
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_detail.html:105
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_list.html:18
#: xpack/plugins/orgs/templates/orgs/org_detail.html:64
#: xpack/plugins/orgs/templates/orgs/org_list.html:22
msgid "Comment"
......@@ -330,15 +330,15 @@ msgstr "远程应用"
#: terminal/templates/terminal/terminal_update.html:45
#: users/templates/users/_user.html:50
#: users/templates/users/user_bulk_update.html:23
#: users/templates/users/user_detail.html:176
#: users/templates/users/user_password_update.html:71
#: users/templates/users/user_profile.html:204
#: users/templates/users/user_profile_update.html:63
#: users/templates/users/user_pubkey_update.html:70
#: users/templates/users/user_pubkey_update.html:76
#: users/templates/users/user_detail.html:178
#: users/templates/users/user_password_update.html:75
#: users/templates/users/user_profile.html:209
#: users/templates/users/user_profile_update.html:67
#: users/templates/users/user_pubkey_update.html:74
#: users/templates/users/user_pubkey_update.html:80
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_create_update.html:71
#: xpack/plugins/cloud/templates/cloud/account_create_update.html:33
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_create.html:35
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_create_update.html:53
#: xpack/plugins/interface/templates/interface/interface.html:72
#: xpack/plugins/vault/templates/vault/vault_create.html:45
msgid "Reset"
......@@ -373,9 +373,9 @@ msgstr "重置"
#: users/templates/users/forgot_password.html:42
#: users/templates/users/user_bulk_update.html:24
#: users/templates/users/user_list.html:57
#: users/templates/users/user_password_update.html:72
#: users/templates/users/user_profile_update.html:64
#: users/templates/users/user_pubkey_update.html:77
#: users/templates/users/user_password_update.html:76
#: users/templates/users/user_profile_update.html:68
#: users/templates/users/user_pubkey_update.html:81
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_create_update.html:72
#: xpack/plugins/interface/templates/interface/interface.html:74
#: xpack/plugins/vault/templates/vault/vault_create.html:46
......@@ -429,7 +429,7 @@ msgstr "详情"
#: assets/templates/assets/system_user_list.html:33
#: assets/templates/assets/system_user_list.html:85 audits/models.py:33
#: perms/templates/perms/asset_permission_detail.html:30
#: perms/templates/perms/asset_permission_list.html:173
#: perms/templates/perms/asset_permission_list.html:177
#: perms/templates/perms/remote_app_permission_detail.html:30
#: perms/templates/perms/remote_app_permission_list.html:59
#: terminal/templates/terminal/terminal_detail.html:16
......@@ -441,13 +441,15 @@ msgstr "详情"
#: users/templates/users/user_list.html:20
#: users/templates/users/user_list.html:102
#: users/templates/users/user_list.html:105
#: users/templates/users/user_profile.html:177
#: users/templates/users/user_profile.html:187
#: users/templates/users/user_profile.html:196
#: users/templates/users/user_profile.html:181
#: users/templates/users/user_profile.html:191
#: users/templates/users/user_profile.html:201
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_detail.html:29
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_list.html:55
#: xpack/plugins/cloud/templates/cloud/account_detail.html:23
#: xpack/plugins/cloud/templates/cloud/account_list.html:39
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_detail.html:29
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_list.html:56
#: xpack/plugins/orgs/templates/orgs/org_detail.html:25
#: xpack/plugins/orgs/templates/orgs/org_list.html:87
msgid "Update"
......@@ -469,10 +471,9 @@ msgstr "更新"
#: 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
#: authentication/templates/authentication/_access_key_modal.html:62
#: ops/templates/ops/task_list.html:64
#: perms/templates/perms/asset_permission_detail.html:34
#: perms/templates/perms/asset_permission_list.html:174
#: perms/templates/perms/asset_permission_list.html:178
#: perms/templates/perms/remote_app_permission_detail.html:34
#: perms/templates/perms/remote_app_permission_list.html:60
#: settings/templates/settings/terminal_setting.html:93
......@@ -487,8 +488,8 @@ msgstr "更新"
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_list.html:57
#: xpack/plugins/cloud/templates/cloud/account_detail.html:27
#: xpack/plugins/cloud/templates/cloud/account_list.html:41
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_detail.html:30
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_list.html:55
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_detail.html:33
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_list.html:57
#: xpack/plugins/orgs/templates/orgs/org_detail.html:29
#: xpack/plugins/orgs/templates/orgs/org_list.html:89
msgid "Delete"
......@@ -526,13 +527,12 @@ msgstr "创建远程应用"
#: assets/templates/assets/system_user_list.html:60 audits/models.py:38
#: audits/templates/audits/operate_log_list.html:41
#: audits/templates/audits/operate_log_list.html:67
#: authentication/templates/authentication/_access_key_modal.html:27
#: ops/templates/ops/adhoc_history.html:59 ops/templates/ops/task_adhoc.html:64
#: ops/templates/ops/task_history.html:65 ops/templates/ops/task_list.html:34
#: perms/forms/asset_permission.py:21
#: perms/templates/perms/asset_permission_create_update.html:50
#: perms/templates/perms/asset_permission_list.html:52
#: perms/templates/perms/asset_permission_list.html:126
#: perms/templates/perms/asset_permission_list.html:56
#: perms/templates/perms/asset_permission_list.html:130
#: perms/templates/perms/remote_app_permission_list.html:19
#: settings/templates/settings/terminal_setting.html:85
#: settings/templates/settings/terminal_setting.html:107
......@@ -545,7 +545,8 @@ msgstr "创建远程应用"
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_execution_subtask_list.html:18
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_list.html:20
#: xpack/plugins/cloud/templates/cloud/account_list.html:16
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_list.html:18
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_history.html:72
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_list.html:19
#: xpack/plugins/orgs/templates/orgs/org_list.html:23
msgid "Action"
msgstr "动作"
......@@ -578,11 +579,15 @@ msgstr "远程应用详情"
msgid "My RemoteApp"
msgstr "我的远程应用"
#: assets/api/asset.py:42
#: assets/api/asset.py:51
#, python-format
msgid "%(hostname)s was %(action)s successfully"
msgstr "%(hostname)s %(action)s成功"
#: assets/api/asset.py:125
msgid "Please select assets that need to be updated"
msgstr "请选择需要更新的资产"
#: assets/api/node.py:61
msgid "You can't update the root node name"
msgstr "不能修改根节点名称"
......@@ -604,20 +609,20 @@ msgstr "不可达"
msgid "Reachable"
msgstr "可连接"
#: assets/const.py:79 assets/models/utils.py:45 authentication/utils.py:13
#: assets/const.py:79 assets/models/utils.py:45 authentication/utils.py:9
#: xpack/plugins/license/models.py:78
msgid "Unknown"
msgstr "未知"
#: assets/forms/asset.py:24 assets/models/asset.py:164
#: assets/forms/asset.py:24 assets/models/asset.py:163
#: assets/models/domain.py:50
#: assets/templates/assets/domain_gateway_list.html:69
#: settings/templates/settings/replay_storage_create.html:59
msgid "Port"
msgstr "端口"
#: assets/forms/asset.py:45 assets/models/asset.py:169
#: assets/models/user.py:107 assets/templates/assets/asset_detail.html:190
#: assets/forms/asset.py:45 assets/models/asset.py:168
#: assets/models/user.py:110 assets/templates/assets/asset_detail.html:190
#: assets/templates/assets/asset_detail.html:198
#: assets/templates/assets/system_user_assets.html:83
#: perms/models/asset_permission.py:79
......@@ -625,11 +630,11 @@ msgstr "端口"
msgid "Nodes"
msgstr "节点"
#: assets/forms/asset.py:48 assets/forms/asset.py:83 assets/models/asset.py:173
#: assets/models/cluster.py:19 assets/models/user.py:65
#: assets/forms/asset.py:48 assets/forms/asset.py:83 assets/models/asset.py:172
#: assets/models/cluster.py:19 assets/models/user.py:68
#: assets/templates/assets/asset_detail.html:76 templates/_nav.html:24
#: xpack/plugins/cloud/models.py:124
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_detail.html:65
#: xpack/plugins/cloud/models.py:161
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_detail.html:68
#: xpack/plugins/orgs/templates/orgs/org_list.html:18
msgid "Admin user"
msgstr "管理用户"
......@@ -642,7 +647,7 @@ msgstr "管理用户"
msgid "Label"
msgstr "标签"
#: assets/forms/asset.py:54 assets/forms/asset.py:89 assets/models/asset.py:168
#: assets/forms/asset.py:54 assets/forms/asset.py:89 assets/models/asset.py:167
#: assets/models/domain.py:26 assets/models/domain.py:52
#: assets/templates/assets/asset_detail.html:80
#: assets/templates/assets/user_asset_list.html:53
......@@ -655,14 +660,14 @@ msgstr "网域"
#: assets/templates/assets/asset_create.html:42
#: perms/forms/asset_permission.py:72 perms/forms/asset_permission.py:79
#: perms/models/asset_permission.py:112
#: perms/templates/perms/asset_permission_list.html:49
#: perms/templates/perms/asset_permission_list.html:70
#: perms/templates/perms/asset_permission_list.html:120
#: 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:116
#: 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:123
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_detail.html:61
#: xpack/plugins/cloud/models.py:157
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_detail.html:64
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_instance.html:64
msgid "Node"
msgstr "节点"
......@@ -713,15 +718,15 @@ 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:52 audits/models.py:94
#: audits/templates/audits/login_log_list.html:51 authentication/forms.py:11
#: authentication/templates/authentication/login.html:64
#: authentication/templates/authentication/new_login.html:90
#: ops/models/adhoc.py:164 perms/templates/perms/asset_permission_list.html:66
#: ops/models/adhoc.py:164 perms/templates/perms/asset_permission_list.html:70
#: perms/templates/perms/asset_permission_user.html:55
#: perms/templates/perms/remote_app_permission_user.html:54
#: settings/templates/settings/_ldap_list_users_modal.html:37 users/forms.py:14
#: users/models/user.py:323 users/templates/users/_select_user_modal.html:14
#: users/models/user.py:328 users/templates/users/_select_user_modal.html:14
#: users/templates/users/user_detail.html:67
#: users/templates/users/user_list.html:36
#: users/templates/users/user_profile.html:47
......@@ -749,9 +754,9 @@ msgstr "密码或密钥密码"
#: settings/forms.py:110 users/forms.py:16 users/forms.py:28
#: users/templates/users/reset_password.html:53
#: users/templates/users/user_password_authentication.html:18
#: users/templates/users/user_password_update.html:43
#: users/templates/users/user_profile_update.html:40
#: users/templates/users/user_pubkey_update.html:40
#: users/templates/users/user_password_update.html:44
#: users/templates/users/user_profile_update.html:41
#: users/templates/users/user_pubkey_update.html:41
#: users/templates/users/user_update.html:20
#: xpack/plugins/change_auth_plan/models.py:93
#: xpack/plugins/change_auth_plan/models.py:264
......@@ -760,7 +765,7 @@ msgstr "密码"
#: assets/forms/user.py:29 assets/serializers/asset_user.py:70
#: assets/templates/assets/_asset_user_auth_update_modal.html:27
#: users/models/user.py:352
#: users/models/user.py:357
msgid "Private key"
msgstr "ssh私钥"
......@@ -773,7 +778,7 @@ msgid "Password and private key file must be input one"
msgstr "密码和私钥, 必须输入一个"
#: assets/forms/user.py:97 assets/models/cmd_filter.py:31
#: assets/models/user.py:115 assets/templates/assets/_system_user.html:66
#: assets/models/user.py:118 assets/templates/assets/_system_user.html:66
#: assets/templates/assets/system_user_detail.html:165
msgid "Command filter"
msgstr "命令过滤器"
......@@ -800,7 +805,7 @@ msgstr "如果选择手动登录模式,用户名和密码可以不填写"
msgid "Use comma split multi command, ex: /bin/whoami,/bin/ifconfig"
msgstr "使用逗号分隔多个命令,如: /bin/whoami,/sbin/ifconfig"
#: assets/models/asset.py:159 assets/models/domain.py:49
#: assets/models/asset.py:158 assets/models/domain.py:49
#: assets/serializers/asset_user.py:28
#: assets/templates/assets/_asset_list_modal.html:46
#: assets/templates/assets/_asset_user_list.html:15
......@@ -815,7 +820,7 @@ msgstr "使用逗号分隔多个命令,如: /bin/whoami,/sbin/ifconfig"
msgid "IP"
msgstr "IP"
#: assets/models/asset.py:160 assets/serializers/asset_user.py:27
#: assets/models/asset.py:159 assets/serializers/asset_user.py:27
#: assets/templates/assets/_asset_list_modal.html:45
#: assets/templates/assets/_asset_user_auth_update_modal.html:9
#: assets/templates/assets/_asset_user_auth_view_modal.html:15
......@@ -824,14 +829,14 @@ msgstr "IP"
#: assets/templates/assets/asset_list.html:96
#: assets/templates/assets/user_asset_list.html:48
#: perms/templates/perms/asset_permission_asset.html:57
#: perms/templates/perms/asset_permission_list.html:69 settings/forms.py:139
#: perms/templates/perms/asset_permission_list.html:73 settings/forms.py:139
#: users/templates/users/_granted_assets.html:24
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_asset_list.html:50
msgid "Hostname"
msgstr "主机名"
#: assets/models/asset.py:163 assets/models/domain.py:51
#: assets/models/user.py:110 assets/templates/assets/asset_detail.html:72
#: assets/models/asset.py:162 assets/models/domain.py:51
#: assets/models/user.py:113 assets/templates/assets/asset_detail.html:72
#: assets/templates/assets/domain_gateway_list.html:70
#: assets/templates/assets/system_user_detail.html:70
#: assets/templates/assets/system_user_list.html:53
......@@ -839,90 +844,90 @@ msgstr "主机名"
msgid "Protocol"
msgstr "协议"
#: assets/models/asset.py:166 assets/serializers/asset.py:63
#: assets/models/asset.py:165 assets/serializers/asset.py:63
#: assets/templates/assets/asset_create.html:24
#: assets/templates/assets/user_asset_list.html:50
#: perms/serializers/user_permission.py:38
msgid "Protocols"
msgstr "协议组"
#: assets/models/asset.py:167 assets/templates/assets/asset_detail.html:104
#: assets/models/asset.py:166 assets/templates/assets/asset_detail.html:104
#: assets/templates/assets/user_asset_list.html:51
msgid "Platform"
msgstr "系统平台"
#: assets/models/asset.py:170 assets/models/cmd_filter.py:21
#: assets/models/asset.py:169 assets/models/cmd_filter.py:21
#: assets/models/domain.py:54 assets/models/label.py:22
#: assets/templates/assets/asset_detail.html:112
msgid "Is active"
msgstr "激活"
#: assets/models/asset.py:176 assets/templates/assets/asset_detail.html:68
#: assets/models/asset.py:175 assets/templates/assets/asset_detail.html:68
msgid "Public IP"
msgstr "公网IP"
#: assets/models/asset.py:177 assets/templates/assets/asset_detail.html:120
#: assets/models/asset.py:176 assets/templates/assets/asset_detail.html:120
msgid "Asset number"
msgstr "资产编号"
#: assets/models/asset.py:180 assets/templates/assets/asset_detail.html:84
#: assets/models/asset.py:179 assets/templates/assets/asset_detail.html:84
msgid "Vendor"
msgstr "制造商"
#: assets/models/asset.py:181 assets/templates/assets/asset_detail.html:88
#: assets/models/asset.py:180 assets/templates/assets/asset_detail.html:88
msgid "Model"
msgstr "型号"
#: assets/models/asset.py:182 assets/templates/assets/asset_detail.html:116
#: assets/models/asset.py:181 assets/templates/assets/asset_detail.html:116
msgid "Serial number"
msgstr "序列号"
#: assets/models/asset.py:184
#: assets/models/asset.py:183
msgid "CPU model"
msgstr "CPU型号"
#: assets/models/asset.py:185
#: assets/models/asset.py:184
#: xpack/plugins/license/templates/license/license_detail.html:80
msgid "CPU count"
msgstr "CPU数量"
#: assets/models/asset.py:186
#: assets/models/asset.py:185
msgid "CPU cores"
msgstr "CPU核数"
#: assets/models/asset.py:187
#: assets/models/asset.py:186
msgid "CPU vcpus"
msgstr "CPU总数"
#: assets/models/asset.py:188 assets/templates/assets/asset_detail.html:96
#: assets/models/asset.py:187 assets/templates/assets/asset_detail.html:96
msgid "Memory"
msgstr "内存"
#: assets/models/asset.py:189
#: assets/models/asset.py:188
msgid "Disk total"
msgstr "硬盘大小"
#: assets/models/asset.py:190
#: assets/models/asset.py:189
msgid "Disk info"
msgstr "硬盘信息"
#: assets/models/asset.py:192 assets/templates/assets/asset_detail.html:108
#: assets/models/asset.py:191 assets/templates/assets/asset_detail.html:108
msgid "OS"
msgstr "操作系统"
#: assets/models/asset.py:193
#: assets/models/asset.py:192
msgid "OS version"
msgstr "系统版本"
#: assets/models/asset.py:194
#: assets/models/asset.py:193
msgid "OS arch"
msgstr "系统架构"
#: assets/models/asset.py:195
#: assets/models/asset.py:194
msgid "Hostname raw"
msgstr "主机名原始"
#: assets/models/asset.py:197 assets/templates/assets/asset_create.html:46
#: assets/models/asset.py:196 assets/templates/assets/asset_create.html:46
#: assets/templates/assets/asset_detail.html:227 templates/_nav.html:26
msgid "Labels"
msgstr "标签管理"
......@@ -966,7 +971,7 @@ msgstr "带宽"
msgid "Contact"
msgstr "联系人"
#: assets/models/cluster.py:22 users/models/user.py:344
#: assets/models/cluster.py:22 users/models/user.py:349
#: users/templates/users/user_detail.html:76
msgid "Phone"
msgstr "手机"
......@@ -992,7 +997,7 @@ msgid "Default"
msgstr "默认"
#: assets/models/cluster.py:36 assets/models/label.py:14
#: users/models/user.py:452
#: users/models/user.py:457
msgid "System"
msgstr "系统"
......@@ -1052,7 +1057,7 @@ msgstr "过滤器"
msgid "Type"
msgstr "类型"
#: assets/models/cmd_filter.py:51 assets/models/user.py:109
#: assets/models/cmd_filter.py:51 assets/models/user.py:112
#: assets/templates/assets/cmd_filter_rule_list.html:60
msgid "Priority"
msgstr "优先级"
......@@ -1102,8 +1107,8 @@ msgstr "默认资产组"
#: perms/forms/asset_permission.py:63 perms/forms/remote_app_permission.py:31
#: perms/models/base.py:36
#: perms/templates/perms/asset_permission_create_update.html:41
#: perms/templates/perms/asset_permission_list.html:46
#: perms/templates/perms/asset_permission_list.html:111
#: perms/templates/perms/asset_permission_list.html:50
#: perms/templates/perms/asset_permission_list.html:115
#: perms/templates/perms/remote_app_permission_create_update.html:43
#: perms/templates/perms/remote_app_permission_list.html:15
#: templates/index.html:87 terminal/backends/command/models.py:12
......@@ -1111,9 +1116,9 @@ msgstr "默认资产组"
#: terminal/templates/terminal/command_list.html:65
#: terminal/templates/terminal/session_list.html:27
#: terminal/templates/terminal/session_list.html:71 users/forms.py:316
#: users/models/user.py:121 users/models/user.py:440
#: users/serializers/v1.py:108 users/templates/users/user_group_detail.html:78
#: users/templates/users/user_group_list.html:36 users/views/user.py:251
#: users/models/user.py:127 users/models/user.py:445
#: users/serializers/v1.py:109 users/templates/users/user_group_detail.html:78
#: users/templates/users/user_group_list.html:36 users/views/user.py:243
#: xpack/plugins/orgs/forms.py:26
#: xpack/plugins/orgs/templates/orgs/org_detail.html:113
#: xpack/plugins/orgs/templates/orgs/org_list.html:14
......@@ -1137,15 +1142,15 @@ msgstr "键"
msgid "New node"
msgstr "新节点"
#: assets/models/user.py:103
#: assets/models/user.py:106
msgid "Automatic login"
msgstr "自动登录"
#: assets/models/user.py:104
#: assets/models/user.py:107
msgid "Manually login"
msgstr "手动登录"
#: assets/models/user.py:108
#: assets/models/user.py:111
#: assets/templates/assets/_asset_group_bulk_update_modal.html:11
#: assets/templates/assets/system_user_assets.html:22
#: assets/templates/assets/system_user_detail.html:22
......@@ -1168,21 +1173,21 @@ msgstr "手动登录"
msgid "Assets"
msgstr "资产管理"
#: assets/models/user.py:111 assets/templates/assets/_system_user.html:59
#: assets/models/user.py:114 assets/templates/assets/_system_user.html:59
#: assets/templates/assets/system_user_detail.html:122
#: assets/templates/assets/system_user_update.html:10
msgid "Auto push"
msgstr "自动推送"
#: assets/models/user.py:112 assets/templates/assets/system_user_detail.html:74
#: assets/models/user.py:115 assets/templates/assets/system_user_detail.html:74
msgid "Sudo"
msgstr "Sudo"
#: assets/models/user.py:113 assets/templates/assets/system_user_detail.html:79
#: assets/models/user.py:116 assets/templates/assets/system_user_detail.html:79
msgid "Shell"
msgstr "Shell"
#: assets/models/user.py:114 assets/templates/assets/system_user_detail.html:66
#: assets/models/user.py:117 assets/templates/assets/system_user_detail.html:66
#: assets/templates/assets/system_user_list.html:54
msgid "Login mode"
msgstr "登录模式"
......@@ -1218,11 +1223,11 @@ msgid "Backend"
msgstr "后端"
#: assets/serializers/asset_user.py:66 users/forms.py:263
#: users/models/user.py:355 users/templates/users/first_login.html:42
#: users/templates/users/user_password_update.html:46
#: users/templates/users/user_profile.html:68
#: users/templates/users/user_profile_update.html:43
#: users/templates/users/user_pubkey_update.html:43
#: users/models/user.py:360 users/templates/users/first_login.html:42
#: users/templates/users/user_password_update.html:49
#: users/templates/users/user_profile.html:69
#: users/templates/users/user_profile_update.html:46
#: users/templates/users/user_pubkey_update.html:46
msgid "Public key"
msgstr "ssh公钥"
......@@ -1251,86 +1256,86 @@ msgstr "自动登录模式,必须填写用户名"
msgid "Password or private key required"
msgstr "密码或密钥密码需要一个"
#: assets/tasks.py:33
#: assets/tasks.py:34
msgid "Asset has been disabled, skipped: {}"
msgstr "资产或许不支持ansible, 跳过: {}"
#: assets/tasks.py:37
#: assets/tasks.py:38
msgid "Asset may not be support ansible, skipped: {}"
msgstr "资产或许不支持ansible, 跳过: {}"
#: assets/tasks.py:50
#: assets/tasks.py:51
msgid "No assets matched, stop task"
msgstr "没有匹配到资产,结束任务"
#: assets/tasks.py:60
#: assets/tasks.py:61
msgid "No assets matched related system user protocol, stop task"
msgstr "没有匹配到与系统用户协议相关的资产,结束任务"
#: assets/tasks.py:86
#: assets/tasks.py:87
msgid "Get asset info failed: {}"
msgstr "获取资产信息失败:{}"
#: assets/tasks.py:136
#: assets/tasks.py:137
msgid "Update some assets hardware info"
msgstr "更新资产硬件信息"
#: assets/tasks.py:153
#: assets/tasks.py:154
msgid "Update asset hardware info: {}"
msgstr "更新资产硬件信息: {}"
#: assets/tasks.py:178
#: assets/tasks.py:179
msgid "Test assets connectivity"
msgstr "测试资产可连接性"
#: assets/tasks.py:232
#: assets/tasks.py:233
msgid "Test assets connectivity: {}"
msgstr "测试资产可连接性: {}"
#: assets/tasks.py:274
#: assets/tasks.py:275
msgid "Test admin user connectivity period: {}"
msgstr "定期测试管理账号可连接性: {}"
#: assets/tasks.py:281
#: assets/tasks.py:282
msgid "Test admin user connectivity: {}"
msgstr "测试管理行号可连接性: {}"
#: assets/tasks.py:349
#: assets/tasks.py:350
msgid "Test system user connectivity: {}"
msgstr "测试系统用户可连接性: {}"
#: assets/tasks.py:356
#: assets/tasks.py:357
msgid "Test system user connectivity: {} => {}"
msgstr "测试系统用户可连接性: {} => {}"
#: assets/tasks.py:369
#: assets/tasks.py:370
msgid "Test system user connectivity period: {}"
msgstr "定期测试系统用户可连接性: {}"
#: assets/tasks.py:470 assets/tasks.py:556
#: assets/tasks.py:471 assets/tasks.py:557
#: xpack/plugins/change_auth_plan/models.py:522
msgid "The asset {} system platform {} does not support run Ansible tasks"
msgstr "资产 {} 系统平台 {} 不支持运行 Ansible 任务"
#: assets/tasks.py:482
#: assets/tasks.py:483
msgid ""
"Push system user task skip, auto push not enable or protocol is not ssh or "
"rdp: {}"
msgstr "推送系统用户任务跳过,自动推送没有打开,或协议不是ssh或rdp: {}"
#: assets/tasks.py:489
#: assets/tasks.py:490
msgid "For security, do not push user {}"
msgstr "为了安全,禁止推送用户 {}"
#: assets/tasks.py:517 assets/tasks.py:531
#: assets/tasks.py:518 assets/tasks.py:532
msgid "Push system users to assets: {}"
msgstr "推送系统用户到入资产: {}"
#: assets/tasks.py:523
#: assets/tasks.py:524
msgid "Push system users to asset: {} => {}"
msgstr "推送系统用户到入资产: {} => {}"
#: assets/tasks.py:603
#: assets/tasks.py:604
msgid "Test asset user connectivity: {}"
msgstr "测试资产用户可连接性: {}"
......@@ -1393,8 +1398,8 @@ msgstr "请输入密码"
#: assets/templates/assets/_asset_user_auth_update_modal.html:68
#: assets/templates/assets/asset_detail.html:307
#: users/templates/users/user_detail.html:307
#: users/templates/users/user_detail.html:334
#: users/templates/users/user_detail.html:311
#: users/templates/users/user_detail.html:338
#: xpack/plugins/interface/views.py:35
msgid "Update successfully!"
msgstr "更新成功"
......@@ -1413,7 +1418,6 @@ msgstr "获取认证信息错误"
#: assets/templates/assets/_asset_user_auth_view_modal.html:97
#: assets/templates/assets/_user_asset_detail_modal.html:23
#: authentication/templates/authentication/_access_key_modal.html:140
#: authentication/templates/authentication/_mfa_confirm_modal.html:53
#: settings/templates/settings/_ldap_list_users_modal.html:99
#: templates/_modal.html:22
......@@ -1477,19 +1481,19 @@ msgstr "重命名节点"
msgid "Delete node"
msgstr "删除节点"
#: assets/templates/assets/_node_tree.html:154
#: assets/templates/assets/_node_tree.html:160
msgid "Create node failed"
msgstr "创建节点失败"
#: assets/templates/assets/_node_tree.html:166
#: assets/templates/assets/_node_tree.html:172
msgid "Have child node, cancel"
msgstr "存在子节点,不能删除"
#: assets/templates/assets/_node_tree.html:168
#: assets/templates/assets/_node_tree.html:174
msgid "Have assets, cancel"
msgstr "存在资产,不能删除"
#: assets/templates/assets/_node_tree.html:242
#: assets/templates/assets/_node_tree.html:248
msgid "Rename success"
msgstr "重命名成功"
......@@ -1499,6 +1503,7 @@ msgstr "重命名成功"
#: perms/templates/perms/asset_permission_create_update.html:38
#: perms/templates/perms/remote_app_permission_create_update.html:39
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_create_update.html:43
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_create_update.html:27
msgid "Basic"
msgstr "基本"
......@@ -1520,6 +1525,7 @@ msgstr "自动生成密钥"
#: perms/templates/perms/remote_app_permission_create_update.html:52
#: terminal/templates/terminal/terminal_update.html:40
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_create_update.html:67
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_create_update.html:48
msgid "Other"
msgstr "其它"
......@@ -1584,15 +1590,15 @@ msgstr "选择节点"
#: 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:108
#: users/templates/users/user_detail.html:388
#: users/templates/users/user_detail.html:414
#: users/templates/users/user_detail.html:437
#: users/templates/users/user_detail.html:482
#: users/templates/users/user_detail.html:392
#: users/templates/users/user_detail.html:418
#: users/templates/users/user_detail.html:441
#: users/templates/users/user_detail.html:486
#: users/templates/users/user_group_create_update.html:32
#: users/templates/users/user_group_list.html:119
#: users/templates/users/user_list.html:255
#: xpack/plugins/cloud/templates/cloud/account_create_update.html:34
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_create.html:36
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_create_update.html:54
#: xpack/plugins/interface/templates/interface/interface.html:103
#: xpack/plugins/orgs/templates/orgs/org_create_update.html:33
msgid "Confirm"
......@@ -1663,9 +1669,10 @@ msgstr "资产用户"
#: assets/templates/assets/asset_asset_user_list.html:47
#: assets/templates/assets/asset_detail.html:144
#: terminal/templates/terminal/session_detail.html:81
#: users/templates/users/user_detail.html:138
#: users/templates/users/user_profile.html:146
#: users/templates/users/user_detail.html:140
#: users/templates/users/user_profile.html:150
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_detail.html:128
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_detail.html:132
#: xpack/plugins/license/templates/license/license_detail.html:102
msgid "Quick modify"
msgstr "快速修改"
......@@ -1690,12 +1697,11 @@ msgstr "硬盘"
#: assets/templates/assets/asset_detail.html:128
#: users/templates/users/user_detail.html:115
#: users/templates/users/user_profile.html:104
#: users/templates/users/user_profile.html:106
msgid "Date joined"
msgstr "创建日期"
#: assets/templates/assets/asset_detail.html:150 authentication/models.py:15
#: authentication/templates/authentication/_access_key_modal.html:25
#: assets/templates/assets/asset_detail.html:150
#: perms/models/asset_permission.py:115 perms/models/base.py:38
#: perms/templates/perms/asset_permission_create_update.html:55
#: perms/templates/perms/asset_permission_detail.html:120
......@@ -1703,7 +1709,7 @@ msgstr "创建日期"
#: perms/templates/perms/remote_app_permission_detail.html:112
#: terminal/templates/terminal/terminal_list.html:34
#: users/templates/users/_select_user_modal.html:18
#: users/templates/users/user_detail.html:144
#: users/templates/users/user_detail.html:146
#: users/templates/users/user_profile.html:63
msgid "Active"
msgstr "激活中"
......@@ -1783,9 +1789,9 @@ msgstr "显示所有子节点资产"
#: assets/templates/assets/asset_list.html:380
#: assets/templates/assets/system_user_list.html:133
#: users/templates/users/user_detail.html:382
#: users/templates/users/user_detail.html:408
#: users/templates/users/user_detail.html:476
#: users/templates/users/user_detail.html:386
#: users/templates/users/user_detail.html:412
#: users/templates/users/user_detail.html:480
#: users/templates/users/user_group_list.html:113
#: users/templates/users/user_list.html:249
#: xpack/plugins/interface/templates/interface/interface.html:97
......@@ -1799,9 +1805,9 @@ msgstr "删除选择资产"
#: assets/templates/assets/asset_list.html:384
#: assets/templates/assets/system_user_list.html:137
#: settings/templates/settings/terminal_setting.html:166
#: users/templates/users/user_detail.html:386
#: users/templates/users/user_detail.html:412
#: users/templates/users/user_detail.html:480
#: users/templates/users/user_detail.html:390
#: users/templates/users/user_detail.html:416
#: users/templates/users/user_detail.html:484
#: users/templates/users/user_group_create_update.html:31
#: users/templates/users/user_group_list.html:117
#: users/templates/users/user_list.html:253
......@@ -2127,19 +2133,17 @@ msgstr "操作"
msgid "Filename"
msgstr "文件名"
#: audits/models.py:23 audits/models.py:76
#: audits/models.py:23 audits/models.py:90
#: audits/templates/audits/ftp_log_list.html:76
#: ops/templates/ops/command_execution_list.html:65
#: ops/templates/ops/task_list.html:31
#: users/templates/users/user_detail.html:458
#: users/templates/users/user_detail.html:462
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_execution_subtask_list.html:14
#: xpack/plugins/cloud/api.py:62
msgid "Success"
msgstr "成功"
#: audits/models.py:32
#: authentication/templates/authentication/_access_key_modal.html:35
#: xpack/plugins/vault/templates/vault/vault.html:46
#: audits/models.py:32 xpack/plugins/vault/templates/vault/vault.html:46
msgid "Create"
msgstr "创建"
......@@ -2165,54 +2169,70 @@ msgstr "禁用"
msgid "Enabled"
msgstr "启用"
#: audits/models.py:72
#: audits/models.py:72 audits/models.py:82
msgid "-"
msgstr ""
#: audits/models.py:77 xpack/plugins/cloud/models.py:164
#: xpack/plugins/cloud/models.py:178
#: audits/models.py:83
msgid "Username/password check failed"
msgstr "用户名/密码 校验失败"
#: audits/models.py:84
msgid "MFA authentication failed"
msgstr "MFA 认证失败"
#: audits/models.py:85
msgid "Username does not exist"
msgstr "用户名不存在"
#: audits/models.py:86
msgid "Password expired"
msgstr "密码过期"
#: audits/models.py:91 xpack/plugins/cloud/models.py:267
#: xpack/plugins/cloud/models.py:290
msgid "Failed"
msgstr "失败"
#: audits/models.py:81
#: audits/models.py:95
msgid "Login type"
msgstr "登录方式"
#: audits/models.py:82
#: audits/models.py:96
msgid "Login ip"
msgstr "登录IP"
#: audits/models.py:83
#: audits/models.py:97
msgid "Login city"
msgstr "登录城市"
#: audits/models.py:84
#: audits/models.py:98
msgid "User agent"
msgstr "Agent"
#: audits/models.py:85 audits/templates/audits/login_log_list.html:56
#: audits/models.py:99 audits/templates/audits/login_log_list.html:56
#: authentication/templates/authentication/_mfa_confirm_modal.html:14
#: users/forms.py:175 users/models/user.py:347
#: users/forms.py:175 users/models/user.py:352
#: users/templates/users/first_login.html:45
msgid "MFA"
msgstr "MFA"
#: audits/models.py:86 audits/templates/audits/login_log_list.html:57
#: audits/models.py:100 audits/templates/audits/login_log_list.html:57
#: xpack/plugins/change_auth_plan/models.py:417
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_execution_subtask_list.html:15
#: xpack/plugins/cloud/models.py:172
#: xpack/plugins/cloud/models.py:281
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_history.html:69
msgid "Reason"
msgstr "原因"
#: audits/models.py:87 audits/templates/audits/login_log_list.html:58
#: xpack/plugins/cloud/models.py:171 xpack/plugins/cloud/models.py:188
#: audits/models.py:101 audits/templates/audits/login_log_list.html:58
#: xpack/plugins/cloud/models.py:278 xpack/plugins/cloud/models.py:313
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_history.html:70
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_instance.html:65
msgid "Status"
msgstr "状态"
#: audits/models.py:88
#: audits/models.py:102
msgid "Date login"
msgstr "登录日期"
......@@ -2244,14 +2264,13 @@ msgstr "选择用户"
#: ops/templates/ops/command_execution_list.html:43
#: ops/templates/ops/command_execution_list.html:48
#: ops/templates/ops/task_list.html:13 ops/templates/ops/task_list.html:18
#: templates/_base_list.html:41
#: templates/_base_list.html:41 templates/_header_bar.html:8
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_history.html:52
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_instance.html:48
msgid "Search"
msgstr "搜索"
#: audits/templates/audits/login_log_list.html:50
#: authentication/templates/authentication/_access_key_modal.html:23
#: ops/templates/ops/adhoc_detail.html:49
#: ops/templates/ops/adhoc_history_detail.html:49
#: ops/templates/ops/task_detail.html:56
......@@ -2270,7 +2289,6 @@ msgid "City"
msgstr "城市"
#: audits/templates/audits/login_log_list.html:59
#: authentication/templates/authentication/_access_key_modal.html:26
#: ops/templates/ops/task_list.html:32
msgid "Date"
msgstr "日期"
......@@ -2301,99 +2319,79 @@ msgstr "登录日志"
msgid "Command execution log"
msgstr "命令执行"
#: authentication/api/auth.py:51 authentication/api/token.py:45
#: authentication/api/auth.py:49
#: authentication/templates/authentication/login.html:52
#: authentication/templates/authentication/new_login.html:77
msgid "Log in frequently and try again later"
msgstr "登录频繁, 稍后重试"
#: authentication/api/auth.py:76
#: authentication/api/auth.py:67
msgid "The user {} password has expired, please update."
msgstr "用户 {} 密码已经过期,请更新。"
#: authentication/api/auth.py:86
msgid "Please carry seed value and conduct MFA secondary certification"
msgstr "请携带seed值, 进行MFA二次认证"
#: authentication/api/auth.py:156
#: authentication/api/auth.py:166
msgid "Please verify the user name and password first"
msgstr "请先进行用户名和密码验证"
#: authentication/api/auth.py:161
#: authentication/api/auth.py:171
msgid "MFA certification failed"
msgstr "MFA认证失败"
#: authentication/api/token.py:80
msgid "MFA required"
msgstr ""
#: authentication/backends/api.py:53
#: authentication/backends/api.py:52
msgid "Invalid signature header. No credentials provided."
msgstr ""
#: authentication/backends/api.py:56
#: authentication/backends/api.py:55
msgid "Invalid signature header. Signature string should not contain spaces."
msgstr ""
#: authentication/backends/api.py:63
#: authentication/backends/api.py:62
msgid "Invalid signature header. Format like AccessKeyId:Signature"
msgstr ""
#: authentication/backends/api.py:67
#: authentication/backends/api.py:66
msgid ""
"Invalid signature header. Signature string should not contain invalid "
"characters."
msgstr ""
#: authentication/backends/api.py:87 authentication/backends/api.py:103
#: authentication/backends/api.py:86 authentication/backends/api.py:102
msgid "Invalid signature."
msgstr ""
#: authentication/backends/api.py:94
#: authentication/backends/api.py:93
msgid "HTTP header: Date not provide or not %a, %d %b %Y %H:%M:%S GMT"
msgstr ""
#: authentication/backends/api.py:99
#: authentication/backends/api.py:98
msgid "Expired, more than 15 minutes"
msgstr ""
#: authentication/backends/api.py:106
#: authentication/backends/api.py:105
msgid "User disabled."
msgstr "用户已禁用"
#: authentication/backends/api.py:121
#: authentication/backends/api.py:120
msgid "Invalid token header. No credentials provided."
msgstr ""
#: authentication/backends/api.py:124
#: authentication/backends/api.py:123
msgid "Invalid token header. Sign string should not contain spaces."
msgstr ""
#: authentication/backends/api.py:131
#: authentication/backends/api.py:130
msgid ""
"Invalid token header. Sign string should not contain invalid characters."
msgstr ""
#: authentication/backends/api.py:141
#: authentication/backends/api.py:140
msgid "Invalid token or cache refreshed."
msgstr ""
#: authentication/const.py:6
msgid "Username/password check failed"
msgstr "用户名/密码 校验失败"
#: authentication/const.py:7
msgid "MFA authentication failed"
msgstr "MFA 认证失败"
#: authentication/const.py:8
msgid "Username does not exist"
msgstr "用户名不存在"
#: authentication/const.py:9
msgid "Password expired"
msgstr "密码过期"
#: authentication/const.py:10
msgid "Disabled or expired"
msgstr "禁用或失效"
#: authentication/forms.py:19
msgid ""
"Please enter a correct username and password. Note that both fields may be "
......@@ -2408,35 +2406,10 @@ msgstr "此账户无效"
msgid "MFA code"
msgstr "MFA 验证码"
#: authentication/models.py:35
#: authentication/models.py:33
msgid "Private Token"
msgstr "ssh密钥"
#: authentication/templates/authentication/_access_key_modal.html:6
msgid "API key list"
msgstr "API Key 列表"
#: authentication/templates/authentication/_access_key_modal.html:24
msgid "Secret"
msgstr "密文"
#: authentication/templates/authentication/_access_key_modal.html:45
msgid "Show"
msgstr "显示"
#: authentication/templates/authentication/_access_key_modal.html:63
#: users/models/user.py:282 users/templates/users/user_profile.html:92
#: users/templates/users/user_profile.html:159
#: users/templates/users/user_profile.html:162
msgid "Disable"
msgstr "禁用"
#: authentication/templates/authentication/_access_key_modal.html:64
#: users/models/user.py:283 users/templates/users/user_profile.html:90
#: users/templates/users/user_profile.html:166
msgid "Enable"
msgstr "启用"
#: authentication/templates/authentication/_mfa_confirm_modal.html:5
msgid "MFA confirm"
msgstr "MFA确认"
......@@ -2495,7 +2468,7 @@ msgstr "改变世界,从一点点开始。"
#: authentication/templates/authentication/login.html:46
#: authentication/templates/authentication/login.html:72
#: authentication/templates/authentication/new_login.html:99
#: templates/_header_bar.html:83
#: templates/_header_bar.html:101
msgid "Login"
msgstr "登录"
......@@ -2526,7 +2499,7 @@ msgstr ""
#: authentication/templates/authentication/login_otp.html:46
#: users/templates/users/user_detail.html:91
#: users/templates/users/user_profile.html:85
#: users/templates/users/user_profile.html:87
msgid "MFA certification"
msgstr "MFA认证"
......@@ -2549,7 +2522,7 @@ msgid "Six figures"
msgstr "6位数字"
#: authentication/templates/authentication/login_otp.html:67
#: users/templates/users/first_login.html:105
#: users/templates/users/first_login.html:108
#: users/templates/users/user_otp_authentication.html:26
#: users/templates/users/user_otp_enable_bind.html:29
#: users/templates/users/user_otp_enable_install_app.html:26
......@@ -2569,8 +2542,8 @@ msgstr "欢迎回来,请输入用户名和密码登录"
msgid "Please enable cookies and try again."
msgstr "设置你的浏览器支持cookie"
#: authentication/views/login.py:172 users/views/user.py:399
#: users/views/user.py:424
#: authentication/views/login.py:172 users/views/user.py:386
#: users/views/user.py:411
msgid "MFA code invalid, or ntp sync server time"
msgstr "MFA验证码不正确,或者服务器端时间不对"
......@@ -2783,7 +2756,7 @@ msgstr "汇总"
#: ops/models/command.py:22
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_execution_list.html:56
#: xpack/plugins/cloud/models.py:170
#: xpack/plugins/cloud/models.py:276
msgid "Result"
msgstr "结果"
......@@ -2983,7 +2956,8 @@ msgstr "版本"
#: ops/templates/ops/task_list.html:63
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_detail.html:137
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_list.html:53
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_list.html:53
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_detail.html:141
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_list.html:54
msgid "Run"
msgstr "执行"
......@@ -3031,13 +3005,13 @@ msgstr "空"
#: perms/forms/asset_permission.py:66 perms/forms/remote_app_permission.py:34
#: perms/models/asset_permission.py:113 perms/models/base.py:37
#: perms/templates/perms/asset_permission_list.html:47
#: perms/templates/perms/asset_permission_list.html:67
#: perms/templates/perms/asset_permission_list.html:114
#: perms/templates/perms/asset_permission_list.html:51
#: perms/templates/perms/asset_permission_list.html:71
#: perms/templates/perms/asset_permission_list.html:118
#: perms/templates/perms/remote_app_permission_list.html:16
#: templates/_nav.html:14 users/forms.py:286 users/models/group.py:26
#: users/models/user.py:331 users/templates/users/_select_user_modal.html:16
#: users/templates/users/user_detail.html:213
#: users/models/user.py:336 users/templates/users/_select_user_modal.html:16
#: users/templates/users/user_detail.html:217
#: users/templates/users/user_list.html:38
#: xpack/plugins/orgs/templates/orgs/org_list.html:15
msgid "User group"
......@@ -3085,8 +3059,8 @@ msgstr "资产授权"
#: perms/models/asset_permission.py:116 perms/models/base.py:40
#: perms/templates/perms/asset_permission_detail.html:90
#: perms/templates/perms/remote_app_permission_detail.html:82
#: users/models/user.py:363 users/templates/users/user_detail.html:107
#: users/templates/users/user_profile.html:116
#: users/models/user.py:368 users/templates/users/user_detail.html:107
#: users/templates/users/user_profile.html:120
msgid "Date expired"
msgstr "失效日期"
......@@ -3137,7 +3111,7 @@ msgid "Add node to this permission"
msgstr "添加节点"
#: perms/templates/perms/asset_permission_asset.html:112
#: users/templates/users/user_detail.html:230
#: users/templates/users/user_detail.html:234
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_asset_list.html:121
msgid "Join"
msgstr "加入"
......@@ -3180,15 +3154,23 @@ msgstr "选择系统用户"
msgid "Create permission"
msgstr "创建授权规则"
#: perms/templates/perms/asset_permission_list.html:51
#: perms/templates/perms/asset_permission_list.html:65
#: perms/templates/perms/asset_permission_list.html:42
msgid "Refresh permission cache"
msgstr "刷新授权缓存"
#: perms/templates/perms/asset_permission_list.html:55
#: perms/templates/perms/asset_permission_list.html:69
#: perms/templates/perms/remote_app_permission_list.html:18
#: users/templates/users/user_list.html:40 xpack/plugins/cloud/models.py:53
#: users/templates/users/user_list.html:40 xpack/plugins/cloud/models.py:74
#: xpack/plugins/cloud/templates/cloud/account_detail.html:58
#: xpack/plugins/cloud/templates/cloud/account_list.html:14
msgid "Validity"
msgstr "有效"
#: perms/templates/perms/asset_permission_list.html:244
msgid "Refresh success"
msgstr "刷新成功"
#: perms/templates/perms/asset_permission_user.html:35
#: perms/templates/perms/remote_app_permission_user.html:34
msgid "User list of "
......@@ -3304,21 +3286,21 @@ msgstr "连接LDAP成功"
msgid "Match {} s users"
msgstr "匹配 {} 个用户"
#: settings/api.py:161
#: settings/api.py:160
msgid "succeed: {} failed: {} total: {}"
msgstr "成功:{} 失败:{} 总数:{}"
#: settings/api.py:183 settings/api.py:219
#: settings/api.py:182 settings/api.py:218
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:189 settings/api.py:225
#: settings/api.py:188 settings/api.py:224
msgid "Create succeed"
msgstr "创建成功"
#: settings/api.py:207 settings/api.py:245
#: settings/api.py:206 settings/api.py:244
#: settings/templates/settings/terminal_setting.html:154
msgid "Delete succeed"
msgstr "删除成功"
......@@ -3631,7 +3613,7 @@ msgid "Please submit the LDAP configuration before import"
msgstr "请先提交LDAP配置再进行导入"
#: settings/templates/settings/_ldap_list_users_modal.html:39
#: users/models/user.py:327 users/templates/users/user_detail.html:71
#: users/models/user.py:332 users/templates/users/user_detail.html:71
#: users/templates/users/user_profile.html:59
msgid "Email"
msgstr "邮件"
......@@ -3777,8 +3759,8 @@ msgid "Endpoint suffix"
msgstr "端点后缀"
#: settings/templates/settings/replay_storage_create.html:136
#: xpack/plugins/cloud/models.py:186
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_detail.html:81
#: xpack/plugins/cloud/models.py:307
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_detail.html:109
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_instance.html:62
msgid "Region"
msgstr "地域"
......@@ -3825,11 +3807,11 @@ msgstr "删除失败"
msgid "Are you sure about deleting it?"
msgstr "您确定删除吗?"
#: settings/utils.py:84
#: settings/utils.py:90
msgid "Search no entry matched in ou {}"
msgstr "在ou:{}中没有匹配条目"
#: settings/utils.py:112
#: settings/utils.py:120
msgid "The user source is not LDAP"
msgstr "用户来源不是LDAP"
......@@ -3852,42 +3834,38 @@ msgstr "创建录像存储"
msgid "Create command storage"
msgstr "创建命令存储"
#: templates/_header_bar.html:12
#: templates/_header_bar.html:31
msgid "Help"
msgstr "帮助"
#: templates/_header_bar.html:19 users/templates/users/_base_otp.html:29
#: templates/_header_bar.html:38 users/templates/users/_base_otp.html:29
msgid "Docs"
msgstr "文档"
#: templates/_header_bar.html:25
#: templates/_header_bar.html:44
msgid "Commercial support"
msgstr "商业支持"
#: templates/_header_bar.html:70 templates/_nav_user.html:32 users/forms.py:154
#: templates/_header_bar.html:89 templates/_nav_user.html:32 users/forms.py:154
#: users/templates/users/_user.html:43
#: users/templates/users/first_login.html:39
#: users/templates/users/user_password_update.html:40
#: users/templates/users/user_profile.html:17
#: users/templates/users/user_profile_update.html:37
#: users/templates/users/user_profile_update.html:57
#: users/templates/users/user_pubkey_update.html:37 users/views/user.py:232
#: users/templates/users/user_profile_update.html:61
#: users/templates/users/user_pubkey_update.html:37 users/views/user.py:224
msgid "Profile"
msgstr "个人信息"
#: templates/_header_bar.html:73
#: templates/_header_bar.html:92
msgid "Admin page"
msgstr "管理页面"
#: templates/_header_bar.html:75
#: templates/_header_bar.html:94
msgid "User page"
msgstr "用户页面"
#: templates/_header_bar.html:78
msgid "API Key"
msgstr ""
#: templates/_header_bar.html:79
#: templates/_header_bar.html:97
msgid "Logout"
msgstr "注销登录"
......@@ -3965,13 +3943,13 @@ msgstr ""
#: templates/_nav.html:10 users/views/group.py:28 users/views/group.py:45
#: users/views/group.py:63 users/views/group.py:81 users/views/group.py:98
#: users/views/login.py:154 users/views/user.py:68 users/views/user.py:85
#: users/views/user.py:129 users/views/user.py:196 users/views/user.py:218
#: users/views/user.py:270 users/views/user.py:311
#: users/views/login.py:154 users/views/user.py:60 users/views/user.py:77
#: users/views/user.py:121 users/views/user.py:188 users/views/user.py:210
#: users/views/user.py:263 users/views/user.py:298
msgid "Users"
msgstr "用户管理"
#: templates/_nav.html:13 users/views/user.py:69
#: templates/_nav.html:13 users/views/user.py:61
msgid "User list"
msgstr "用户列表"
......@@ -4410,7 +4388,7 @@ msgid ""
"You should use your ssh client tools connect terminal: {} <br /> <br />{}"
msgstr "你可以使用ssh客户端工具连接终端"
#: users/api/user.py:96
#: users/api/user.py:97
msgid "You do not have permission."
msgstr "你没有权限"
......@@ -4418,7 +4396,7 @@ msgstr "你没有权限"
msgid "Could not reset self otp, use profile reset instead"
msgstr "不能再该页面重置MFA, 请去个人信息页面重置"
#: users/forms.py:33 users/models/user.py:335
#: users/forms.py:33 users/models/user.py:340
#: users/templates/users/_select_user_modal.html:15
#: users/templates/users/user_detail.html:87
#: users/templates/users/user_list.html:37
......@@ -4427,6 +4405,7 @@ msgid "Role"
msgstr "角色"
#: users/forms.py:36 users/forms.py:233
#: users/templates/users/user_update.html:30
msgid "ssh public key"
msgstr "ssh公钥"
......@@ -4438,7 +4417,7 @@ msgstr ""
msgid "Paste user id_rsa.pub here."
msgstr "复制用户公钥到这里"
#: users/forms.py:52 users/templates/users/user_detail.html:221
#: users/forms.py:52 users/templates/users/user_detail.html:225
msgid "Join user groups"
msgstr "添加到用户组"
......@@ -4446,11 +4425,11 @@ msgstr "添加到用户组"
msgid "Public key should not be the same as your old one."
msgstr "不能和原来的密钥相同"
#: users/forms.py:91 users/forms.py:252 users/serializers/v1.py:94
#: users/forms.py:91 users/forms.py:252 users/serializers/v1.py:95
msgid "Not a valid ssh public key"
msgstr "ssh密钥不合法"
#: users/forms.py:104 users/views/login.py:114 users/views/user.py:293
#: users/forms.py:104 users/views/login.py:114 users/views/user.py:280
msgid "* Your password does not meet the requirements"
msgstr "* 您的密码不符合要求"
......@@ -4472,16 +4451,16 @@ msgstr "密码策略"
#: users/forms.py:160
msgid ""
"Tip: when enabled, you will enter the MFA binding process the next time you "
"log in. you can also directly bind in \"personal information -> quick "
"When enabled, you will enter the MFA binding process the next time you log "
"in. you can also directly bind in \"personal information -> quick "
"modification -> change MFA Settings\"!"
msgstr ""
"提示:启用之后您将会在下次登录时进入MFA绑定流程;您也可以在(个人信息->快速修"
"改->更改MFA设置)中直接绑定!"
"启用之后您将会在下次登录时进入MFA绑定流程;您也可以在(个人信息->快速修改->更"
"改MFA设置)中直接绑定!"
#: users/forms.py:170
msgid "* Enable MFA authentication to make the account more secure."
msgstr "* 启用MFA认证,使账号更加安全."
msgstr "* 启用MFA认证,使账号更加安全"
#: users/forms.py:180
msgid ""
......@@ -4493,8 +4472,8 @@ msgstr ""
"设置复杂密码,启用MFA认证)"
#: users/forms.py:187 users/templates/users/first_login.html:48
#: users/templates/users/first_login.html:107
#: users/templates/users/first_login.html:130
#: users/templates/users/first_login.html:110
#: users/templates/users/first_login.html:139
msgid "Finish"
msgstr "完成"
......@@ -4532,81 +4511,92 @@ msgid "Select users"
msgstr "选择用户"
#: users/models/user.py:50 users/templates/users/user_update.html:22
#: users/views/login.py:46 users/views/login.py:107 users/views/user.py:283
#: users/views/login.py:46 users/views/login.py:107
msgid "User auth from {}, go there change password"
msgstr "用户认证源来自 {}, 请去相应系统修改密码"
#: users/models/user.py:120 users/models/user.py:448
#: users/models/user.py:126 users/models/user.py:453
msgid "Administrator"
msgstr "管理员"
#: users/models/user.py:122
#: users/models/user.py:128
msgid "Application"
msgstr "应用程序"
#: users/models/user.py:123
#: users/models/user.py:129
msgid "Auditor"
msgstr "审计员"
#: users/models/user.py:284 users/templates/users/user_profile.html:88
#: users/models/user.py:287 users/templates/users/user_profile.html:94
#: users/templates/users/user_profile.html:163
#: users/templates/users/user_profile.html:166
msgid "Disable"
msgstr "禁用"
#: users/models/user.py:288 users/templates/users/user_profile.html:92
#: users/templates/users/user_profile.html:170
msgid "Enable"
msgstr "启用"
#: users/models/user.py:289 users/templates/users/user_profile.html:90
msgid "Force enable"
msgstr "强制启用"
#: users/models/user.py:338
#: users/models/user.py:343
msgid "Avatar"
msgstr "头像"
#: users/models/user.py:341 users/templates/users/user_detail.html:82
#: users/models/user.py:346 users/templates/users/user_detail.html:82
msgid "Wechat"
msgstr "微信"
#: users/models/user.py:370 users/templates/users/user_detail.html:103
#: users/models/user.py:375 users/templates/users/user_detail.html:103
#: users/templates/users/user_list.html:39
#: users/templates/users/user_profile.html:100
#: users/templates/users/user_profile.html:102
msgid "Source"
msgstr "用户来源"
#: users/models/user.py:374
#: users/models/user.py:379
msgid "Date password last updated"
msgstr "最后更新密码日期"
#: users/models/user.py:451
#: users/models/user.py:456
msgid "Administrator is the super user of system"
msgstr "Administrator是初始的超级管理员"
#: users/serializers/v1.py:39
#: users/serializers/v1.py:41
msgid "Groups name"
msgstr "用户组名"
#: users/serializers/v1.py:40
#: users/serializers/v1.py:42
msgid "Source name"
msgstr "用户来源名"
#: users/serializers/v1.py:41
#: users/serializers/v1.py:43
msgid "Is first login"
msgstr "首次登录"
#: users/serializers/v1.py:42
#: users/serializers/v1.py:44
msgid "Role name"
msgstr "角色名"
#: users/serializers/v1.py:43
#: users/serializers/v1.py:45
msgid "Is valid"
msgstr "账户是否有效"
#: users/serializers/v1.py:44
#: users/serializers/v1.py:46
msgid "Is expired"
msgstr " 是否过期"
#: users/serializers/v1.py:45
#: users/serializers/v1.py:47
msgid "Avatar url"
msgstr "头像路径"
#: users/serializers/v1.py:54
#: users/serializers/v1.py:55
msgid "Role limit to {}"
msgstr "角色只能为 {}"
#: users/serializers/v1.py:66
#: users/serializers/v1.py:67
msgid "Password does not match security rules"
msgstr "密码不满足安全规则"
......@@ -4623,9 +4613,9 @@ msgid "Security token validation"
msgstr "安全令牌验证"
#: users/templates/users/_base_otp.html:44 users/templates/users/_user.html:13
#: users/templates/users/user_profile_update.html:51
#: xpack/plugins/cloud/models.py:120
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_detail.html:57
#: users/templates/users/user_profile_update.html:55
#: xpack/plugins/cloud/models.py:147
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_detail.html:60
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_list.html:13
msgid "Account"
msgstr "账户"
......@@ -4660,7 +4650,7 @@ msgid "Import users"
msgstr "导入用户"
#: users/templates/users/_user_update_modal.html:4
#: users/templates/users/user_update.html:4 users/views/user.py:130
#: users/templates/users/user_update.html:4 users/views/user.py:122
msgid "Update user"
msgstr "更新用户"
......@@ -4681,7 +4671,12 @@ msgstr "我同意条款和条件"
msgid "Please choose the terms and conditions."
msgstr "请选择同意条款和条件"
#: users/templates/users/first_login.html:101
#: users/templates/users/first_login.html:77
#: users/templates/users/user_update.html:32
msgid "User auth from {}, ssh key login is not supported"
msgstr "用户认证源来自 {}, 不支持使用 SSH Key 登录"
#: users/templates/users/first_login.html:104
msgid "Previous"
msgstr "上一步"
......@@ -4733,20 +4728,20 @@ 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:373 users/utils.py:84
#: users/templates/users/user_detail.html:377 users/utils.py:88
msgid "Reset password"
msgstr "重置密码"
#: users/templates/users/reset_password.html:59
#: users/templates/users/user_create.html:13
#: users/templates/users/user_password_update.html:61
#: users/templates/users/user_password_update.html:65
#: users/templates/users/user_update.html:13
msgid "Your password must satisfy"
msgstr "您的密码必须满足:"
#: users/templates/users/reset_password.html:60
#: users/templates/users/user_create.html:14
#: users/templates/users/user_password_update.html:62
#: users/templates/users/user_password_update.html:66
#: users/templates/users/user_update.html:14
msgid "Password strength"
msgstr "密码强度:"
......@@ -4757,53 +4752,53 @@ msgstr "再次输入密码"
#: users/templates/users/reset_password.html:105
#: users/templates/users/user_create.html:33
#: users/templates/users/user_password_update.html:99
#: users/templates/users/user_update.html:46
#: users/templates/users/user_password_update.html:103
#: users/templates/users/user_update.html:55
msgid "Very weak"
msgstr "很弱"
#: users/templates/users/reset_password.html:106
#: users/templates/users/user_create.html:34
#: users/templates/users/user_password_update.html:100
#: users/templates/users/user_update.html:47
#: users/templates/users/user_password_update.html:104
#: users/templates/users/user_update.html:56
msgid "Weak"
msgstr "弱"
#: users/templates/users/reset_password.html:107
#: users/templates/users/user_create.html:35
#: users/templates/users/user_password_update.html:101
#: users/templates/users/user_update.html:48
#: users/templates/users/user_password_update.html:105
#: users/templates/users/user_update.html:57
msgid "Normal"
msgstr "正常"
#: users/templates/users/reset_password.html:108
#: users/templates/users/user_create.html:36
#: users/templates/users/user_password_update.html:102
#: users/templates/users/user_update.html:49
#: users/templates/users/user_password_update.html:106
#: users/templates/users/user_update.html:58
msgid "Medium"
msgstr "一般"
#: users/templates/users/reset_password.html:109
#: users/templates/users/user_create.html:37
#: users/templates/users/user_password_update.html:103
#: users/templates/users/user_update.html:50
#: users/templates/users/user_password_update.html:107
#: users/templates/users/user_update.html:59
msgid "Strong"
msgstr "强"
#: users/templates/users/reset_password.html:110
#: users/templates/users/user_create.html:38
#: users/templates/users/user_password_update.html:104
#: users/templates/users/user_update.html:51
#: users/templates/users/user_password_update.html:108
#: users/templates/users/user_update.html:60
msgid "Very strong"
msgstr "很强"
#: users/templates/users/user_create.html:4
#: users/templates/users/user_list.html:28 users/views/user.py:86
#: users/templates/users/user_list.html:28 users/views/user.py:78
msgid "Create user"
msgstr "创建用户"
#: users/templates/users/user_detail.html:19
#: users/templates/users/user_granted_asset.html:18 users/views/user.py:197
#: users/templates/users/user_granted_asset.html:18 users/views/user.py:189
msgid "User detail"
msgstr "用户详情"
......@@ -4819,85 +4814,85 @@ msgid "Force enabled"
msgstr "强制启用"
#: users/templates/users/user_detail.html:119
#: users/templates/users/user_profile.html:108
#: users/templates/users/user_profile.html:110
msgid "Last login"
msgstr "最后登录"
#: users/templates/users/user_detail.html:123
#: users/templates/users/user_profile.html:112
#: users/templates/users/user_detail.html:124
#: users/templates/users/user_profile.html:115
msgid "Last password updated"
msgstr "最后更新密码"
#: users/templates/users/user_detail.html:158
#: users/templates/users/user_detail.html:160
msgid "Force enabled MFA"
msgstr "强制启用MFA"
#: users/templates/users/user_detail.html:173
#: users/templates/users/user_detail.html:175
msgid "Reset MFA"
msgstr "重置MFA"
#: users/templates/users/user_detail.html:182
#: users/templates/users/user_detail.html:184
msgid "Send reset password mail"
msgstr "发送重置密码邮件"
#: users/templates/users/user_detail.html:185
#: users/templates/users/user_detail.html:194
#: users/templates/users/user_detail.html:187
#: users/templates/users/user_detail.html:197
msgid "Send"
msgstr "发送"
#: users/templates/users/user_detail.html:191
#: users/templates/users/user_detail.html:194
msgid "Send reset ssh key mail"
msgstr "发送重置密钥邮件"
#: users/templates/users/user_detail.html:199
#: users/templates/users/user_detail.html:461
#: users/templates/users/user_detail.html:203
#: users/templates/users/user_detail.html:465
msgid "Unblock user"
msgstr "解除登录限制"
#: users/templates/users/user_detail.html:202
#: users/templates/users/user_detail.html:206
msgid "Unblock"
msgstr "解除"
#: users/templates/users/user_detail.html:316
#: users/templates/users/user_detail.html:320
msgid "Goto profile page enable MFA"
msgstr "请去个人信息页面启用自己的MFA"
#: users/templates/users/user_detail.html:372
#: users/templates/users/user_detail.html:376
msgid "An e-mail has been sent to the user`s mailbox."
msgstr "已发送邮件到用户邮箱"
#: users/templates/users/user_detail.html:383
#: users/templates/users/user_detail.html:387
msgid "This will reset the user password and send a reset mail"
msgstr "将失效用户当前密码,并发送重设密码邮件到用户邮箱"
#: users/templates/users/user_detail.html:398
#: users/templates/users/user_detail.html:402
msgid ""
"The reset-ssh-public-key E-mail has been sent successfully. Please inform "
"the user to update his new ssh public key."
msgstr "重设密钥邮件将会发送到用户邮箱"
#: users/templates/users/user_detail.html:399
#: users/templates/users/user_detail.html:403
msgid "Reset SSH public key"
msgstr "重置SSH密钥"
#: users/templates/users/user_detail.html:409
#: users/templates/users/user_detail.html:413
msgid "This will reset the user public key and send a reset mail"
msgstr "将会失效用户当前密钥,并发送重置邮件到用户邮箱"
#: users/templates/users/user_detail.html:427
#: users/templates/users/user_detail.html:431
msgid "Successfully updated the SSH public key."
msgstr "更新ssh密钥成功"
#: users/templates/users/user_detail.html:428
#: users/templates/users/user_detail.html:432
#: users/templates/users/user_detail.html:436
msgid "User SSH public key update"
msgstr "ssh密钥"
#: users/templates/users/user_detail.html:477
#: users/templates/users/user_detail.html:481
msgid "After unlocking the user, the user can log in normally."
msgstr "解除用户登录限制后,此用户即可正常登录"
#: users/templates/users/user_detail.html:491
#: users/templates/users/user_detail.html:495
msgid "Reset user MFA success"
msgstr "重置用户MFA成功"
......@@ -4999,57 +4994,57 @@ msgid ""
"installed, go to the next step directly)."
msgstr "安装完成后点击下一步进入绑定页面(如已安装,直接进入下一步"
#: users/templates/users/user_profile.html:95
#: users/templates/users/user_profile.html:97
msgid "Administrator Settings force MFA login"
msgstr "管理员设置强制使用MFA登录"
#: users/templates/users/user_profile.html:120
#: users/templates/users/user_profile.html:124
msgid "User groups"
msgstr "用户组"
#: users/templates/users/user_profile.html:152
#: users/templates/users/user_profile.html:156
msgid "Set MFA"
msgstr "设置MFA"
#: users/templates/users/user_profile.html:174
#: users/templates/users/user_profile.html:178
msgid "Update password"
msgstr "更改密码"
#: users/templates/users/user_profile.html:184
#: users/templates/users/user_profile.html:188
msgid "Update MFA"
msgstr "更改MFA"
#: users/templates/users/user_profile.html:193
#: users/templates/users/user_profile.html:198
msgid "Update SSH public key"
msgstr "更改SSH密钥"
#: users/templates/users/user_profile.html:201
#: users/templates/users/user_profile.html:206
msgid "Reset public key and download"
msgstr "重置并下载SSH密钥"
#: users/templates/users/user_pubkey_update.html:51
#: users/templates/users/user_pubkey_update.html:55
msgid "Old public key"
msgstr "原来ssh密钥"
#: users/templates/users/user_pubkey_update.html:59
#: users/templates/users/user_pubkey_update.html:63
msgid "Fingerprint"
msgstr "指纹"
#: users/templates/users/user_pubkey_update.html:65
#: users/templates/users/user_pubkey_update.html:69
msgid "Update public key"
msgstr "更新密钥"
#: users/templates/users/user_pubkey_update.html:68
#: users/templates/users/user_pubkey_update.html:72
msgid "Or reset by server"
msgstr "或者重置并下载密钥"
#: users/templates/users/user_pubkey_update.html:94
#: users/templates/users/user_pubkey_update.html:98
msgid ""
"The new public key has been set successfully, Please download the "
"corresponding private key."
msgstr "新的公钥已设置成功,请下载对应的私钥"
#: users/utils.py:24
#: users/utils.py:28
#, python-format
msgid ""
"\n"
......@@ -5094,16 +5089,16 @@ msgstr ""
" </p>\n"
" "
#: users/utils.py:59
#: users/utils.py:63
msgid "Create account successfully"
msgstr "创建账户成功"
#: users/utils.py:63
#: users/utils.py:67
#, python-format
msgid "Hello %(name)s"
msgstr "您好 %(name)s"
#: users/utils.py:86
#: users/utils.py:90
#, python-format
msgid ""
"\n"
......@@ -5147,11 +5142,11 @@ msgstr ""
" </br>\n"
" "
#: users/utils.py:117
#: users/utils.py:121
msgid "Security notice"
msgstr "安全通知"
#: users/utils.py:119
#: users/utils.py:123
#, python-format
msgid ""
"\n"
......@@ -5200,11 +5195,11 @@ msgstr ""
" </br>\n"
" "
#: users/utils.py:155
#: users/utils.py:159
msgid "SSH Key Reset"
msgstr "重置ssh密钥"
#: users/utils.py:157
#: users/utils.py:161
#, python-format
msgid ""
"\n"
......@@ -5229,6 +5224,18 @@ msgstr ""
" </br>\n"
" "
#: users/utils.py:194
msgid "User not exist"
msgstr "用户不存在"
#: users/utils.py:196
msgid "Disabled or expired"
msgstr "禁用或失效"
#: users/utils.py:209
msgid "Password or SSH public key invalid"
msgstr "密码或密钥不合法"
#: users/views/group.py:29
msgid "User group list"
msgstr "用户组列表"
......@@ -5270,47 +5277,47 @@ msgstr "密码不一致"
msgid "First login"
msgstr "首次登录"
#: users/views/user.py:148
#: users/views/user.py:140
msgid "Bulk update user success"
msgstr "批量更新用户成功"
#: users/views/user.py:176
#: users/views/user.py:168
msgid "Bulk update user"
msgstr "批量更新用户"
#: users/views/user.py:219
#: users/views/user.py:211
msgid "User granted assets"
msgstr "用户授权资产"
#: users/views/user.py:252
#: users/views/user.py:244
msgid "Profile setting"
msgstr "个人信息设置"
#: users/views/user.py:271
#: users/views/user.py:264
msgid "Password update"
msgstr "密码更新"
#: users/views/user.py:312
#: users/views/user.py:299
msgid "Public key update"
msgstr "密钥更新"
#: users/views/user.py:354
#: users/views/user.py:341
msgid "Password invalid"
msgstr "用户名或密码无效"
#: users/views/user.py:454
#: users/views/user.py:441
msgid "MFA enable success"
msgstr "MFA 绑定成功"
#: users/views/user.py:455
#: users/views/user.py:442
msgid "MFA enable success, return login page"
msgstr "MFA 绑定成功,返回到登录页面"
#: users/views/user.py:457
#: users/views/user.py:444
msgid "MFA disable success"
msgstr "MFA 解绑成功"
#: users/views/user.py:458
#: users/views/user.py:445
msgid "MFA disable success, return login page"
msgstr "MFA 解绑成功,返回登录页面"
......@@ -5328,6 +5335,7 @@ msgid "* Please enter custom password"
msgstr "* 请输入自定义密码"
#: xpack/plugins/change_auth_plan/forms.py:64
#: xpack/plugins/cloud/serializers.py:73
msgid "* Please enter a valid crontab expression"
msgstr "* 请输入有效的 crontab 表达式"
......@@ -5335,6 +5343,10 @@ msgstr "* 请输入有效的 crontab 表达式"
#: 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
#: xpack/plugins/cloud/forms.py:33 xpack/plugins/cloud/forms.py:81
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_create_update.html:41
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_detail.html:72
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_list.html:16
msgid "Periodic perform"
msgstr "定时执行"
......@@ -5346,11 +5358,11 @@ msgstr ""
"提示:用户名为将要修改的资产上的用户的用户名。如果用户存在,则修改密码;如果"
"用户不存在,则创建用户。"
#: xpack/plugins/change_auth_plan/forms.py:125
#: xpack/plugins/change_auth_plan/forms.py:125 xpack/plugins/cloud/forms.py:84
msgid "Tips: (Units: hour)"
msgstr "提示:(单位: 时)"
#: xpack/plugins/change_auth_plan/forms.py:126
#: xpack/plugins/change_auth_plan/forms.py:126 xpack/plugins/cloud/forms.py:85
msgid ""
"eg: Every Sunday 03:05 run <5 3 * * 0> <br> Tips: Using 5 digits linux "
"crontab expressions <min hour day month week> (<a href='https://tool.lu/"
......@@ -5389,12 +5401,16 @@ msgstr "所有资产使用不同的随机密码"
#: xpack/plugins/change_auth_plan/models.py:76
#: xpack/plugins/change_auth_plan/models.py:145
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_detail.html:100
#: xpack/plugins/cloud/models.py:165 xpack/plugins/cloud/models.py:219
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_detail.html:91
msgid "Cycle perform"
msgstr "周期执行"
#: xpack/plugins/change_auth_plan/models.py:81
#: xpack/plugins/change_auth_plan/models.py:143
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_detail.html:92
#: xpack/plugins/cloud/models.py:170 xpack/plugins/cloud/models.py:217
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_detail.html:83
msgid "Regularly perform"
msgstr "定期执行"
......@@ -5454,10 +5470,12 @@ msgid "Length"
msgstr "长度"
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_detail.html:84
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_detail.html:75
msgid "Yes"
msgstr "是"
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_detail.html:86
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_detail.html:77
msgid "No"
msgstr "否"
......@@ -5475,6 +5493,7 @@ msgid "Execution list of plan"
msgstr "执行列表"
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_execution_list.html:104
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_history.html:89
msgid "Log"
msgstr "日志"
......@@ -5503,15 +5522,15 @@ msgstr "更新计划"
msgid "Plan execution task list"
msgstr "执行任务列表"
#: xpack/plugins/cloud/api.py:61 xpack/plugins/cloud/providers/base.py:84
#: xpack/plugins/cloud/api.py:61 xpack/plugins/cloud/providers/base.py:93
msgid "Account unavailable"
msgstr "账户无效"
#: xpack/plugins/cloud/forms.py:12
#: xpack/plugins/cloud/forms.py:14
msgid "Access Key ID"
msgstr ""
#: xpack/plugins/cloud/forms.py:13
#: xpack/plugins/cloud/forms.py:18
msgid "Access Key Secret"
msgstr ""
......@@ -5536,85 +5555,87 @@ msgid "Select admins"
msgstr "选择管理员"
#: xpack/plugins/cloud/meta.py:9 xpack/plugins/cloud/views.py:27
#: xpack/plugins/cloud/views.py:44 xpack/plugins/cloud/views.py:61
#: xpack/plugins/cloud/views.py:76 xpack/plugins/cloud/views.py:90
#: xpack/plugins/cloud/views.py:107 xpack/plugins/cloud/views.py:129
#: xpack/plugins/cloud/views.py:145 xpack/plugins/cloud/views.py:197
#: xpack/plugins/cloud/views.py:44 xpack/plugins/cloud/views.py:62
#: xpack/plugins/cloud/views.py:78 xpack/plugins/cloud/views.py:92
#: xpack/plugins/cloud/views.py:109 xpack/plugins/cloud/views.py:127
#: xpack/plugins/cloud/views.py:143 xpack/plugins/cloud/views.py:159
#: xpack/plugins/cloud/views.py:211
msgid "Cloud center"
msgstr "云管中心"
#: xpack/plugins/cloud/models.py:44
#: xpack/plugins/cloud/models.py:53
msgid "Available"
msgstr "有效"
#: xpack/plugins/cloud/models.py:45
#: xpack/plugins/cloud/models.py:54
msgid "Unavailable"
msgstr "无效"
#: xpack/plugins/cloud/models.py:50
#: xpack/plugins/cloud/models.py:63
#: xpack/plugins/cloud/templates/cloud/account_detail.html:54
#: xpack/plugins/cloud/templates/cloud/account_list.html:13
msgid "Provider"
msgstr "云服务商"
#: xpack/plugins/cloud/models.py:51
#: xpack/plugins/cloud/models.py:66
msgid "Access key id"
msgstr ""
#: xpack/plugins/cloud/models.py:52
#: xpack/plugins/cloud/models.py:70
msgid "Access key secret"
msgstr ""
#: xpack/plugins/cloud/models.py:60
#: xpack/plugins/cloud/models.py:88
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_create_update.html:30
msgid "Cloud account"
msgstr "云账号"
#: xpack/plugins/cloud/models.py:121
#: xpack/plugins/cloud/models.py:150
msgid "Regions"
msgstr "地域"
#: xpack/plugins/cloud/models.py:122
#: xpack/plugins/cloud/models.py:153
msgid "Instances"
msgstr "实例"
#: xpack/plugins/cloud/models.py:126
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_detail.html:73
#: xpack/plugins/cloud/models.py:176
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_detail.html:97
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_list.html:17
msgid "Date last sync"
msgstr "最后同步日期"
#: xpack/plugins/cloud/models.py:132 xpack/plugins/cloud/models.py:169
#: xpack/plugins/cloud/models.py:187 xpack/plugins/cloud/models.py:274
msgid "Sync instance task"
msgstr "同步实例任务"
#: xpack/plugins/cloud/models.py:165 xpack/plugins/cloud/models.py:179
#: xpack/plugins/cloud/models.py:268 xpack/plugins/cloud/models.py:291
msgid "Succeed"
msgstr "成功"
#: xpack/plugins/cloud/models.py:166
#: xpack/plugins/cloud/models.py:269
msgid "Partial succeed"
msgstr ""
#: xpack/plugins/cloud/models.py:173 xpack/plugins/cloud/models.py:189
#: xpack/plugins/cloud/models.py:284 xpack/plugins/cloud/models.py:316
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_history.html:71
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_instance.html:66
msgid "Date sync"
msgstr "同步日期"
#: xpack/plugins/cloud/models.py:180
#: xpack/plugins/cloud/models.py:292
msgid "Exist"
msgstr "存在"
#: xpack/plugins/cloud/models.py:183
#: xpack/plugins/cloud/models.py:297
msgid "Sync task"
msgstr "同步任务"
#: xpack/plugins/cloud/models.py:184
#: xpack/plugins/cloud/models.py:301
msgid "Sync instance task history"
msgstr "同步实例任务历史"
#: xpack/plugins/cloud/models.py:185
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_detail.html:89
#: xpack/plugins/cloud/models.py:304
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_detail.html:117
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_instance.html:61
msgid "Instance"
msgstr "实例"
......@@ -5636,7 +5657,7 @@ msgid "Qcloud"
msgstr "腾讯云"
#: xpack/plugins/cloud/templates/cloud/account_detail.html:20
#: xpack/plugins/cloud/views.py:77
#: xpack/plugins/cloud/views.py:79
msgid "Account detail"
msgstr "账户详情"
......@@ -5645,35 +5666,52 @@ msgstr "账户详情"
msgid "Create account"
msgstr "创建账户"
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_create.html:91
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_create_update.html:33
msgid "Region & Instance"
msgstr "地域 & 实例"
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_create_update.html:37
msgid "Node & AdminUser"
msgstr "节点 & 管理用户"
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_create_update.html:66
msgid "Loading..."
msgstr "加载中..."
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_create.html:106
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_create_update.html:67
msgid "Load failed"
msgstr "加载失败"
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_detail.html:20
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_history.html:25
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_instance.html:21
#: xpack/plugins/cloud/views.py:130
#: xpack/plugins/cloud/views.py:144
msgid "Sync task detail"
msgstr "同步任务详情"
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_detail.html:23
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_history.html:28
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_instance.html:24
#: xpack/plugins/cloud/views.py:146
#: xpack/plugins/cloud/views.py:160
msgid "Sync task history"
msgstr "同步历史列表"
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_detail.html:26
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_history.html:31
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_instance.html:27
#: xpack/plugins/cloud/views.py:198
#: xpack/plugins/cloud/views.py:212
msgid "Sync instance list"
msgstr "同步实例列表"
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_detail.html:138
msgid "Run task manually"
msgstr "手动执行任务"
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_detail.html:181
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_list.html:98
msgid "Sync success"
msgstr "同步成功"
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_history.html:65
msgid "Total count"
msgstr "总数"
......@@ -5702,22 +5740,22 @@ msgstr "执行次数"
msgid "Instance count"
msgstr "实例个数"
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_list.html:93
msgid "Sync success"
msgstr "同步成功"
#: xpack/plugins/cloud/views.py:62
#: xpack/plugins/cloud/views.py:63
msgid "Update account"
msgstr "更新账户"
#: xpack/plugins/cloud/views.py:91
#: xpack/plugins/cloud/views.py:93
msgid "Sync instance task list"
msgstr "同步实例任务列表"
#: xpack/plugins/cloud/views.py:108
#: xpack/plugins/cloud/views.py:110
msgid "Create sync Instance task"
msgstr "创建同步实例任务"
#: xpack/plugins/cloud/views.py:128
msgid "Update sync Instance task"
msgstr "更新同步实例任务"
#: xpack/plugins/interface/forms.py:17 xpack/plugins/interface/models.py:15
msgid "Title of login page"
msgstr "登录页面标题"
......@@ -5945,18 +5983,6 @@ msgstr "密码匣子"
msgid "vault create"
msgstr "创建"
#~ msgid "Please select assets that need to be updated"
#~ msgstr "请选择需要更新的资产"
#~ msgid "The user {} password has expired, please update."
#~ msgstr "用户 {} 密码已经过期,请更新。"
#~ msgid "User not exist"
#~ msgstr "用户不存在"
#~ msgid "Password or SSH public key invalid"
#~ msgstr "密码或密钥不合法"
#~ msgid "Interface"
#~ msgstr "界面"
......
......@@ -9,13 +9,15 @@ from rest_framework.generics import (
)
from rest_framework.pagination import LimitOffsetPagination
from common.permissions import IsValidUser, IsOrgAdminOrAppUser
from common.permissions import IsValidUser, IsOrgAdminOrAppUser, IsOrgAdmin
from common.tree import TreeNodeSerializer
from common.utils import get_logger
from ..utils import (
AssetPermissionUtil, ParserNode,
)
from .mixin import UserPermissionCacheMixin, GrantAssetsMixin, NodesWithUngroupMixin
from .mixin import (
UserPermissionCacheMixin, GrantAssetsMixin, NodesWithUngroupMixin
)
from .. import const
from ..hands import User, Asset, Node, SystemUser, NodeSerializer
from .. import serializers
......@@ -29,6 +31,7 @@ __all__ = [
'UserGrantedNodesWithAssetsApi', 'UserGrantedNodeAssetsApi',
'ValidateUserAssetPermissionApi', 'UserGrantedNodesAsTreeApi',
'UserGrantedNodesWithAssetsAsTreeApi', 'GetUserAssetPermissionActionsApi',
'RefreshAssetPermissionCacheApi'
]
......@@ -373,3 +376,12 @@ class GetUserAssetPermissionActionsApi(UserPermissionCacheMixin, RetrieveAPIView
actions = asset["system_users"].get(system_id, 0)
break
return {"actions": actions}
class RefreshAssetPermissionCacheApi(RetrieveAPIView):
permission_classes = (IsOrgAdmin,)
def retrieve(self, request, *args, **kwargs):
# expire all cache
AssetPermissionUtil.expire_all_cache()
return Response({'msg': True}, status=200)
......@@ -33,10 +33,14 @@
</div>
</div>
<div class="mail-box-header">
<div class="uc pull-left m-r-5">
<a class="btn btn-sm btn-primary btn-create-permission">
<div class="btn-group uc pull-left m-r-5">
<button class="btn btn-sm btn-primary btn-create-permission">
{% trans "Create permission" %}
</a>
</button>
<button data-toggle="dropdown" class="btn btn-primary btn-sm dropdown-toggle"><span class="caret"></span></button>
<ul class="dropdown-menu">
<li><a class="refresh-asset-permission-cache" href="#">{% trans 'Refresh permission cache' %}</a></li>
</ul>
</div>
<table class="table table-striped table-bordered table-hover" id="permission_list_table" style="width: 100%">
<thead>
......@@ -232,6 +236,14 @@ $(document).ready(function(){
.replace('{{ DEFAULT_PK }}', uid);
objectDelete($this, name, the_url);
})
.on('click', '.refresh-asset-permission-cache', function () {
var the_url = "{% url 'api-perms:refresh-asset-permission-cache' %}";
requestApi({
url: the_url,
method: 'GET',
success_message: "{% trans 'Refresh success' %}"
});
})
.on('click', '.btn-create-permission', function () {
var url = "{% url 'perms:asset-permission-create' %}";
var nodes = zTree.getSelectedNodes();
......
......@@ -57,6 +57,9 @@ asset_permission_urlpatterns = [
# 验证用户是否有某个资产和系统用户的权限
path('asset-permissions/user/validate/', api.ValidateUserAssetPermissionApi.as_view(), name='validate-user-asset-permission'),
path('asset-permissions/user/actions/', api.GetUserAssetPermissionActionsApi.as_view(), name='get-user-asset-permission-actions'),
# 刷新缓存
path('asset-permissions/user/cache/refresh/', api.RefreshAssetPermissionCacheApi.as_view(), name='refresh-asset-permission-cache'),
]
......
......@@ -414,15 +414,12 @@ class AssetPermissionCacheMixin:
cache.delete_pattern(key)
self.expire_cache_meta()
@classmethod
def expire_all_cache_meta(cls):
key = cls.CACHE_META_KEY_PREFIX + '*'
cache.delete_pattern(key)
@classmethod
def expire_all_cache(cls):
key = cls.CACHE_KEY_PREFIX + '*'
cache.delete_pattern(key)
meta_key = cls.CACHE_META_KEY_PREFIX + '*'
cache.delete_pattern(meta_key)
class AssetPermissionUtil(AssetPermissionCacheMixin):
......
......@@ -7,6 +7,7 @@ from django.utils.translation import ugettext_lazy as _
from users.models import User
from users.utils import construct_user_email
from common.utils import get_logger
from common.const import LDAP_AD_ACCOUNT_DISABLE
from .models import settings
......@@ -70,7 +71,12 @@ class LDAPUtil:
for attr, mapping in self.attr_map.items():
if not hasattr(entry, mapping):
continue
user_item[attr] = getattr(entry, mapping).value or ''
value = getattr(entry, mapping).value or ''
if mapping.lower() == 'useraccountcontrol' and attr == 'is_active'\
and value:
value = int(value) & LDAP_AD_ACCOUNT_DISABLE \
!= LDAP_AD_ACCOUNT_DISABLE
user_item[attr] = value
return user_item
def search_user_items(self):
......@@ -102,7 +108,9 @@ class LDAPUtil:
if not hasattr(user, field):
continue
if isinstance(getattr(user, field), bool):
value = value.lower() in ['true', 1]
if isinstance(value, str):
value = value.lower()
value = value in ['true', 1, True]
setattr(user, field, value)
user.save()
......
......@@ -157,7 +157,7 @@ UserProfileForm.verbose_name = _("Profile")
class UserMFAForm(forms.ModelForm):
mfa_description = _(
'Tip: when enabled, '
'When enabled, '
'you will enter the MFA binding process the next time you log in. '
'you can also directly bind in '
'"personal information -> quick modification -> change MFA Settings"!')
......
......@@ -54,6 +54,12 @@ class AuthMixin:
def can_update_password(self):
return self.is_local
def can_update_ssh_key(self):
return self.can_use_ssh_key_login()
def can_use_ssh_key_login(self):
return settings.TERMINAL_PUBLIC_KEY_AUTH
def check_otp(self, code):
from ..utils import check_otp_code
return check_otp_code(self.otp_secret_key, code)
......
......@@ -122,7 +122,7 @@ function initTree() {
$.fn.zTree.init($("#assetTree"), setting, data);
zTree = $.fn.zTree.getZTreeObj("assetTree");
rootNodeAddDom(zTree, function () {
treeUrl = treeUrl.replace('cache_policy=1', 'cache_policy=2');
treeUrl = setUrlParam(treeUrl, 'cache_policy', '2');
initTree();
});
});
......@@ -156,7 +156,7 @@ function loadLabels() {
}
$(document).ready(function () {
loadLabels()
{#loadLabels()#}
}).on('click', '.labels-menu li', function () {
var val = $(this).text();
$("#user_assets_table_filter input").val(val);
......
......@@ -73,14 +73,17 @@
<p id="noTerms" class="red-fonts" style="visibility: hidden; font-size: 10px; margin-top: 10px;">* {% trans 'Please choose the terms and conditions.' %}</p>
{% endif %}
{% if wizard.steps.current == '1' and not request.user.can_update_ssh_key %}
<b id="ssh_key_help_text">{% trans 'User auth from {}, ssh key login is not supported' %}</b>
{% else %}
{% bootstrap_form wizard.form %}
{% endif %}
{% if form.mfa_description %}
<b>{{ form.mfa_description }}</b>
{% endif %}
{% if form.pubkey_description %}
<span>或者:</span>
{% if form.pubkey_description and request.user.can_update_ssh_key %}
<a type="button" id="btn-reset-pubkey">{{ form.pubkey_description }}</a>
{% endif %}
......@@ -121,12 +124,18 @@
{% block custom_foot_js %}
<script>
$(document).on('click', ".fl_goto", function(){
$(document).ready(function(){
var origin_ssh_key_text = $("#ssh_key_help_text").text();
var new_ssh_key_text = origin_ssh_key_text.replace('{}', "{{ request.user.source_display }}");
$("#ssh_key_help_text").html(new_ssh_key_text)
})
.on('click', ".fl_goto", function(){
var $form = $('#fl_form');
$('<input />', {'name': 'wizard_goto_step', 'value': $(this).data('goto'), 'type': 'hidden'}).appendTo($form);
$form.submit();
return false;
}).on('click', '#fl_submit', function(){
})
.on('click', '#fl_submit', function(){
var isFinish = $('#fl_submit').html() === "{% trans 'Finish' %}";
var noChecked = !$('#acceptTerms').prop('checked');
if ( isFinish && noChecked){
......@@ -136,11 +145,12 @@
$('#fl_form').submit();
return false;
}
}).on('click', '#btn-reset-pubkey', function () {
})
.on('click', '#btn-reset-pubkey', function () {
var the_url = '{% url "users:user-pubkey-generate" %}';
window.open(the_url, "_blank");
$('#fl_form').submit();
})
})
</script>
{% endblock %}
......@@ -119,10 +119,12 @@
<td>{% trans 'Last login' %}:</td>
<td><b>{{ user_object.last_login|date:"Y-m-j H:i:s" }}</b></td>
</tr>
{% if user_object.can_update_password %}
<tr>
<td>{% trans 'Last password updated' %}:</td>
<td><b>{{ user_object.date_password_last_updated|date:"Y-m-j H:i:s" }}</b></td>
</tr>
{% endif %}
<tr>
<td>{% trans 'Comment' %}:</td>
<td><b>{{ user_object.comment }}</b></td>
......@@ -187,6 +189,7 @@
</td>
</tr>
{% endif %}
{% if user_object.can_update_ssh_key %}
<tr>
<td>{% trans 'Send reset ssh key mail' %}:</td>
<td>
......@@ -195,6 +198,7 @@
</span>
</td>
</tr>
{% endif %}
<tr style="{% if not unblock %}display:none{% endif %}">
<td>{% trans 'Unblock user' %}</td>
<td>
......
......@@ -34,7 +34,7 @@
<script>
var assetTableUrl = "{% url 'api-perms:user-assets' pk=object.id %}?cache_policy=1";
var selectUrl = '{% url "api-perms:user-node-assets" pk=object.id node_id=DEFAULT_PK %}?cache_policy=1&all=1';
var treeUrl = "{% url 'api-perms:user-nodes-as-tree' pk=object.id %}?&cache_policy=1";
var treeUrl = "{% url 'api-perms:user-nodes-as-tree' pk=object.id %}?cache_policy=1";
$(document).ready(function () {
initTree();
......
......@@ -39,12 +39,16 @@
<li>
<a href="{% url 'users:user-profile-update' %}" class="text-center">{% trans 'Profile' %} </a>
</li>
{% if request.user.can_update_password %}
<li class="active">
<a href="{% url 'users:user-password-update' %}" class="text-center">{% trans 'Password' %} </a>
</li>
{% endif %}
{% if request.user.can_update_ssh_key %}
<li>
<a href="{% url 'users:user-pubkey-update' %}" class="text-center">{% trans 'Public key' %} </a>
</li>
{% endif %}
</ul>
</div>
<div class="tab-content" style="background-color: #ffffff">
......
......@@ -64,6 +64,7 @@
<td>{{ user.is_active|yesno:"Yes,No,Unkown" }}</td>
</tr>
{% if user.can_update_ssh_key %}
<tr>
<td class="text-navy">{% trans 'Public key' %}</td>
<td>
......@@ -81,6 +82,7 @@
</table>
</td>
</tr>
{% endif %}
<tr>
<td class="text-navy">{% trans 'MFA certification' %}</td>
<td>
......@@ -108,10 +110,12 @@
<td class="text-navy">{% trans 'Last login' %}</td>
<td>{{ user.last_login|date:"Y-m-d H:i:s" }}</td>
</tr>
{% if user.can_update_password %}
<tr>
<td class="text-navy">{% trans 'Last password updated' %}</td>
<td>{{ user.date_password_last_updated|date:"Y-m-d H:i:s" }}</td>
</tr>
{% endif %}
<tr>
<td class="text-navy">{% trans 'Date expired' %}</td>
<td>{{ user.date_expired|date:"Y-m-d H:i:s" }}</td>
......@@ -189,6 +193,7 @@
</td>
</tr>
{% endif %}
{% if request.user.can_update_ssh_key %}
<tr>
<td>{% trans 'Update SSH public key' %}:</td>
<td>
......@@ -205,6 +210,7 @@
</span>
</td>
</tr>
{% endif %}
</tbody>
</table>
</div>
......
......@@ -36,12 +36,16 @@
<li class="active">
<a href="{% url 'users:user-profile-update' %}" class="text-center">{% trans 'Profile' %} </a>
</li>
{% if request.user.can_update_password %}
<li>
<a href="{% url 'users:user-password-update' %}" class="text-center">{% trans 'Password' %} </a>
</li>
{% endif %}
{% if request.user.can_update_ssh_key %}
<li>
<a href="{% url 'users:user-pubkey-update' %}" class="text-center">{% trans 'Public key' %} </a>
</li>
{% endif %}
</ul>
</div>
<div class="tab-content" style="background-color: #ffffff">
......
......@@ -36,12 +36,16 @@
<li>
<a href="{% url 'users:user-profile-update' %}" class="text-center">{% trans 'Profile' %} </a>
</li>
{% if request.user.can_update_password %}
<li>
<a href="{% url 'users:user-password-update' %}" class="text-center">{% trans 'Password' %} </a>
</li>
{% endif %}
{% if request.user.can_update_ssh_key %}
<li class="active">
<a href="{% url 'users:user-pubkey-update' %}" class="text-center">{% trans 'Public key' %} </a>
</li>
{% endif %}
</ul>
</div>
<div class="tab-content" style="background-color: #ffffff">
......
......@@ -23,7 +23,16 @@
</div>
</div>
{% endif %}
{% if object.can_update_ssh_key %}
{% bootstrap_field form.public_key layout="horizontal" %}
{% else %}
<div class="form-group">
<label class="col-sm-2 control-label">{% trans 'ssh public key' %}</label>
<div class="col-sm-8 controls" style="margin-top: 8px;" id="ssh_key_help_text">
{% trans 'User auth from {}, ssh key login is not supported' %}
</div>
</div>
{% endif %}
{% endblock %}
{% block custom_foot_js %}
......@@ -77,9 +86,13 @@ function passwordCheck() {
$(document).ready(function(){
passwordCheck();
var origin_text = $("#password_help_text").text();
var new_text = origin_text.replace('{}', "{{ object.source_display }}");
$("#password_help_text").html(new_text);
var origin_password_text = $("#password_help_text").text();
var new_password_text = origin_password_text.replace('{}', "{{ object.source_display }}");
$("#password_help_text").html(new_password_text);
var origin_ssh_key_text = $("#ssh_key_help_text").text();
var new_ssh_key_text = origin_ssh_key_text.replace('{}', "{{ object.source_display }}");
$("#ssh_key_help_text").html(new_ssh_key_text)
})
.on("submit", "form", function (evt) {
......
......@@ -2,40 +2,32 @@
from __future__ import unicode_literals
import json
import uuid
import csv
import codecs
import chardet
from io import StringIO
from django.contrib import messages
from django.contrib.auth import authenticate, login as auth_login
from django.contrib.auth import authenticate
from django.contrib.messages.views import SuccessMessageMixin
from django.core.cache import cache
from django.conf import settings
from django.http import HttpResponse, JsonResponse
from django.http import HttpResponse
from django.shortcuts import redirect
from django.urls import reverse_lazy, reverse
from django.utils import timezone
from django.utils.translation import ugettext as _
from django.utils.decorators import method_decorator
from django.views import View
from django.views.generic.base import TemplateView
from django.db import transaction
from django.views.generic.edit import (
CreateView, UpdateView, FormView
)
from django.views.generic.detail import DetailView
from django.views.decorators.csrf import csrf_exempt
from django.contrib.auth import logout as auth_logout
from common.const import (
create_success_msg, update_success_msg, KEY_CACHE_RESOURCES_ID
)
from common.mixins import JSONResponseMixin
from common.utils import get_logger, get_object_or_none, is_uuid, ssh_key_gen
from common.permissions import PermissionsMixin, IsOrgAdmin, IsValidUser
from common.utils import get_logger, ssh_key_gen
from common.permissions import (
PermissionsMixin, IsOrgAdmin, IsValidUser,
UserCanUpdatePassword, UserCanUpdateSSHKey,
)
from orgs.utils import current_org
from .. import forms
from ..models import User, UserGroup
......@@ -260,6 +252,7 @@ class UserPasswordUpdateView(PermissionsMixin, UpdateView):
model = User
form_class = forms.UserPasswordForm
success_url = reverse_lazy('users:user-profile')
permission_classes = [IsValidUser, UserCanUpdatePassword]
def get_object(self, queryset=None):
return self.request.user
......@@ -279,12 +272,6 @@ class UserPasswordUpdateView(PermissionsMixin, UpdateView):
return super().get_success_url()
def form_valid(self, form):
if not self.request.user.can_update_password():
error = _("User auth from {}, go there change password").format(
self.request.source_display
)
form.add_error("password", error)
return self.form_invalid(form)
password = form.cleaned_data.get('new_password')
is_ok = check_password_rules(password)
if not is_ok:
......@@ -300,7 +287,7 @@ class UserPublicKeyUpdateView(PermissionsMixin, UpdateView):
template_name = 'users/user_pubkey_update.html'
model = User
form_class = forms.UserPublicKeyForm
permission_classes = [IsValidUser]
permission_classes = [IsValidUser, UserCanUpdateSSHKey]
success_url = reverse_lazy('users:user-profile')
def get_object(self, queryset=None):
......
......@@ -81,7 +81,7 @@ def make_migrations():
def collect_static():
print("Collect static files")
os.chdir(os.path.join(BASE_DIR, 'apps'))
subprocess.call('python3 manage.py collectstatic --no-input', shell=True)
subprocess.call('python3 manage.py collectstatic --no-input -c &> /dev/null && echo "Collect static file done"', shell=True)
def prepare():
......
tiff-dev jpeg-dev zlib-dev freetype-dev lcms-dev libwebp-dev tcl-dev tk-dev python3-dev libressl-dev openldap-dev cyrus-sasl-dev krb5-dev sshpass postgresql-dev mariadb-dev sqlite-dev libffi-dev openssh-client
tiff-dev jpeg-dev zlib-dev freetype-dev lcms-dev libwebp-dev tcl-dev tk-dev python3-dev libressl-dev openldap-dev cyrus-sasl-dev krb5-dev sshpass postgresql-dev mariadb-dev sqlite-dev libffi-dev openssh-client gcc libc-dev linux-headers make autoconf
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment