1、新增 inline-device 历史流量折线图

2、优化交换机监测折线图 查询语句
3、修改 监测设置,一个字段只能设置一个告警配置的限制
4、修改首页菜单宽度
This commit is contained in:
fangshunjian
2019-01-22 12:13:38 +06:00
parent 97248b92ba
commit 9b39c65447
12 changed files with 802 additions and 45 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

@@ -424,13 +424,15 @@ html, body {
.nav a span{
margin-left: 40px;
}
#leftNodes {
width:250px;
}
.middle_tab{
left: 210px;
left: 250px;
}
.middle_right{
left : 215px;
left : 255px;
}
@@ -564,7 +566,7 @@ html, body {
<table>
<tr valign="buttom" id="titles">
<td width="100%" height="18" background="<c:url value='/images/main_58.png'/>">
<div align="center" style="width: 210px;background-color: #a81e32">
<div align="center" style="width: 250px;background-color: #a81e32">
<span id="show" class="STYLE1"
style="color: rgb(242, 229, 229);cursor:pointer; font-weight: bold;width: 100%">▽i18n_main.text.show1_n81i▽</span>
</div>

View File

@@ -29,6 +29,7 @@
<script type="text/javascript" src="<c:url value='/js/WebCalendar.js' />"></script>
<script>
var oldDrawDiv = "1";
Highcharts.setOptions({global: {useUTC: false}});
$(function() {
$( "#tabs" ).tabs();
$( "#tabs" ).removeClass("ui-widget");//删除ui样式(此样式会使折线图下方navigator失灵)

View File

@@ -58,10 +58,10 @@
addr:"Astana",
url:'http://10.0.5.19:8086/query'
},
/* "100001":{
"100001":{
addr:"Almaty",
url:'http://10.0.5.19:8086/query'
} */
url:'http://10.0.5.15:8086/query'
}
};
//配置查询相关信息
var queryInfo = {

View File

@@ -32,6 +32,23 @@
document.form3.submit();
}
//绘制折线图
function drawPic(deviceId,seqId,title){
var url = "/nmsweb/detection/inlineDevice.do?action=drawPic&checkTypeId=10&dsiId=9&sqId="+seqId +"&deviceId=" + deviceId;
//iframe窗
top.layer.open({
type: 2,
title: title,
shadeClose: false,
shade: 0.6 ,
maxmin: true, //开启最大化最小化按钮
area: ['1200px', '750px'],
content: url
});
}
jQuery(function(){
$("#info").floatHeaderDiv();
})
@@ -65,31 +82,40 @@
<div class="box_2"><jsp:include page="/include/include.jsp" /></div>
<table border="0" cellpadding="0" cellspacing="0" class="table">
<tr>
<td width="5%" class="color_top">
<td width="2%" class="color_top">
IP
</td>
<td width="5%" class="color_top">
<td width="2%" class="color_top">
Device ID
</td>
<td width="2%" class="color_top">
Link ID
</td>
<td width="3%" class="color_top">
i18n_deviceType_n81i
</td>
<td width="5%" class="color_top">
<td width="2%" class="color_top">
i18n_addr_n81i
</td>
<td width="5%" class="color_top">
i18n_isp_n81i
</td>
<td width="5%" class="color_top">
<td width="2%" class="color_top">
pass status
</td>
<td width="10%" class="color_top"><!-- 输入速度 mbps -->
<td width="5%" class="color_top"><!-- 输入速度 mbps -->
i18n_sdigp.text.inoctetsspeed_n81i
</td>
<td width="10%" class="color_top"><!-- 输入包速率 pps -->
<td width="5%" class="color_top"><!-- 输入包速率 pps -->
i18n_sdigp.text.inpktsspeed_n81i
</td>
<td width="10%" class="color_8">
<td width="5%" class="color_8">
<!-- 更新时间 -->i18n_dclwl.text.dataCheckTime_n81i
</td>
<td width="15%" class="color_8">
ODF
</td>
</tr>
<c:choose>
<c:when test="${fn:length(page.result) > 0}">
@@ -104,6 +130,12 @@
<td class="${color }">
${item['ip_addr']}
</td>
<td class="${color }">
${item['device_id']}
</td>
<td class="${color }">
${item['link_id']}
</td>
<td class="${color }">
${item['device_type']}
</td>
@@ -118,6 +150,9 @@
</td>
<td class="${color }">
${item['INOCTETSSPEED']}
<a href="javascript:drawPic(${item['id'] },${item['seq_id'] },'${item['ip_addr']}-${item['isp_key_name']}')">
<img src="${pageContext.request.contextPath }/images/action.png" border=0 height="15" width="15" alt="" title="i18n_miln.message.drawPic_n81i" />
</a>
</td>
<td class="${color }">
${item['INPKTSSPEED']}
@@ -125,6 +160,9 @@
<td class="${color }">
${item['DATA_CHECK_TIME']}
</td>
<td class="${color }">
${item['ODF']}
</td>
<tr>
</c:forEach>
</c:when>
@@ -142,6 +180,9 @@
</c:if>
</form>
</div>
<div id="chartDiv"></div>
</body>
</html>

