mirror of https://github.com/jumpserver/jumpserver
Merge branch 'master' into dev
commit
d1ac7ca647
|
@ -36,9 +36,10 @@ Web批量执行命令
|
||||||
### 文档
|
### 文档
|
||||||
|
|
||||||
* [访问wiki](https://github.com/ibuler/jumpserver/wiki)
|
* [访问wiki](https://github.com/ibuler/jumpserver/wiki)
|
||||||
* [快速安装](https://github.com/ibuler/jumpserver/wiki/快速安装)
|
* [快速安装](https://github.com/ibuler/jumpserver/wiki/Quickinstall)
|
||||||
* [名词解释](https://github.com/ibuler/jumpserver/wiki/名称解释)
|
* [名词解释](https://github.com/ibuler/jumpserver/wiki/Termexplain)
|
||||||
* [快速开始](https://github.com/ibuler/jumpserver/wiki/快速开始)
|
* [快速开始](https://github.com/ibuler/jumpserver/wiki/Quickstart)
|
||||||
|
* [FAQ](https://github.com/ibuler/jumpserver/wiki/FAQs)
|
||||||
|
|
||||||
### 特点
|
### 特点
|
||||||
|
|
||||||
|
|
|
@ -527,7 +527,7 @@ class Nav(object):
|
||||||
user_asset_search = user_asset_all
|
user_asset_search = user_asset_all
|
||||||
|
|
||||||
self.search_result = dict(zip(range(len(user_asset_search)), user_asset_search))
|
self.search_result = dict(zip(range(len(user_asset_search)), user_asset_search))
|
||||||
color_print('[%-3s] %-12s %-15s %-5s %-10s %s' % ('ID', u'主机名', 'IP', u'端口', u'系统用户', u'备注'), 'title')
|
color_print('[%-3s] %-12s %-15s %-5s %-10s %s' % ('ID', '主机名', 'IP', '端口', '系统用户', '备注'), 'title')
|
||||||
for index, asset in self.search_result.items():
|
for index, asset in self.search_result.items():
|
||||||
# 获取该资产信息
|
# 获取该资产信息
|
||||||
asset_info = get_asset_info(asset)
|
asset_info = get_asset_info(asset)
|
||||||
|
@ -734,7 +734,7 @@ def main():
|
||||||
主程序
|
主程序
|
||||||
"""
|
"""
|
||||||
if not login_user: # 判断用户是否存在
|
if not login_user: # 判断用户是否存在
|
||||||
color_print(u'没有该用户,或许你是以root运行的 No that user.', exits=True)
|
color_print('没有该用户,或许你是以root运行的 No that user.', exits=True)
|
||||||
|
|
||||||
gid_pattern = re.compile(r'^g\d+$')
|
gid_pattern = re.compile(r'^g\d+$')
|
||||||
nav = Nav(login_user)
|
nav = Nav(login_user)
|
||||||
|
|
|
@ -109,7 +109,7 @@ class PreSetup(object):
|
||||||
|
|
||||||
def _test_db_conn(self):
|
def _test_db_conn(self):
|
||||||
try:
|
try:
|
||||||
MySQLdb.connect(host=self.db_host, port=self.db_port,
|
MySQLdb.connect(host=self.db_host, port=int(self.db_port),
|
||||||
user=self.db_user, passwd=self.db_pass, db=self.db)
|
user=self.db_user, passwd=self.db_pass, db=self.db)
|
||||||
color_print('连接数据库成功', 'green')
|
color_print('连接数据库成功', 'green')
|
||||||
return True
|
return True
|
||||||
|
@ -157,7 +157,7 @@ class PreSetup(object):
|
||||||
self._setup_mysql()
|
self._setup_mysql()
|
||||||
else:
|
else:
|
||||||
db_host = raw_input('请输入数据库服务器IP [127.0.0.1]: ')
|
db_host = raw_input('请输入数据库服务器IP [127.0.0.1]: ')
|
||||||
db_port = int(raw_input('请输入数据库服务器端口 [3306]: '))
|
db_port = raw_input('请输入数据库服务器端口 [3306]: ')
|
||||||
db_user = raw_input('请输入数据库服务器用户 [root]: ')
|
db_user = raw_input('请输入数据库服务器用户 [root]: ')
|
||||||
db_pass = raw_input('请输入数据库服务器密码: ')
|
db_pass = raw_input('请输入数据库服务器密码: ')
|
||||||
db = raw_input('请输入使用的数据库 [jumpserver]: ')
|
db = raw_input('请输入使用的数据库 [jumpserver]: ')
|
||||||
|
|
|
@ -539,7 +539,7 @@ def perm_role_push(request):
|
||||||
if not failed_asset:
|
if not failed_asset:
|
||||||
msg = u'系统用户 %s 推送成功[ %s ]' % (role.name, ','.join(success_asset.keys()))
|
msg = u'系统用户 %s 推送成功[ %s ]' % (role.name, ','.join(success_asset.keys()))
|
||||||
else:
|
else:
|
||||||
error = u'系统用户 %s 推送失败 [ %s ], 推送成功 [ %s ]' % (role.name,
|
error = u'系统用户 %s 推送失败 [ %s ], 推送成功 [ %s ] 进入系统用户详情,查看失败原因' % (role.name,
|
||||||
','.join(failed_asset.keys()),
|
','.join(failed_asset.keys()),
|
||||||
','.join(success_asset.keys()))
|
','.join(success_asset.keys()))
|
||||||
return my_render('jperm/perm_role_push.html', locals(), request)
|
return my_render('jperm/perm_role_push.html', locals(), request)
|
||||||
|
|
|
@ -67,7 +67,7 @@
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<select name="asset" id="asset" data-placeholder="请选择资产" class="chosen-select form-control m-b" multiple tabindex="2">
|
<select name="asset" id="asset" data-placeholder="请选择资产" class="chosen-select form-control m-b" multiple tabindex="2">
|
||||||
{% for asset in assets %}
|
{% for asset in assets %}
|
||||||
<option value="{{ asset.id }}"{% if asset in rule.asset.all %} selected {% endif %}>{{ asset.ip }}</option>
|
<option value="{{ asset.id }}"{% if asset in rule.asset.all %} selected {% endif %}>{{ asset.hostname }}</option>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</select>
|
</select>
|
||||||
<span class="help-block m-b-none">资产和资产组必选一个</span>
|
<span class="help-block m-b-none">资产和资产组必选一个</span>
|
||||||
|
|
|
@ -113,12 +113,12 @@ $('#userForm').validator({
|
||||||
|
|
||||||
$("document").ready(function() {
|
$("document").ready(function() {
|
||||||
$("#regen_ssh_key").click(function () {
|
$("#regen_ssh_key").click(function () {
|
||||||
alert('申请已提交,请等待,请勿重复提交');
|
layer.alert('申请已提交,请等待,请勿重复提交');
|
||||||
$.get(
|
$.get(
|
||||||
$(this).attr('value'),
|
$(this).attr('value'),
|
||||||
{},
|
{},
|
||||||
function(data){
|
function(data){
|
||||||
alert(data)
|
layer.alert(data)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue