增加日志FTP页面展示及国际化
This commit is contained in:
30
src/main/java/com/nis/domain/log/NtcFtpLog.java
Normal file
30
src/main/java/com/nis/domain/log/NtcFtpLog.java
Normal file
@@ -0,0 +1,30 @@
|
||||
package com.nis.domain.log;
|
||||
|
||||
public class NtcFtpLog extends BaseLogEntity<NtcFtpLog> {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 348767275603485504L;
|
||||
|
||||
private String ftpUrl;//FTP链接
|
||||
private String ftpContent;//FTP内容
|
||||
|
||||
public String getFtpUrl() {
|
||||
return ftpUrl;
|
||||
}
|
||||
public void setFtpUrl(String ftpUrl) {
|
||||
this.ftpUrl = ftpUrl;
|
||||
}
|
||||
public String getFtpContent() {
|
||||
return ftpContent;
|
||||
}
|
||||
public void setFtpContent(String ftpContent) {
|
||||
this.ftpContent = ftpContent;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -300,6 +300,7 @@ public final class Constants {
|
||||
public static final String NTC_IPSEC_LOG = Configurations.getStringProperty("ntcIpsecLog","");
|
||||
public static final String NTC_SSH_LOG = Configurations.getStringProperty("ntcSshLog","");
|
||||
public static final String NTC_MAIL_LOG = Configurations.getStringProperty("ntcMailLog","");
|
||||
public static final String NTC_FTP_LOG = Configurations.getStringProperty("ntcFtpLog","");
|
||||
//报表类型,1- 配置命中总量业务
|
||||
public static final Integer BUSINESSTYPE_CONFIG=Configurations.getIntProperty("businesstype_config", 1);
|
||||
//报表类型,2- 配置报表业务
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.nis.web.controller.log.ntc;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.http.client.ClientProtocolException;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.log.NtcFtpLog;
|
||||
import com.nis.domain.maat.LogRecvData;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.httpclient.HttpClientUtil;
|
||||
import com.nis.web.controller.BaseController;
|
||||
|
||||
@Controller
|
||||
@RequestMapping(value = "${adminPath}/log/ntc/NtcFtpLogs")
|
||||
public class FtpController extends BaseController{
|
||||
|
||||
/**
|
||||
* @param model
|
||||
* @param entry
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
* @throws ClientProtocolException
|
||||
* @throws IOException
|
||||
*/
|
||||
@RequestMapping(value={"list",""})
|
||||
public String list(Model model,@ModelAttribute("log")NtcFtpLog entry,HttpServletRequest request, HttpServletResponse response) throws ClientProtocolException, IOException {
|
||||
|
||||
try {
|
||||
|
||||
Page<NtcFtpLog> page = new Page<NtcFtpLog>(request, response);
|
||||
Map<String, Object> params=new HashMap<>();
|
||||
params.put("pageSize", page.getPageSize());
|
||||
params.put("pageNo", page.getPageNo());
|
||||
//查询值判断
|
||||
initLogSearchValue(entry,params);
|
||||
|
||||
String url = "";
|
||||
url = Constants.LOG_BASE_URL+Constants.NTC_FTP_LOG;
|
||||
String jsonString = HttpClientUtil.getMsg(url,params,request);
|
||||
|
||||
Gson gson = new GsonBuilder().create();
|
||||
//gson泛型支持
|
||||
LogRecvData<NtcFtpLog> fromJson = gson.fromJson(jsonString, new TypeToken<LogRecvData<NtcFtpLog>>(){}.getType());
|
||||
|
||||
if (fromJson.getStatus().intValue() == 200) {
|
||||
BeanUtils.copyProperties(fromJson.getData(), page);
|
||||
List<NtcFtpLog> list = page.getList();
|
||||
for (NtcFtpLog l : list) {
|
||||
l.setFunctionId(entry.getFunctionId());
|
||||
setLogAction(l);
|
||||
}
|
||||
model.addAttribute("page", page);
|
||||
logger.info("查询Ftp日志成功");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.info("查询Ftp日志失败", e);
|
||||
addMessage(model, e.getMessage());
|
||||
}
|
||||
return "/log/ntc/ftpList";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -652,6 +652,8 @@ cname=CNAME
|
||||
dns_query=query
|
||||
dns_response=response
|
||||
entrance=entrance
|
||||
ftp_url=ftp url
|
||||
ftp_content=ftp content
|
||||
#dns_sub=DNS_SUB
|
||||
mail_proto=mail protocol
|
||||
mail_from=sender
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -219,14 +219,14 @@ clusterBStartTime=1503504000725
|
||||
isCommit=true
|
||||
############################################################################################################################################
|
||||
############################################################################################################################################
|
||||
httpUrl=http://10.0.6.201:8090/galaxy/service/cfg/v1/
|
||||
httpUrl=http://10.0.6.242:8080/galaxy/service/cfg/v1/
|
||||
maatCfg=configSources
|
||||
fileUploadCfg=fileUploadSources
|
||||
callbackCfg=commonSources
|
||||
fileDigestCfg=fileDigestSources
|
||||
configIdSources=configPzIdSources
|
||||
#logBaseUrl=http://10.0.6.201:8090/galaxy/service/log/v1/
|
||||
logBaseUrl=http://10.0.6.104:8081/galaxy/service/log/v1/
|
||||
#logBaseUrl=http://10.0.6.242:8080/galaxy/service/log/v1/
|
||||
logBaseUrl=http://10.0.6.242:8080/galaxy/service/log/v1/
|
||||
ntcPzReport=ntcPzReport
|
||||
ntcIpLog=ntcIpLogs
|
||||
ntcHttpLog=ntcHttpLogs
|
||||
@@ -238,6 +238,7 @@ ntcOpenvpnLog=ntcOpenvpnLogs
|
||||
ntcIpsecLog=ntcIpsecLogs
|
||||
ntcSshLog=ntcSshLogs
|
||||
ntcMailLog=ntcMailLogs
|
||||
ntcFtpLog=ntcFtpLogs
|
||||
|
||||
client_connect_timeout=300000
|
||||
client_read_timeout=300000
|
||||
|
||||
237
src/main/webapp/WEB-INF/views/log/ntc/ftpList.jsp
Normal file
237
src/main/webapp/WEB-INF/views/log/ntc/ftpList.jsp
Normal file
@@ -0,0 +1,237 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8"%>
|
||||
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
||||
<html>
|
||||
<head>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
//筛选功能
|
||||
filterActionInit();
|
||||
//reset
|
||||
$("#resetBtn").on("click",function(){
|
||||
$("select.selectpicker").each(function(){
|
||||
$(this).selectpicker('val',$(this).find('option:first').val());
|
||||
$(this).find("option").attr("selected",false);
|
||||
$(this).find("option:first").attr("selected",true);
|
||||
});
|
||||
$(".Wdate").attr("value",'');
|
||||
$(':input','#searchForm')
|
||||
.not(':button,:submit,:reset,:hidden')
|
||||
.attr("value",'');
|
||||
$("#searchForm")[0].reset();
|
||||
});
|
||||
|
||||
});
|
||||
//查询
|
||||
function page(n,s){
|
||||
$("#intype").attr("name",$("#seltype").val());
|
||||
$("#pageNo").val(n);
|
||||
$("#pageSize").val(s);
|
||||
$("#searchForm").attr("action","${ctx}/log/ntc/NtcFtpLogs");
|
||||
$("#searchForm").submit();
|
||||
return false;
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="page-content">
|
||||
<h3 class="page-title">
|
||||
FTP
|
||||
<small><spring:message code="date_list"/></small>
|
||||
</h3>
|
||||
|
||||
<h5 class="page-header"></h5>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="portlet">
|
||||
<div class="portlet-body">
|
||||
<div class="row" >
|
||||
<form:form id="searchForm" modelAttribute="log" action="${ctx}/log/ntc/NtcFtpLogs" method="post" class="form-search">
|
||||
<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
|
||||
<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
|
||||
<input id="functionId" name="functionId" type="hidden" value="${log.functionId}"/>
|
||||
<!-- 筛选按钮展开状态-->
|
||||
<input id="isFilterAction" name="isFilterAction" type="hidden" value="${log.isFilterAction }"/>
|
||||
|
||||
<sys:tableSort id="orderBy" name="orderBy" value="${page.orderBy}" callback="page();"/>
|
||||
|
||||
<!-- 搜索内容与操作按钮栏 -->
|
||||
<div class="col-md-12">
|
||||
<div class="pull-left">
|
||||
<form:select path="serviceType" class="selectpicker select2 input-small">
|
||||
<form:option value=""><spring:message code="action"/></form:option>
|
||||
<form:option value="16"><spring:message code="action_reject"/></form:option>
|
||||
<form:option value="1"><spring:message code="action_monit"/></form:option>
|
||||
</form:select>
|
||||
</div>
|
||||
<div class="pull-left">
|
||||
<div class="input-group">
|
||||
<div class="input-group-btn">
|
||||
<span class="selectpicker form-control" ><spring:message code="begin_date"/></span>
|
||||
</div>
|
||||
<input id="searchFoundStartTime" name="searchFoundStartTime" type="text" readonly="readonly" class="form-control input-medium Wdate "
|
||||
value="${log.searchFoundStartTime}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pull-left">
|
||||
<div class="input-group">
|
||||
<div class="input-group-btn">
|
||||
<span class="selectpicker form-control" ><spring:message code="end_date"/></span>
|
||||
</div>
|
||||
<input id="searchFoundEndTime" name="searchFoundEndTime" type="text" readonly="readonly" class="form-control input-medium Wdate "
|
||||
value="${log.searchFoundEndTime}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="pull-left">
|
||||
<button type="button" class="btn blue" onClick="page()"> <i class="fa fa-search"></i> <spring:message code="search"/> </button>
|
||||
<button type="button" class="btn btn-default" id="resetBtn"> <i class="fa fa-refresh"></i> <spring:message code="reset"/> </button>
|
||||
<button type="button" class="btn btn-default" id="filter-btn"> <spring:message code="filter"></spring:message> <i class="fa fa-angle-double-down"></i></button>
|
||||
</div>
|
||||
|
||||
<div class="pull-right">
|
||||
<a class="btn btn-icon-only btn-default setfields tooltips"
|
||||
data-container="body" data-placement="top" data-original-title=<spring:message code="custom_columns"/> href="javascript:;">
|
||||
<i class="icon-wrench"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 筛选搜索内容栏默认隐藏-->
|
||||
<div class="col-md-12 filter-action-select-panle hide" >
|
||||
<div class="row">
|
||||
<div class="col-md-2">
|
||||
<div class="form-group">
|
||||
<label><spring:message code="protocol_type"/>:</label>
|
||||
<c:set var="select"><spring:message code='select'/></c:set>
|
||||
<form:select path="protocol" class="selectpicker select2 form-control" data-live-search="true" data-live-search-placeholder="search">
|
||||
<form:option value=""><spring:message code="select"/></form:option>
|
||||
<c:forEach items="${fns:getDictList('LOG_PROTOCOL')}" var="dict">
|
||||
<form:option value="${dict.itemCode}" ><spring:message code="${dict.itemValue}"/></form:option>
|
||||
</c:forEach>
|
||||
</form:select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
<div class="form-group">
|
||||
<label><spring:message code="direct"/>:</label>
|
||||
<form:select path="direction" class="selectpicker select2 form-control">
|
||||
<form:option value=""><spring:message code="select"/></form:option>
|
||||
<c:forEach items="${fns:getDictList('DIRECTION')}" var="dict">
|
||||
<form:option value="${dict.itemCode}"><spring:message code="${dict.itemValue}"/></form:option>
|
||||
</c:forEach>
|
||||
</form:select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="form-group">
|
||||
<label><spring:message code="entrance_id"/>:</label>
|
||||
<input id=entranceId name="entranceId" class="form-control" type="text" value="${log.entranceId}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="form-group">
|
||||
<label><spring:message code="clj_ip"/>:</label>
|
||||
<input id=cljIp name="cljIp" class="form-control" type="text" value="${log.cljIp}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="form-group">
|
||||
<label><spring:message code="clientip"/>:</label>
|
||||
<input id="clientIp" name="clientIp" class="form-control" type="text" value="${log.clientIp}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="form-group">
|
||||
<label><spring:message code="serverip"/>:</label>
|
||||
<input id="serverIp" name="serverIp" class="form-control" type="text" value="${log.serverIp}"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /筛选搜索内容栏 结束-->
|
||||
</form:form>
|
||||
</div>
|
||||
|
||||
<div class="table-responsive">
|
||||
<sys:message content="${message}"/>
|
||||
<table id="contentTable" class="table table-striped table-bordered table-condensed text-nowrap">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><spring:message code='cfg_id'/></th>
|
||||
<th><spring:message code='entrance_id'/></th>
|
||||
<th><spring:message code="action"/></th>
|
||||
<th><spring:message code='direct'/></th>
|
||||
<th><spring:message code='found_time'/></th>
|
||||
<th><spring:message code='recv_time'/></th>
|
||||
<th><spring:message code='protocol_type'/></th>
|
||||
<th><spring:message code='addr_type'/></th>
|
||||
<th><spring:message code='serverip'/></th>
|
||||
<th><spring:message code='clientip'/></th>
|
||||
<th><spring:message code='serverport'/></th>
|
||||
<th><spring:message code='clientport'/></th>
|
||||
<th><spring:message code='deviceid'/></th>
|
||||
<th><spring:message code='stream_type'/></th>
|
||||
<th><spring:message code='clj_ip'/></th>
|
||||
<th><spring:message code='nest_addr_list'/></th>
|
||||
<th><spring:message code='user_region'/></th>
|
||||
<th><spring:message code='ftp_url'/></th>
|
||||
<th><spring:message code='ftp_content'/></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<c:forEach items="${page.list}" var="log" varStatus="status" step="1">
|
||||
<tr>
|
||||
<td>${log.cfgId}</td>
|
||||
<td>${log.entranceId}</td>
|
||||
<td>
|
||||
<c:if test="${log.action eq 16 }"><spring:message code="action_reject"/></c:if>
|
||||
<c:if test="${log.action eq 1 }"><spring:message code="action_monit"/></c:if>
|
||||
</td>
|
||||
<td>
|
||||
<c:forEach items="${fns:getDictList('DIRECTION')}" var="dic">
|
||||
<c:if test="${log.direction==dic.itemCode}"><spring:message code="${dic.itemValue }"/></c:if>
|
||||
</c:forEach>
|
||||
</td>
|
||||
<td>${log.foundTime}</td>
|
||||
<td>${log.recvTime}</td>
|
||||
<td>
|
||||
<c:forEach items="${fns:getDictList('LOG_PROTOCOL')}" var="dic">
|
||||
<c:if test="${log.protocol==dic.itemCode}"><spring:message code="${dic.itemValue }"/></c:if>
|
||||
</c:forEach>
|
||||
</td>
|
||||
<td>
|
||||
<c:forEach items="${fns:getDictList('IP_TYPE')}" var="dic">
|
||||
<c:if test="${log.addrType==dic.itemCode}"><spring:message code="${dic.itemValue }"/></c:if>
|
||||
</c:forEach>
|
||||
</td>
|
||||
<td>${log.serverIp}</td>
|
||||
<td>${log.clientIp}</td>
|
||||
<td>${log.serverPort}</td>
|
||||
<td>${log.clientPort}</td>
|
||||
<td>${log.deviceId}</td>
|
||||
<td>
|
||||
<c:forEach items="${fns:getDictList('LOG_STREAM_TYPE')}" var="dic">
|
||||
<c:if test="${log.streamType==dic.itemCode}"><spring:message code="${dic.itemValue }"/></c:if>
|
||||
</c:forEach>
|
||||
</td>
|
||||
<td>${log.cljIp}</td>
|
||||
<td>${log.nestAddrList}</td>
|
||||
<td>${log.userRegion}</td>
|
||||
<td>${log.ftpUrl}</td>
|
||||
<td>${log.ftpContent}</td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="page">${page}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user