Merge branch 'master' into dev

pull/71/head
ibuler 2015-12-31 10:20:08 +08:00
commit d1ac7ca647
6 changed files with 12 additions and 11 deletions

View File

@ -36,9 +36,10 @@ Web批量执行命令
### 文档
* [访问wiki](https://github.com/ibuler/jumpserver/wiki)
* [快速安装](https://github.com/ibuler/jumpserver/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/Termexplain)
* [快速开始](https://github.com/ibuler/jumpserver/wiki/Quickstart)
* [FAQ](https://github.com/ibuler/jumpserver/wiki/FAQs)
### 特点

View File

@ -527,7 +527,7 @@ class Nav(object):
user_asset_search = user_asset_all
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():
# 获取该资产信息
asset_info = get_asset_info(asset)
@ -734,7 +734,7 @@ def main():
主程序
"""
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+$')
nav = Nav(login_user)

View File

@ -109,7 +109,7 @@ class PreSetup(object):
def _test_db_conn(self):
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)
color_print('连接数据库成功', 'green')
return True
@ -157,7 +157,7 @@ class PreSetup(object):
self._setup_mysql()
else:
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_pass = raw_input('请输入数据库服务器密码: ')
db = raw_input('请输入使用的数据库 [jumpserver]: ')

View File

@ -539,7 +539,7 @@ def perm_role_push(request):
if not failed_asset:
msg = u'系统用户 %s 推送成功[ %s ]' % (role.name, ','.join(success_asset.keys()))
else:
error = u'系统用户 %s 推送失败 [ %s ], 推送成功 [ %s ]' % (role.name,
error = u'系统用户 %s 推送失败 [ %s ], 推送成功 [ %s ] 进入系统用户详情,查看失败原因' % (role.name,
','.join(failed_asset.keys()),
','.join(success_asset.keys()))
return my_render('jperm/perm_role_push.html', locals(), request)

View File

@ -67,7 +67,7 @@
<div class="col-sm-8">
<select name="asset" id="asset" data-placeholder="请选择资产" class="chosen-select form-control m-b" multiple tabindex="2">
{% 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 %}
</select>
<span class="help-block m-b-none">资产和资产组必选一个</span>

View File

@ -113,12 +113,12 @@ $('#userForm').validator({
$("document").ready(function() {
$("#regen_ssh_key").click(function () {
alert('申请已提交,请等待,请勿重复提交');
layer.alert('申请已提交,请等待,请勿重复提交');
$.get(
$(this).attr('value'),
{},
function(data){
alert(data)
layer.alert(data)
}
)
})