mirror of https://github.com/jumpserver/jumpserver
commit
ece9b16351
|
@ -98,4 +98,5 @@ class TreeNodeSerializer(serializers.Serializer):
|
||||||
isParent = serializers.BooleanField(default=False)
|
isParent = serializers.BooleanField(default=False)
|
||||||
open = serializers.BooleanField(default=False)
|
open = serializers.BooleanField(default=False)
|
||||||
iconSkin = serializers.CharField(max_length=128, allow_blank=True)
|
iconSkin = serializers.CharField(max_length=128, allow_blank=True)
|
||||||
|
nocheck = serializers.BooleanField(default=False)
|
||||||
meta = serializers.JSONField()
|
meta = serializers.JSONField()
|
||||||
|
|
|
@ -15,7 +15,7 @@ def jumpserver_processor(request):
|
||||||
'FAVICON_URL': static('img/facio.ico'),
|
'FAVICON_URL': static('img/facio.ico'),
|
||||||
'JMS_TITLE': 'Jumpserver',
|
'JMS_TITLE': 'Jumpserver',
|
||||||
'VERSION': settings.VERSION,
|
'VERSION': settings.VERSION,
|
||||||
'COPYRIGHT': 'FIT2CLOUD 飞致云' + ' © 2014-2019',
|
'COPYRIGHT': 'FIT2CLOUD 飞致云' + ' © 2014-2020',
|
||||||
'SECURITY_COMMAND_EXECUTION': settings.SECURITY_COMMAND_EXECUTION,
|
'SECURITY_COMMAND_EXECUTION': settings.SECURITY_COMMAND_EXECUTION,
|
||||||
'SECURITY_MFA_VERIFY_TTL': settings.SECURITY_MFA_VERIFY_TTL,
|
'SECURITY_MFA_VERIFY_TTL': settings.SECURITY_MFA_VERIFY_TTL,
|
||||||
'FORCE_SCRIPT_NAME': settings.FORCE_SCRIPT_NAME,
|
'FORCE_SCRIPT_NAME': settings.FORCE_SCRIPT_NAME,
|
||||||
|
|
Binary file not shown.
|
@ -8,7 +8,7 @@ msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: Jumpserver 0.3.3\n"
|
"Project-Id-Version: Jumpserver 0.3.3\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2020-01-14 16:52+0800\n"
|
"POT-Creation-Date: 2020-01-15 12:40+0800\n"
|
||||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
"Last-Translator: ibuler <ibuler@qq.com>\n"
|
"Last-Translator: ibuler <ibuler@qq.com>\n"
|
||||||
"Language-Team: Jumpserver team<ibuler@qq.com>\n"
|
"Language-Team: Jumpserver team<ibuler@qq.com>\n"
|
||||||
|
@ -3222,33 +3222,37 @@ msgstr "任务列表"
|
||||||
msgid "Go"
|
msgid "Go"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ops/templates/ops/command_execution_create.html:179
|
#: ops/templates/ops/command_execution_create.html:159
|
||||||
|
msgid "Asset configuration does not include the SSH protocol"
|
||||||
|
msgstr "资产配置不包含 SSH 协议"
|
||||||
|
|
||||||
|
#: ops/templates/ops/command_execution_create.html:183
|
||||||
msgid "Selected assets"
|
msgid "Selected assets"
|
||||||
msgstr "已选择资产"
|
msgstr "已选择资产"
|
||||||
|
|
||||||
#: ops/templates/ops/command_execution_create.html:182
|
#: ops/templates/ops/command_execution_create.html:186
|
||||||
msgid "In total"
|
msgid "In total"
|
||||||
msgstr "总共"
|
msgstr "总共"
|
||||||
|
|
||||||
#: ops/templates/ops/command_execution_create.html:219
|
#: ops/templates/ops/command_execution_create.html:223
|
||||||
msgid ""
|
msgid ""
|
||||||
"Select the left asset, select the running system user, execute command in "
|
"Select the left asset, select the running system user, execute command in "
|
||||||
"batch"
|
"batch"
|
||||||
msgstr "选择左侧资产, 选择运行的系统用户,批量执行命令"
|
msgstr "选择左侧资产, 选择运行的系统用户,批量执行命令"
|
||||||
|
|
||||||
#: ops/templates/ops/command_execution_create.html:263
|
#: ops/templates/ops/command_execution_create.html:267
|
||||||
msgid "Unselected assets"
|
msgid "Unselected assets"
|
||||||
msgstr "没有选中资产"
|
msgstr "没有选中资产"
|
||||||
|
|
||||||
#: ops/templates/ops/command_execution_create.html:267
|
#: ops/templates/ops/command_execution_create.html:271
|
||||||
msgid "No input command"
|
msgid "No input command"
|
||||||
msgstr "没有输入命令"
|
msgstr "没有输入命令"
|
||||||
|
|
||||||
#: ops/templates/ops/command_execution_create.html:271
|
#: ops/templates/ops/command_execution_create.html:275
|
||||||
msgid "No system user was selected"
|
msgid "No system user was selected"
|
||||||
msgstr "没有选择系统用户"
|
msgstr "没有选择系统用户"
|
||||||
|
|
||||||
#: ops/templates/ops/command_execution_create.html:281
|
#: ops/templates/ops/command_execution_create.html:285
|
||||||
msgid "Pending"
|
msgid "Pending"
|
||||||
msgstr "等待"
|
msgstr "等待"
|
||||||
|
|
||||||
|
|
|
@ -86,7 +86,7 @@
|
||||||
<div class="col-sm-2">
|
<div class="col-sm-2">
|
||||||
<select class="select2 form-control" id="system-users-select">
|
<select class="select2 form-control" id="system-users-select">
|
||||||
{% for s in system_users %}
|
{% for s in system_users %}
|
||||||
<option value="{{ s.id }}" {% if s.protocol != 'ssh' or s.login_mode != 'auto' %}disabled{% endif %}>{{ s }}</option>
|
<option value="{{ s.id }}" {% if s.login_mode == 'manual' or s.protocol in 'mysql|telnet|vnc'%}disabled{% endif %}>{{ s }}</option>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</select>
|
</select>
|
||||||
<button type="button" class="btn btn-primary btn-execute" style="margin-top: 30px; width: 100%">
|
<button type="button" class="btn btn-primary btn-execute" style="margin-top: 30px; width: 100%">
|
||||||
|
@ -138,11 +138,11 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
callback: {
|
callback: {
|
||||||
onCheck: onCheck
|
onCheck: onCheck,
|
||||||
|
onClick: onClick,
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
$.get(url, function (data, status) {
|
$.get(url, function (data, status) {
|
||||||
$.fn.zTree.init($("#assetTree"), setting, data);
|
$.fn.zTree.init($("#assetTree"), setting, data);
|
||||||
zTree = $.fn.zTree.getZTreeObj("assetTree");
|
zTree = $.fn.zTree.getZTreeObj("assetTree");
|
||||||
|
@ -152,25 +152,29 @@
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
function onClick(event, treeId, treeNode, clickFlag){
|
||||||
|
if (treeNode.meta.type === 'asset'){
|
||||||
|
let protocolsStr = treeNode.meta.asset.protocols + '';
|
||||||
|
if (protocolsStr.indexOf('ssh/') === -1){
|
||||||
|
toastr.warning("{% trans "Asset configuration does not include the SSH protocol" %}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
function getSelectedAssetsNode() {
|
function getSelectedAssetsNode() {
|
||||||
var nodes = zTree.getCheckedNodes(true);
|
var nodes = zTree.getCheckedNodes(true);
|
||||||
var assetsNodeId = [];
|
var assetsNodeId = [];
|
||||||
var assetsNode = [];
|
var assetsNode = [];
|
||||||
nodes.forEach(function (node) {
|
nodes.forEach(function (node) {
|
||||||
if (node.meta.type === 'asset' && !node.isHidden) {
|
if (node.meta.type === 'asset' && !node.isHidden) {
|
||||||
var protocols = node.meta.asset.protocols;
|
var protocolsStr = node.meta.asset.protocols + '';
|
||||||
protocols.forEach(function (val) {
|
if (assetsNodeId.indexOf(node.id) === -1 && protocolsStr.indexOf('ssh') > -1){
|
||||||
if (assetsNodeId.indexOf(node.id) === -1 && val.indexOf("ssh") > -1) {
|
|
||||||
assetsNodeId.push(node.id);
|
assetsNodeId.push(node.id);
|
||||||
assetsNode.push(node)
|
assetsNode.push(node)
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return assetsNode;
|
return assetsNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
function onCheck(e, treeId, treeNode) {
|
function onCheck(e, treeId, treeNode) {
|
||||||
var nodes = getSelectedAssetsNode();
|
var nodes = getSelectedAssetsNode();
|
||||||
var nodes_names = nodes.map(function (node) {
|
var nodes_names = nodes.map(function (node) {
|
||||||
|
|
|
@ -481,6 +481,7 @@ class ParserNode:
|
||||||
'isParent': False,
|
'isParent': False,
|
||||||
'open': False,
|
'open': False,
|
||||||
'iconSkin': icon_skin,
|
'iconSkin': icon_skin,
|
||||||
|
'nocheck': not asset.has_protocol('ssh'),
|
||||||
'meta': {
|
'meta': {
|
||||||
'type': 'asset',
|
'type': 'asset',
|
||||||
'asset': {
|
'asset': {
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
from django.db.models import Q
|
from django.db.models import Q
|
||||||
|
from django.utils.translation import ugettext as _
|
||||||
from orgs.utils import set_to_root_org
|
from orgs.utils import set_to_root_org
|
||||||
|
|
||||||
from ..models import DatabaseAppPermission
|
from ..models import DatabaseAppPermission
|
||||||
|
@ -16,7 +17,6 @@ __all__ = [
|
||||||
'parse_database_app_to_tree_node'
|
'parse_database_app_to_tree_node'
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
def get_user_database_app_permissions(user, include_group=True):
|
def get_user_database_app_permissions(user, include_group=True):
|
||||||
if include_group:
|
if include_group:
|
||||||
groups = user.groups.all()
|
groups = user.groups.all()
|
||||||
|
@ -73,7 +73,7 @@ class DatabaseAppPermissionUtil:
|
||||||
def construct_database_apps_tree_root():
|
def construct_database_apps_tree_root():
|
||||||
tree_root = {
|
tree_root = {
|
||||||
'id': 'ID_DATABASE_APP_ROOT',
|
'id': 'ID_DATABASE_APP_ROOT',
|
||||||
'name': 'DatabaseApp',
|
'name': _('DatabaseApp'),
|
||||||
'title': 'DatabaseApp',
|
'title': 'DatabaseApp',
|
||||||
'pId': '',
|
'pId': '',
|
||||||
'open': False,
|
'open': False,
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
from django.db.models import Q
|
from django.db.models import Q
|
||||||
|
from django.utils.translation import ugettext as _
|
||||||
|
|
||||||
from common.tree import TreeNode
|
from common.tree import TreeNode
|
||||||
from orgs.utils import set_to_root_org
|
from orgs.utils import set_to_root_org
|
||||||
|
@ -72,7 +73,7 @@ class RemoteAppPermissionUtil:
|
||||||
def construct_remote_apps_tree_root():
|
def construct_remote_apps_tree_root():
|
||||||
tree_root = {
|
tree_root = {
|
||||||
'id': 'ID_REMOTE_APP_ROOT',
|
'id': 'ID_REMOTE_APP_ROOT',
|
||||||
'name': 'RemoteApp',
|
'name': _('RemoteApp'),
|
||||||
'title': 'RemoteApp',
|
'title': 'RemoteApp',
|
||||||
'pId': '',
|
'pId': '',
|
||||||
'open': False,
|
'open': False,
|
||||||
|
|
Loading…
Reference in New Issue