日志趋势添加servicID查询条件
This commit is contained in:
@@ -57,7 +57,7 @@ public class LogSearchController extends BaseController{
|
||||
|
||||
|
||||
@RequestMapping(value = {"logTrend",""})
|
||||
public String logTrend(Model model,BaseLogEntity<Object> entity,String cfgId,RedirectAttributes attr, HttpServletRequest request,
|
||||
public String logTrend(Model model,BaseLogEntity<Object> entity,String cfgId,String serviceId,RedirectAttributes attr, HttpServletRequest request,
|
||||
HttpServletResponse response) {
|
||||
Calendar cal = Calendar. getInstance ();
|
||||
cal.setTime(new Date());
|
||||
@@ -67,16 +67,20 @@ public class LogSearchController extends BaseController{
|
||||
model.addAttribute("beginDate", oneHoursAgo);
|
||||
model.addAttribute("endDate", now);
|
||||
model.addAttribute("cfgId", cfgId);
|
||||
model.addAttribute("serviceId", serviceId);
|
||||
return "/cfg/logCfgTrendList";
|
||||
}
|
||||
|
||||
@RequestMapping(value="actionLogTrend")
|
||||
@ResponseBody
|
||||
public List actionTrans(String cfgId,String beginDate,String endDate){
|
||||
public List actionTrans(String cfgId,String beginDate,String endDate,String serviceId){
|
||||
Map<String, Object> fromJsonList = new HashMap<String, Object>();
|
||||
List resultList = new ArrayList();
|
||||
String url = Constants.LOG_BASE_URL+Constants.NTC_PZ_REPORT;
|
||||
url=url+"?searchBusinessType=2&searchCfgId="+cfgId;
|
||||
if(!StringUtil.isEmpty(serviceId)){
|
||||
url=url+"&searchService="+serviceId;
|
||||
}
|
||||
try {
|
||||
//String url="http://192.168.10.204:9999/galaxy-service/service/log/v1/ntcPzReport?searchBusinessType=2&searchReportStartTime=2018-12-29%2000:00:00&searchReportEndTime=2018-12-30%2000:00:00";
|
||||
url = urlAddDate(url,beginDate,endDate);
|
||||
|
||||
@@ -47,13 +47,14 @@
|
||||
<!-- 搜索内容与操作按钮栏 -->
|
||||
</form:form>
|
||||
</div>
|
||||
<br>
|
||||
<div id="chart" style="width:97%;height:480px;"></div>
|
||||
|
||||
<div id="chart" style="width:97%;height:90%;margin-top: 35px;"></div>
|
||||
|
||||
<%-- <input id="searchAction" name="searchAction" type="hidden" value="${searchAction}"/> --%>
|
||||
<input id="beginDateh" type="hidden" value="${beginDate}"/>
|
||||
<input id="endDateh" type="hidden" value="${endDate}"/>
|
||||
<input id="cfgId" type="hidden" value="${cfgId}"/>
|
||||
<input id="serviceId" type="hidden" value="${serviceId}"/>
|
||||
<input id="total" type="hidden"/>
|
||||
</div>
|
||||
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/highcharts.js"></script>
|
||||
@@ -73,10 +74,11 @@ $(document).ready(function(){
|
||||
var starth=$("#beginDateh").val();
|
||||
var endh=$("#endDateh").val();
|
||||
var cfgId=$("#cfgId").val();
|
||||
var serviceId=$("#serviceId").val();
|
||||
excfgid=cfgId;
|
||||
$("#beginDate").val(starth);
|
||||
$("#endDate").val(endh);
|
||||
actionTransAjax(logTltle,starth,endh,cfgId);
|
||||
actionTransAjax(logTltle,starth,endh,cfgId,serviceId);
|
||||
//筛选功能初始化
|
||||
$("#resetBtn").on("click",function(){
|
||||
$("select.selectpicker").each(function(){
|
||||
@@ -97,13 +99,13 @@ function searchList(){
|
||||
var start=$("#beginDate").val();
|
||||
var end=$("#endDate").val();
|
||||
var cfgId=$("#cfgId").val();
|
||||
|
||||
var serviceId=$("#serviceId").val();
|
||||
$("#beginDateh").val(start);
|
||||
$("#endDateh").val(end);
|
||||
if(start==''||end==''||end==null||start==null){
|
||||
window.location.reload();
|
||||
}else{
|
||||
actionTransAjax(logTltle,start,end,cfgId);
|
||||
actionTransAjax(logTltle,start,end,cfgId,serviceId);
|
||||
}
|
||||
}
|
||||
// 局点信息
|
||||
@@ -119,7 +121,7 @@ function showActionTransChart(xData,series){
|
||||
filename:logTltle+"_"+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate()+nowDate.getHours()+nowDate.getMinutes()+nowDate.getSeconds(),
|
||||
scale:1,
|
||||
sourceWidth: 1280,
|
||||
sourceHeight: 500,
|
||||
sourceHeight: 600,
|
||||
buttons: {
|
||||
contextButton: {
|
||||
menuItems: [
|
||||
@@ -204,10 +206,10 @@ function showActionTransChart(xData,series){
|
||||
});
|
||||
}
|
||||
// 动作一小时,间隔五分钟统计数据
|
||||
function actionTransAjax(searchAction,beginDate,endDate,cfgId){
|
||||
function actionTransAjax(searchAction,beginDate,endDate,cfgId,serviceId){
|
||||
loading();
|
||||
$.ajax({
|
||||
url: "${ctx}/toLogSearch/actionLogTrend?cfgId="+cfgId+"&searchAction="+searchAction+"&beginDate="+beginDate+"&endDate="+endDate,
|
||||
url: "${ctx}/toLogSearch/actionLogTrend?cfgId="+cfgId+"&searchAction="+searchAction+"&beginDate="+beginDate+"&endDate="+endDate+"&serviceId="+serviceId,
|
||||
type : "get" ,
|
||||
dataType:"json",
|
||||
async:true,
|
||||
|
||||
@@ -172,9 +172,10 @@ var GetLogTotal=function(_data){
|
||||
var hasLog=false;
|
||||
for(var i=0;i<data.length;i++){
|
||||
if($(this).attr("compileId")==data[i].compileId){
|
||||
var serviceId= $(this).attr("serviceId");
|
||||
$(this).attr("id",i+"logTotal");
|
||||
//$(this).html(data[i].sum);
|
||||
$(this).html("<a href='javascript:;' onclick='logSearch(\""+data[i].compileId+"\")'>"+data[i].sum+"<a>");
|
||||
$(this).html("<a href='javascript:;' onclick='logSearch(\""+data[i].compileId+"\",\""+serviceId+"\")'>"+data[i].sum+"<a>");
|
||||
$(this).parent("tr").find("td:eq(1)").html("<a href='javascript:;' onclick='toLogSearch("+i+")'>"+data[i].compileId+"<a>");
|
||||
hasLog=true;
|
||||
}
|
||||
@@ -652,10 +653,10 @@ function setStartTimeByFormat(startTimeSelector,endTimeSelector,granule,unit,for
|
||||
$(endTimeSelector).val(dateFtt(formatParm,endTime)+endStr);
|
||||
}
|
||||
|
||||
function logSearch(cfgId){
|
||||
function logSearch(cfgId,serviceId){
|
||||
var title=$.validator.messages.log_trend;
|
||||
var url=$("#jbox_cfg_url",parent.document).val();
|
||||
url=url+"?cfgId="+cfgId;
|
||||
url=url+"?cfgId="+cfgId+"&serviceId="+serviceId;
|
||||
top.$.jBox("iframe:"+url, {
|
||||
title: title,
|
||||
width: $(document).width()*0.8,
|
||||
|
||||
Reference in New Issue
Block a user