add: redis监控、日志监控
This commit is contained in:
@@ -35,6 +35,7 @@ public class Indexer {
|
||||
|
||||
/**
|
||||
* 构造方法,实例化IndexWriter
|
||||
*
|
||||
* @param indexDir
|
||||
* @throws Exception
|
||||
*/
|
||||
@@ -51,6 +52,7 @@ public class Indexer {
|
||||
|
||||
/**
|
||||
* 索引指定目录下的所有文件
|
||||
*
|
||||
* @param dataDir
|
||||
* @return
|
||||
* @throws Exception
|
||||
@@ -71,6 +73,7 @@ public class Indexer {
|
||||
|
||||
/**
|
||||
* 索引指定的文件
|
||||
*
|
||||
* @param file
|
||||
* @throws Exception
|
||||
*/
|
||||
@@ -82,7 +85,7 @@ public class Indexer {
|
||||
//Document doc = json2Doc(jsonDoc);
|
||||
// Document doc = new Document();
|
||||
// doc.add(new TextField("content", jsonDoc, Field.Store.YES));
|
||||
Field fieldContent=new TextField("fieldContent", FileUtils.readFileToString(null,"UTF-8"), Field.Store.YES);
|
||||
Field fieldContent = new TextField("fieldContent", FileUtils.readFileToString(null, "UTF-8"), Field.Store.YES);
|
||||
|
||||
//将doc添加到索引中
|
||||
writer.addDocument(doc);
|
||||
@@ -90,6 +93,7 @@ public class Indexer {
|
||||
|
||||
/**
|
||||
* 获取文档,文档里再设置每个字段,就类似于数据库中的一行记录
|
||||
*
|
||||
* @param file
|
||||
* @return
|
||||
* @throws Exception
|
||||
@@ -105,6 +109,7 @@ public class Indexer {
|
||||
doc.add(new TextField("fullPath", file.getCanonicalPath(), Field.Store.YES));
|
||||
return doc;
|
||||
}
|
||||
|
||||
public Document json2Doc(String strDoc) {
|
||||
Document doc = new Document();
|
||||
JSONObject jsonDoc = JSONObject.parseObject(strDoc);
|
||||
@@ -120,7 +125,7 @@ public class Indexer {
|
||||
Directory directory = FSDirectory.open(new File("D:\\lucene\\index").toPath());
|
||||
//步骤二:创建一个IndexWriter对象,用于写索引
|
||||
// Analyzer analyzer = new StandardAnalyzer();
|
||||
IndexWriter indexWriter=new IndexWriter(directory,new IndexWriterConfig(new IKAnalyzer(false)));
|
||||
IndexWriter indexWriter = new IndexWriter(directory, new IndexWriterConfig(new IKAnalyzer(false)));
|
||||
// indexWriter.deleteAll();//清理所有索引库
|
||||
// IndexWriter indexWriter=new IndexWriter(directory,new IndexWriterConfig(new StandardAnalyzer()));
|
||||
//记录索引开始时间
|
||||
@@ -132,35 +137,36 @@ public class Indexer {
|
||||
indexWriter.addDocument(document);
|
||||
//记录索引结束时间
|
||||
long endTime = System.currentTimeMillis();
|
||||
System.out.println("建立索引"+ "共耗时" + (endTime-startTime) + "毫秒");
|
||||
System.out.println("建立索引" + "共耗时" + (endTime - startTime) + "毫秒");
|
||||
indexWriter.commit();
|
||||
//步骤八:关闭资源
|
||||
indexWriter.close();
|
||||
System.out.println("建立索引成功-----关闭资源");
|
||||
}
|
||||
|
||||
//系统的日志文件路径
|
||||
@Value("${logging.file.path}")
|
||||
private String logUrl;
|
||||
|
||||
public static void main(String[] args)throws IOException {
|
||||
public static void main(String[] args) throws IOException {
|
||||
//步骤一:创建Directory对象,用于指定索引库的位置 RAMDirectory内存
|
||||
Directory directory = FSDirectory.open(new File("D:\\lucene\\index").toPath());
|
||||
//步骤二:创建一个IndexWriter对象,用于写索引
|
||||
// Analyzer analyzer = new StandardAnalyzer();
|
||||
IndexWriter indexWriter=new IndexWriter(directory,new IndexWriterConfig(new IKAnalyzer(false)));
|
||||
IndexWriter indexWriter = new IndexWriter(directory, new IndexWriterConfig(new IKAnalyzer(false)));
|
||||
|
||||
indexWriter.deleteAll();//清理所有索引库
|
||||
// IndexWriter indexWriter=new IndexWriter(directory,new IndexWriterConfig(new StandardAnalyzer()));
|
||||
indexWriter.deleteAll();//清理所有索引库
|
||||
// indexWriter=new IndexWriter(directory,new IndexWriterConfig(new StandardAnalyzer()));
|
||||
//记录索引开始时间
|
||||
long startTime = System.currentTimeMillis();
|
||||
//步骤三:读取磁盘中文件,对应每一个文件创建一个文档对象
|
||||
File file=new File("D:\\testlog");
|
||||
File file = new File("D:\\testlog");
|
||||
//步骤四:获取文件列表
|
||||
File[] files = file.listFiles();
|
||||
for (File item:files) {
|
||||
for (File item : files) {
|
||||
BufferedReader bufferedReader = new BufferedReader(new FileReader(item));
|
||||
String strLine = null;
|
||||
while(null != (strLine = bufferedReader.readLine())){
|
||||
while (null != (strLine = bufferedReader.readLine())) {
|
||||
Document document = new Document();
|
||||
// document.add(new Field());
|
||||
document.add(new TextField("fieldContent", strLine, Field.Store.YES));
|
||||
@@ -169,7 +175,7 @@ public class Indexer {
|
||||
}
|
||||
//记录索引结束时间
|
||||
long endTime = System.currentTimeMillis();
|
||||
System.out.println("建立索引"+ "共耗时" + (endTime-startTime) + "毫秒");
|
||||
System.out.println("建立索引" + "共耗时" + (endTime - startTime) + "毫秒");
|
||||
indexWriter.commit();
|
||||
//步骤八:关闭资源
|
||||
indexWriter.close();
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package org.nl.modules.system.service.convert;
|
||||
package org.nl.config.redis;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
import org.nl.modules.system.service.vo.RedisMonitorRespVO;
|
||||
import org.nl.system.service.redis.vo.RedisMonitorRespVO;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Properties;
|
||||
@@ -13,6 +13,7 @@ import java.util.Properties;
|
||||
* @Description: redis---Spring Boot 对象转换 MapStruct
|
||||
* @Date: 2022-08-04
|
||||
*/
|
||||
@Mapper
|
||||
public interface RedisConvert {
|
||||
|
||||
RedisConvert INSTANCE = Mappers.getMapper(RedisConvert.class);
|
||||
@@ -30,6 +31,4 @@ public interface RedisConvert {
|
||||
return respVO;
|
||||
}
|
||||
|
||||
// List<RedisKeyDefineRespVO> convertList(List<RedisKeyDefine> list);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package org.nl.system.controller.logging;
|
||||
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.modules.logging.annotation.Log;
|
||||
import org.nl.system.service.logging.ISysLogService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 系统日志 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-08
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/logs")
|
||||
@Api(tags = "系统:日志管理")
|
||||
public class SysLogController {
|
||||
@Autowired
|
||||
private ISysLogService logService;
|
||||
@GetMapping
|
||||
@ApiOperation("日志查询")
|
||||
//@SaCheckPermission("@el.check()")
|
||||
public ResponseEntity<Object> query(@RequestParam Map criteria, PageQuery pageable){
|
||||
criteria.put("log_type","INFO");
|
||||
return new ResponseEntity<>(TableDataInfo.build(logService.queryAll(criteria,pageable)), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping(value = "/error")
|
||||
@ApiOperation("错误日志查询")
|
||||
// @SaCheckPermission("@el.check()")
|
||||
public ResponseEntity<Object> queryErrorLog(@RequestParam Map criteria, PageQuery pageable){
|
||||
criteria.put("log_type","ERROR");
|
||||
return new ResponseEntity<>(TableDataInfo.build(logService.queryAll(criteria,pageable)), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping(value = "/error/{id}")
|
||||
@ApiOperation("日志异常详情查询")
|
||||
// @SaCheckPermission("@el.check()")
|
||||
public ResponseEntity<Object> queryErrorLogs(@PathVariable String id){
|
||||
return new ResponseEntity<>(logService.findByErrDetail(id), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@DeleteMapping(value = "/del/error")
|
||||
@Log("删除所有ERROR日志")
|
||||
@ApiOperation("删除所有ERROR日志")
|
||||
// @SaCheckPermission("@el.check()")
|
||||
public ResponseEntity<Object> delAllErrorLog(){
|
||||
logService.delAllByError();
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@DeleteMapping(value = "/del/info")
|
||||
@Log("删除所有INFO日志")
|
||||
@ApiOperation("删除所有INFO日志")
|
||||
// @SaCheckPermission("@el.check()")
|
||||
public ResponseEntity<Object> delAllInfoLog(){
|
||||
logService.delAllByInfo();
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package org.nl.modules.system.rest;
|
||||
package org.nl.system.controller.redis;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.modules.logging.annotation.Log;
|
||||
import org.nl.modules.system.service.RedisService;
|
||||
import org.nl.system.service.redis.RedisService;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -50,7 +50,7 @@ public class RedisController {
|
||||
@DeleteMapping
|
||||
public ResponseEntity<Object> deleteByKey(@RequestBody String[] ids) {
|
||||
redisService.deleteByKey(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
package org.nl.system.service.logging;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.system.service.logging.dao.SysLog;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 系统日志 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-08
|
||||
*/
|
||||
public interface ISysLogService extends IService<SysLog> {
|
||||
|
||||
/**
|
||||
* 分页查询日志
|
||||
* @param criteria
|
||||
* @param pageable
|
||||
* @return
|
||||
*/
|
||||
IPage<SysLog> queryAll(Map criteria, PageQuery pageable);
|
||||
|
||||
/**
|
||||
* 查询异常详情
|
||||
* @param id 日志ID
|
||||
* @return Object
|
||||
*/
|
||||
Object findByErrDetail(String id);
|
||||
|
||||
/**
|
||||
* 删除所有异常日志
|
||||
*/
|
||||
void delAllByError();
|
||||
|
||||
/**
|
||||
* 删除所有操作日志
|
||||
*/
|
||||
void delAllByInfo();
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package org.nl.system.service.logging.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.time.LocalDateTime;
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 系统日志
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-08
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("sys_log")
|
||||
public class SysLog implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId(value = "log_id")
|
||||
private String log_id;
|
||||
|
||||
private String description;
|
||||
|
||||
private String log_type;
|
||||
|
||||
private String method;
|
||||
|
||||
private String params;
|
||||
|
||||
private String request_ip;
|
||||
|
||||
private Long time;
|
||||
|
||||
private String username;
|
||||
|
||||
private String address;
|
||||
|
||||
private String browser;
|
||||
|
||||
/** 异常详细 */
|
||||
private byte[] exception_detail;
|
||||
|
||||
private String create_time;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package org.nl.system.service.logging.dao.mapper;
|
||||
|
||||
import org.nl.system.service.logging.dao.SysLog;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 系统日志 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-08
|
||||
*/
|
||||
public interface SysLogMapper extends BaseMapper<SysLog> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.nl.system.service.logging.dao.mapper.SysLogMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,12 @@
|
||||
package org.nl.system.service.logging.dto;
|
||||
|
||||
import org.nl.common.domain.query.BaseQuery;
|
||||
import org.nl.system.service.logging.dao.SysLog;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description:
|
||||
* @Date: 2023/5/8
|
||||
*/
|
||||
public class SysLogQuery extends BaseQuery<SysLog> {
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package org.nl.system.service.logging.impl;
|
||||
|
||||
import cn.hutool.core.lang.Dict;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.modules.common.utils.ValidationUtil;
|
||||
import org.nl.system.service.logging.ISysLogService;
|
||||
import org.nl.system.service.logging.dao.SysLog;
|
||||
import org.nl.system.service.logging.dao.mapper.SysLogMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 系统日志 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-08
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class SysLogServiceImpl extends ServiceImpl<SysLogMapper, SysLog> implements ISysLogService {
|
||||
|
||||
@Autowired
|
||||
private SysLogMapper logMapper;
|
||||
|
||||
@Override
|
||||
public IPage<SysLog> queryAll(Map whereJson, PageQuery pageable) {
|
||||
String blurry = ObjectUtil.isNotEmpty(whereJson.get("blurry"))?whereJson.get("blurry").toString():null;
|
||||
String log_type = ObjectUtil.isNotEmpty(whereJson.get("log_type"))?whereJson.get("log_type").toString():null;
|
||||
String begin_time = ObjectUtil.isNotEmpty(whereJson.get("begin_time"))?whereJson.get("begin_time").toString():null;
|
||||
String end_time = ObjectUtil.isNotEmpty(whereJson.get("end_time"))?whereJson.get("end_time").toString():null;
|
||||
LambdaQueryWrapper<SysLog> lam = new LambdaQueryWrapper<>();
|
||||
lam.eq(ObjectUtil.isNotEmpty(log_type), SysLog::getLog_type, log_type)
|
||||
.like(ObjectUtil.isNotEmpty(blurry), SysLog::getDescription, blurry)
|
||||
.le(ObjectUtil.isNotEmpty(end_time), SysLog::getCreate_time, end_time)
|
||||
.ge(ObjectUtil.isNotEmpty(begin_time), SysLog::getCreate_time, begin_time)
|
||||
.orderByDesc(SysLog::getCreate_time);
|
||||
IPage<SysLog> page = new Page<>(pageable.getPage()+1, pageable.getSize());
|
||||
logMapper.selectPage(page, lam);
|
||||
return page;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object findByErrDetail(String id) {
|
||||
SysLog sysLog = logMapper.selectById(id);
|
||||
if (ObjectUtil.isEmpty(sysLog)) {
|
||||
sysLog = new SysLog();
|
||||
}
|
||||
ValidationUtil.isNull(sysLog.getLog_id(), "SysLog", "log_id", id);
|
||||
byte[] details = sysLog.getException_detail();
|
||||
return Dict.create().set("exception", new String(ObjectUtil.isNotNull(details) ? details : "".getBytes()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delAllByError() {
|
||||
logMapper.delete(new LambdaQueryWrapper<SysLog>().eq(SysLog::getLog_type, "ERROR"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delAllByInfo() {
|
||||
logMapper.delete(new LambdaQueryWrapper<SysLog>().eq(SysLog::getLog_type, "INFO"));
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.nl.modules.system.service;
|
||||
package org.nl.system.service.redis;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.nl.modules.system.service.entity;
|
||||
package org.nl.system.service.redis.dao;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.nl.modules.system.service.entity;
|
||||
package org.nl.system.service.redis.dao;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -1,13 +1,11 @@
|
||||
package org.nl.modules.system.service.impl;
|
||||
package org.nl.system.service.redis.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.modules.system.service.RedisService;
|
||||
import org.nl.modules.system.service.convert.RedisConvert;
|
||||
import org.nl.modules.system.service.entity.RedisKeyDefine;
|
||||
import org.nl.modules.system.service.entity.RedisKeyRegistry;
|
||||
import org.nl.system.service.redis.RedisService;
|
||||
import org.nl.config.redis.RedisConvert;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.redis.connection.DataType;
|
||||
import org.springframework.data.redis.connection.RedisServerCommands;
|
||||
@@ -38,7 +36,6 @@ public class RedisServiceImpl implements RedisService {
|
||||
Properties commandStats = stringRedisTemplate.execute((
|
||||
RedisCallback<Properties>) connection -> connection.info("commandstats"));
|
||||
assert commandStats != null; // 断言,避免警告
|
||||
// System.out.println("info:" + info + " dbsize:" + dbSize + " com:" + commandStats);
|
||||
// 拼接结果返回
|
||||
// 转成实体
|
||||
JSONObject json = new JSONObject();
|
||||
@@ -48,9 +45,8 @@ public class RedisServiceImpl implements RedisService {
|
||||
|
||||
@Override
|
||||
public JSONObject getKeyDefineList() {
|
||||
List<RedisKeyDefine> keyDefines = RedisKeyRegistry.list();
|
||||
// List<RedisKeyDefine> keyDefines = RedisKeyRegistry.list();
|
||||
JSONObject json = new JSONObject();
|
||||
System.out.println(keyDefines);
|
||||
// json.put("info", RedisConvert.INSTANCE.convertList(keyDefines));
|
||||
return json;
|
||||
}
|
||||
@@ -1,11 +1,11 @@
|
||||
package org.nl.modules.system.service.vo;
|
||||
package org.nl.system.service.redis.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import org.nl.modules.system.service.entity.RedisKeyDefine;
|
||||
import org.nl.system.service.redis.dao.RedisKeyDefine;
|
||||
|
||||
import java.time.Duration;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.nl.modules.system.service.vo;
|
||||
package org.nl.system.service.redis.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
@@ -31,18 +31,18 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="username" label="用户名" />
|
||||
<el-table-column prop="requestIp" label="IP" />
|
||||
<el-table-column prop="request_ip" label="IP" />
|
||||
<el-table-column show-overflow-tooltip prop="address" label="IP来源" />
|
||||
<el-table-column prop="description" label="描述" show-overflow-tooltip />
|
||||
<el-table-column prop="browser" label="浏览器" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="createTime" label="创建日期" min-width="100" show-overflow-tooltip>
|
||||
<el-table-column prop="create_time" label="创建日期" min-width="100" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
<span>{{ parseTime(scope.row.create_time) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="异常详情" width="100px">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" @click="info(scope.row.id)">查看详情</el-button>
|
||||
<el-button size="mini" type="text" @click="info(scope.row.log_id)">查看详情</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -83,9 +83,9 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
// 获取异常详情
|
||||
info(id) {
|
||||
info(log_id) {
|
||||
this.dialog = true
|
||||
getErrDetail(id).then(res => {
|
||||
getErrDetail(log_id).then(res => {
|
||||
this.errorInfo = res.exception
|
||||
})
|
||||
},
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="username" label="用户名" />
|
||||
<el-table-column prop="requestIp" label="IP" />
|
||||
<el-table-column prop="request_ip" label="IP" />
|
||||
<el-table-column show-overflow-tooltip prop="address" label="IP来源" />
|
||||
<el-table-column prop="description" label="描述" show-overflow-tooltip />
|
||||
<el-table-column prop="browser" label="浏览器" min-width="120" show-overflow-tooltip />
|
||||
@@ -42,9 +42,9 @@
|
||||
<el-tag v-else type="danger">{{ scope.row.time }}ms</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="createTime" label="创建日期" width="180px">
|
||||
<el-table-column prop="create_time" label="创建日期" width="180px">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
<span>{{ parseTime(scope.row.create_time) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
@@ -194,7 +194,7 @@ export default {
|
||||
})
|
||||
// 查询 Redis Key 模板列表
|
||||
getKeyDefineList().then(res => {
|
||||
// console.log(res)
|
||||
console.log(res)
|
||||
this.keyDefineList = res.info
|
||||
this.keyDefineListLoad = false
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user