View File

@@ -0,0 +1,564 @@
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/jstl/c" prefix="c"%>
<%@ taglib uri="/jstl/fn" prefix="fn"%>
<%@ taglib uri="/jstl/fmt" prefix="fmt"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>i18n_dswmi.message.title_n81i</title>
<link href="<c:url value='/css/nms.css'/>" rel="stylesheet"
type="text/css" />
<link href="<c:url value='/js/dtree/css/dtree.css'/>"
rel="stylesheet" type="text/css" />
<link href="<%=path%>/css/themes/base/jquery.ui.all.css" rel="stylesheet" type="text/css"></link>
<link href="<%=path%>/css/themes/base/jquery.ui.css" rel="stylesheet" type="text/css"></link>
<script type="text/javascript"src="<c:url value='/js/jquery-1.4.2.min.js'/>"></script>
<script type="text/javascript"
src="<c:url value='/js/ui/jquery-ui.min.js'/>"></script>
<script type="text/javascript"
src="<c:url value='/js/highcharts.js'/>"></script>
<script type="text/javascript" src="<c:url value='/js/WebCalendar.js' />"></script>
<script>
var oldDrawDiv = "1";
Highcharts.setOptions({global: {useUTC: false}});
$(function() {
$( "#tabs" ).tabs();
$( "#tabs" ).removeClass("ui-widget");//删除ui样式(此样式会使折线图下方navigator失灵)
if(document.getElementById("tabs-1")){
$("a[dtype='cli']:eq(0)").trigger('click');
}
$("#ok").click(function() {
var result = "";
var num = $(".checks:checked").size();
//if(num>2){
//alert("请选择不大于2个标识进行绘图以使页面流畅");
//return;
//}else{
$(".checks:checked").each(function() {
var lable = $(this).closest("label");
result += lable.attr("ids")+',';
});
//if (result == "" || result =="undefined") {
//alert("请选择绘制统计图标识");
//return;
//} else {
var metaId= $("#mid").val();
var drwTo= $("#tabIndex").val();
getPicScorce(metaId,drwTo);
//清空选择
//$(".checks").removeAttr("checked");
//resetBg();
//}
//}
})
$("#clear").click(function() {
$(".checks").removeAttr("checked");
resetBg();
})
$(".checks").click(function() {
resetBg();
})
});
function resetBg() {
$(".checks").each(function() {
var label = $(this).closest("label");
if ($(this).is(":checked")) {
label.css("background-Color", "#B5C19B");
} else {
label.css("background-Color", "");
}
})
}
//type为空是服务器检测菜单
//type=1:网元监测
//type=1异常网元
//showHistory不为空是查询监测历史记录
function goBack(){
var action ="<c:url value='/detection/monitorData.do?action=query'/>";
if($("#type").val()== "1"){
action ="<c:url value='/detection/monitorData.do?action=queryNE'/>";
}else if($("#type").val()== "2"){
action ="<c:url value='/detection/monitorData.do?action=queryAbnormalSet'/>";
}
if($("#showHistory").val()== "history"){
action ="<c:url value='/detection/monitorData.do?action=showDetectionInfo'/>";
}
if($("#flag").val()== "queryEmergent"){
action ="<c:url value='/detection/monitorData.do?action=queryEmergent'/>";
}
if($("#flag").val()== "queryEmergentDetail"){
action ="<c:url value='/detection/monitorData.do?action=queryEmergentDetail&requestType=topo&nodeGroupId=${nodeGroupId}&nodeId=${nodeId}'/>";
}
if($("#requestType").val()== "newTopo"){
action ="<c:url value='/detection/monitorData.do?action=query&nodeId=${nodeId}'/>";
}
document.Mkform.action=action;
document.Mkform.submit();
}
//查询记录
function qry(){
var startTime = $("#startTime").val();
if(startTime==""){
alert("i18n_dswmi.message.startTime_n81i");
return;
}
var endTime = $("#endTime").val();
if(endTime==""){
alert("i18n_dswmi.message.endTime_n81i");
return;
}
var start=new Date(startTime.replace(/-/g,"/"));//起始时间操作值
var start1=new Date(startTime.replace(/-/g,"/"));//起始时间备份
start.setDate(start.getDate()+7);//起始时间日期加一周 用来与结束时间比较
var end=new Date(endTime.replace(/-/g,"/"));//结束时间
if(end<=start1){
alert("i18n_dswmi.message.startGtEnd_n81i");
return;
}
if(end>start){
alert("i18n_dswmi.message.intervalErr_n81i");
return;
}
$("#ok").click();
}
var seriesOptions = [];
var policeValue;
var xtilte="";
var ytitle="";
function getPicScorce(metaid,drwTo){
var lns = "";
$(".checks:checked").each(function() {
var lable = $(this).closest("label");
lns += lable.attr("ids")+',';
});
$("#tabIndex").val(drwTo);
$("#mid").val(metaid);//此行要在 判断是否选择绘制统计图标识的前面否则点击其他tab时再选择端口点击确定时不显示曲线图因为展示的字段仍是之前的tab所以当前tab不会显示曲线图
seriesOptions = [];//清空数据源
if (lns == "" || lns =="undefined") {
//避免切换tab时先看到旧的曲线图再刷新为新的曲线图
//$("#tabs-"+oldDrawDiv).empty();
//$("#tabs-"+oldDrawDiv).append('');
//如果未选择统计图标识则新tab需要清理内容否则显示的是之前的内容
$("#tabs-"+drwTo).empty();
$("#tabs-"+drwTo).append('');
alert("i18n_dswmi.message.selectToChart_n81i");
return;
}
$.ajax( {
url : "<%=path%>/detection/monitorData!getSwitchportSource.do?metaId="+metaid+"&dId="+$('#did').val()+"&cId="+$('#ctid').val()+"&seqId="+$('#seqId').val()+"&lns="+lns+"&startTime="+$('#startTime').val()+"&endTime="+$('#endTime').val()+"&type="+$('#type').val()+"&requestType="+$('#requestType').val()+"&nodeGroupId="+$('#nodeGroupId').val(),
type : "POST",
dataType : "json",
success : function(datas) {
if(datas!=null){
$('#tabsHidd-'+drwTo).val('1');
xtitle = datas[0].xtitle;
ytitle = datas[0].ytitle;
policeValue = datas[0].policeVal;
var lines = datas[1].lines;
seriesOptions = [];
if(lines[0].data==null || lines[0].data.length==0){// 针对丢包数,仅显示一条折线
seriesOptions[0] = {
name: lines[2].name,
data: lines[2].data,
type: 'line'
};
} else {// 针对bps\pps显示一条step线和点
seriesOptions[0] = {
name: lines[0].name,
data: lines[0].data,
type: 'line',
step: true,
color: '#0CF223'
};
seriesOptions[1] = {
name: lines[1].name,
data: lines[1].data,
type: 'scatter',
color : '#0896E9'
};
}
if((lines[0].data == null || lines[0].data == "") && (lines[2].data == null || lines[2].data == "") ){
$("#tabs-"+drwTo).empty();
$("#tabs-"+drwTo).append('i18n_dswmi.message.noData_n81i');
}else{
//$.each(lines, function(k, da) {
//seriesOptions[k] = {
// name: da.name,
// data: da.data
//};
createChart(policeValue,drwTo);
//});
}
}else{
$("#tabs-"+drwTo).empty();
$("#tabs-"+drwTo).append('i18n_dswmi.message.noData_n81i');
}
}
})
oldDrawDiv = drwTo;
if (lns == "" || lns =="undefined") {
$(".checks").first().addr("checked","true");
}
}
function createChart(policeNum,dto) {
var chartObj = new Highcharts.Chart(
{
chart : {
renderTo : 'tabs-'+dto,
zoomType : 'x',
showAxes : true,
spacingRight : 20,
defaultSeriesType : 'line',
borderWidth: 1
},
title : {
text : xtitle
},
subtitle : {
text : ''//这是副标题内容
},
xAxis : {
type : 'datetime',
//maxZoom : 1000 * 60 * 60 * 24 *14,
//startOfWeek: 50,
labels : {
rotation : 20,
y : 20,
x : 20
},
dateTimeLabelFormats: {
second: '%Y-%m-%d %H:%M:%S',
minute: '%Y-%m-%d %H:%M',
hour: '%Y-%m-%d %H:%M',
day: '%Y-%m-%d',
week: '%Y-%m-%d',
month: '%Y-%m',
year: '%Y'
}
},
yAxis : {
title : {
text : ytitle
},
minorTickInterval: 'auto',
min:0,
plotLines: [{
value: policeValue,
width: 2,
color: '#F24C52',
dashStyle: 'dash',
label: {
text: 'i18n_dswmi.message.policyLine_n81i:('+policeNum+')',
align: 'right',
y: 8,
x: 0
}
}]/*,
plotBands: [{
from: 80,
to: 100,
color: '#F24C52'
}]*/
},
tooltip : {
borderColor : "#374E94",
backgroundColor : {
linearGradient : [ 0, 0, 0, 60 ],
stops : [ [ 0, '#FFFFFF' ], [ 1, '#E0E0E0' ] ]
},
borderWidth : 1,
shared : true,
crosshairs : {
width : 1,
color : 'red'
},
formatter : function() {
var s = Highcharts.dateFormat("%Y-%m-%d %H:%M",
this.x) + ' [';
$.each(this.points, function(i, point) {
s += '<span style="color:#374E94">'
+ point.series.name
+ ':</span><span style="font-weight: bold;color:#F24C52">'
+ point.y + '</span> ';
});
s = $.trim(s) + "]";
return s;
}
},
plotOptions:{
line:{
lineWidth : 1,
marker: {
radius: 2,
states: {
hover: {
radius: 3
}
}
}
},
area : {
fillColor : {
//linearGradient : [ 0, 0, 0, 200 ],
//stops : [ [ 0, "#F24C52" ], [ 1, 'rgba(255,0,0,0)' ] ]
linearGradient : [ 0, 0, 30, 250 ],
stops : [ [ 0, "#0896E9" ], [ 1, 'rgba(0,157,145,0)' ] ]
},
fillOpacity: 0.08,
lineWidth : 1,
shadow : true,
marker: {
radius: 3,
states: {
hover: {
radius: 5
}
}
}
},
column: {
grouping: false,
shadow: false,
pointPlacement: 'between',
groupPadding: 0,
pointPadding: 0,
borderWidth: 0,
color: '#0CF223'
},
scatter:{
marker: {
radius: 2,
states: {
hover: {
radius: 3
}
},
symbol: 'circle'
}
}
},
exporting : {
buttons : {
exportButton : {
enabled : false
}
}
},
series : seriesOptions,
credits: {
enabled: false,
text: 'i18n_dswmi.message.updateTheMark_n81i'
}
});
Highcharts.setOptions( {
global : {
useUTC : false
}
});
}
</script>
</head>
<body>
<form action="" name="Mkform" method="post">
<input type="hidden" name="cip" value="${cip }" />
<input type="hidden" name="ctn" value="${ctn }" />
<input type="hidden" name="stateInfo" id="stateInfo" value="${stateInfo }" />
<input type="hidden" id="seqId" name="seqId" value="${sqId}"/>
<input type="hidden" id="did" name ="dsiId" value="${dsiId }"/>
<input type="hidden" id="nodeIpRange" name ="nodeIpRange" value="${nodeIpRange }"/>
<input type="hidden" id="nodeGroupStr" name ="nodeGroupStr" value="${nodeGroupStr }"/>
<input type="hidden" id = "ctid" name="ctid" value = "${ctId}"/>
<input type="hidden" id = "isClick" name="isClick" value ="0"/>
<input type="hidden" id = "mid" name="mid" value = "${metaId}"/>
<input type="hidden" id="tabIndex" value=""/>
<!-- type为空服务器检测type=1网元检测 type=2:异常网元 -->
<input type="hidden" value="${type }" name="type" id="type"/>
<input type="hidden" value="${flag }" name="flag" id="flag"/>
<input type="hidden" value="${nodeType }" name="nodeType" id="nodeType"/>
<!-- 来源于拓扑图 begin -->
<input type="hidden" id="requestType" name="requestType" value="${requestType }" />
<input type="hidden" id="nodeGroupId" name="nodeGroupId" value="${nodeGroupId }" />
<!-- 来源于拓扑图 end -->
<!-- 是否为特种设备进入此页面 -->
<input type="hidden" name="entry" id="entry" value="${entry }"/>
<input type="hidden" name="detectId" id="detectId" value="${detectId }"/>
<input type="hidden" name="ip" id="ip" value="${ip }"/>
<input type="hidden" name="pid" id="pid" value="${pid }"/>
<!-- 查看监测设置历史记录 begin -->
<input type="hidden" name="sqId" value="${sqId }" />
<input type="hidden" name="sTime" value="${sTime }" />
<input type="hidden" name="eTime" value="${eTime }" />
<input type="hidden" name="status" value="${status }" />
<input type="hidden" name="showHistory" value="${showHistory }" id="showHistory" />
<!-- 查看监测设置历史记录 end -->
<jsp:include page="/common/transferHiddenParameter.jsp" />
<table width="80%" align="center" border="0" cellpadding="0"
cellspacing="1" class="table">
<tr>
<td class="color_8" colspan="2">
<strong>i18n_dswmi.message.title_n81i</strong>
</td>
</tr>
<tr>
<td class="box_1">
<div class="box_1">
<label class="divTopText"><font class="selectText">i18n_dswmi.text.startTime_n81i</font>
<%--<%
Date d = new Date();
d.setDate(d.getDate()-7);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String st = sdf.format(d);
String et = sdf.format(new Date());
%>
--%><input type="text" id="startTime"
name="startTime" value="" readonly
onclick="SelectDate(this,'yyyy-MM-dd',${session.i18n_lang == 'zh_CN'?0:1})"/></label>
<label class="divTopText"><font class="selectText">i18n_dswmi.text.endTime_n81i</font>
<input type="text" id="endTime"
name="endTime" value="" readonly
onclick="SelectDate(this,'yyyy-MM-dd',${session.i18n_lang == 'zh_CN'?0:1})"/></label>
<img src="<c:url value='/images/button_chaxun.png'/>"
class="img_middle2" onclick="javascript:qry();" />
</div>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color: red;">i18n_dswmi.message.defaultMsg_n81i</span>
</td>
<td class="box_2">
<div class="box_2" style="margin-top: 5px;">
<!-- <input type="button" class=btn3_mouseout
onmouseover="this.className='btn3_mouseover'"
onmouseout="this.className='btn3_mouseout'"
onmousedown="this.className='btn3_mousedown'"
onmouseup="this.className='btn3_mouseup'"
onclick="goBack()" value="i18n_dswmi.button.back_n81i"/> -->
</div>
</td>
</tr>
<tr>
<td align="center" colspan="2">
<div id="tabs">
<c:set var="index" value="${1}" />
<c:set var="index1" value="${1}" />
<c:choose>
<c:when test="${fn:length(metadataList) > 0}">
<ul>
<c:forEach items="${metadataList}" var="meta">
<c:if test="${meta.filedComments==''}">
<li>
<a dtype='cli' href="#tabs-${index }" onclick="getPicScorce(${meta.id },'${index }')">${meta.filedName}</a>
<input id="tabsHidd-${index }" type="hidden" value="0"/>
</li>
</c:if>
<c:if test="${meta.filedComments!=''}">
<li>
<a dtype='cli' href="#tabs-${index }" onclick="getPicScorce(${meta.id },'${index }')">${meta.filedComments}</a>
<input id="tabsHidd-${index }" type="hidden" value="0"/>
</li>
</c:if>
<c:set var="index" value="${index + 1}" />
</c:forEach>
</ul>
<!-- 画图用的div -->
<c:forEach items="${metadataList}" var="meta1">
<div id="tabs-${index1 }" style='padding: 0;margin: 0;width: 95%; height: 450px;'>
</div>
<c:set var="index1" value="${index1 + 1}" />
</c:forEach>
</c:when>
<c:otherwise>
<span>i18n_dswmi.message.noRecord_n81i</span>
</c:otherwise>
</c:choose>
</div>
<div id="listDiv"
style="margin:5px 0px;background-color: #d3eaef; text-align:left;overflow: auto;border:1px solid gray;">
<c:choose>
<c:when test="${fn:length(dataList) > 0}">
<table width="100%" align="left" border="0" cellpadding="0" cellspacing="0" style="margin-top: 5px;">
<c:set var="numPerRow" value="${6}" />
<c:forEach items="${dataList}" var="item" varStatus="iIndex" >
<c:if test="${iIndex.count%numPerRow==1}">
<tr>
</c:if>
<td align="left" width="10%">
<label class="item" title="${item}" ids="${item}"style="text-overflow: ellipsis; overflow: hidden;padding-left: 5px;">
<input name='lineNameRadio' class="checks" type="checkbox" value="${item}" ${iIndex.index eq 0 ? "checked=checked" : ""} />
${item}
</label>
</td>
<c:if test="${iIndex.count%numPerRow==0}">
</tr>
</c:if>
</c:forEach>
<c:if test="${fn:length(dataList)%numPerRow!=0}">
</tr>
</c:if>
</table>
</c:when>
<c:otherwise>
<span>i18n_dswmi.textnoClassify_n81i</span>
</c:otherwise>
</c:choose>
<span style=" text-align: left;">
<br/>
<input type="button" class=btn3_mouseout
onmouseover="this.className='btn3_mouseover'"
onmouseout="this.className='btn3_mouseout'"
onmousedown="this.className='btn3_mousedown'"
onmouseup="this.className='btn3_mouseup'"
id="clear" value="i18n_dswmi.button.clearSelected_n81i"/>
&nbsp;
<input type="button" class=btn3_mouseout
onmouseover="this.className='btn3_mouseover'"
onmouseout="this.className='btn3_mouseout'"
onmousedown="this.className='btn3_mousedown'"
onmouseup="this.className='btn3_mouseup'"
id="ok" value="i18n_dswmi.button.sure_n81i"/>
</span>
</div>
</td>
</tr>
</table>
</form>
<br />
</body>
</html>

