add:es日志,接入未测试
todo:添加日志删除按钮及日志条数显示
This commit is contained in:
@@ -44,7 +44,19 @@
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<!-- logback appender日志-->
|
||||
<dependency>
|
||||
<groupId>com.internetitem</groupId>
|
||||
<artifactId>logback-elasticsearch-appender</artifactId>
|
||||
<version>1.6</version>
|
||||
</dependency>
|
||||
|
||||
<!-- elasticsearch-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-elasticsearch</artifactId>
|
||||
<version>2.7.5</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Excel打印-->
|
||||
<dependency>
|
||||
|
||||
137
mes/hd/nladmin-system/src/main/java/org/nl/aspect/LogAspect.java
Normal file
137
mes/hd/nladmin-system/src/main/java/org/nl/aspect/LogAspect.java
Normal file
@@ -0,0 +1,137 @@
|
||||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.nl.aspect;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.aspectj.lang.ProceedingJoinPoint;
|
||||
import org.aspectj.lang.annotation.Around;
|
||||
import org.aspectj.lang.annotation.Aspect;
|
||||
import org.aspectj.lang.annotation.Pointcut;
|
||||
import org.aspectj.lang.reflect.MethodSignature;
|
||||
import org.nl.modules.system.util.BaseCode;
|
||||
import org.nl.utils.RequestHolder;
|
||||
import org.nl.utils.SecurityUtils;
|
||||
import org.nl.utils.StringUtils;
|
||||
import org.slf4j.MDC;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.Parameter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author Zheng Jie
|
||||
* @date 2018-11-24
|
||||
*/
|
||||
@Component
|
||||
@Aspect
|
||||
@Slf4j
|
||||
public class LogAspect {
|
||||
|
||||
|
||||
@Pointcut("execution(* org.nl.wms.*.rest..*.*(..))")
|
||||
public void logPointCut() {
|
||||
}
|
||||
|
||||
@Around("logPointCut()")
|
||||
public Object logAround(ProceedingJoinPoint joinPoint) throws Throwable {
|
||||
|
||||
MethodSignature signature = (MethodSignature) joinPoint.getSignature();
|
||||
Method method = signature.getMethod();
|
||||
String params = getParameter(method, joinPoint.getArgs());
|
||||
HttpServletRequest request = RequestHolder.getHttpServletRequest();
|
||||
String url = request.getRequestURI();
|
||||
|
||||
MDC.put("requestMethod",url);
|
||||
MDC.put("requestIp", StringUtils.getIp(request));
|
||||
MDC.put("traceId", BaseCode.intToChars(IdUtil.getSnowflake(1, 1).nextId()));
|
||||
MDC.put("requestTime", DateUtil.now());
|
||||
|
||||
Object result;
|
||||
long comming = System.currentTimeMillis();
|
||||
try {
|
||||
log.info("[--request--][请求接口:{}][请求参数:{}]",url,params);
|
||||
result = joinPoint.proceed();
|
||||
|
||||
}catch (Exception ex){
|
||||
StringBuffer errorStack = new StringBuffer();
|
||||
errorStack.append("<br/>【异常堆栈:");
|
||||
String errorMsg = ex.getMessage();
|
||||
int x = 0;
|
||||
StackTraceElement[] stackTrace = ex.getStackTrace();
|
||||
if (stackTrace!=null && stackTrace.length>0){
|
||||
for (StackTraceElement stack : stackTrace) {
|
||||
x++;errorStack.append(stack.toString().replaceAll("<",">")).append("<br/>");
|
||||
if (x>10){ break; }
|
||||
}
|
||||
}
|
||||
log.error("[-requestError-][请求接口:{}]【异常信息:{}】[请求参数:{}] {}", url,errorMsg,params, errorStack.append("】").toString());
|
||||
throw ex;
|
||||
}finally {
|
||||
log.info("[--response--][请求接口:{} 执行结束][耗时:{}s]",url,(System.currentTimeMillis() - comming)/1000);
|
||||
MDC.clear();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据方法和传入的参数获取请求参数
|
||||
*/
|
||||
private String getParameter(Method method, Object[] args) {
|
||||
List<Object> argList = new ArrayList<>();
|
||||
Parameter[] parameters = method.getParameters();
|
||||
for (int i = 0; i < parameters.length; i++) {
|
||||
//将RequestBody注解修饰的参数作为请求参数
|
||||
RequestBody requestBody = parameters[i].getAnnotation(RequestBody.class);
|
||||
if (requestBody != null) {
|
||||
argList.add(args[i]);
|
||||
}
|
||||
//将RequestParam注解修饰的参数作为请求参数
|
||||
RequestParam requestParam = parameters[i].getAnnotation(RequestParam.class);
|
||||
if (requestParam != null) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
String key = parameters[i].getName();
|
||||
if (!StrUtil.isEmpty(requestParam.value())) {
|
||||
key = requestParam.value();
|
||||
}
|
||||
map.put(key, args[i]);
|
||||
argList.add(map);
|
||||
}
|
||||
}
|
||||
if (argList.size() == 0) {
|
||||
return "";
|
||||
}
|
||||
return argList.size() == 1 ? JSONUtil.toJsonStr(argList.get(0)) : JSONUtil.toJsonStr(argList);
|
||||
}
|
||||
|
||||
public String getUsername() {
|
||||
try {
|
||||
return SecurityUtils.getCurrentUsername();
|
||||
} catch (Exception e) {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
package org.nl.config;
|
||||
|
||||
import com.alibaba.druid.filter.FilterChain;
|
||||
import com.alibaba.druid.filter.FilterEventAdapter;
|
||||
import com.alibaba.druid.proxy.jdbc.JdbcParameter;
|
||||
import com.alibaba.druid.proxy.jdbc.PreparedStatementProxy;
|
||||
import com.alibaba.druid.proxy.jdbc.ResultSetProxy;
|
||||
import com.alibaba.druid.proxy.jdbc.StatementProxy;
|
||||
import com.alibaba.druid.sql.SQLUtils;
|
||||
import com.alibaba.druid.util.JdbcUtils;
|
||||
import com.mysql.cj.jdbc.result.ResultSetImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.MDC;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/*
|
||||
* @author ZZQ
|
||||
* @Date 2023/2/10 11:27 上午
|
||||
*/
|
||||
@Slf4j
|
||||
public class DruidFilter extends FilterEventAdapter {
|
||||
|
||||
@Override
|
||||
public int preparedStatement_executeUpdate(FilterChain chain, PreparedStatementProxy statement) throws SQLException {
|
||||
|
||||
return super.preparedStatement_executeUpdate(chain, statement);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int statement_executeUpdate(FilterChain chain, StatementProxy statement, String sql) throws SQLException {
|
||||
|
||||
return super.statement_executeUpdate(chain, statement, sql);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void statementExecuteAfter(StatementProxy statement, String sql, boolean result) {
|
||||
String traceId = MDC.get("traceId");
|
||||
int size = statement.getParametersSize();
|
||||
String executeSql = sql;
|
||||
int count = 0;
|
||||
try {
|
||||
count=statement.getUpdateCount();
|
||||
}catch (Exception ex){ }
|
||||
if (StringUtils.isNotEmpty(traceId) && count>0) {
|
||||
if (size > 0) {
|
||||
Collection<JdbcParameter> values = statement.getParameters().values();
|
||||
List<Object> params = new ArrayList<>();
|
||||
for (JdbcParameter value : values) {
|
||||
params.add(value.getValue());
|
||||
}
|
||||
executeSql = SQLUtils.format(executeSql, JdbcUtils.MYSQL, params);
|
||||
}
|
||||
log.info("[----SQL----][update][ SQL: {} ]", executeSql);
|
||||
}
|
||||
super.statementExecuteAfter(statement, sql, result);
|
||||
}
|
||||
@Override
|
||||
public ResultSetProxy statement_getResultSet(FilterChain chain, StatementProxy statement) throws SQLException {
|
||||
ResultSetProxy rs = super.statement_getResultSet(chain, statement);
|
||||
String executeSql = statement.getLastExecuteSql();
|
||||
String traceId = MDC.get("traceId");
|
||||
if (StringUtils.isNotEmpty(traceId)){
|
||||
int result = 0;
|
||||
if (rs != null) {
|
||||
ResultSetImpl rss = rs.getResultSetRaw().unwrap(ResultSetImpl.class);
|
||||
result = rss.getRows().size();
|
||||
}
|
||||
try {
|
||||
int size = statement.getParametersSize();
|
||||
if (size>0){
|
||||
Collection<JdbcParameter> values = statement.getParameters().values();
|
||||
List<Object> params = new ArrayList<>();
|
||||
for (JdbcParameter value : values) {
|
||||
params.add(value.getValue());
|
||||
}
|
||||
executeSql = SQLUtils.format(executeSql, JdbcUtils.MYSQL, params);
|
||||
}
|
||||
}catch (Exception ex){
|
||||
log.warn("[-SQL解析异常-][{}]",ex.getMessage());
|
||||
}
|
||||
log.info("[----SQL----][select][执行结果:{}][ SQL: {} ]",result, executeSql);
|
||||
}
|
||||
return rs;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package org.nl.config;
|
||||
|
||||
/*
|
||||
* @author ZZQ
|
||||
* @Date 2023/2/13 9:58 上午
|
||||
*/
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
public class ESConfig {
|
||||
|
||||
@Value(("${es.index}"))
|
||||
private String index;
|
||||
|
||||
|
||||
public String getIndex() {
|
||||
return index;
|
||||
}
|
||||
|
||||
public void setIndex(String index) {
|
||||
this.index = index;
|
||||
}
|
||||
}
|
||||
@@ -106,7 +106,6 @@ public class WebSocketServer {
|
||||
* */
|
||||
public static void sendInfo(SocketMsg socketMsg,@PathParam("sid") String sid) throws IOException {
|
||||
String message = JSONObject.toJSONString(socketMsg);
|
||||
log.info("推送消息到"+sid+",推送内容:"+message);
|
||||
for (WebSocketServer item : webSocketSet) {
|
||||
try {
|
||||
//这里可以设定只推送给这个sid的,为null则全部推送
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package org.nl.modules.system.domain;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.data.annotation.Id;
|
||||
import org.springframework.data.elasticsearch.annotations.Document;
|
||||
|
||||
/*
|
||||
* @author ZZQ
|
||||
* @Date 2023/2/8 4:06 下午
|
||||
*/
|
||||
@Document(indexName = "#{@ESConfig.index}", type = "whxr_log")
|
||||
@Data
|
||||
public class LogRepositoryDTO {
|
||||
|
||||
private String message;
|
||||
private String host;
|
||||
private String logLevel;
|
||||
private String logger;
|
||||
private String requestTime;
|
||||
private String requestIp;
|
||||
@Id
|
||||
private String id;
|
||||
private String traceId;
|
||||
private String requestMethod;
|
||||
private String thread;
|
||||
private String system;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package org.nl.modules.system.enums;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
public enum LevelEnum {
|
||||
DEBUG,
|
||||
INFO,
|
||||
WARN,
|
||||
ERROR;
|
||||
public static LevelEnum checkLevel(String level){
|
||||
if (!StringUtils.isEmpty(level)){
|
||||
for (LevelEnum value : LevelEnum.values()) {
|
||||
if (value.name().equals(level)){
|
||||
return value;
|
||||
};
|
||||
}
|
||||
}
|
||||
return LevelEnum.DEBUG;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package org.nl.modules.system.repository;
|
||||
|
||||
import org.nl.modules.system.domain.LogRepositoryDTO;
|
||||
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/*
|
||||
* @author ZZQ
|
||||
* @Date 2023/2/8 4:11 下午
|
||||
*/
|
||||
@Repository
|
||||
public interface EsLogRepository extends ElasticsearchRepository<LogRepositoryDTO, String> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package org.nl.modules.system.rest;
|
||||
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.nl.modules.system.service.EsLogService;
|
||||
import org.nl.modules.system.service.dto.LogQuery;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* @author ldjun
|
||||
* @version 1.0
|
||||
* @date 2023年01月29日 18:55
|
||||
* @desc desc
|
||||
*/
|
||||
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/api/esLog")
|
||||
public class EsLogController {
|
||||
private final EsLogService esLogService;
|
||||
|
||||
|
||||
@GetMapping("/labels/{type}")
|
||||
@ApiOperation("获取标签")
|
||||
public ResponseEntity<Object> labelsValues(@PathVariable String type) {
|
||||
return new ResponseEntity<>(esLogService.getLabelsValues(type), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/query")
|
||||
@ApiOperation("日志查询")
|
||||
public ResponseEntity<Object> queryAll(@RequestBody LogQuery query) {
|
||||
return new ResponseEntity<>(esLogService.query(query), HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package org.nl.modules.system.service;
|
||||
|
||||
import cn.hutool.db.PageResult;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import org.nl.modules.system.service.dto.LogQuery;
|
||||
|
||||
/**
|
||||
* @author ldjun
|
||||
* @version 1.0
|
||||
* @date 2023年02月07日 14:34
|
||||
* @desc desc
|
||||
*/
|
||||
public interface EsLogService {
|
||||
/**
|
||||
* 获取labels和values树
|
||||
* @return
|
||||
*/
|
||||
JSONArray getLabelsValues(String type);
|
||||
|
||||
/**
|
||||
* 日志查询
|
||||
* @param logQuery
|
||||
* @return
|
||||
*/
|
||||
PageResult query(LogQuery logQuery);
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package org.nl.modules.system.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/*
|
||||
* @author ZZQ
|
||||
* @Date 2023/2/8 5:18 下午
|
||||
*/
|
||||
@Data
|
||||
public class LogQuery {
|
||||
/**
|
||||
* 创建时间范围查询
|
||||
*/
|
||||
private Date startTime;
|
||||
private Date endTime;
|
||||
/**
|
||||
* 追踪id
|
||||
*/
|
||||
private String traceId;
|
||||
/**
|
||||
* 日志内容模糊匹配
|
||||
*/
|
||||
private String message;
|
||||
/**
|
||||
* 日志级别
|
||||
*/
|
||||
private String logLevel;
|
||||
/**
|
||||
* 系统标签
|
||||
*/
|
||||
private String system;
|
||||
/**
|
||||
* 是否只查询Http相关请求
|
||||
*/
|
||||
private Boolean isRequest = Boolean.TRUE;
|
||||
/**
|
||||
* 是否过滤wql日志
|
||||
*/
|
||||
private Boolean filterSql = Boolean.TRUE;
|
||||
|
||||
private Integer size = 20;
|
||||
|
||||
private Integer page = 1;
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
package org.nl.modules.system.service.impl;
|
||||
|
||||
import cn.hutool.db.PageResult;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.elasticsearch.action.search.SearchResponse;
|
||||
import org.elasticsearch.index.query.BoolQueryBuilder;
|
||||
import org.elasticsearch.index.query.QueryBuilders;
|
||||
import org.elasticsearch.script.Script;
|
||||
import org.elasticsearch.search.aggregations.AggregationBuilders;
|
||||
import org.elasticsearch.search.aggregations.Aggregations;
|
||||
import org.elasticsearch.search.aggregations.bucket.terms.Terms;
|
||||
import org.nl.modules.system.domain.LogRepositoryDTO;
|
||||
import org.nl.modules.system.enums.LevelEnum;
|
||||
import org.nl.modules.system.repository.EsLogRepository;
|
||||
import org.nl.modules.system.service.EsLogService;
|
||||
import org.nl.modules.system.service.dto.LogQuery;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.data.domain.Sort;
|
||||
import org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate;
|
||||
import org.springframework.data.elasticsearch.core.aggregation.impl.AggregatedPageImpl;
|
||||
import org.springframework.data.elasticsearch.core.query.FetchSourceFilter;
|
||||
import org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author ldjun
|
||||
* @version 1.0
|
||||
* @date 2023年02月07日 14:35
|
||||
* @desc desc
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class EsLogServiceImpl implements EsLogService {
|
||||
|
||||
private final EsLogRepository esLogRepository;
|
||||
|
||||
private final ElasticsearchRestTemplate elasticsearchRestTemplate;
|
||||
|
||||
@Override
|
||||
public PageResult query(LogQuery logQuery){
|
||||
PageResult page = new PageResult();
|
||||
if (logQuery != null){
|
||||
BoolQueryBuilder query = QueryBuilders.boolQuery(); //requestMethod
|
||||
extractedParam(logQuery, query);
|
||||
Iterable<LogRepositoryDTO> all = esLogRepository.search(query, PageRequest.of(logQuery.getPage()-1,logQuery.getSize(), Sort.by("@timestamp").descending()));
|
||||
page.addAll(((AggregatedPageImpl) all).getContent());
|
||||
page.setTotal((int) ((AggregatedPageImpl) all).getTotalElements());
|
||||
page.setPage(logQuery.getPage());
|
||||
page.setPageSize(logQuery.getSize());
|
||||
}
|
||||
return page;
|
||||
}
|
||||
|
||||
|
||||
private void extractedParam(LogQuery logQuery, BoolQueryBuilder query) {
|
||||
if (StringUtils.isNotEmpty(logQuery.getLogLevel())){
|
||||
query.must().add(QueryBuilders.matchQuery("logLevel", LevelEnum.checkLevel(logQuery.getLogLevel())));
|
||||
}
|
||||
if (StringUtils.isNotEmpty(logQuery.getSystem())){
|
||||
query.must().add(QueryBuilders.matchQuery("system", logQuery.getSystem()));
|
||||
}
|
||||
if (logQuery.getIsRequest()){
|
||||
query.must().add(QueryBuilders.existsQuery("requestMethod"));
|
||||
}
|
||||
if (logQuery.getFilterSql()){
|
||||
query.mustNot().add(QueryBuilders.wildcardQuery("logger","org.nl.modules.wql.core.engine.*"));
|
||||
}
|
||||
query.mustNot().add(QueryBuilders.matchPhraseQuery("logger","org.elasticsearch.client.RestClient"));
|
||||
if (StringUtils.isNotEmpty(logQuery.getTraceId())){
|
||||
query.must().add(QueryBuilders.matchQuery("traceId", logQuery.getTraceId()));
|
||||
}
|
||||
if (StringUtils.isNotEmpty(logQuery.getMessage())){
|
||||
query.must().add(QueryBuilders.matchPhraseQuery("message", logQuery.getMessage()));
|
||||
}
|
||||
if (logQuery.getEndTime()!=null ){
|
||||
String script = "doc['@timestamp'].value.millis < " + logQuery.getEndTime().getTime() + "L";
|
||||
query.must().add(QueryBuilders.scriptQuery(new Script(script)));
|
||||
}
|
||||
if (logQuery.getStartTime()!=null){
|
||||
String script = "doc['@timestamp'].value.millis > " + logQuery.getStartTime().getTime() + "L";
|
||||
query.must().add(QueryBuilders.scriptQuery(new Script(script)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public JSONArray getLabelsValues(String type) {
|
||||
JSONArray result = new JSONArray();
|
||||
FetchSourceFilter fetchSourceFilter = new FetchSourceFilter(new String[]{type}, null);
|
||||
NativeSearchQueryBuilder queryBuilder = new NativeSearchQueryBuilder();
|
||||
queryBuilder.withCollapseField(type+".keyword");
|
||||
queryBuilder.withSourceFilter(fetchSourceFilter);
|
||||
queryBuilder.addAggregation(AggregationBuilders.terms(type).field(type+".keyword").size(100));
|
||||
Aggregations agg = elasticsearchRestTemplate.query(queryBuilder.build(), SearchResponse::getAggregations);
|
||||
Terms terms = agg.get(type);
|
||||
List<? extends Terms.Bucket> buckets = terms.getBuckets();
|
||||
if (!CollectionUtils.isEmpty(buckets)){
|
||||
buckets.stream().map(Terms.Bucket::getKeyAsString).forEach(v-> {
|
||||
JSONObject item = new JSONObject();
|
||||
item.put("label", v);
|
||||
item.put("value", v);
|
||||
result.add(item);
|
||||
});
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -100,7 +100,7 @@ public class MenuServiceImpl implements MenuService {
|
||||
* @return /
|
||||
*/
|
||||
@Override
|
||||
@Cacheable(key = "'user:' + #p0")
|
||||
// @Cacheable(key = "'user:' + #p0")
|
||||
public List<MenuDto> findByUser(Long currentUserId) {
|
||||
List<RoleSmallDto> roles = roleService.findByUsersId(currentUserId);
|
||||
Set<Long> roleIds = roles.stream().map(RoleSmallDto::getId).collect(Collectors.toSet());
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
package org.nl.modules.system.util;
|
||||
|
||||
/*
|
||||
* @author ZZQ
|
||||
* @Date 2023/2/9 2:54 下午
|
||||
*/
|
||||
public class BaseCode {
|
||||
|
||||
static final char[] MySerials = new char[]{
|
||||
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
|
||||
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h',
|
||||
'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p','q','r','s','t','u','v','w','x','y','z',
|
||||
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H',
|
||||
'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P','Q','R','S','T','U','V','W','X','Y','Z'};
|
||||
|
||||
|
||||
public static final String intToChars(long n){
|
||||
String s = "";
|
||||
if (n == 0) {
|
||||
s = "0";
|
||||
}
|
||||
while (n != 0) {
|
||||
int i = (int) (n % MySerials.length);
|
||||
char c = MySerials[i];
|
||||
s = c + s;
|
||||
n = n / MySerials.length;
|
||||
}
|
||||
for (int x = s.length();x<5;x++){
|
||||
s="0"+s;
|
||||
}
|
||||
return s;
|
||||
}
|
||||
}
|
||||
@@ -47,12 +47,12 @@ public class Init implements ApplicationRunner, BeanFactoryAware, ApplicationCon
|
||||
private void init() throws Exception {
|
||||
//初始化WQL
|
||||
initWql();
|
||||
//随线程启动
|
||||
initApplicationAutoInitialExecuter();
|
||||
initWebAutoInitialExecuter();
|
||||
//初始化任务调度
|
||||
initQuartz();
|
||||
//用户岗位表【sys_users_roles】
|
||||
// //随线程启动
|
||||
// initApplicationAutoInitialExecuter();
|
||||
// initWebAutoInitialExecuter();
|
||||
// //初始化任务调度
|
||||
// initQuartz();
|
||||
// //用户岗位表【sys_users_roles】
|
||||
System.out.println("项目启动成功!");
|
||||
}
|
||||
private void initOracle(){
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"properties": [
|
||||
{
|
||||
"name": "es.index",
|
||||
"type": "java.lang.String",
|
||||
"description": "Description for es.index."
|
||||
}
|
||||
] }
|
||||
@@ -0,0 +1 @@
|
||||
druid.filters.DruidFilter=org.nl.config.DruidFilter
|
||||
@@ -15,6 +15,22 @@ erp:
|
||||
|
||||
#配置数据源
|
||||
spring:
|
||||
data:
|
||||
elasticsearch:
|
||||
repositories:
|
||||
enabled: true
|
||||
client:
|
||||
reactive:
|
||||
#endpoints: 172.31.185.110:9200,172.31.154.9:9200 #内网
|
||||
endpoints: 47.96.133.178:8200 #外网
|
||||
# endpoints: http://10.1.3.90:9200 #外网
|
||||
elasticsearch:
|
||||
rest:
|
||||
#uris: 172.31.185.110:9200,172.31.154.9:9200 #内网
|
||||
uris: 47.96.133.178:8200 #外网
|
||||
# uris: http://10.1.3.90:9200 #外网
|
||||
username: elastic
|
||||
password: 123456
|
||||
datasource:
|
||||
druid:
|
||||
db-type: com.alibaba.druid.pool.DruidDataSource
|
||||
@@ -58,16 +74,8 @@ spring:
|
||||
enabled: true
|
||||
url-pattern: /druid/*
|
||||
reset-enable: false
|
||||
filter:
|
||||
stat:
|
||||
enabled: true
|
||||
# 记录慢SQL
|
||||
log-slow-sql: true
|
||||
slow-sql-millis: 1000
|
||||
merge-sql: true
|
||||
wall:
|
||||
config:
|
||||
multi-statement-allow: true
|
||||
filters:
|
||||
DruidFilter,stat
|
||||
redis:
|
||||
#数据库索引
|
||||
database: 2
|
||||
@@ -158,4 +166,6 @@ logging:
|
||||
file:
|
||||
path: C:\log\wms
|
||||
config: classpath:logback-spring.xml
|
||||
es:
|
||||
index: whxr_log
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ spring:
|
||||
freemarker:
|
||||
check-template-location: false
|
||||
profiles:
|
||||
active: prod
|
||||
active: dev
|
||||
jackson:
|
||||
time-zone: GMT+8
|
||||
data:
|
||||
|
||||
@@ -14,6 +14,7 @@ https://juejin.cn/post/6844903775631572999
|
||||
<property name="log.pattern"
|
||||
value="%black(%contextName-) %red(%d{yyyy-MM-dd HH:mm:ss}) %green([%thread]) %highlight(%-5level) %boldMagenta(%logger{36}) - %gray(%msg%n)"/>
|
||||
<springProperty scope="context" name="logPath" source="logging.file.path" defaultValue="logs"/>
|
||||
<springProperty scope="context" name="esIndex" source="es.index"/>
|
||||
<property name="LOG_HOME" value="${logPath}"/>
|
||||
<!--引入默认的一些设置-->
|
||||
<include resource="log/XrToMes.xml"/>
|
||||
@@ -48,6 +49,66 @@ https://juejin.cn/post/6844903775631572999
|
||||
</encoder>
|
||||
|
||||
</appender>
|
||||
<appender name="esLogAppender" class="com.internetitem.logback.elasticsearch.ElasticsearchAppender">
|
||||
<url>http://47.96.133.178:8200/_bulk</url>
|
||||
<index>${esIndex}</index>
|
||||
<type>whxr_log</type>
|
||||
<loggerName>es-logger</loggerName> <!-- optional -->
|
||||
<errorLoggerName>es-error-logger</errorLoggerName> <!-- optional -->
|
||||
<connectTimeout>30000</connectTimeout> <!-- optional (in ms, default 30000) -->
|
||||
<errorsToStderr>false</errorsToStderr> <!-- optional (default false) -->
|
||||
<includeCallerData>false</includeCallerData> <!-- optional (default false) -->
|
||||
<logsToStderr>false</logsToStderr> <!-- optional (default false) -->
|
||||
<maxQueueSize>104857600</maxQueueSize> <!-- optional (default 104857600) -->
|
||||
<maxRetries>3</maxRetries> <!-- optional (default 3) -->
|
||||
<readTimeout>30000</readTimeout> <!-- optional (in ms, default 30000) -->
|
||||
<sleepTime>250</sleepTime> <!-- optional (in ms, default 250) -->
|
||||
<rawJsonMessage>false</rawJsonMessage> <!-- optional (default false) -->
|
||||
<includeMdc>false</includeMdc> <!-- optional (default false) -->
|
||||
<maxMessageSize>20000</maxMessageSize> <!-- optional (default -1 -->
|
||||
<!-- <authentication class="com.internetitem.logback.elasticsearch.config.BasicAuthentication" /> <!– optional –>-->
|
||||
<properties>
|
||||
<property>
|
||||
<name>system</name>
|
||||
<value>mes</value>
|
||||
</property>
|
||||
<property>
|
||||
<name>traceId</name>
|
||||
<value>%X{traceId}</value>
|
||||
</property>
|
||||
<property>
|
||||
<name>logLevel</name>
|
||||
<value>%level</value>
|
||||
</property>
|
||||
<property>
|
||||
<name>requestMethod</name>
|
||||
<value>%X{requestMethod}</value>
|
||||
</property>
|
||||
<property>
|
||||
<name>requestTime</name>
|
||||
<value>%d{yyyy-MM-dd HH:mm:ss.SSS}</value>
|
||||
</property>
|
||||
<property>
|
||||
<name>requestIp</name>
|
||||
<value>%X{requestIp}</value>
|
||||
</property>
|
||||
<property>
|
||||
<name>thread</name>
|
||||
<value>%thread</value>
|
||||
</property>
|
||||
<property>
|
||||
<name>logger</name>
|
||||
<value>%logger</value>
|
||||
</property>
|
||||
</properties>
|
||||
<headers>
|
||||
<header>
|
||||
<name>Content-Type</name>
|
||||
<value>application/json</value>
|
||||
</header>
|
||||
</headers>
|
||||
</appender>
|
||||
|
||||
|
||||
<!--异步到文件-->
|
||||
<appender name="asyncFileAppender" class="ch.qos.logback.classic.AsyncAppender">
|
||||
@@ -58,9 +119,14 @@ https://juejin.cn/post/6844903775631572999
|
||||
|
||||
<!--开发环境:打印控制台-->
|
||||
<springProfile name="dev">
|
||||
<root level="debug">
|
||||
<root level="info">
|
||||
<appender-ref ref="esLogAppender"/>
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
</root>
|
||||
<!-- <logger name="es-logger" level="warn" additivity="false">-->
|
||||
<!-- <appender-ref ref="esLogAppender"/>-->
|
||||
<!-- <appender-ref ref="CONSOLE"/>-->
|
||||
<!-- </logger>-->
|
||||
<logger name="org.springframework" level="ERROR" additivity="false">
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
</logger>
|
||||
@@ -99,10 +165,14 @@ https://juejin.cn/post/6844903775631572999
|
||||
|
||||
<!--生产环境:打印控制台和输出到文件-->
|
||||
<springProfile name="prod">
|
||||
<root level="debug">
|
||||
<!-- <appender-ref ref="CONSOLE"/>-->
|
||||
<root level="info">
|
||||
<appender-ref ref="esLogAppender"/>
|
||||
<appender-ref ref="asyncFileAppender"/>
|
||||
</root>
|
||||
<logger name="es-logger" level="warn" additivity="false">
|
||||
<appender-ref ref="esLogAppender"/>
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
</logger>
|
||||
<logger name="org.springframework" level="ERROR" additivity="false">
|
||||
<appender-ref ref="asyncFileAppender"/>
|
||||
</logger>
|
||||
|
||||
BIN
mes/qd/dist.zip
Normal file
BIN
mes/qd/dist.zip
Normal file
Binary file not shown.
18
mes/qd/src/views/tools/es/api/loki.js
Normal file
18
mes/qd/src/views/tools/es/api/loki.js
Normal file
@@ -0,0 +1,18 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function getLogData(param) {
|
||||
return request({
|
||||
url: '/api/esLog/query',
|
||||
method: 'post',
|
||||
data: param
|
||||
})
|
||||
}
|
||||
|
||||
export function labelsValues(type) {
|
||||
return request({
|
||||
url: '/api/esLog/labels/' + type,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export default { getLogData, labelsValues }
|
||||
348
mes/qd/src/views/tools/es/view/index.vue
Normal file
348
mes/qd/src/views/tools/es/view/index.vue
Normal file
@@ -0,0 +1,348 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div class="head-container">
|
||||
<!--工具栏-->
|
||||
<el-form :inline="true" class="demo-form-inline" label-suffix=":" label-width="90px">
|
||||
<el-form-item label="标签">
|
||||
<el-select
|
||||
v-model="system"
|
||||
clearable
|
||||
style="width: 100px; height: 35px;top: -5px;"
|
||||
placeholder="所属标签"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in systemOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="级别">
|
||||
<el-select
|
||||
v-model="logLevelValue"
|
||||
clearable
|
||||
style="width: 100px; height: 35px;top: -5px;"
|
||||
placeholder="日志级别"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in labelsOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="关键字">
|
||||
<el-input
|
||||
v-model="message"
|
||||
size="mini"
|
||||
placeholder="请输入内容"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="链路追踪">
|
||||
<el-input
|
||||
v-model="traceId"
|
||||
size="mini"
|
||||
placeholder="请输入链路id"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="SQL日志" prop="filterSql">
|
||||
<el-switch
|
||||
v-model="filterSql"
|
||||
active-color="#F56C6C"
|
||||
inactive-color="#409EFF"
|
||||
active-value="1"
|
||||
inactive-valu="0"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="HTTP日志" prop="isRequest">
|
||||
<el-switch
|
||||
v-model="isRequest"
|
||||
active-color="#409EFF"
|
||||
inactive-color="#F56C6C"
|
||||
active-value="1"
|
||||
inactive-valu="0"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item v-show="!showOptions" label="时间范围">
|
||||
<el-date-picker
|
||||
v-model="timeRange"
|
||||
size="mini"
|
||||
clearable
|
||||
type="datetimerange"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
align="right"
|
||||
@change="queryData"
|
||||
@blur="queryData"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item v-show="showOptions" label="时间段">
|
||||
<el-select v-model="timeZoneValue" filterable placeholder="请选择标签" size="mini" @change="queryData">
|
||||
<el-option
|
||||
v-for="item in timeZoneOptions"
|
||||
:key="item.index"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-tooltip class="item" effect="dark" content="切换查询条件" placement="top">
|
||||
<span class="el-icon-sort" @click="changeShow" />
|
||||
</el-tooltip>
|
||||
</el-form-item>
|
||||
<el-form-item label="显示条数">
|
||||
<el-input-number
|
||||
v-model="size"
|
||||
size="mini"
|
||||
controls-position="right"
|
||||
:min="20"
|
||||
:max="5000"
|
||||
:step="10"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="当前页">
|
||||
<el-input-number
|
||||
v-model="page"
|
||||
size="mini"
|
||||
controls-position="right"
|
||||
:min="1"
|
||||
:max="2000"
|
||||
:step="1"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-dropdown split-button type="primary" size="mini" @click="queryData">
|
||||
查询
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item v-for="(item, index) in runStatuOptions" :key="index" @click.native="startInterval(item)">{{ item.label }}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<!-- <div style="margin: 3px; min-height: 80vh;">
|
||||
<el-table :data="logs">
|
||||
<el-table-column label="ip" prop="requestIp" />
|
||||
<el-table-column label="所属系统" prop="system" />
|
||||
<el-table-column label="请求时间" prop="requestTime" />
|
||||
<el-table-column label="traceId" prop="traceId" />
|
||||
<el-table-column label="请求时间" prop="requestTime" />
|
||||
<el-table-column label="请求接口" prop="requestMethod" />
|
||||
<el-table-column label="logger" prop="logger" />
|
||||
<el-table-column label="thread" prop="thread" />
|
||||
<el-table-column label="message" prop="message" show-overflow-tooltip/>
|
||||
</el-table>
|
||||
</div>
|
||||
-->
|
||||
<div style="margin: 3px; min-height: 80vh;">
|
||||
<!--数据判空-->
|
||||
<!-- <el-empty v-if="showEmpty" :description="emptyText" />-->
|
||||
<!--数据加载-->
|
||||
<el-card shadow="hover" style="width: 100%;overflow-x: scroll" class="log-warpper">
|
||||
<div style="width: 100%">
|
||||
<div v-for="(log, index) in logs" :key="index">
|
||||
<div>
|
||||
<span style="color: #6c0a99;font-weight: 700">{{ log.system }}</span>
|
||||
<span style="color: #13ce66">{{ log.thread }}</span>
|
||||
<span :style="fontType(log.logLevel)">{{ log.logLevel }}</span>
|
||||
<span>{{ log.requestIp }}</span>
|
||||
<span style="color: #7c8db0">{{ log.requestTime }}</span>
|
||||
<span style="color: chocolate">{{ log.traceId }}</span>
|
||||
<span style="color: #7a6df0">{{ log.requestMethod }}</span>
|
||||
<span style="margin: 5px;font-size: 15px" v-html="log.message">{{ log.message }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import logOperation from '@/views/tools/es/api/loki'
|
||||
|
||||
let queryParam = {
|
||||
logLevel: null,
|
||||
system: null,
|
||||
startTime: null,
|
||||
endTime: null,
|
||||
traceId: null,
|
||||
message: null,
|
||||
filterSql: true,
|
||||
isRequest: true,
|
||||
page: null,
|
||||
size: 20
|
||||
}
|
||||
export default {
|
||||
name: 'ES',
|
||||
data() {
|
||||
return {
|
||||
labelsOptions: [], // 所有标签和对应所有值数据
|
||||
systemOptions: [], // 所有标签和对应所有值数据
|
||||
logLevelValue: '',
|
||||
system: '',
|
||||
timeRange: [],
|
||||
message: '',
|
||||
traceId: '',
|
||||
size: 20,
|
||||
logData: [],
|
||||
filterSql: '1',
|
||||
isRequest: '1',
|
||||
logs: [], // 所有日志
|
||||
showEmpty: true,
|
||||
emptyText: '请选择标签',
|
||||
page: 1,
|
||||
runStatu: 'off',
|
||||
runStatuOptions: [{
|
||||
label: 'off',
|
||||
value: 0
|
||||
}, {
|
||||
label: '5s',
|
||||
value: 5000
|
||||
}, {
|
||||
label: '10s',
|
||||
value: 10000
|
||||
}, {
|
||||
label: '1m',
|
||||
value: 60000
|
||||
}, {
|
||||
label: '5m',
|
||||
value: 300000
|
||||
}, {
|
||||
label: '30m',
|
||||
value: 1800000
|
||||
}],
|
||||
timeZoneOptions: [{
|
||||
label: '最近5分钟',
|
||||
value: 300 * 1000
|
||||
}, {
|
||||
label: '最近15分钟',
|
||||
value: 900 * 1000
|
||||
}, {
|
||||
label: '最近30分钟',
|
||||
value: 1800 * 1000
|
||||
}, {
|
||||
label: '最近1小时',
|
||||
value: 3600 * 1000
|
||||
}, {
|
||||
label: '最近3小时',
|
||||
value: 3600 * 1000 * 3
|
||||
}, {
|
||||
label: '最近6小时',
|
||||
value: 3600 * 1000 * 6
|
||||
}, {
|
||||
label: '最近12小时',
|
||||
value: 3600 * 1000 * 12
|
||||
}, {
|
||||
label: '最近24小时',
|
||||
value: 3600 * 1000 * 24
|
||||
}, {
|
||||
label: '最近2天',
|
||||
value: 3600 * 1000 * 24 * 2
|
||||
}, {
|
||||
label: '最近7天',
|
||||
value: 3600 * 1000 * 24 * 7
|
||||
}, {
|
||||
label: '最近15天',
|
||||
value: 3600 * 1000 * 24 * 15
|
||||
}],
|
||||
timeZoneValue: '',
|
||||
showOptions: true
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.initLabelsValues('logLevel')
|
||||
this.initLabelsValues('system')
|
||||
},
|
||||
methods: {
|
||||
fontType(level) {
|
||||
if (level === 'INFO') {
|
||||
return { 'color': '#1b6cc4' }
|
||||
}
|
||||
if (level === 'ERROR') {
|
||||
return { 'color': '#e30a0a' }
|
||||
}
|
||||
if (level === 'DEBUG') {
|
||||
return { 'color': '#1e2022' }
|
||||
}
|
||||
return { 'color': '#a74dc6' }
|
||||
},
|
||||
initLabelsValues(type) {
|
||||
logOperation.labelsValues(type).then(res => {
|
||||
if (type === 'logLevel') {
|
||||
this.labelsOptions = res
|
||||
}
|
||||
if (type === 'system') {
|
||||
this.systemOptions = res
|
||||
}
|
||||
})
|
||||
},
|
||||
queryData() {
|
||||
// 清空查询数据
|
||||
this.clearParam()
|
||||
queryParam.logLevel = this.logLevelValue
|
||||
const time = new Date()
|
||||
if (this.timeZoneValue !== '') {
|
||||
queryParam.startTime = new Date(((time.getTime() - this.timeZoneValue)))
|
||||
}
|
||||
if (this.timeRange !== '' && this.timeRange.length > 0) {
|
||||
queryParam.startTime = this.timeRange[0]
|
||||
queryParam.endTime = this.timeRange[1]
|
||||
}
|
||||
queryParam.message = this.message.replace(/^\s*|\s*$/g, '')
|
||||
queryParam.filterSql = this.filterSql === '1'
|
||||
queryParam.isRequest = this.filterSql === '1'
|
||||
queryParam.traceId = this.traceId
|
||||
queryParam.size = this.size
|
||||
queryParam.page = this.page
|
||||
queryParam.system = this.system
|
||||
|
||||
logOperation.getLogData(queryParam).then(res => {
|
||||
this.showEmpty = false
|
||||
// 清空
|
||||
this.logs = []
|
||||
for (const j in res.records) { // 用push的方式将所有日志数组添加进去
|
||||
this.logs.push(res.records[j])
|
||||
}
|
||||
})
|
||||
},
|
||||
changetype() {
|
||||
|
||||
},
|
||||
clearParam() {
|
||||
queryParam = {
|
||||
logLevel: null,
|
||||
startTime: null,
|
||||
endTime: null,
|
||||
message: null,
|
||||
traceId: null,
|
||||
isRequest: true,
|
||||
filterSql: true,
|
||||
size: 20
|
||||
}
|
||||
},
|
||||
changeShow() {
|
||||
// 清空数据
|
||||
this.timeZoneValue = ''
|
||||
this.timeRange = []
|
||||
this.showOptions = !this.showOptions
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.log-warpper {
|
||||
white-space: nowrap;
|
||||
word-break: break-word;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user