Merge branches 'guanghongwei' and 'wangyong' of gitcafe.com:ibuler/jumpserver into guanghongwei

pull/6/head
guanghongwei 10 years ago
commit 81f80b4b0c

@ -5,7 +5,9 @@ from django.shortcuts import render_to_response
from django.core.paginator import Paginator, EmptyPage
from models import IDC, Asset, BisGroup
from juser.models import UserGroup
from connect import PyCrypt, KEY
from jpermission.models import Permission
cryptor = PyCrypt(KEY)
@ -20,6 +22,7 @@ def jadd_host(request):
groups = []
eidc = IDC.objects.all()
egroup = BisGroup.objects.all()
eusergroup = UserGroup.objects.all()
if request.method == 'POST':
j_ip = request.POST.get('j_ip')

@ -0,0 +1,8 @@
PS1='[\u@192.168.196.73 \W]\$ '
Last login: Sun Jan 4 13:30:11 2015 from 192.168.199.162
clear;echo -e '\033[32mLogin 192.168.196.73 done. Enjoy it.\033[0m'
[halcyon@localhost ~]$ PS1='[\u@192.168.196.73 \W]\$ '
[halcyon@192.168.196.73 ~]$ clear;echo -e '\033[32mLogin 192.168.196.73 done. Enjoy it.\033[0m'
Login 192.168.196.73 done. Enjoy it.
[halcyon@192.168.196.73 ~]$ ls
[halcyon@192.168.196.73 ~]$

@ -74,7 +74,6 @@
form.submit();
}
});
</script>
{% endblock %}

