You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
347 lines
11 KiB
347 lines
11 KiB
10 months ago
|
<#include "../../_include/_t.ftl"/>
|
||
|
<!DOCTYPE html>
|
||
|
<html>
|
||
|
<head>
|
||
|
<title></title>
|
||
|
<#include "../../_include/_h.ftl"/>
|
||
|
<#include "../../_include/_l.ftl"/>
|
||
|
<#include "../../_include/_j.ftl"/>
|
||
|
<#include "../../_include/_z.ftl"/>
|
||
|
<#include "../../_include/_e.ftl"/>
|
||
|
<#include "../../_include/_p.ftl"/>
|
||
|
<#include "../../_include/admin/_c.ftl"/>
|
||
|
</head>
|
||
|
<body>
|
||
|
<div class="page_div">
|
||
|
<blockquote class="layui-elem-quote">${title}</blockquote>
|
||
|
<div class="layui-bg-gray page_tools">
|
||
|
<div class="layui-inline layui-form" style="width:110px;" id="log_appId_tips">
|
||
|
<select id="log_logType" lay-filter="log_logType_filter">
|
||
|
<option value="1">登录操作</option>
|
||
|
</select>
|
||
|
</div>
|
||
|
<div class="layui-inline layui-form" style="width:250px;" id="log_appId_tips">
|
||
|
<select id="log_appId" lay-filter="log_appId_filter">
|
||
|
<option value="">请选择应用系统</option>
|
||
|
<option value="iffclouds">智慧消防云平台(Web平台端)</option>
|
||
|
<option value="iffcloudsapp">智慧消防云平台(Mobile移动端)</option>
|
||
|
</select>
|
||
|
</div>
|
||
|
<div class="layui-inline" style="width:130px;">
|
||
|
<input class="layui-input" id="log_usersInfo" placeholder="账号(支持模糊)" autocomplete="off"/>
|
||
|
</div>
|
||
|
<div class="layui-input-inline" style="width:100px;" id="taski1_beginTime_tips">
|
||
|
<input class="layui-input" type="text" id="log_beginTime" value="${.now?string('yyyy-MM')}-01" placeholder="操作开始时间" autocomplete="off" style="cursor:pointer;"/>
|
||
|
</div>
|
||
|
<div class="layui-input-inline" style="width:100px;" id="taski1_endTime_tips">
|
||
|
<input class="layui-input" type="text" id="log_endTime" value="${.now?string('yyyy-MM-dd')}" placeholder="操作结束时间" autocomplete="off" style="cursor:pointer;"/>
|
||
|
</div>
|
||
|
<button id="log_queryBtn" class="layui-btn layui-btn-normal"><i class="layui-icon"></i>查询</button>
|
||
|
<button id="log_resetBtn" class="layui-btn layui-btn-normal"><i class="layui-icon"></i>重置</button>
|
||
|
<button id="log_ipBtn" class="layui-btn"><i class="layui-icon"></i>IP地址分析</button>
|
||
|
</div>
|
||
|
<table id="log_dataTable" lay-filter="log_dataTable_filter" lay-size="sm"></table>
|
||
|
</div>
|
||
|
<!--修改页面-->
|
||
|
<div id="log_updateWin" class="page_win page_win_hide">
|
||
|
<form id="log_updateForm" lay-filter="log_updateForm_filter" class="layui-form">
|
||
|
<input type="hidden" name="id" value=""/>
|
||
|
<input type="hidden" name="appId" value=""/>
|
||
|
<div class="layui-form-item">
|
||
|
<label class="layui-form-label">所属应用:</label>
|
||
|
<div class="layui-form-mid"><span id="log_updateForm_app"></span></div>
|
||
|
</div>
|
||
|
<div class="layui-form-item">
|
||
|
<label class="layui-form-label">规则名称:</label>
|
||
|
<div class="layui-input-inline" style="width:600px;">
|
||
|
<input type="text" name="ruleName" class="layui-input" placeholder="请输入规则名称" lay-verify="required" lay-verType="tips" autocomplete="off"/>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="layui-form-item">
|
||
|
<label class="layui-form-label">描述:</label>
|
||
|
<div class="layui-input-inline" style="width:600px;">
|
||
|
<input type="text" name="ruleDes" class="layui-input" placeholder="请输入描述" autocomplete="off"/>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="layui-form-item">
|
||
|
<label class="layui-form-label">详情:</label>
|
||
|
<div class="layui-input-inline">
|
||
|
<ul id="log_updateTree" class="ztree"></ul>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="layui-form-item">
|
||
|
<div class="layui-input-block page_btn">
|
||
|
<button lay-submit class="layui-btn layui-btn-normal" lay-filter="log_updateForm_filter"><i class="icon_submit"></i>保存数据</button>
|
||
|
<button id="log_updateForm_closeBtn" class="layui-btn layui-btn-danger"><i class="icon_cancel"></i>关闭</button>
|
||
|
</div>
|
||
|
</div>
|
||
|
</form>
|
||
|
</div>
|
||
|
|
||
|
<div id="log_ip" class="page_win page_win_hide">
|
||
|
<div id="log_ip_analyzed" style="width:1000px;height:500px;"></div>
|
||
|
</div>
|
||
|
|
||
|
<script type="text/javascript">
|
||
|
layuiplus.on_w_1(function(){
|
||
|
layuiplus.init(1);
|
||
|
//定义窗口变量============
|
||
|
var log_addWin = null;
|
||
|
var log_updateWin = null;
|
||
|
//数据表格=================================================================================
|
||
|
var log_dataTable = table.render({
|
||
|
elem:"#log_dataTable",
|
||
|
url:"${ctx}/admin/sys/log/list",
|
||
|
method:"get",
|
||
|
cols:[[
|
||
|
{field:"logType",title:"日志类型",unresize:true,width:160,templet:function(d){
|
||
|
if(d.logType == "1") return "<span style=\"color:green;\">登录</span>";
|
||
|
if(d.logType == "2") return "<span style=\"color:blue;\">操作</span>";
|
||
|
}},
|
||
|
{field:"logTime",title:"操作时间",unresize:true,width:160},
|
||
|
{field:"appId",title:"所属应用系统",unresize:true,width:160,templet:function(d){
|
||
|
if(d.appId == "iffclouds")
|
||
|
return "<span style=\"color:green;\">Web平台端</span>";
|
||
|
else
|
||
|
return "<span style=\"color:blue;\">Mobile移动端</span>";
|
||
|
}},
|
||
|
{field:"usersInfo",title:"登录账号",unresize:true,width:200},
|
||
|
{field:"logIp",title:"登录IP地址",unresize:true,width:160},
|
||
|
{field:"logM",title:"操作模块",unresize:true,width:200,templet:function(d){
|
||
|
if(d.logType == "1") return "-";
|
||
|
if(d.logType == "2") return "-"
|
||
|
}}
|
||
|
/*
|
||
|
{title:"操作 ",unresize:true,align:"left",templet:function(d){
|
||
|
var opt = "<a class=\"layui-btn layui-btn-xs\" lay-event=\"opt_copy\">复制账号</a> ";
|
||
|
return opt;
|
||
|
}}
|
||
|
*/
|
||
|
]],
|
||
|
page:{
|
||
|
layout:["prev","page","next","skip","count","limit"],
|
||
|
limits:[10,20,30]
|
||
|
//curr:1,//设定初始页
|
||
|
//groups:5,//连续页码
|
||
|
//first:"首页",//不设置为1
|
||
|
//last:"尾页"//不设置为总页数
|
||
|
},
|
||
|
text:{none:"暂无数据,请点击查询。"}
|
||
|
});
|
||
|
//数据表格每行数据操作监听=================================================================
|
||
|
/*
|
||
|
table.on("tool(log_dataTable_filter)",function(row){//row.data row.event
|
||
|
if(row.event == "opt_copy"){
|
||
|
}
|
||
|
});
|
||
|
*/
|
||
|
//数据表格上面工具栏================================================================================
|
||
|
form.on("select(log_appId_filter)",function(data){
|
||
|
//console.log(data.value);//得到被选中的值
|
||
|
if(data.value == "") return false;
|
||
|
log_dataTable.reload({
|
||
|
url:"${ctx}/admin/sys/log/list",
|
||
|
where:{
|
||
|
logType:$("#log_logType").val(),
|
||
|
usersInfo:$("#log_usersInfo").val(),
|
||
|
beginTime:$("#log_beginTime").val(),
|
||
|
endTime:$("#log_endTime").val(),
|
||
|
appId:data.value
|
||
|
}
|
||
|
});
|
||
|
});
|
||
|
$("#log_queryBtn").click(function(){
|
||
|
log_dataTable.reload({
|
||
|
url:"${ctx}/admin/sys/log/list",
|
||
|
where:{
|
||
|
logType:$("#log_logType").val(),
|
||
|
usersInfo:$("#log_usersInfo").val(),
|
||
|
beginTime:$("#log_beginTime").val(),
|
||
|
endTime:$("#log_endTime").val(),
|
||
|
appId:$("#log_appId").val()
|
||
|
}
|
||
|
});
|
||
|
});
|
||
|
$("#log_resetBtn").click(function(){
|
||
|
$("#log_usersInfo").val("");
|
||
|
$("#log_beginTime").val("${.now?string('yyyy-MM')}-01");
|
||
|
$("#log_endTime").val("${.now?string('yyyy-MM-dd')}");
|
||
|
log_dataTable.reload({
|
||
|
url:"${ctx}/admin/sys/log/list",
|
||
|
where:{
|
||
|
logType:$("#log_logType").val(),
|
||
|
usersInfo:$("#log_usersInfo").val(),
|
||
|
beginTime:$("#log_beginTime").val(),
|
||
|
endTime:$("#log_endTime").val(),
|
||
|
appId:$("#log_appId").val()
|
||
|
}
|
||
|
});
|
||
|
});
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
$("#log_ipBtn").click(function(){
|
||
|
$.post("${ctx}/admin/sys/log/ip", {}, function(str){
|
||
|
var obj = JSON.parse(str);
|
||
|
var data1 = [];
|
||
|
var data2 = [];
|
||
|
//将json对象中取出的数据存到数组里
|
||
|
for(var i=0;i<obj.length;i++){
|
||
|
data1[i] = obj[i].LOG_IP;
|
||
|
data2[i] = obj[i].NUM;
|
||
|
}
|
||
|
var myCharts = echarts.init(document.getElementById("log_ip_analyzed"));
|
||
|
var options = {
|
||
|
legend: {
|
||
|
data:['登陆次数']
|
||
|
},
|
||
|
tooltip : {
|
||
|
trigger: 'axis'
|
||
|
},
|
||
|
xAxis: {
|
||
|
type: 'category',
|
||
|
data: data1,
|
||
|
axisLabel: {
|
||
|
interval:0,
|
||
|
rotate:30
|
||
|
}
|
||
|
},
|
||
|
yAxis: {
|
||
|
type: 'value'
|
||
|
},
|
||
|
series: [{
|
||
|
name:'登陆次数',
|
||
|
data: data2,
|
||
|
type: 'bar',
|
||
|
barWidth: 40
|
||
|
}]
|
||
|
};
|
||
|
myCharts.setOption(options);
|
||
|
layer.open({
|
||
|
title:"IP地址分析",
|
||
|
type: 1,
|
||
|
area: ["1000px", "550px"],
|
||
|
content: $("#log_ip")
|
||
|
});
|
||
|
});
|
||
|
});
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
//添加窗口按钮=====================================================================================
|
||
|
form.on("submit(log_addForm_filter)",function(formData){
|
||
|
var log_tree = $.fn.zTree.getZTreeObj("log_addTree");
|
||
|
var nodes = log_tree.getCheckedNodes(true);
|
||
|
if(nodes.length == 0) return false;
|
||
|
var arr1 = new Array();//存全选的
|
||
|
var arr2 = new Array();//存半选的
|
||
|
for(var i = 0;i < nodes.length;i++){
|
||
|
if(nodes[i].getCheckStatus().half){
|
||
|
arr2.push(nodes[i].id);
|
||
|
}else{
|
||
|
arr1.push(nodes[i].id);
|
||
|
}
|
||
|
}
|
||
|
var _data = formData.field;
|
||
|
_data.ruleVals = arr1.join(",");
|
||
|
_data.ruleVals2 = arr2.join(",");
|
||
|
$.ajax({
|
||
|
type:"post",
|
||
|
url:"${ctx}/admin/resource/rule/add",
|
||
|
data:_data,
|
||
|
dataType:"json",
|
||
|
success:function(data){
|
||
|
if(data.status == true){
|
||
|
log_dataTable.reload({
|
||
|
where:{
|
||
|
appId:$("#log_appId").val()
|
||
|
}
|
||
|
});
|
||
|
layer.close(log_addWin);
|
||
|
layer.msg("操作成功",{time:2000});
|
||
|
}
|
||
|
}
|
||
|
});
|
||
|
return false;
|
||
|
});
|
||
|
$("#log_addForm_closeBtn").click(function(){
|
||
|
layer.close(log_addWin);
|
||
|
return false;
|
||
|
});
|
||
|
//修改按钮=====================================================================================
|
||
|
form.on("submit(log_updateForm_filter)",function(formData){
|
||
|
var log_tree = $.fn.zTree.getZTreeObj("log_updateTree");
|
||
|
var nodes = log_tree.getCheckedNodes(true);
|
||
|
if(nodes.length == 0) return false;
|
||
|
var arr1 = new Array();//存全选的
|
||
|
var arr2 = new Array();//存半选的
|
||
|
for(var i = 0;i < nodes.length;i++){
|
||
|
if(nodes[i].getCheckStatus().half){
|
||
|
arr2.push(nodes[i].id);
|
||
|
}else{
|
||
|
arr1.push(nodes[i].id);
|
||
|
}
|
||
|
}
|
||
|
var _data = formData.field;
|
||
|
_data.ruleVals = arr1.join(",");
|
||
|
_data.ruleVals2 = arr2.join(",");
|
||
|
$.ajax({
|
||
|
type:"post",
|
||
|
url:"${ctx}/admin/resource/rule/update",
|
||
|
data:_data,
|
||
|
dataType:"json",
|
||
|
success:function(data){
|
||
|
if(data.status == true){
|
||
|
log_dataTable.reload({
|
||
|
where:{
|
||
|
appId:$("#log_appId").val()
|
||
|
}
|
||
|
});
|
||
|
layer.close(log_updateWin);
|
||
|
layer.msg("操作成功",{time:2000});
|
||
|
}
|
||
|
}
|
||
|
});
|
||
|
return false;
|
||
|
});
|
||
|
$("#log_updateForm_closeBtn").click(function(){
|
||
|
layer.close(log_updateWin);
|
||
|
return false;
|
||
|
});
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
//时间控制
|
||
|
ldate.render({
|
||
|
elem:"#log_beginTime"
|
||
|
});
|
||
|
ldate.render({
|
||
|
elem:"#log_endTime",
|
||
|
max:"${.now?string('yyyy-MM-dd')}"
|
||
|
});
|
||
|
|
||
|
|
||
|
});
|
||
|
</script>
|
||
|
</body>
|
||
|
</html>
|