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

This commit is contained in:
guanghongwei
2015-04-04 12:48:56 +08:00
10 changed files with 297 additions and 59 deletions

View File

@@ -56,7 +56,6 @@
<th class="text-center"> 所属部门 </th>
<th class="text-center"> 所属主机组 </th>
<th class="text-center"> 是否激活 </th>
<!--<th class="text-center" name="j_time"> 添加时间 </th>-->
<th class="text-center" name="j_comment"> 备注 </th>
<th class="text-center"> 操作 </th>
</tr>
@@ -70,9 +69,8 @@
<td class="text-center" name="j_type"> {{ login_types|get_item:post.login_type }} </td>
<td class="text-center" name="j_idc"> {{ post.idc.name }} </td>
<td class="text-center" name="j_dept">{{ post.dept.all | group_str2 }}</td>
<td class="text-center" name="j_group">{{ post.bis_group.all | group_str2 }}</td>
<td class="text-center" name="j_group">{{ post.bis_group.all | group_str2_all }}</td>
<td class="text-center" name="j_active"> {{ post.is_active|bool2str }} </td>
<!--<td class="text-center"> {{ post.date_added|date:"Y-m-d H:i:s" }} </td>-->
<td class="text-center" name="j_comment"> {{ post.comment }} </td>
<td class="text-center" data-editable='false'>
<a value="/jasset/{{ post.ip }}/" class="iframe btn btn-xs btn-primary">详情</a>

View File

@@ -6,35 +6,26 @@
<div class="row">
<div class="col-lg-10">
<div id="add_asset" class="ibox float-e-margins">
<div id="ibox-content" 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="#">未启用 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">
<h3>授权完成, 已邮件通知申请人, 五秒钟后关闭页面</h3>
<h2 id="jumpTo" class="text-center text-info"></h2>
</div>
</div>
</div>
</div>
</div>
<script>
<script>
function countDown(secs,surl){
var jumpTo = document.getElementById('jumpTo');
jumpTo.innerHTML='{{ smg }}......' + secs + '秒';
if(--secs>0){
setTimeout("countDown("+secs+",'"+surl+"')",1000);
}
else{
location.href=surl;
}
}
countDown(10,'/');
</script>
{% endblock content %}

View File

@@ -0,0 +1,55 @@
{% load mytags %}
<html>
<head>
<link href="/static/css/bootstrap.min.css" rel="stylesheet">
<script src="/static/js/jquery-2.1.1.js"></script>
<script src="/static/js/bootstrap.min.js"></script>
<!--<link href="/static/css/style.css" rel="stylesheet">
<!--{% include 'head_script.html' %}
<!--<style type="text/css">-->
<!--body-->
<!--{-->
<!--background: #FFFFFF;-->
<!--}-->
<!--</style>-->
</head>
<body>
<div class="container">
<h3 class="text-center"><span class="text-success">{{ post.applyer }}</span>权限申请详情</h3>
<br/>
<div class="row">
<div class="col-xs-5">
<h6 class="text-right">申请人</h6>
<h6 class="text-right">所属部门</h6>
<h6 class="text-right">申请主机组</h6>
<h6 class="text-right">申请主机</h6>
{% for i in post.asset|ast_to_list_1 %}
<h6 class="text-right" style="color: #ffffff">Null</h6>
{% endfor %}
<h6 class="text-right">批准人</h6>
<h6 class="text-right">申请时间</h6>
<h6 class="text-right">批准时间</h6>
<h6 class="text-right">备注</h6>
</div>
<div class="col-xs-2">
<div class="col-sm-offset-6" style="width: 2; height: 70%; background-color: #1AB394; padding-top: 200px"></div>
</div>
<div class="col-xs-5">
<h6 class="text-left">{{ post.applyer }}</h6>
<h6 class="text-left">{{ post.dept }}</h6>
<h6 class="text-left">{% for i in post.bisgroup|ast_to_list_1 %} {{ i }} {% endfor %}</h6>
{% for i in post.asset|ast_to_list_1 %}
<h6 class="text-left">{{ i }}</h6>
{% endfor %}
<h6 class="text-right" style="color: #ffffff">Null</h6>
<h6 class="text-left">{{ post.approver }}1</h6>
<h6 class="text-left">{{ post.date_add|date:"Y-m-d H:i:s"}}</h6>
<h6 class="text-left"> {{ post.date_end|date:"Y-m-d H:i:s" }}1 </h6>
<h6 class="text-left"> {{ post.comment }} </h6>
</div>
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1,42 @@
{% load mytags %}
<div class="tab-content">
<table class="table table-striped table-bordered table-hover ">
<thead>
<tr>
<th class="text-center"> 申请人 </th>
<th class="text-center"> 所属部门 </th>
<th class="text-center"> 申请主机组 </th>
<th class="text-center"> 申请主机 </th>
<th class="text-center"> 批准人 </th>
<th class="text-center"> 申请时间 </th>
<!--<th class="text-center"> 批准时间 </th>-->
<th class="text-center"> 备注 </th>
<th class="text-center"> 详情 </th>
</tr>
</thead>
<tbody>
{% for post in contacts.object_list %}
<tr class="gradeX">
<td class="text-center" id="username"> {{ post.applyer }} </td>
<td class="text-center" id="dept"> {{ post.dept }} </td>
<td class="text-center" id="ip"> {% for i in post.bisgroup|ast_to_list %} {{ i }} {% endfor %}... </td>
<td class="text-center" id="remote_ip">{% for i in post.asset|ast_to_list %} {{ i }} {% endfor %}... </td>
<td class="text-center" id="approver"> {{ post.approver }} </td>
<td class="text-center" id="start_time"> {{ post.date_add|date:"Y-m-d H:i:s"}} </td>
<!--<td class="text-center" id="end_time"> {{ post.date_end|date:"Y-m-d H:i:s" }} </td>-->
<td class="text-center" id=""> {{ post.comment }} </td>
<td class="text-center" data-editable='false'>
<a value="/jperm/apply_info/?uuid={{ post.uuid }}" class="iframe btn btn-xs btn-primary">详情</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<div class="row">
<div class="col-sm-6">
</div>
{% include 'paginator.html' %}
</div>
</div>
</div>

