mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-10-22 00:09:14 +00:00
dashboard等
This commit is contained in:
@@ -8,8 +8,6 @@
|
||||
<script src="/static/js/inspinia.js"></script>
|
||||
<script src="/static/js/plugins/pace/pace.min.js"></script>
|
||||
|
||||
<!-- iCheck box -->
|
||||
|
||||
<!-- Peity -->
|
||||
<script src="/static/js/plugins/peity/jquery.peity.min.js"></script>
|
||||
|
||||
@@ -19,17 +17,14 @@
|
||||
<script src="/static/js/base.js"></script>
|
||||
|
||||
<!-- pop windows layer-->
|
||||
<script src="/static/js/layer/layer.min.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');
|
||||
if($("#"+str1).length>0) {
|
||||
$("#"+str1).addClass('active');
|
||||
}
|
||||
</script>
|
||||
|
||||
<!--<script>-->
|
||||
<!--$(document).ready(function(){-->
|
||||
<!--$(".iframe").colorbox({iframe:true, width:"70%", height:"80%"});-->
|
||||
<!--});-->
|
||||
<!--</script>-->
|
@@ -5,5 +5,3 @@
|
||||
<!-- validator js -->
|
||||
<script src="/static/js/validator/jquery.validator.js"></script>
|
||||
<script src="/static/js/validator/zh_CN.js"></script>
|
||||
|
||||
<script src="/static/js/layer/layer.min.js"></script>
|
||||
|
65
templates/index.html
Normal file
65
templates/index.html
Normal file
@@ -0,0 +1,65 @@
|
||||
{% extends 'base.html' %}
|
||||
{% block content %}
|
||||
{% include 'nav_cat_bar.html' %}
|
||||
|
||||
<div class="wrapper wrapper-content">
|
||||
<div class="row">
|
||||
<div class="col-lg-3">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-title">
|
||||
<span class="label label-success pull-right">Monthly</span>
|
||||
<h5>用户总数</h5>
|
||||
</div>
|
||||
<div class="ibox-content">
|
||||
<h1 class="no-margins">{{ users.count}}</h1>
|
||||
<div class="stat-percent font-bold text-success">98% <i class="fa fa-bolt"></i></div>
|
||||
<small>All user</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-3">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-title">
|
||||
<span class="label label-info pull-right">Annual</span>
|
||||
<h5>主机总数</h5>
|
||||
</div>
|
||||
<div class="ibox-content">
|
||||
<h1 class="no-margins">{{ hosts.count }}</h1>
|
||||
<div class="stat-percent font-bold text-info">20% <i class="fa fa-level-up"></i></div>
|
||||
<small>All host</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-3">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-title">
|
||||
<span class="label label-primary pull-right">Today</span>
|
||||
<h5>在线用户</h5>
|
||||
</div>
|
||||
<div class="ibox-content">
|
||||
<h1 class="no-margins">{{ online_user.count }}</h1>
|
||||
<div class="stat-percent font-bold text-navy">44% <i class="fa fa-level-up"></i></div>
|
||||
<small>Online user</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-3">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-title">
|
||||
<span class="label label-danger pull-right">Low value</span>
|
||||
<h5>已连接服务器</h5>
|
||||
</div>
|
||||
<div class="ibox-content">
|
||||
<h1 class="no-margins">{{ online_host.count }}</h1>
|
||||
<div class="stat-percent font-bold text-danger">38% <i class="fa fa-level-down"></i></div>
|
||||
<small>Connect host</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
{% endblock %}
|
@@ -106,7 +106,6 @@
|
||||
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$(".iframe").colorbox({iframe:true, width:"70%", height:"70%"});
|
||||
$('#editable').editableTableWidget();
|
||||
});
|
||||
|
||||
|
@@ -32,11 +32,11 @@
|
||||
<tr class="gradeX">
|
||||
<td class="text-center"> {{ post.id }} </td>
|
||||
<td class="text-center"> {{ post.name }} </td>
|
||||
<td class="text-center"> <a href="/jasset/group_detail/{{ post.id }}">{{ post.asset_set.count }}</a> </td>
|
||||
<td class="text-center"> <a href="/jasset/group_detail/?id={{ post.id }}">{{ post.asset_set.count }}</a> </td>
|
||||
<td class="text-center"> {{ post.comment }} </td>
|
||||
<td class="text-center">
|
||||
<a href="/jasset/group_detail/{{ post.id }}" class="btn btn-xs btn-info">详情</a>
|
||||
<a href="/jasset/group_edit/{{ post.id }}" class="btn btn-xs btn-info">编辑</a>
|
||||
<a href="/jasset/group_detail/?id={{ post.id }}" class="btn btn-xs btn-info">详情</a>
|
||||
<a href="/jasset/group_edit/?id={{ post.id }}" class="btn btn-xs btn-info">编辑</a>
|
||||
<a href="/jasset/group_del/{{ post.id }}" class="btn btn-xs btn-danger">删除</a>
|
||||
</td>
|
||||
</tr>
|
||||
|
@@ -74,7 +74,7 @@
|
||||
<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>
|
||||
<a href="/jasset/host_edit/{{ post.id }}" class="btn btn-xs btn-info">编辑</a>
|
||||
<a href="/jasset/host_edit/?id={{ post.id }}" class="btn btn-xs btn-info">编辑</a>
|
||||
<a href="/jasset/host_del/{{ post.id }}" class="btn btn-xs btn-danger">删除</a>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -124,7 +124,7 @@
|
||||
var url= $(this).attr("value");
|
||||
$.layer({
|
||||
type: 2,
|
||||
title: 'iframe父子操作',
|
||||
title: 'JumpServer主机详情',
|
||||
maxmin: true,
|
||||
shift: 'top',
|
||||
border: [2, 0.3, '#1AB394'],
|
||||
|
@@ -27,8 +27,8 @@
|
||||
<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 href="/jasset/{{ post.ip }}/" class="iframe btn btn-xs btn-primary">详情</a>
|
||||
<a href="/jasset/host_edit/{{ post.id }}" class="btn btn-xs btn-info">编辑</a>
|
||||
<a value="/jasset/{{ post.ip }}/" class="iframe btn btn-xs btn-primary">详情</a>
|
||||
<a href="/jasset/host_edit/?id={{ post.id }}" class="btn btn-xs btn-info">编辑</a>
|
||||
<a href="/jasset/host_del/{{ post.id }}" class="btn btn-xs btn-danger">删除</a>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -62,3 +62,80 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$('#editable').editableTableWidget();
|
||||
});
|
||||
|
||||
$(".iframe").on('click', function(){
|
||||
var url= $(this).attr("value");
|
||||
$.layer({
|
||||
type: 2,
|
||||
title: 'JumpServer主机详情',
|
||||
maxmin: true,
|
||||
shift: 'top',
|
||||
border: [2, 0.3, '#1AB394'],
|
||||
shade: [0.5, '#000000'],
|
||||
shadeClose: true,
|
||||
area : ['800px' , '600px'],
|
||||
iframe: {src: url}
|
||||
});
|
||||
});
|
||||
|
||||
function alter(form) {
|
||||
selectData = GetTableDataBox();
|
||||
if (selectData[1] != 0) {
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "/jasset/host_edit/batch/",
|
||||
data: {"editable": selectData[0], "len_table": selectData[1]},
|
||||
success: function (data) {
|
||||
alert("修改成功");
|
||||
window.open("/jasset/host_list/", "_self");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function del(form) {
|
||||
var checkboxes = document.getElementById(form);
|
||||
var id_list = {};
|
||||
var j = 0;
|
||||
for (var i = 0; i < checkboxes.elements.length; i++) {
|
||||
if (checkboxes.elements[i].type == "checkbox" && checkboxes.elements[i].checked == true && checkboxes.elements[i].value != "checkall") {
|
||||
id_list[j] = checkboxes.elements[i].value;
|
||||
j++;
|
||||
}
|
||||
}
|
||||
if (confirm("确定删除")) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/jasset/host_del/multi/",
|
||||
data: {"id_list": id_list, "len_list": j},
|
||||
success: function (data) {
|
||||
window.open("/jasset/host_list/", "_self");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function host_search(){
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: "/jasset/search/",
|
||||
data: $("#search_form").serialize(),
|
||||
success: function (data) {
|
||||
$("#contents_form").html(data);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$("#search_input").keydown(function(e){
|
||||
if(e.keyCode==13){
|
||||
host_search()
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
</script>
|
||||
|
@@ -62,7 +62,7 @@
|
||||
<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 href="/jasset/{{ post.ip }}/" class="iframe btn btn-xs btn-primary">详情</a>
|
||||
<a href="/jasset/?id={{ post.ip }}/" class="iframe btn btn-xs btn-primary">详情</a>
|
||||
<a href="/jasset/host_del/{{ post.id }}" class="btn btn-xs btn-danger">删除</a>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -105,7 +105,6 @@
|
||||
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$(".iframe").colorbox({iframe:true, width:"70%", height:"70%"});
|
||||
$('#editable').editableTableWidget();
|
||||
});
|
||||
|
||||
|
@@ -32,10 +32,10 @@
|
||||
<tr class="gradeX">
|
||||
<td class="text-center"> {{ post.id }} </td>
|
||||
<td class="text-center"> {{ post.name }} </td>
|
||||
<td class="text-center"> <a href="/jasset/idc_detail/{{ post.id }}">{{ post.asset_set.count }}</a> </td>
|
||||
<td class="text-center"> <a href="/jasset/idc_detail/?id={{ post.id }}">{{ post.asset_set.count }}</a> </td>
|
||||
<td class="text-center"> {{ post.comment }} </td>
|
||||
<td class="text-center">
|
||||
<a href="/jasset/idc_detail/{{ post.id }}" class="iframe btn btn-xs btn-primary">详情</a>
|
||||
<a href="/jasset/?id={{ post.id }}" class="iframe btn btn-xs btn-primary">详情</a>
|
||||
<a href="/jasset/idc_del/{{ post.id }}" class="btn btn-xs btn-danger">删除</a>
|
||||
</td>
|
||||
</tr>
|
||||
|
@@ -1,17 +1,8 @@
|
||||
{% load mytags %}
|
||||
<html>
|
||||
<head>
|
||||
<link href="/static/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="/static/font-awesome/css/font-awesome.css" rel="stylesheet">
|
||||
<link href="/static/css/plugins/iCheck/custom.css" rel="stylesheet">
|
||||
<link href="/static/css/animate.css" rel="stylesheet">
|
||||
<link href="/static/css/style.css" rel="stylesheet">
|
||||
<link href="/static/css/colorbox.css" rel="stylesheet">
|
||||
|
||||
<!-- Mainly scripts -->
|
||||
<script src="/static/js/jquery-2.1.1.js"></script>
|
||||
<script src="/static/js/bootstrap.min.js"></script>
|
||||
<script src="/static/js/plugins/metisMenu/jquery.metisMenu.js"></script>
|
||||
<script src="/static/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
|
||||
{% include 'link_css.html' %}
|
||||
{% include 'head_script.html' %}
|
||||
|
||||
<style type="text/css">
|
||||
body
|
||||
@@ -24,7 +15,7 @@
|
||||
<body>
|
||||
<div class="row">
|
||||
<div class="contact-box">
|
||||
<h2 class="text-center">{{ offset }}主机详情</h2>
|
||||
<h3 class="text-center">{{ offset }}主机详情</h3>
|
||||
<table class="table table-striped table-bordered table-hover " id="editable" >
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -39,22 +30,60 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="gradeX">
|
||||
<td> <a class="iframe" href="/jasset/{{ post.ip }}/">{{ post.ip }}</a></td>
|
||||
<td> <a id="ip" class="iframe" href="/jasset/{{ post.ip }}/">{{ post.ip }}</a></td>
|
||||
<td> {{ post.port }} </td>
|
||||
<td> {{ post.get_login_type}} </td>
|
||||
<td class="center"> {{ post.idc.name }} </td>
|
||||
<td class="center">
|
||||
{% for group in post.bis_group.all %}
|
||||
{{ group }}
|
||||
{% endfor %}
|
||||
</td>
|
||||
<td class="center"> {{ post.date_added }} </td>
|
||||
<td class="center"> {{ post.comment }} </td>
|
||||
<td> {{ login_types|get_item:post.login_type }} </td>
|
||||
<td class="text-center"> {{ post.idc.name }} </td>
|
||||
<td class="text-center">{% for group in post.bis_group.all|filter_private %} {{ group }} {% endfor %}</td>
|
||||
<td class="text-center"> {{ post.date_added|date:"Y-m-d H:i:s" }} </td>
|
||||
<td class="text-center"> {{ post.comment }} </td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<a> 是否激活: {{ post.is_active }}</a>
|
||||
<!--<a> 是否激活: {{ post.is_active }}</a>-->
|
||||
<h3 class="text-center">最近一周登录详情</h3>
|
||||
<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>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for l in log %}
|
||||
<tr class="gradeX">
|
||||
<td class="text-center" id="username"> {{ l.user }} </td>
|
||||
<td class="text-center" id="start_time">{{ l.start_time|date:"Y-m-d H:i:s" }}</td>
|
||||
<td class="text-center" id="end_time"> {{ l.end_time|date:"Y-m-d H:i:s" }} </td>
|
||||
<td class="text-center">
|
||||
<a class="log_command text-success" href="/jlog/history/?id={{ l.id }}">命令统计</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
<script src="/static/js/bootstrap-dialog.js"></script>
|
||||
<script>
|
||||
$('.log_command').on('click',function(){
|
||||
var url = $(this).attr('href');
|
||||
var username = $('#username')[0].innerText;
|
||||
var ip = $('#ip')[0].innerText;
|
||||
var start_time = $('#start_time')[0].innerText;
|
||||
var end_time = $('#end_time')[0].innerText;
|
||||
var div_username = ' 登录用户名: '+'<span class="text-info">'+username+'' + '</span>';
|
||||
var div_ip = ' 登录主机: '+'<span class="text-info">' + ip + '</span>';
|
||||
var div_time = ' 开始时间: ' + '<span class="text-info">'+start_time +'</span>' + ' 结束时间: ' +'<span class="text-info">' + end_time + '</span>'
|
||||
var title = div_username + div_ip + div_time
|
||||
$.ajax({url:url,success:function(data){
|
||||
BootstrapDialog.show({title: title, message:data});
|
||||
}});
|
||||
return false;
|
||||
})
|
||||
</script>
|
||||
</html>
|
@@ -21,7 +21,7 @@
|
||||
</ul>
|
||||
</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>
|
||||
<a><i class="fa fa-cube"></i> <span class="nav-label">资产管理</span><span class="fa arrow"></span></a>
|
||||
<ul class="nav nav-second-level">
|
||||
<li id="host_add"><a href="/jasset/host_add/">添加资产</a></li>
|
||||
<li id="host_list"><a href="/jasset/host_list/">查看资产  </span><span class="label label-info pull-right">16/18</span></a></li>
|
||||
|
Reference in New Issue
Block a user