View File

@@ -400,7 +400,7 @@
onkeyup="lianxiangkeyup('nodeIp','NodeTable','String','nodeIp','suggest1',this.value);"
name="nodeIp" title="i18n_sitl.message.nodeIp_n81i" value="${nodeIp}" size="20" />
<div id='suggest1' class="ac_results"></div></label>
<label class="divTopText"><font class="selectText">i18n_sitl.text.networElementType_n81i</font>
<%-- <label class="divTopText"><font class="selectText">i18n_sitl.text.networElementType_n81i</font>
<select name="networElementType" id="networElementType" style="width:140px;" >
<option value="">i18n_sitl.message.selectDefault_n81i</option>
<c:forEach items="${optionList}" var="optionTable" >
@@ -408,7 +408,7 @@
${optionTable.typeValue}
</option>
</c:forEach>
</select> </label>
</select> </label> --%>
<img src="<c:url value='/images/button_chaxun.png'/>"
class="img_middle2" onclick="javascript:qry();" />
</div>

View File

@@ -6,7 +6,7 @@ import com.nms.thread.common.ThreadPoolCommon;
import com.nms.thread.socket.SSLClient;
public class DetectInsertTimeOutThread implements Runnable{
private static final Logger logger = Logger.getLogger(DetectDatasTimeoutAlarmThread.class);
private static final Logger logger = Logger.getLogger(DetectInsertTimeOutThread.class);
private String ip;
private int port;
private long timeout;

View File

@@ -13,13 +13,17 @@ import org.hibernate.SQLQuery;
import com.nis.util.StringUtil;
import edu.emory.mathcs.backport.java.util.Arrays;
import nis.nms.domains.CheckTypeInfo;
import nis.nms.domains.Metadata;
import nis.nms.service.CommonService;
import nis.nms.util.BaseAction;
import nis.nms.util.Constant;
import nis.nms.util.Page;
@Results({
@Result(name = "inlineInfoList", value = "/page/detection/monitorData/inlineInfoList.jsp")
@Result(name = "inlineInfoList", value = "/page/detection/monitorData/inlineInfoList.jsp"),
@Result(name = "inlineSwitchportMonitorInfo", value = "/page/detection/monitorData/inlineSwitchportMonitorInfo.jsp")
})
@SuppressWarnings("all")
public class InlineDeviceAction extends BaseAction{
@@ -34,6 +38,12 @@ public class InlineDeviceAction extends BaseAction{
private String nodeIp;//查询条件节点ip
private String addrCode; //查询条件:地域编码
private String ispKeyCode;//查询条件:运营商唯一标识
private String sqId;
private String ctId;
private String detectionSetInfoId;
private List metadataList;
private List dataList;
private String dsiId;
@Override
public String executeAction() throws Exception {
@@ -41,6 +51,8 @@ public class InlineDeviceAction extends BaseAction{
//查询运营商等信息
if("query".equalsIgnoreCase(this.action)) {
result = inlineInfoList();
}else if("drawPic".equalsIgnoreCase(this.action)) {
result = ajaxDrawDateSource();
}
return result;
}
@@ -180,6 +192,57 @@ public class InlineDeviceAction extends BaseAction{
this.getRequest().setAttribute("page", devicePage);
return "inlineInfoList";
}
public String ajaxDrawDateSource() {
String resu = "";
try {
String deviceId = this.getRequest().getParameter("deviceId");//sys_device_info表的id deviceId
dsiId = this.getRequest().getParameter("dsiId");
sqId = this.getRequest().getParameter("sqId");
ctId = this.getRequest().getParameter("checkTypeId");
detectionSetInfoId=this.getRequest().getParameter("detectionSetInfoId");
CheckTypeInfo checkTypeInfo = (CheckTypeInfo) this.commonService.get(CheckTypeInfo.class,Long.parseLong(ctId));
String tString = "select * from metadata where table_name = "
+ "(select table_name from check_type_info where id="
+ "(select check_type_id from detection_set_info where id=" + dsiId + ")) "
+ " and chart_state = '0'";
metadataList = this.commonService.executeSQL(tString, Metadata.class);
String sql = "SELECT " +
" sdi.*,nt.* " +
" FROM " +
" sys_device_info sdi " +
" LEFT JOIN ( SELECT node_ip, seq_id FROM node_table GROUP BY node_ip ) nt ON nt.node_ip = sdi.ip_addr " +
"where sdi.status != 0 and sdi.id = ?";
List<Map<String,Object>> list = commonService.executeSQLMap(sql, deviceId);
if(list != null && list.size()>0) {
Map<String, Object> deviceMap = list.get(0);
String portName = deviceMap.get("port_name")+"";
if(!StringUtil.isBlank(portName)) {
String[] split = portName.split(",");
dataList = Arrays.asList(split);
}
}
// 针对多项监测都使用分类标识所以取消判断是否为snmp监控
// 得到分类标识字段
return "inlineSwitchportMonitorInfo";
} catch (Exception e) {
e.printStackTrace();
logger.error(e.getStackTrace());
outHtmlString(
"<script type=\"text/javascript\">alert('i18n_MonitorDataAction.emportCurrentXlsAbnormalSet.faild_n81i');this.location='detectionSet.do?action=query&pageNo="
+ pageNo + "&pageSize=" + pageSize + "'</script>");
}
return resu;
}
public CommonService getCommonService() {
return commonService;
@@ -245,5 +308,61 @@ public class InlineDeviceAction extends BaseAction{
this.ispKeyCode = ispKeyCode;
}
public SimpleDateFormat getSdf() {
return sdf;
}
public void setSdf(SimpleDateFormat sdf) {
this.sdf = sdf;
}
public String getSqId() {
return sqId;
}
public void setSqId(String sqId) {
this.sqId = sqId;
}
public String getCtId() {
return ctId;
}
public void setCtId(String ctId) {
this.ctId = ctId;
}
public String getDetectionSetInfoId() {
return detectionSetInfoId;
}
public void setDetectionSetInfoId(String detectionSetInfoId) {
this.detectionSetInfoId = detectionSetInfoId;
}
public List getMetadataList() {
return metadataList;
}
public void setMetadataList(List metadataList) {
this.metadataList = metadataList;
}
public List getDataList() {
return dataList;
}
public void setDataList(List dataList) {
this.dataList = dataList;
}
public String getDsiId() {
return dsiId;
}
public void setDsiId(String dsiId) {
this.dsiId = dsiId;
}
}

View File

@@ -12,6 +12,8 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
import org.apache.struts2.config.Result;
@@ -37,6 +39,7 @@ import nis.nms.domains.OptionTable;
import nis.nms.domains.VDetectionInfoNew;
import nis.nms.service.CommonService;
import nis.nms.util.BaseAction;
import nis.nms.util.Common;
import nis.nms.util.Constant;
import nis.nms.util.DateUtil;
import nis.nms.util.ExportUtils;
@@ -1013,18 +1016,25 @@ public class MonitorDataAction extends BaseAction {
try {
String[] linStrings = lines.split(",");// 选择的端口,可能是多个
String temp = "";
String source = "select max(to_char(data_check_time,'yyyy-mm-dd HH24:mi')) maxTime," + sortFiledType[0]
+ " from " + checkTypeInfo.getTableName() + " t where " + metadata.getFiledName() + " is not null"
String source = "select to_char(din.data_check_time,'yyyy-mm-dd HH24:mi') maxTime," + sortFiledType[0]
+ " from " + checkTypeInfo.getTableName() + " t "
+ " left join detection_info_new din on t.DETECTION_INFO_ID = din.DETECTION_INFO_ID "
+ "where " + metadata.getFiledName() + " is not null"
// +" and t.data_check_time >= trunc(sysdate-30)"
+ " and t.detection_info_id in "
/*+ " and t.detection_info_id in "
+ "(select d.id from detection_info d where d.detection_set_info_id=" + dsiId + " and d.seq_id = "
+ seqId + ")";
+ seqId + ")";*/
+ " and din.seq_id =" + seqId
+ " and din.detection_set_info_id=" +dsiId ;
if (null != startTime && !startTime.equals("") && null != endTime && !endTime.equals("")) {
source += " and to_char(data_check_time,'yyyy-mm-dd')>= '" + startTime
+ "' and to_char(data_check_time,'yyyy-mm-dd')<='" + endTime + "'";
} else {
source += " and t.data_check_time >= trunc(sysdate-1) ";
if(Constant.IS_MYSQL) {
source += " and t.data_check_time >= '" + Common.getDateStr(new Date(), "yyyy-MM-dd 00:00:00") +"' " ;
}else {
source += " and t.data_check_time >= trunc(sysdate-1) ";
}
}
if (sortFiledType[1].toString().equals("NUMBER") || sortFiledType[1].toString().equals("Number")) {
temp = lines.substring(0, lines.length() - 1);
@@ -1043,25 +1053,32 @@ public class MonitorDataAction extends BaseAction {
// ------------------以上确定最后一个数据点----------------------------
if (lastList != null && lastList.size() > 0) {
Object[] row = (Object[]) lastList.get(0);
String lastSource = "select * from ( select to_char(data_check_time,'yyyy-mm-dd HH24:mi'),"
+ metadata.getFiledName() + " from " + checkTypeInfo.getTableName() + " t where "
String lastSource = "select * from ( select to_char(t.data_check_time,'yyyy-mm-dd HH24:mi') data_check_time ,"
+ metadata.getFiledName() + " from " + checkTypeInfo.getTableName() + " t "
+ " where "
+ metadata.getFiledName() + " is not null"
// +" and t.data_check_time >= trunc(sysdate-30)"
+ " and t.detection_info_id in "
/*+ " and t.detection_info_id in "
+ "(select d.id from detection_info d where d.detection_set_info_id=" + dsiId
+ " and d.seq_id = " + seqId + ")";
+ " and d.seq_id = " + seqId + ")";*/
+ " and t.seq_id =" + seqId
+ " and t.detection_set_info_id=" +dsiId ;
if (null != startTime && !startTime.equals("") && null != endTime && !endTime.equals("")) {
lastSource += " and to_char(data_check_time,'yyyy-mm-dd')>= '" + startTime
+ "' and to_char(data_check_time,'yyyy-mm-dd')<='" + endTime + "'";
lastSource += " and to_char(t.data_check_time,'yyyy-mm-dd')>= '" + startTime
+ "' and to_char(t.data_check_time,'yyyy-mm-dd')<='" + endTime + "'";
} else {
lastSource += " and t.data_check_time >= trunc(sysdate-1) ";
if(Constant.IS_MYSQL) {
lastSource += " and t.data_check_time >= '" + Common.getDateStr(new Date(), "yyyy-MM-dd 00:00:00") +"' " ;
}else {
lastSource += " and t.data_check_time >= trunc(sysdate-1) ";
}
}
if (sortFiledType[1].toString().equals("NUMBER") || sortFiledType[1].toString().equals("Number")) {
lastSource += " and " + sortFiledType[0] + " = " + row[1] + " order by data_check_time desc) ttt ";
lastSource += " and " + sortFiledType[0] + " = " + row[1] + " order by din.data_check_time desc ) ttt ";
} else if (sortFiledType[1].toString().indexOf("VARCHAR2") != -1) {
lastSource += " and " + sortFiledType[0] + " = '" + row[1] + "' order by data_check_time desc) ttt ";
lastSource += " and " + sortFiledType[0] + " = '" + row[1] + "' order by din.data_check_time desc) ttt ";
}
lastSource += " order by data_check_time desc ";
/* lastSource += " where rownum < 21"; */
// @2018年4月10日18:45:00 fang 修改rownum 适配 mysql
@@ -2904,7 +2921,11 @@ public class MonitorDataAction extends BaseAction {
source += " and to_char(data_check_time,'yyyy-mm-dd')>= '" + startTime
+ "' and to_char(data_check_time,'yyyy-mm-dd')<='" + endTime + "'";
} else {
source += " and t.data_check_time >= trunc(sysdate-1) ";
if(Constant.IS_MYSQL) {
source += " and t.data_check_time >= '" + Common.getDateStr(new Date(), "yyyy-MM-dd 00:00:00") +"' " ;
}else {
source += " and t.data_check_time >= trunc(sysdate-1) ";
}
}
if (sortFiledType[1].toString().equals("NUMBER")
|| sortFiledType[1].toString().equals("Number")) {
@@ -2930,11 +2951,12 @@ public class MonitorDataAction extends BaseAction {
source += " order by data_check_time_digital desc) tttt ";
// @2018年4月10日18:45:00 fang 修改rownum 适配 mysql
if (Constant.IS_MYSQL) {
/*if (Constant.IS_MYSQL) {
source = source + " order by data_check_time_digital asc limit 20";
} else {
source += " where rownum < 21 order by data_check_time_digital asc";// 查询最近时间的21条数据
}
}*/
source += " order by data_check_time_digital asc";
System.out.println("------NoFirstInSource--------sql:" + source);
List lineSourceList = this.commonService.executeSQL(source);
@@ -3012,7 +3034,11 @@ public class MonitorDataAction extends BaseAction {
source += " and to_char(data_check_time,'yyyy-mm-dd')>= '" + startTime
+ "' and to_char(data_check_time,'yyyy-mm-dd')<='" + endTime + "'";
} else {
source += " and t.data_check_time >= trunc(sysdate-1) ";// 默认查询一天的数据
if(Constant.IS_MYSQL) {
source += " and t.data_check_time >= '" + Common.getDateStr(new Date(), "yyyy-MM-dd 00:00:00") +"' " ;
}else {
source += " and t.data_check_time >= trunc(sysdate-1) ";
}
}
if (sortFiledType[1].toString().equals("NUMBER")
|| sortFiledType[1].toString().equals("Number")) {
@@ -3032,11 +3058,12 @@ public class MonitorDataAction extends BaseAction {
* ;//查询最近时间的21条数据
*/
// @2018年4月10日18:45:00 fang 修改rownum 适配 mysql
if (Constant.IS_MYSQL) {
/*if (Constant.IS_MYSQL) {
source = source + " order by data_check_time_digital asc limit 20";
} else {
source += " where rownum < 21 order by data_check_time_digital asc";// 查询最近时间的21条数据
}
}*/
source = source + " order by data_check_time_digital asc";
System.out.println("------source--------sql:" + source);
List lineSourceList = this.commonService.executeSQL(source);
@@ -3097,7 +3124,9 @@ public class MonitorDataAction extends BaseAction {
String jsonStr = JSONArray.fromObject(returnList).toString();
System.out.println(jsonStr);
this.getResponse().setCharacterEncoding("utf-8");
HttpServletResponse response = this.getResponse();
response.setCharacterEncoding("utf-8");
response.setContentType("application/json");
PrintWriter printWriter = this.getResponse().getWriter();
printWriter.write(jsonStr);
printWriter.close();

View File

@@ -235,10 +235,10 @@ public class PoliceSetAction extends BaseAction {
+ dataPoliceRelation.getMetadata().getId();
List list = this.commonService.executeSQL(sql);
int num = Integer.parseInt(list.get(0).toString());
if (num > 0) {
/*if (num > 0) {
this.outHtmlString("<script>alert('i18n_PoliceSetAction.queryPoliceSetInfo.recordExists_n81i');this.location='policeSet.do?action=query&pIden="+pIden+"&ctn="+ctn+"&ip="+ip+"&pageNo="+pageNo+"&pageSize="+pageSize+"&setId="+setId+"'</script>");
return;
}
}*/
Metadata metadata = (Metadata) this.commonService.get(
Metadata.class, dataPoliceRelation.getMetadata().getId());
@@ -286,10 +286,10 @@ public class PoliceSetAction extends BaseAction {
"from DataPoliceRelation where detectionSetInfo.id=? and metadata.id=? and id<>?",
Long.valueOf(detectionSetInfoId), dataPoliceRelation.getMetadata().getId(), dataPoliceRelation
.getId());
if (list != null && list.size() > 0) {
/*if (list != null && list.size() > 0) {
this.outHtmlString("<script>alert('i18n_PoliceSetAction.queryPoliceSetInfo.recordExists_n81i');this.location='policeSet.do?action=openUpdate&ids="+policeRelationId+"&detectionSetInfoId="+detectionSetInfoId+"'</script>");
return;
}
}*/
DataPoliceRelation dpRelation = (DataPoliceRelation) this.commonService
.get(DataPoliceRelation.class, dataPoliceRelation.getId());
DetectionSetInfo ds = null;

View File

@@ -167,6 +167,7 @@ public class SwitchDetectionAction extends BaseAction {
if (!com.nis.util.StringUtil.isBlank(requestType) && requestType.equals("topo")) {
resultpage = totalSwitchInfoStatisticsForTopo();
} else {
this.networElementType = "1";
resultpage = totalSwitchInfoStatistics();
}