日志检索模块导出问题修改
This commit is contained in:
@@ -245,13 +245,13 @@ public class CollectVoipLogController extends BaseController {
|
||||
String jsonString = HttpClientUtil.getMsg(url, params, request);
|
||||
|
||||
GsonBuilder builder = new GsonBuilder();
|
||||
builder.registerTypeAdapter(Date.class, new JsonDeserializer<Date>() {
|
||||
|
||||
public Date deserialize(JsonElement json, java.lang.reflect.Type typeOfT,
|
||||
JsonDeserializationContext context) throws JsonParseException {
|
||||
return new Date(json.getAsJsonPrimitive().getAsLong());
|
||||
}
|
||||
});
|
||||
// builder.registerTypeAdapter(Date.class, new JsonDeserializer<Date>() {
|
||||
//
|
||||
// public Date deserialize(JsonElement json, java.lang.reflect.Type typeOfT,
|
||||
// JsonDeserializationContext context) throws JsonParseException {
|
||||
// return new Date(json.getAsJsonPrimitive().getAsLong());
|
||||
// }
|
||||
// });
|
||||
Gson gson = builder.setDateFormat("yyyy-MM-dd HH:mm:ss").create();
|
||||
// gson泛型支持
|
||||
LogRecvData<NtcCollectVoipLog> fromJson = gson.fromJson(jsonString,
|
||||
|
||||
@@ -133,6 +133,8 @@ public class MmPornAvSampleController extends BaseController {
|
||||
//---------------------------
|
||||
|
||||
PageLog<MmAvIpLog> page = new PageLog<MmAvIpLog>(request, response);
|
||||
page.setPageNo(1);
|
||||
page.setPageSize(Constants.MAX_LOG_EXPORT_SIZE);
|
||||
Map<String, Object> params=new HashMap<>();
|
||||
params.put("pageSize", page.getPageSize());
|
||||
params.put("pageNo", page.getPageNo());
|
||||
|
||||
@@ -100,7 +100,7 @@ public class MmSampleAudioController extends BaseController{
|
||||
System.out.print(log.getFunctionId());
|
||||
model.addAttribute("serviceList", serviceList);
|
||||
|
||||
String url = Constants.LOG_BASE_URL + Constants.NTC_DDOS_LOG;
|
||||
String url = Constants.LOG_BASE_URL + Constants.NTC_MMSAMPLEAUDIO_LOG;
|
||||
String recv = HttpClientUtil.getMsg(url, params, request);
|
||||
List<MmSampleAudioLog> list = new ArrayList<MmSampleAudioLog>();
|
||||
if (StringUtils.isNotBlank(recv)) {
|
||||
|
||||
@@ -89,6 +89,8 @@ public class MmSamplePicController extends BaseController{
|
||||
Map<String, String> noExportMap = new HashMap<String, String>();
|
||||
|
||||
PageLog<MmSamplePicLog> page = new PageLog<MmSamplePicLog>(request,response);
|
||||
page.setPageNo(1);
|
||||
page.setPageSize(Constants.MAX_LOG_EXPORT_SIZE);
|
||||
Map<String, Object> params = new HashMap<String,Object>();
|
||||
params.put("pageSize", page.getPageSize());
|
||||
params.put("pageNo", page.getPageNo());
|
||||
|
||||
@@ -96,7 +96,7 @@ public class MmSampleVideoController extends BaseController{
|
||||
System.out.print(log.getFunctionId());
|
||||
model.addAttribute("serviceList", serviceList);
|
||||
|
||||
String url = Constants.LOG_BASE_URL + Constants.NTC_DDOS_LOG;
|
||||
String url = Constants.LOG_BASE_URL + Constants.NTC_MMSAMPLEVIDEO_LOG;
|
||||
String recv = HttpClientUtil.getMsg(url, params, request);
|
||||
List<MmSampleVideoLog> list = new ArrayList<MmSampleVideoLog>();
|
||||
if (StringUtils.isNotBlank(recv)) {
|
||||
|
||||
@@ -95,6 +95,8 @@ public class MmSampleVoipLogController extends BaseController {
|
||||
//---------------------------
|
||||
|
||||
PageLog<MmVoipLog> page = new PageLog<MmVoipLog>(request, response);
|
||||
page.setPageNo(1);
|
||||
page.setPageSize(Constants.MAX_LOG_EXPORT_SIZE);
|
||||
Map<String, Object> params=new HashMap<>();
|
||||
params.put("pageSize", page.getPageSize());
|
||||
params.put("pageNo", page.getPageNo());
|
||||
|
||||
@@ -104,6 +104,7 @@ public class OpenVpnLogController extends BaseController{
|
||||
//radius配置导出
|
||||
@RequestMapping(value = "exportNtcOpenvpnLogs")
|
||||
public void exportRadius(@ModelAttribute("log") NtcOpenVpnLog log, Model model,String hColumns,String type, HttpServletRequest request, HttpServletResponse response,RedirectAttributes redirectAttributes){
|
||||
String name="";
|
||||
try {
|
||||
//export data info
|
||||
List<String> titleList=new ArrayList<String>();
|
||||
@@ -142,9 +143,14 @@ public class OpenVpnLogController extends BaseController{
|
||||
l.setFunctionId(log.getFunctionId());
|
||||
setLogAction(l, serviceList);
|
||||
}
|
||||
}
|
||||
if(log.getFunctionId()==214){
|
||||
name="spoofing_ip_policy";
|
||||
}else if(log.getFunctionId()==212){
|
||||
name="ip_payload";
|
||||
}
|
||||
titleList.add("spoofing_ip_policy");
|
||||
classMap.put("spoofing_ip_policy", NtcOpenVpnLog.class);
|
||||
titleList.add(name);
|
||||
classMap.put(name, NtcOpenVpnLog.class);
|
||||
SysUser user =UserUtils.getUser();
|
||||
if (!user.isAdmin()){
|
||||
hColumns+=",scene_file,";
|
||||
@@ -152,18 +158,18 @@ public class OpenVpnLogController extends BaseController{
|
||||
hColumns+=",";
|
||||
}
|
||||
String cfgIndexInfoNoExport=","+hColumns;
|
||||
noExportMap.put("spoofing_ip_policy",cfgIndexInfoNoExport);
|
||||
dataMap.put("spoofing_ip_policy",list);
|
||||
String timeRange= initLogMap(log,"spoofing_ip_policy");
|
||||
noExportMap.put(name,cfgIndexInfoNoExport);
|
||||
dataMap.put(name,list);
|
||||
String timeRange= initLogMap(log,name);
|
||||
noExportMap.put("timeRange", timeRange);
|
||||
/*}*/
|
||||
if("csv".equals(type)){
|
||||
this._exportCsv(model, request, response, redirectAttributes,"spoofing_ip_policy",titleList,classMap,dataMap,noExportMap);
|
||||
this._exportCsv(model, request, response, redirectAttributes,name,titleList,classMap,dataMap,noExportMap);
|
||||
}else{
|
||||
this._export(model, request, response, redirectAttributes,"spoofing_ip_policy",titleList,classMap,dataMap,noExportMap);
|
||||
this._export(model, request, response, redirectAttributes,name,titleList,classMap,dataMap,noExportMap);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("openVpn export failed",e);
|
||||
logger.error(name+" export failed",e);
|
||||
addMessage(redirectAttributes,"error","export_failed");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -175,7 +175,7 @@ public class PxyHttpLogController extends BaseController {
|
||||
} else {
|
||||
hColumns += ",";
|
||||
}
|
||||
String cfgIndexInfoNoExport = "," + hColumns;
|
||||
String cfgIndexInfoNoExport = ",inner_smac,inner_dmac,nest_addr_list," + hColumns;
|
||||
noExportMap.put(pxyName, cfgIndexInfoNoExport);
|
||||
dataMap.put(pxyName, list);
|
||||
String timeRange= initLogMap(log,pxyName);
|
||||
|
||||
Reference in New Issue
Block a user