View File

@@ -38,7 +38,7 @@
<input type="text" class="form-control input-sm" id="search_input" name="keyword" placeholder="Search">
<input type="text" style="display: none">
<div class="input-group-btn">
<button id='search_btn' type="button" class="btn btn-sm btn-primary" onclick="log_search()">
<button id='search_btn' type="button" class="btn btn-sm btn-primary" onclick="apply_search()">
Search
</button>
</div>
@@ -58,8 +58,9 @@
<th class="text-center"> 申请主机 </th>
<th class="text-center"> 批准人 </th>
<th class="text-center"> 申请时间 </th>
<th class="text-center"> 批准时间 </th>
<!--<th class="text-center"> 批准时间 </th>-->
<th class="text-center"> 备注 </th>
<th class="text-center"> 详情 </th>
</tr>
</thead>
@@ -68,15 +69,15 @@
<tr class="gradeX">
<td class="text-center" id="username"> {{ post.applyer }} </td>
<td class="text-center" id="dept"> {{ post.dept }} </td>
<td class="text-center" id="ip"> {% for i in post.bisgroup|ast_to_list %} {{ i }} {% endfor %} </td>
<td class="text-center" id="remote_ip">{% for i in post.asset|ast_to_list %} {{ i }} {% endfor %} </td>
<td class="text-center" id="ip"> {% for i in post.bisgroup|ast_to_list %} {{ i }} {% endfor %}... </td>
<td class="text-center" id="remote_ip">{% for i in post.asset|ast_to_list %} {{ i }} {% endfor %}... </td>
<td class="text-center" id="approver"> {{ post.approver }} </td>
<!--{% ifnotequal session_role_id 0 %}-->
<!--<td class="text-center"><a href="/jlog/history/?id={{ post.id }}" class="log_command"> 命令统计 </td>-->
<!--{% endifnotequal %}-->
<td class="text-center" id="start_time"> {{ post.date_add|date:"Y-m-d H:i:s"}} </td>
<td class="text-center" id="end_time"> {{ post.date_end|date:"Y-m-d H:i:s" }} </td>
<!--<td class="text-center" id="end_time"> {{ post.date_end|date:"Y-m-d H:i:s" }} </td>-->
<td class="text-center" id=""> {{ post.comment }} </td>
<td class="text-center" data-editable='false'>
<a value="/jperm/apply_info/?uuid={{ post.uuid }}" class="iframe btn btn-xs btn-primary">详情</a>
</td>
</tr>
{% endfor %}
</tbody>
@@ -93,4 +94,36 @@
</div>
</div>
<script>
$(".iframe").on('click', function(){
var url= $(this).attr("value");
$.layer({
type: 2,
title: '权限申请详情',
maxmin: true,
shift: 'top',
border: [2, 0.3, '#1AB394'],
shade: [0.5, '#000000'],
shadeClose: true,
area : ['800px' , '600px'],
iframe: {src: url}
});
});
function apply_search(){
$.ajax({
type: "GET",
url: "/jperm/apply_search/?env=offline",
data: $("#search_form").serialize(),
success: function (data) {
$(".tab-content").html(data);
}
});
}
$("#search_input").keydown(function(e){
if(e.keyCode==13){
apply_search()
}
})
</script>
{% endblock %}

