mirror of https://github.com/jumpserver/jumpserver
添加授权详情页,并添加用户详情页链接到授权列表
parent
e96053ba20
commit
d5fba23d73
167
jperm/views.py
167
jperm/views.py
|
@ -85,11 +85,30 @@ def dept_perm_edit(request):
|
|||
def perm_list(request):
|
||||
header_title, path1, path2 = u'灏忕粍鎺堟潈', u'鎺堟潈绠$悊', u'鎺堟潈璇︽儏'
|
||||
keyword = request.GET.get('search', '')
|
||||
uid = request.GET.get('uid', '')
|
||||
agid = request.GET.get('agid', '')
|
||||
if keyword:
|
||||
contact_list = UserGroup.objects.filter(Q(name__icontains=keyword) | Q(comment__icontains=keyword))
|
||||
else:
|
||||
contact_list = UserGroup.objects.all().order_by('name')
|
||||
|
||||
if uid:
|
||||
user = User.objects.filter(id=uid)
|
||||
print user
|
||||
if user:
|
||||
user = user[0]
|
||||
contact_list = contact_list.filter(user=user)
|
||||
|
||||
if agid:
|
||||
contact_list_confirm = []
|
||||
asset_group = BisGroup.objects.filter(id=agid)
|
||||
if asset_group:
|
||||
asset_group = asset_group[0]
|
||||
for user_group in contact_list:
|
||||
if asset_group in user_group_perm_asset_group_api(user_group):
|
||||
contact_list_confirm.append(user_group)
|
||||
contact_list = contact_list_confirm
|
||||
|
||||
contact_list, p, contacts, page_range, current_page, show_first, show_end = pages(contact_list, request)
|
||||
return render_to_response('jperm/perm_list.html', locals(), context_instance=RequestContext(request))
|
||||
|
||||
|
@ -98,11 +117,30 @@ def perm_list(request):
|
|||
def perm_list_adm(request):
|
||||
header_title, path1, path2 = u'灏忕粍鎺堟潈', u'鎺堟潈绠$悊', u'鎺堟潈璇︽儏'
|
||||
keyword = request.GET.get('search', '')
|
||||
uid = request.GET.get('uid', '')
|
||||
agid = request.GET.get('agid', '')
|
||||
user, dept = get_session_user_dept(request)
|
||||
contact_list = dept.usergroup_set.all().order_by('name')
|
||||
if keyword:
|
||||
contact_list = contact_list.filter(Q(name__icontains=keyword) | Q(comment__icontains=keyword))
|
||||
|
||||
if uid:
|
||||
user = User.objects.filter(id=uid)
|
||||
print user
|
||||
if user:
|
||||
user = user[0]
|
||||
contact_list = contact_list.filter(user=user)
|
||||
|
||||
if agid:
|
||||
contact_list_confirm = []
|
||||
asset_group = BisGroup.objects.filter(id=agid)
|
||||
if asset_group:
|
||||
asset_group = asset_group[0]
|
||||
for user_group in contact_list:
|
||||
if asset_group in user_group_perm_asset_group_api(user_group):
|
||||
contact_list_confirm.append(user_group)
|
||||
contact_list = contact_list_confirm
|
||||
|
||||
contact_list, p, contacts, page_range, current_page, show_first, show_end = pages(contact_list, request)
|
||||
return render_to_response('jperm/perm_list.html', locals(), context_instance=RequestContext(request))
|
||||
|
||||
|
@ -187,19 +225,15 @@ def perm_edit_adm(request):
|
|||
|
||||
@require_admin
|
||||
def perm_detail(request):
|
||||
header_title, path1, path2 = u'缂栬緫鎺堟潈', u'鎺堟潈绠$悊', u'鎺堟潈璇︽儏'
|
||||
header_title, path1, path2 = u'鎺堟潈绠$悊', u'灏忕粍绠$悊', u'鎺堟潈璇︽儏'
|
||||
group_id = request.GET.get('id')
|
||||
user_group = UserGroup.objects.filter(id=group_id)
|
||||
if user_group:
|
||||
user_group = user_group[0]
|
||||
users_list = user_group.user_set.all()
|
||||
users = user_group.user_set.all()
|
||||
group_user_num = len(users)
|
||||
perms = user_group.perm_set.all()
|
||||
asset_groups = [perm.asset_group for perm in perms]
|
||||
assets_list = []
|
||||
|
||||
for asset_group in asset_groups:
|
||||
assets_list.extend(asset_group.asset_set.all())
|
||||
|
||||
return render_to_response('jperm/perm_detail.html', locals(), context_instance=RequestContext(request))
|
||||
|
||||
|
||||
|
@ -224,17 +258,6 @@ def perm_asset_detail(request):
|
|||
return render_to_response('jperm/perm_asset_detail.html', locals(), context_instance=RequestContext(request))
|
||||
|
||||
|
||||
# def sudo_db_add(name, user_runas, user_groups_select, asset_groups_select, cmd_groups_select, comment):
|
||||
# user_groups_select_list, asset_groups_select_list, cmd_groups_select_list = \
|
||||
# user_asset_cmd_groups_get(user_groups_select, asset_groups_select, cmd_groups_select)
|
||||
#
|
||||
# sudo_perm = SudoPerm(name=name, user_runas=user_runas, comment=comment)
|
||||
# sudo_perm.save()
|
||||
# sudo_perm.user_group = user_groups_select_list
|
||||
# sudo_perm.asset_group = asset_groups_select_list
|
||||
# sudo_perm.cmd_group = cmd_groups_select_list
|
||||
|
||||
|
||||
def unicode2str(unicode_list):
|
||||
return [str(i) for i in unicode_list]
|
||||
|
||||
|
@ -243,7 +266,6 @@ def sudo_ldap_add(user_group, user_runas, asset_groups_select,
|
|||
cmd_groups_select):
|
||||
if not LDAP_ENABLE:
|
||||
return True
|
||||
|
||||
assets = []
|
||||
cmds = []
|
||||
user_runas = user_runas.split(',')
|
||||
|
@ -283,7 +305,6 @@ def sudo_ldap_add(user_group, user_runas, asset_groups_select,
|
|||
'sudoOption': ['!authenticate'],
|
||||
'sudoRunAsUser': unicode2str(user_runas),
|
||||
'sudoUser': unicode2str(users_name)}
|
||||
print sudo_dn
|
||||
ldap_conn.delete(sudo_dn)
|
||||
ldap_conn.add(sudo_dn, sudo_attr)
|
||||
|
||||
|
@ -306,53 +327,6 @@ def sudo_update(user_group, user_runas, asset_groups_select, cmd_groups_select,
|
|||
sudo_ldap_add(user_group, user_runas, asset_groups_select_list, cmd_groups_select_list)
|
||||
|
||||
|
||||
# @require_super_user
|
||||
# def sudo_add(request):
|
||||
# header_title, path1, path2 = u'Sudo鎺堟潈', u'鏉冮檺绠$悊', u'娣诲姞Sudo鏉冮檺'
|
||||
# user_groups = UserGroup.objects.filter(id__gt=2)
|
||||
# asset_groups = BisGroup.objects.all()
|
||||
# cmd_groups = CmdGroup.objects.all()
|
||||
#
|
||||
# if request.method == 'POST':
|
||||
# name = request.POST.get('name')
|
||||
# users_runas = request.POST.get('runas', 'root')
|
||||
# user_groups_select = request.POST.getlist('user_groups_select')
|
||||
# asset_groups_select = request.POST.getlist('asset_groups_select')
|
||||
# cmd_groups_select = request.POST.getlist('cmd_groups_select')
|
||||
# comment = request.POST.get('comment', '')
|
||||
#
|
||||
# if LDAP_ENABLE:
|
||||
# sudo_db_add(name, users_runas, user_groups_select, asset_groups_select, cmd_groups_select, comment)
|
||||
# sudo_ldap_add(name, users_runas, user_groups_select, asset_groups_select, cmd_groups_select)
|
||||
#
|
||||
# msg = '娣诲姞鎴愬姛'
|
||||
# return render_to_response('jperm/sudo_add.html', locals(), context_instance=RequestContext(request))
|
||||
|
||||
|
||||
# @require_admin
|
||||
# def sudo_add_adm(request):
|
||||
# header_title, path1, path2 = u'Sudo鎺堟潈', u'鏉冮檺绠$悊', u'娣诲姞Sudo鏉冮檺'
|
||||
# user, dept = get_session_user_dept(request)
|
||||
# user_groups = dept.usergroup_set.filter(id__gt=2)
|
||||
# asset_groups = dept.bisgroup_set.all()
|
||||
# cmd_groups = CmdGroup.objects.all()
|
||||
#
|
||||
# if request.method == 'POST':
|
||||
# name = request.POST.get('name')
|
||||
# users_runas = request.POST.get('runas', 'root')
|
||||
# user_groups_select = request.POST.getlist('user_groups_select')
|
||||
# asset_groups_select = request.POST.getlist('asset_groups_select')
|
||||
# cmd_groups_select = request.POST.getlist('cmd_groups_select')
|
||||
# comment = request.POST.get('comment', '')
|
||||
#
|
||||
# if LDAP_ENABLE:
|
||||
# sudo_db_add(name, users_runas, user_groups_select, asset_groups_select, cmd_groups_select, comment)
|
||||
# sudo_ldap_add(name, users_runas, user_groups_select, asset_groups_select, cmd_groups_select)
|
||||
#
|
||||
# msg = '娣诲姞鎴愬姛'
|
||||
# return render_to_response('jperm/sudo_add.html', locals(), context_instance=RequestContext(request))
|
||||
|
||||
|
||||
@require_super_user
|
||||
def sudo_list(request):
|
||||
header_title, path1, path2 = u'Sudo鎺堟潈', u'鏉冮檺绠$悊', u'Sudo鏉冮檺璇︽儏'
|
||||
|
@ -417,7 +391,6 @@ def sudo_edit(request):
|
|||
msg = '淇敼鎴愬姛'
|
||||
|
||||
return HttpResponseRedirect('/jperm/sudo_list/')
|
||||
|
||||
return render_to_response('jperm/sudo_edit.html', locals(), context_instance=RequestContext(request))
|
||||
|
||||
|
||||
|
@ -467,6 +440,26 @@ def sudo_edit_adm(request):
|
|||
return render_to_response('jperm/sudo_edit.html', locals(), context_instance=RequestContext(request))
|
||||
|
||||
|
||||
@require_admin
|
||||
def sudo_detail(request):
|
||||
header_title, path1, path2 = u'Sudo鎺堟潈璇︽儏', u'鎺堟潈绠$悊', u'鎺堟潈璇︽儏'
|
||||
user_group_id = request.GET.get('id')
|
||||
user_group = UserGroup.objects.filter(id=user_group_id)
|
||||
if user_group:
|
||||
asset_groups = []
|
||||
cmd_groups = []
|
||||
user_group = user_group[0]
|
||||
users = user_group.user_set.all()
|
||||
group_user_num = len(users)
|
||||
|
||||
for perm in user_group.sudoperm_set.all():
|
||||
asset_groups.extend(perm.asset_group.all())
|
||||
cmd_groups.extend(perm.cmd_group.all())
|
||||
|
||||
print asset_groups
|
||||
return render_to_response('jperm/sudo_detail.html', locals(), context_instance=RequestContext(request))
|
||||
|
||||
|
||||
@require_admin
|
||||
def sudo_refresh(request):
|
||||
sudo_perm_all = SudoPerm.objects.all()
|
||||
|
@ -479,43 +472,6 @@ def sudo_refresh(request):
|
|||
return HttpResponse('鍒锋柊sudo鎺堟潈鎴愬姛')
|
||||
|
||||
|
||||
# @require_admin
|
||||
# def sudo_detail(request):
|
||||
# header_title, path1, path2 = u'Sudo鎺堟潈璇︽儏', u'鎺堟潈绠$悊', u'鎺堟潈璇︽儏'
|
||||
# sudo_perm_id = request.GET.get('id')
|
||||
# sudo_perm = SudoPerm.objects.filter(id=sudo_perm_id)
|
||||
# if sudo_perm:
|
||||
# sudo_perm = sudo_perm[0]
|
||||
# user_groups = sudo_perm.user_group.all()
|
||||
# asset_groups = sudo_perm.asset_group.all()
|
||||
# cmd_groups = sudo_perm.cmd_group.all()
|
||||
#
|
||||
# users_list = []
|
||||
# assets_list = []
|
||||
# cmds_list = []
|
||||
#
|
||||
# for user_group in user_groups:
|
||||
# users_list.extend(user_group.user_set.all())
|
||||
# for asset_group in asset_groups:
|
||||
# assets_list.extend(asset_group.asset_set.all())
|
||||
# for cmd_group in cmd_groups:
|
||||
# cmds_list.append({cmd_group.name: cmd_group.cmd.split(',')})
|
||||
#
|
||||
# return render_to_response('jperm/sudo_detail.html', locals(), context_instance=RequestContext(request))
|
||||
|
||||
|
||||
# @require_admin
|
||||
# def sudo_del(request):
|
||||
# sudo_perm_id = request.GET.get('id', '0')
|
||||
# sudo_perm = SudoPerm.objects.filter(id=int(sudo_perm_id))
|
||||
# if sudo_perm:
|
||||
# name = sudo_perm[0].name
|
||||
# sudo_perm.delete()
|
||||
# sudo_dn = 'cn=%s,ou=Sudoers,%s' % (name, LDAP_BASE_DN)
|
||||
# ldap_conn.delete(sudo_dn)
|
||||
# return HttpResponseRedirect('/jperm/sudo_list/')
|
||||
|
||||
|
||||
@require_super_user
|
||||
def cmd_add(request):
|
||||
header_title, path1, path2 = u'sudo鍛戒护娣诲姞', u'鎺堟潈绠$悊', u'鍛戒护缁勬坊鍔'
|
||||
|
@ -543,7 +499,6 @@ def cmd_add(request):
|
|||
CmdGroup.objects.create(name=name, dept=dept, cmd=cmd, comment=comment)
|
||||
msg = u'鍛戒护缁勬坊鍔犳垚鍔'
|
||||
return HttpResponseRedirect('/jperm/cmd_list/')
|
||||
|
||||
return render_to_response('jperm/sudo_cmd_add.html', locals(), context_instance=RequestContext(request))
|
||||
|
||||
|
||||
|
|
|
@ -283,6 +283,14 @@ def view_splitter(request, su=None, adm=None):
|
|||
return HttpResponseRedirect('/login/')
|
||||
|
||||
|
||||
def user_group_perm_asset_group_api(user_group):
|
||||
asset_group_list = []
|
||||
perm_list = user_group.perm_set.all()
|
||||
for perm in perm_list:
|
||||
asset_group_list.append(perm.asset_group)
|
||||
return asset_group_list
|
||||
|
||||
|
||||
def user_perm_group_api(username):
|
||||
if username:
|
||||
user = User.objects.get(username=username)
|
||||
|
|
|
@ -380,3 +380,6 @@ def sudo_cmd_ids(user_group_id):
|
|||
return '0'
|
||||
|
||||
|
||||
@register.filter(name='cmd_group_split')
|
||||
def cmd_group_split(cmd_group):
|
||||
return cmd_group.cmd.split(',')
|
||||
|
|
|
@ -5,10 +5,10 @@
|
|||
{% include 'nav_cat_bar.html' %}
|
||||
<div class="wrapper wrapper-content animated fadeInRight">
|
||||
<div class="row">
|
||||
<div class="col-lg-6">
|
||||
<div class="col-lg-4">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-title">
|
||||
<h5>鐢ㄦ埛璇︽儏</h5>
|
||||
<h5>鎺堟潈涓绘満/缁</h5>
|
||||
<div class="ibox-tools">
|
||||
<a class="collapse-link">
|
||||
<i class="fa fa-chevron-up"></i>
|
||||
|
@ -17,9 +17,9 @@
|
|||
<i class="fa fa-wrench"></i>
|
||||
</a>
|
||||
<ul class="dropdown-menu dropdown-user">
|
||||
<li><a href="#">鏈惎鐢 1</a>
|
||||
<li><a href="#">Config option 1</a>
|
||||
</li>
|
||||
<li><a href="#">鏈惎鐢 2</a>
|
||||
<li><a href="#">Config option 2</a>
|
||||
</li>
|
||||
</ul>
|
||||
<a class="close-link">
|
||||
|
@ -27,35 +27,41 @@
|
|||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ibox-content">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>鐢ㄦ埛鍚</th>
|
||||
<th>濮撳悕</th>
|
||||
<th>閮ㄩ棬</th>
|
||||
<th>灏忕粍</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for user in users_list %}
|
||||
<tr>
|
||||
<td>{{ user.username }}</td>
|
||||
<td>{{ user.name }}</td>
|
||||
<td>{{ user.dept.name }}</td>
|
||||
<td>{{ user.group.all | group_str2 }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="ibox-content ibox-heading">
|
||||
<h3>鐢ㄦ埛</h3>
|
||||
<small><i class="fa fa-map-marker"></i> 缁勪笅鐢ㄦ埛.</small>
|
||||
</div>
|
||||
<div class="ibox-content inspinia-timeline">
|
||||
<div class="timeline-item">
|
||||
<div class="row">
|
||||
<div class="col-xs-3 date">
|
||||
<i class="fa fa-users"></i>
|
||||
<b>{{ user_group.name }}</b>
|
||||
<br>
|
||||
<small class="text-navy">鍏: {{ group_user_num }} 鐢ㄦ埛</small>
|
||||
</div>
|
||||
<div class="col-xs-7 content no-top-border">
|
||||
<p class="m-b-xs"><strong>{{ user_group.comment }}</strong></p>
|
||||
<p>
|
||||
{% for user in users %}
|
||||
{{ user.name }}<br>
|
||||
{% endfor %}
|
||||
</p>
|
||||
<p></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% if not user|get_user_asset_group %}
|
||||
(鏃)
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-6">
|
||||
<div class="col-lg-4">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-title">
|
||||
<h5>鎺堟潈璇︽儏</h5>
|
||||
<h5>鎺堟潈涓绘満/缁</h5>
|
||||
<div class="ibox-tools">
|
||||
<a class="collapse-link">
|
||||
<i class="fa fa-chevron-up"></i>
|
||||
|
@ -64,9 +70,9 @@
|
|||
<i class="fa fa-wrench"></i>
|
||||
</a>
|
||||
<ul class="dropdown-menu dropdown-user">
|
||||
<li><a href="#">鏈惎鐢 1</a>
|
||||
<li><a href="#">Config option 1</a>
|
||||
</li>
|
||||
<li><a href="#">鏈惎鐢 2</a>
|
||||
<li><a href="#">Config option 2</a>
|
||||
</li>
|
||||
</ul>
|
||||
<a class="close-link">
|
||||
|
@ -74,33 +80,38 @@
|
|||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ibox-content">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>IP</th>
|
||||
<th>IDC</th>
|
||||
<th>涓绘満缁</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for asset in assets_list %}
|
||||
<tr>
|
||||
<td>{{ asset.ip }}</td>
|
||||
<td>{{ asset.idc.name }}</td>
|
||||
<td>
|
||||
{% for group in asset.bis_group.all %}
|
||||
{{ group }}
|
||||
<div class="ibox-content ibox-heading">
|
||||
<h3>鎺堟潈涓绘満/缁</h3>
|
||||
<small><i class="fa fa-map-marker"></i> 杩欓噷鍖呭惈浜嗙敤鎴锋墍鏈夌殑涓绘満缁勫拰缁勪笅鐨勪富鏈.</small>
|
||||
</div>
|
||||
<div class="ibox-content inspinia-timeline">
|
||||
{% for group in asset_groups %}
|
||||
<div class="timeline-item">
|
||||
<div class="row">
|
||||
<div class="col-xs-3 date">
|
||||
<i class="fa fa-repeat"></i>
|
||||
<b>{{ group.name }}</b>
|
||||
<br>
|
||||
<small class="text-navy">鍏: {{ group | group_asset_list_count }}鍙</small>
|
||||
</div>
|
||||
<div class="col-xs-7 content no-top-border">
|
||||
<p class="m-b-xs"><strong>{{ group.comment }}</strong></p>
|
||||
<p>
|
||||
{% for asset in group|group_asset_list %}
|
||||
{{ asset.ip }}<br>
|
||||
{% endfor %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</p>
|
||||
<p></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% if not user|get_user_asset_group %}
|
||||
(鏆傛棤)
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -5,10 +5,10 @@
|
|||
{% include 'nav_cat_bar.html' %}
|
||||
<div class="wrapper wrapper-content animated fadeInRight">
|
||||
<div class="row">
|
||||
<div class="col-lg-6">
|
||||
<div class="col-lg-4">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-title">
|
||||
<h5>Sudo鎺堟潈璇︽儏</h5>
|
||||
<h5>鎺堟潈涓绘満/缁</h5>
|
||||
<div class="ibox-tools">
|
||||
<a class="collapse-link">
|
||||
<i class="fa fa-chevron-up"></i>
|
||||
|
@ -17,9 +17,9 @@
|
|||
<i class="fa fa-wrench"></i>
|
||||
</a>
|
||||
<ul class="dropdown-menu dropdown-user">
|
||||
<li><a href="#">鏈惎鐢 1</a>
|
||||
<li><a href="#">Config option 1</a>
|
||||
</li>
|
||||
<li><a href="#">鏈惎鐢 2</a>
|
||||
<li><a href="#">Config option 2</a>
|
||||
</li>
|
||||
</ul>
|
||||
<a class="close-link">
|
||||
|
@ -27,123 +27,139 @@
|
|||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ibox-content">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>鐢ㄦ埛鍚</th>
|
||||
<th>濮撳悕</th>
|
||||
<th>閮ㄩ棬</th>
|
||||
<th>灞炵粍</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for user in users_list %}
|
||||
<tr>
|
||||
<td>{{ user.username }}</td>
|
||||
<td>{{ user.name }}</td>
|
||||
<td>{{ user.dept.name }}</td>
|
||||
<td>{{ user.group.all | group_str2}}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="ibox-content ibox-heading">
|
||||
<h3>鐢ㄦ埛</h3>
|
||||
<small><i class="fa fa-map-marker"></i> 缁勪笅鐢ㄦ埛.</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-6">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-title">
|
||||
<h5>鎺堟潈涓绘満 <small> Asset.</small></h5>
|
||||
<div class="ibox-tools">
|
||||
<a class="collapse-link">
|
||||
<i class="fa fa-chevron-up"></i>
|
||||
</a>
|
||||
<a class="dropdown-toggle" data-toggle="dropdown" href="#">
|
||||
<i class="fa fa-wrench"></i>
|
||||
</a>
|
||||
<ul class="dropdown-menu dropdown-user">
|
||||
<li><a href="#">鏈惎鐢 1</a>
|
||||
</li>
|
||||
<li><a href="#">鏈惎鐢 2</a>
|
||||
</li>
|
||||
</ul>
|
||||
<a class="close-link">
|
||||
<i class="fa fa-times"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ibox-content">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>IP</th>
|
||||
<th>IDC</th>
|
||||
<th>涓绘満缁</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for asset in assets_list %}
|
||||
<tr>
|
||||
<td>{{ asset.ip }}</td>
|
||||
<td>{{ asset.idc.name }}</td>
|
||||
<td>
|
||||
{% for group in asset.bis_group.all|filter_private %}
|
||||
{{ group }}
|
||||
{% endfor %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-6">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-title">
|
||||
<h5>鎺堟潈鍛戒护 <small> Command.</small></h5>
|
||||
<div class="ibox-tools">
|
||||
<a class="collapse-link">
|
||||
<i class="fa fa-chevron-up"></i>
|
||||
</a>
|
||||
<a class="dropdown-toggle" data-toggle="dropdown" href="#">
|
||||
<i class="fa fa-wrench"></i>
|
||||
</a>
|
||||
<ul class="dropdown-menu dropdown-user">
|
||||
<li><a href="#">鏈惎鐢 1</a>
|
||||
</li>
|
||||
<li><a href="#">鏈惎鐢 2</a>
|
||||
</li>
|
||||
</ul>
|
||||
<a class="close-link">
|
||||
<i class="fa fa-times"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ibox-content">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>鍛戒护</th>
|
||||
<th>鍛戒护缁</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for cmd_group in cmds_list %}
|
||||
{% for cmd_group_name, cmds in cmd_group.items %}
|
||||
{% for cmd in cmds %}
|
||||
<tr>
|
||||
<td>{{ cmd }}</td>
|
||||
<td>{{ cmd_group_name }}</td>
|
||||
</tr>
|
||||
<div class="ibox-content inspinia-timeline">
|
||||
<div class="timeline-item">
|
||||
<div class="row">
|
||||
<div class="col-xs-3 date">
|
||||
<i class="fa fa-users"></i>
|
||||
<b>{{ user_group.name }}</b>
|
||||
<br>
|
||||
<small class="text-navy">鍏: {{ group_user_num }} 鐢ㄦ埛</small>
|
||||
</div>
|
||||
<div class="col-xs-7 content no-top-border">
|
||||
<p class="m-b-xs"><strong>{{ user_group.comment }}</strong></p>
|
||||
<p>
|
||||
{% for user in users %}
|
||||
{{ user.name }}<br>
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</p>
|
||||
<p></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% if not users %}
|
||||
(鏆傛棤)
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-title">
|
||||
<h5>鎺堟潈涓绘満/缁</h5>
|
||||
<div class="ibox-tools">
|
||||
<a class="collapse-link">
|
||||
<i class="fa fa-chevron-up"></i>
|
||||
</a>
|
||||
<a class="dropdown-toggle" data-toggle="dropdown" href="#">
|
||||
<i class="fa fa-wrench"></i>
|
||||
</a>
|
||||
<ul class="dropdown-menu dropdown-user">
|
||||
<li><a href="#">Config option 1</a>
|
||||
</li>
|
||||
<li><a href="#">Config option 2</a>
|
||||
</li>
|
||||
</ul>
|
||||
<a class="close-link">
|
||||
<i class="fa fa-times"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ibox-content ibox-heading">
|
||||
<h3>鎺堟潈涓绘満/缁</h3>
|
||||
<small><i class="fa fa-map-marker"></i> 杩欓噷鍖呭惈浜唖udo鎺堟潈鎵鏈夌殑涓绘満缁勫拰缁勪笅鐨勪富鏈.</small>
|
||||
</div>
|
||||
<div class="ibox-content inspinia-timeline">
|
||||
{% for group in asset_groups %}
|
||||
<div class="timeline-item">
|
||||
<div class="row">
|
||||
<div class="col-xs-3 date">
|
||||
<i class="fa fa-repeat"></i>
|
||||
<b>{{ group.name }}</b>
|
||||
<br>
|
||||
<small class="text-navy">鍏: {{ group | group_asset_list_count }}鍙</small>
|
||||
</div>
|
||||
<div class="col-xs-7 content no-top-border">
|
||||
<p class="m-b-xs"><strong>{{ group.comment }}</strong></p>
|
||||
<p>
|
||||
{% for asset in group|group_asset_list %}
|
||||
{{ asset.ip }}<br>
|
||||
{% endfor %}
|
||||
</p>
|
||||
<p></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% if not asset_groups %}
|
||||
(鏆傛棤)
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-title">
|
||||
<h5>鎺堟潈鍛戒护/缁</h5>
|
||||
<div class="ibox-tools">
|
||||
<a class="collapse-link">
|
||||
<i class="fa fa-chevron-up"></i>
|
||||
</a>
|
||||
<a class="dropdown-toggle" data-toggle="dropdown" href="#">
|
||||
<i class="fa fa-wrench"></i>
|
||||
</a>
|
||||
<ul class="dropdown-menu dropdown-user">
|
||||
<li><a href="#">Config option 1</a>
|
||||
</li>
|
||||
<li><a href="#">Config option 2</a>
|
||||
</li>
|
||||
</ul>
|
||||
<a class="close-link">
|
||||
<i class="fa fa-times"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ibox-content inspinia-timeline">
|
||||
{% for cmd_group in cmd_groups %}
|
||||
<div class="timeline-item">
|
||||
<div class="row">
|
||||
<div class="col-xs-3 date">
|
||||
<i class="fa fa-linux"></i>
|
||||
<b>{{ cmd_group.name }}</b>
|
||||
<br>
|
||||
<small class="text-navy">鍏: {{ cmd_group.id|sudo_cmd_count }} 涓</small>
|
||||
</div>
|
||||
<div class="col-xs-7 content no-top-border">
|
||||
<p class="m-b-xs"><strong>{{ group.comment }}</strong></p>
|
||||
<p>
|
||||
{% for cmd in cmd_group|cmd_group_split %}
|
||||
{{ cmd }}<br>
|
||||
{% endfor %}
|
||||
</p>
|
||||
<p></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% if not cmd_groups %}
|
||||
(鏆傛棤)
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
<div class="wrapper wrapper-content animated fadeInRight">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="col-lg-10">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-title">
|
||||
<h5> Sudo鎺堟潈鍒楄〃 </h5>
|
||||
|
@ -45,7 +45,6 @@
|
|||
</div>
|
||||
|
||||
<div class="panel-body">
|
||||
|
||||
<div class="tab-content">
|
||||
<div id="tab-1" class="tab-pane active">
|
||||
<table class="table table-striped table-bordered table-hover " id="editable" >
|
||||
|
@ -72,6 +71,7 @@
|
|||
<td class="text-center"><a value="/jperm/cmd_detail/?id={{ group.id | sudo_cmd_ids }}" class="iframe">{{ group.id | sudo_cmd_count }}</a> </td>
|
||||
<td class="text-center"> {{ group.comment }} </td>
|
||||
<td class="text-center">
|
||||
<a href="../sudo_detail/?id={{ group.id }}" class="btn btn-xs btn-primary">璇︽儏</a>
|
||||
<a href="../sudo_edit/?id={{ group.id }}" class="btn btn-xs btn-danger">sudo鎺堟潈</a>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -87,15 +87,9 @@
|
|||
{% include 'paginator.html' %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -118,20 +118,18 @@
|
|||
<div class="row">
|
||||
<div class="col-xs-3 date">
|
||||
<i class="fa fa-repeat"></i>
|
||||
<b>{{ group.name }}</b>
|
||||
<b><a href="/jperm/perm_list/?uid={{ user.id }}&agid={{ group.id }}">{{ group.name }}</a></b>
|
||||
<br>
|
||||
<small class="text-navy">鍏: {{ group | group_asset_list_count }}鍙</small>
|
||||
</div>
|
||||
<div class="col-xs-7 content no-top-border">
|
||||
<p class="m-b-xs"><strong>{{ group.comment }}</strong></p>
|
||||
|
||||
<p>
|
||||
{% for asset in group|group_asset_list %}
|
||||
{{ asset.ip }}<br>
|
||||
{% endfor %}
|
||||
</p>
|
||||
<p></p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -35,11 +35,11 @@
|
|||
<a href="/jperm/dept_perm_list/">閮ㄩ棬鎺堟潈</a>
|
||||
</li>
|
||||
|
||||
<li class="perm_list perm_edit perm_detail ">
|
||||
<li class="perm_list perm_edit perm_detail">
|
||||
<a href="/jperm/perm_list/">灏忕粍鎺堟潈</a>
|
||||
</li>
|
||||
|
||||
<li class="sudo_list sudo_edit sudo_add cmd_list cmd_edit cmd_add">
|
||||
<li class="sudo_list sudo_edit sudo_add cmd_list cmd_edit cmd_add sudo_detail">
|
||||
<a href="/jperm/sudo_list/">Sudo鎺堟潈</a>
|
||||
</li>
|
||||
<li class="apply_show online"><a href="/jperm/apply_show/online/">鏉冮檺瀹℃壒</a></li>
|
||||
|
@ -91,7 +91,7 @@
|
|||
<a href="/jperm/perm_list/">灏忕粍鎺堟潈</a>
|
||||
</li>
|
||||
|
||||
<li class="sudo_list sudo_edit sudo_add cmd_list cmd_edit cmd_add">
|
||||
<li class="sudo_list sudo_edit sudo_add cmd_list cmd_edit cmd_add sudo_detail">
|
||||
<a href="/jperm/sudo_list/">Sudo鎺堟潈</a>
|
||||
</li>
|
||||
<li class="apply_show online"><a href="/jperm/apply_show/online/">鏉冮檺瀹℃壒</a></li>
|
||||
|
|
Loading鈥
Reference in New Issue