@ -103,6 +103,16 @@
</div>
</div>
<div class="hr-line-dashed"></div>
<div class="form-group">
<label for="j_group" class="col-sm-2 control-label"> 所属用户组 </label>
<div class="col-sm-8">
{% for g in eusergroup %}
<label class="checkbox-inline"><input type="checkbox" id="j_usergroup" value="{{ g }}" name="j_usergroup"> {{ g }} </label>
{% endfor %}
</div>
</div>
<div class="hr-line-dashed"></div>
<div class="form-group"><label class="col-sm-2 control-label"> 是否激活 </label>
<div class="col-sm-8">
@ -169,6 +179,12 @@ $('#assetForm').validator({
ok: "",
msg: {checked: "至少选择一个组"}
},
"j_usergroup": {
rule: "checked",
tip: "选择用户组",
ok: "",
msg: {checked: "至少选择一个组"}
},
"j_user": {
rule: "required(type_m)",
tip: "普通用户名",

@ -49,7 +49,7 @@
<div class="col-sm-8">
{% for t, type in login_types.items %}
{% ifequal t post.login_type %}
<div class="radio i-checks"><label> <input type="radio" id="{{ t }}" checked value="{{ t }}" name="j_type" onclick="show(this)"> <i> {{ type }} </i></label></div>
<div class="radio i-checks"><label> <input type="radio" id="{{ t }}" checked="" value="{{ t }}" name="j_type" onclick="show(this)"> <i> {{ type }} </i></label></div>
{% else %}
<div class="radio i-checks"><label> <input type="radio" id="{{ t }}" value="{{ t }}" name="j_type" onclick="show(this)"> <i> {{ type }} </i></label></div>
{% endifequal %}
@ -58,22 +58,22 @@
<div name="a1" id=a1 style="display:none;">
<div class="form-group"><label class="col-sm-2 col-sm-offset-1 control-label"> 普通用户名 </label>
<div class="col-sm-6"><input type="text" value="{{ post.username_common }}" name="j_user" placeholder="lilei" class="form-control"></div>
<div class="col-sm-6"><input type="text" name="j_user" placeholder="lilei" class="form-control"></div>
</div>
<div class="hr-line-dashed"></div>
<div class="form-group"><label class="col-sm-2 col-sm-offset-1 control-label"> 普通用户密码 </label>
<div class="col-sm-6"><input type="password" value="{{ post.password_common }}" name="j_password" placeholder="Password" class="form-control"></div>
<div class="col-sm-6"><input type="password" name="j_password" placeholder="Password" class="form-control"></div>
</div>
<div class="hr-line-dashed"></div>
<div class="form-group"><label class="col-sm-2 col-sm-offset-1 control-label"> 超管用户名 </label>
<div class="col-sm-6"><input type="text" value="{{ post.username_super }}" name="j_root" placeholder="root" class="form-control"></div>
<div class="col-sm-6"><input type="text" name="j_root" placeholder="root" class="form-control"></div>
</div>
<div class="hr-line-dashed"></div>
<div class="form-group"><label class="col-sm-2 col-sm-offset-1 control-label"> 超管用户密码 </label>
<div class="col-sm-6"><input type="password" value="{{ post.password_super }}" name="j_passwd" placeholder="Password" class="form-control"></div>
<div class="col-sm-6"><input type="password" name="j_passwd" placeholder="Password" class="form-control"></div>
</div>
</div>
@ -212,4 +212,5 @@ $('#assetForm').validator({
</script>
{% endblock %}

@ -71,23 +71,34 @@
{% endfor %}
</tbody>
</table>
<div class="row">
<div class="col-sm-6">
<div class="dataTables_info" id="editable_info" role="status" aria-live="polite">
Showing {{ contacts.start_index }} to {{ contacts.end_index }} of {{ p.count }} entries
</div>
</div>
<div class="col-sm-6">
<div class="dataTables_paginate paging_simple_numbers" id="editable_paginate">
<ul class="pagination" style="margin-top: 0; float: right">
<ul class="pagination">
{% if contacts.has_previous %}
<li><a href="?page={{ contacts.previous_page_number }}">&laquo;</a></li>
{% endif %}
{% if contacts.has_previous %}
<li><a href="?page={{ contacts.previous_page_number }}">&laquo;</a></li>
{% endif %}
{% for page in p.page_range %}
{% ifequal offset1 page %}
<li class="active"><a href="?page={{ page }}" title="第{{ page }}页">{{ page }}</a></li>
{% else %}
<li><a href="?page={{ page }}" title="第{{ page }}页">{{ page }}</a></li>
{% endifequal %}
{% endfor %}
{% if contacts.has_next %}
<li><a href="?page={{ contacts.next_page_number }}">&raquo;</a></li>
{% endif %}
</ul>
{% for page in p.page_range %}
{% ifequal offset1 page %}
<li class="active"><a href="?page={{ page }}" title="第{{ page }}页">{{ page }}</a></li>
{% else %}
<li><a href="?page={{ page }}" title="第{{ page }}页">{{ page }}</a></li>
{% endifequal %}
{% endfor %}
{% if contacts.has_next %}
<li><a href="?page={{ contacts.next_page_number }}">&raquo;</a></li>
{% endif %}
</ul>
</div>
</div>
</div>
</div>
</div>
</div>

@ -11,27 +11,27 @@
<li ><a href="dashboard_3.html">Dashboard v.3</a></li>
</ul>-->
</li>
<li>
<li id="juser">
<a href="#"><i class="fa fa-rebel"></i> <span class="nav-label">用户管理</span><span class="fa arrow"></span></a>
<ul class="nav nav-second-level">
<li><a href="/juser/user_list/">查看用户</a></li>
<li><a href="/juser/user_add/">添加用户</a></li>
<li><a href="/juser/group_list/">查看属组</a></li>
<li><a href="/juser/group_add/">添加属组</a></li>
<li id="user_list"><a href="/juser/user_list/">查看用户</a></li>
<li id="user_add"><a href="/juser/user_add/">添加用户</a></li>
<li id="group_list"><a href="/juser/group_list/">查看属组</a></li>
<li id="group_add"><a href="/juser/group_add/">添加属组</a></li>
</ul>
</li>
<li>
<li id="jasset">
<a href="mailbox.html"><i class="fa fa-cube"></i> <span class="nav-label">资产管理</span><span class="fa arrow"></span></a>
<ul class="nav nav-second-level">
<li><a href="/jasset/host_list/">查看资产</a></li>
<li><a href="/jasset/host_add/">添加资产</a></li>
<li><a href="/jasset/idc_list/">查看机房</a></li>
<li><a href="/jasset/idc_add/">添加机房</a></li>
<li><a href="/jasset/group_list/">查看业务组</a></li>
<li><a href="/jasset/group_add/">添加业务组</a></li>
<li id="host_list"><a href="/jasset/host_list/">查看资产</a></li>
<li id="host_add"><a href="/jasset/host_add/">添加资产</a></li>
<li id="idc_list"><a href="/jasset/idc_list/">查看机房</a></li>
<li id="idc_add"><a href="/jasset/idc_add/">添加机房</a></li>
<li id="group_list"><a href="/jasset/group_list/">查看业务组</a></li>
<li id="group_add"><a href="/jasset/group_add/">添加业务组</a></li>
</ul>
</li>
<li>
<li id="jperm">
<a href="#"><i class="fa fa-edit"></i> <span class="nav-label">授权管理</span><span class="fa arrow"></span></a>
<ul class="nav nav-second-level">
<li><a href="/jperm/perm_user_show/">查看授权</a></li>
@ -40,11 +40,11 @@
<li><a href="/jperm/add/">添加sudo</a></li>
</ul>
</li>
<li>
<li id="jlog">
<a href="#"><i class="fa fa-files-o"></i> <span class="nav-label">日志审计</span><span class="fa arrow"></span></a>
<ul class="nav nav-second-level">
<li><a href="/log/showlist/">查看日志</a></li>
<li><a href="/log/detail/">日志分析</a></li>
<li id="log_list"><a href="/jlog/log_list/">查看日志</a></li>
<li id="log_detail"><a href="/jlog/log_detail/">日志分析</a></li>
</ul>
</li>
<li>

@ -33,3 +33,11 @@
<!-- validator js -->
<script src="/static/js/validator/jquery.validator.js"></script>
<script src="/static/js/validator/zh_CN.js"></script>
<!-- active menu -->
<script>
var str = document.location.pathname.split("/")[1];
var str1 = document.location.pathname.split("/")[2];
$("#"+str).addClass('active');
$("#"+str1).addClass('active');
</script>
Loading…
Cancel
Save