View File

@@ -1,4 +1,5 @@
{% extends 'base.html' %}
{% load mytags %}
{% block content %}
{% include 'nav_cat_bar.html' %}
<div class="wrapper wrapper-content animated fadeInRight">
@@ -37,7 +38,7 @@
<input type="text" class="form-control input-sm" id="search_input" name="keyword" placeholder="Search">
<input type="text" style="display: none">
<div class="input-group-btn">
<button id='search_btn' type="button" class="btn btn-sm btn-primary" onclick="log_search()">
<button id='search_btn' type="button" class="btn btn-sm btn-primary" onclick="apply_search()">
Search
</button>
</div>
@@ -56,8 +57,8 @@
<th class="text-center"> 申请主机组 </th>
<th class="text-center"> 申请主机 </th>
<th class="text-center"> 申请时间 </th>
<th class="text-center"> 批准时间 </th>
<th class="text-center"> 备注 </th>
<th class="text-center"> 操作 </th>
</tr>
</thead>
@@ -66,14 +67,13 @@
<tr class="gradeX">
<td class="text-center" id="username"> {{ post.applyer }} </td>
<td class="text-center" id="dept"> {{ post.dept }} </td>
<td class="text-center" id="ip"> {{ post.bisgroup }} </td>
<td class="text-center" id="remote_ip"> {{ post.asset }} </td>
<!--{% ifnotequal session_role_id 0 %}-->
<!--<td class="text-center"><a href="/jlog/history/?id={{ post.id }}" class="log_command"> 命令统计 </td>-->
<!--{% endifnotequal %}-->
<td class="text-center" id="ip"> {% for i in post.bisgroup|ast_to_list %} {{ i }} {% endfor %}... </td>
<td class="text-center" id="remote_ip"> {% for i in post.asset|ast_to_list %} {{ i }} {% endfor %}... </td>
<td class="text-center" id="start_time"> {{ post.date_add|date:"Y-m-d H:i:s"}} </td>
<td class="text-center" id="end_time"> {{ post.date_end|date:"Y-m-d H:i:s" }} </td>
<td class="text-center" id=""> {{ post.comment }} </td>
<td class="text-center" data-editable='false'>
<a value="/jperm/apply_info/?uuid={{ post.uuid }}" class="iframe btn btn-xs btn-primary">详情</a>
</td>
</tr>
{% endfor %}
</tbody>
@@ -89,5 +89,36 @@
</div>
</div>
</div>
<script>
$(".iframe").on('click', function(){
var url= $(this).attr("value");
$.layer({
type: 2,
title: '权限申请详情',
maxmin: true,
shift: 'top',
border: [2, 0.3, '#1AB394'],
shade: [0.5, '#000000'],
shadeClose: true,
area : ['800px' , '600px'],
iframe: {src: url}
});
});
function apply_search(){
$.ajax({
type: "GET",
url: "/jperm/apply_search/?env=online",
data: $("#search_form").serialize(),
success: function (data) {
$(".tab-content").html(data);
}
});
}
$("#search_input").keydown(function(e){
if(e.keyCode==13){
apply_search()
}
})
</script>
{% endblock %}

View File

@@ -48,6 +48,7 @@
<li class="sudo_list sudo_edit sudo_add cmd_list cmd_edit">
<a href="/jperm/sudo_list/">Sudo授权</a>
</li>
<li class="apply_show online"><a href="/jperm/apply_show/online/">权限审批</a></li>
</ul>
</li>
{# <li id="jlog">#}
@@ -112,6 +113,7 @@
<li id="sudo_add">
<a href="/jperm/sudo_list/">Sudo授权</a>
</li>
<li class="apply_show online"><a href="/jperm/apply_show/online/">权限审批</a></li>
</ul>
</li>
<li id="jlog">