🔨 数据清理时添加条数限制.
This commit is contained in:
@@ -1,17 +0,0 @@
|
|||||||
package com.orion.visor.framework.common.annotation;
|
|
||||||
|
|
||||||
import java.lang.annotation.*;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 保留
|
|
||||||
*
|
|
||||||
* @author Jiahang Li
|
|
||||||
* @version 1.0.0
|
|
||||||
* @since 2024/6/6 15:26
|
|
||||||
*/
|
|
||||||
@Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD})
|
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
|
||||||
@Documented
|
|
||||||
public @interface Keep {
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package com.orion.visor.framework.common.entity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据清理请求 定义
|
||||||
|
*
|
||||||
|
* @author Jiahang Li
|
||||||
|
* @version 1.0.0
|
||||||
|
* @since 2024/8/29 11:26
|
||||||
|
*/
|
||||||
|
public interface DataClearRequest {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取清理数量限制
|
||||||
|
*
|
||||||
|
* @return 清理限制
|
||||||
|
*/
|
||||||
|
Integer getLimit();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置清理数量限制
|
||||||
|
*
|
||||||
|
* @param limit limit
|
||||||
|
*/
|
||||||
|
void setLimit(Integer limit);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
package com.orion.visor.framework.common.entity;
|
package com.orion.visor.framework.common.entity;
|
||||||
|
|
||||||
import com.orion.lang.define.wrapper.IPageRequest;
|
|
||||||
import com.orion.visor.framework.common.validator.group.Page;
|
import com.orion.visor.framework.common.validator.group.Page;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import javax.validation.constraints.Max;
|
import javax.validation.constraints.Max;
|
||||||
import javax.validation.constraints.Min;
|
import javax.validation.constraints.Min;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 公共页码请求
|
* 公共页码请求
|
||||||
@@ -17,16 +17,18 @@ import javax.validation.constraints.Min;
|
|||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Schema(description = "公共页码请求")
|
@Schema(description = "公共页码请求")
|
||||||
public class PageRequest implements IPageRequest {
|
public class PageRequest {
|
||||||
|
|
||||||
|
@NotNull(groups = Page.class)
|
||||||
@Min(value = 1, groups = Page.class)
|
@Min(value = 1, groups = Page.class)
|
||||||
@Max(value = 10000, groups = Page.class)
|
@Max(value = 10000, groups = Page.class)
|
||||||
@Schema(description = "页码")
|
@Schema(description = "页码")
|
||||||
private int page;
|
private Integer page;
|
||||||
|
|
||||||
|
@NotNull(groups = Page.class)
|
||||||
@Min(value = 1, groups = Page.class)
|
@Min(value = 1, groups = Page.class)
|
||||||
@Max(value = 200, groups = Page.class)
|
@Max(value = 200, groups = Page.class)
|
||||||
@Schema(description = "大小")
|
@Schema(description = "大小")
|
||||||
private int limit;
|
private Integer limit;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ public class SqlUtils {
|
|||||||
* @param limit limit
|
* @param limit limit
|
||||||
* @return limit
|
* @return limit
|
||||||
*/
|
*/
|
||||||
public static String limit(Integer limit) {
|
public static String limit(Number limit) {
|
||||||
return Const.LIMIT + Const.SPACE + limit;
|
return Const.LIMIT + Const.SPACE + limit;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -31,7 +31,7 @@ public class SqlUtils {
|
|||||||
* @param limit limit
|
* @param limit limit
|
||||||
* @return limit
|
* @return limit
|
||||||
*/
|
*/
|
||||||
public static String limit(int offset, Integer limit) {
|
public static String limit(Number offset, Number limit) {
|
||||||
return Const.LIMIT + Const.SPACE + offset + Const.COMMA + limit;
|
return Const.LIMIT + Const.SPACE + offset + Const.COMMA + limit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ public class DataQuery<T> {
|
|||||||
|
|
||||||
private final BaseMapper<T> dao;
|
private final BaseMapper<T> dao;
|
||||||
|
|
||||||
private IPageRequest page;
|
private PageRequest page;
|
||||||
|
|
||||||
private Wrapper<T> wrapper;
|
private Wrapper<T> wrapper;
|
||||||
|
|
||||||
@@ -74,8 +74,9 @@ public class DataQuery<T> {
|
|||||||
return new DataQuery<>(dao, wrapper);
|
return new DataQuery<>(dao, wrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
public DataQuery<T> page(IPageRequest page) {
|
public DataQuery<T> page(com.orion.visor.framework.common.entity.PageRequest page) {
|
||||||
this.page = Valid.notNull(page, "page is null");
|
com.orion.visor.framework.common.entity.PageRequest pr = Valid.notNull(page, "page is null");
|
||||||
|
this.page = new PageRequest(pr.getPage(), pr.getLimit());
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -200,6 +201,18 @@ public class DataQuery<T> {
|
|||||||
return dao.selectCount(wrapper);
|
return dao.selectCount(wrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Long countMax(Number max) {
|
||||||
|
Long count = dao.selectCount(wrapper);
|
||||||
|
if (max == null) {
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
long maxValue = max.longValue();
|
||||||
|
if (maxValue <= 0L) {
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
return Math.min(count, maxValue);
|
||||||
|
}
|
||||||
|
|
||||||
public boolean absent() {
|
public boolean absent() {
|
||||||
return dao.selectCount(wrapper) == 0;
|
return dao.selectCount(wrapper) == 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,6 +60,18 @@ Authorization: {{token}}
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
${httpComment} ${apiComment.queryCount}
|
||||||
|
POST {{baseUrl}}/${package.ModuleName}/${typeHyphen}/count
|
||||||
|
Content-Type: application/json
|
||||||
|
Authorization: {{token}}
|
||||||
|
|
||||||
|
{
|
||||||
|
#foreach($field in ${table.fields})
|
||||||
|
"${field.propertyName}": ""#if($foreach.hasNext),#end
|
||||||
|
#end
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
${httpComment} ${apiComment.deleteById}
|
${httpComment} ${apiComment.deleteById}
|
||||||
DELETE {{baseUrl}}/${package.ModuleName}/${typeHyphen}/delete?id=1
|
DELETE {{baseUrl}}/${package.ModuleName}/${typeHyphen}/delete?id=1
|
||||||
Authorization: {{token}}
|
Authorization: {{token}}
|
||||||
|
|||||||
@@ -113,6 +113,13 @@ public class ${table.controllerName} {
|
|||||||
return ${typeLower}Service.get${type}Page(request);
|
return ${typeLower}Service.get${type}Page(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/count")
|
||||||
|
@Operation(summary = "${apiComment.queryCount}")
|
||||||
|
@PreAuthorize("@ss.hasPermission('${package.ModuleName}:${typeHyphen}:query')")
|
||||||
|
public Long get${type}Count(@Validated @RequestBody ${type}QueryRequest request) {
|
||||||
|
return ${typeLower}Service.get${type}Count(request);
|
||||||
|
}
|
||||||
|
|
||||||
#if($meta.enableDemoApi)
|
#if($meta.enableDemoApi)
|
||||||
@DemoDisableApi
|
@DemoDisableApi
|
||||||
#end
|
#end
|
||||||
|
|||||||
@@ -152,10 +152,9 @@ public class ${table.serviceImplName} implements ${table.serviceName} {
|
|||||||
#end
|
#end
|
||||||
@Override
|
@Override
|
||||||
public Long get${type}Count(${type}QueryRequest request) {
|
public Long get${type}Count(${type}QueryRequest request) {
|
||||||
// 条件
|
return ${typeLower}DAO.of()
|
||||||
LambdaQueryWrapper<${type}DO> wrapper = this.buildQueryWrapper(request);
|
.wrapper(this.buildQueryWrapper(request))
|
||||||
// 查询
|
.countMax(request.getLimit());
|
||||||
return ${typeLower}DAO.selectCount(wrapper);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -115,6 +115,13 @@ export function get${vue.featureEntity}Page(request: ${vue.featureEntity}QueryRe
|
|||||||
return axios.post<DataGrid<${vue.featureEntity}QueryResponse>>('/${package.ModuleName}/${typeHyphen}/query', request);
|
return axios.post<DataGrid<${vue.featureEntity}QueryResponse>>('/${package.ModuleName}/${typeHyphen}/query', request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* $apiComment.queryCount
|
||||||
|
*/
|
||||||
|
export function get${vue.featureEntity}Count(request: ${vue.featureEntity}QueryRequest) {
|
||||||
|
return axios.post<number>('/${package.ModuleName}/${typeHyphen}/count', request);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* $apiComment.deleteById
|
* $apiComment.deleteById
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,18 +1,24 @@
|
|||||||
spring:
|
spring:
|
||||||
datasource:
|
datasource:
|
||||||
druid:
|
druid:
|
||||||
url: jdbc:mysql://127.0.0.1:3306/orion_visor?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowPublicKeyRetrieval=true&useSSL=false&serverTimezone=Asia/Shanghai&autoReconnect=true
|
url: jdbc:mysql://116.62.194.246:3306/orion_visor?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowPublicKeyRetrieval=true&useSSL=false&serverTimezone=Asia/Shanghai&autoReconnect=true
|
||||||
username: root
|
username: root
|
||||||
password: Data@123456
|
password: maxData@123456
|
||||||
|
# url: jdbc:mysql://101.43.254.243:3307/orion_visor?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowPublicKeyRetrieval=true&useSSL=false&serverTimezone=Asia/Shanghai&autoReconnect=true
|
||||||
|
# username: root
|
||||||
|
# password: Data@123456
|
||||||
initial-size: 0
|
initial-size: 0
|
||||||
min-idle: 1
|
min-idle: 1
|
||||||
max-active: 5
|
max-active: 5
|
||||||
stat-view-servlet:
|
stat-view-servlet:
|
||||||
enabled: false
|
enabled: false
|
||||||
redis:
|
redis:
|
||||||
host: 127.0.0.1
|
host: 116.62.194.246
|
||||||
port: 6379
|
port: 6379
|
||||||
password: Data@123456
|
password: maxData@123456
|
||||||
|
# host: 101.43.254.243
|
||||||
|
# port: 6380
|
||||||
|
# password: Data@123456
|
||||||
redisson:
|
redisson:
|
||||||
threads: 2
|
threads: 2
|
||||||
netty-threads: 2
|
netty-threads: 2
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package com.orion.visor.module.asset.controller;
|
|||||||
import com.orion.lang.define.wrapper.DataGrid;
|
import com.orion.lang.define.wrapper.DataGrid;
|
||||||
import com.orion.visor.framework.biz.operator.log.core.annotation.OperatorLog;
|
import com.orion.visor.framework.biz.operator.log.core.annotation.OperatorLog;
|
||||||
import com.orion.visor.framework.common.utils.Valid;
|
import com.orion.visor.framework.common.utils.Valid;
|
||||||
import com.orion.visor.framework.common.validator.group.Clear;
|
|
||||||
import com.orion.visor.framework.common.validator.group.Page;
|
import com.orion.visor.framework.common.validator.group.Page;
|
||||||
import com.orion.visor.framework.log.core.annotation.IgnoreLog;
|
import com.orion.visor.framework.log.core.annotation.IgnoreLog;
|
||||||
import com.orion.visor.framework.log.core.enums.IgnoreLogMode;
|
import com.orion.visor.framework.log.core.enums.IgnoreLogMode;
|
||||||
@@ -11,6 +10,7 @@ import com.orion.visor.framework.security.core.utils.SecurityUtils;
|
|||||||
import com.orion.visor.framework.web.core.annotation.RestWrapper;
|
import com.orion.visor.framework.web.core.annotation.RestWrapper;
|
||||||
import com.orion.visor.module.asset.define.operator.ExecCommandLogOperatorType;
|
import com.orion.visor.module.asset.define.operator.ExecCommandLogOperatorType;
|
||||||
import com.orion.visor.module.asset.entity.request.exec.ExecInterruptRequest;
|
import com.orion.visor.module.asset.entity.request.exec.ExecInterruptRequest;
|
||||||
|
import com.orion.visor.module.asset.entity.request.exec.ExecLogClearRequest;
|
||||||
import com.orion.visor.module.asset.entity.request.exec.ExecLogQueryRequest;
|
import com.orion.visor.module.asset.entity.request.exec.ExecLogQueryRequest;
|
||||||
import com.orion.visor.module.asset.entity.request.exec.ExecLogTailRequest;
|
import com.orion.visor.module.asset.entity.request.exec.ExecLogTailRequest;
|
||||||
import com.orion.visor.module.asset.entity.vo.ExecHostLogVO;
|
import com.orion.visor.module.asset.entity.vo.ExecHostLogVO;
|
||||||
@@ -98,6 +98,14 @@ public class ExecCommandLogController {
|
|||||||
return execLogService.getExecHistory(request);
|
return execLogService.getExecHistory(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/count")
|
||||||
|
@Operation(summary = "查询批量执行日志数量")
|
||||||
|
@PreAuthorize("@ss.hasPermission('asset:exec-command-log:query')")
|
||||||
|
public Long getExecCommandLogCount(@Validated @RequestBody ExecLogQueryRequest request) {
|
||||||
|
request.setSource(SOURCE);
|
||||||
|
return execLogService.queryExecLogCount(request);
|
||||||
|
}
|
||||||
|
|
||||||
@OperatorLog(ExecCommandLogOperatorType.DELETE)
|
@OperatorLog(ExecCommandLogOperatorType.DELETE)
|
||||||
@DeleteMapping("/delete")
|
@DeleteMapping("/delete")
|
||||||
@Operation(summary = "删除批量执行日志")
|
@Operation(summary = "删除批量执行日志")
|
||||||
@@ -125,19 +133,11 @@ public class ExecCommandLogController {
|
|||||||
return execHostLogService.deleteExecHostLogById(id);
|
return execHostLogService.deleteExecHostLogById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/query-count")
|
|
||||||
@Operation(summary = "查询批量执行日志数量")
|
|
||||||
@PreAuthorize("@ss.hasPermission('asset:exec-command-log:management:clear')")
|
|
||||||
public Long getExecCommandLogCount(@RequestBody ExecLogQueryRequest request) {
|
|
||||||
request.setSource(SOURCE);
|
|
||||||
return execLogService.queryExecLogCount(request);
|
|
||||||
}
|
|
||||||
|
|
||||||
@OperatorLog(ExecCommandLogOperatorType.CLEAR)
|
@OperatorLog(ExecCommandLogOperatorType.CLEAR)
|
||||||
@PostMapping("/clear")
|
@PostMapping("/clear")
|
||||||
@Operation(summary = "清空批量执行日志")
|
@Operation(summary = "清空批量执行日志")
|
||||||
@PreAuthorize("@ss.hasPermission('asset:exec-command-log:management:clear')")
|
@PreAuthorize("@ss.hasPermission('asset:exec-command-log:management:clear')")
|
||||||
public Integer clearExecCommandLog(@Validated(Clear.class) @RequestBody ExecLogQueryRequest request) {
|
public Integer clearExecCommandLog(@Validated @RequestBody ExecLogClearRequest request) {
|
||||||
request.setSource(SOURCE);
|
request.setSource(SOURCE);
|
||||||
return execLogService.clearExecLog(request);
|
return execLogService.clearExecLog(request);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,13 +3,13 @@ package com.orion.visor.module.asset.controller;
|
|||||||
import com.orion.lang.define.wrapper.DataGrid;
|
import com.orion.lang.define.wrapper.DataGrid;
|
||||||
import com.orion.visor.framework.biz.operator.log.core.annotation.OperatorLog;
|
import com.orion.visor.framework.biz.operator.log.core.annotation.OperatorLog;
|
||||||
import com.orion.visor.framework.common.utils.Valid;
|
import com.orion.visor.framework.common.utils.Valid;
|
||||||
import com.orion.visor.framework.common.validator.group.Clear;
|
|
||||||
import com.orion.visor.framework.common.validator.group.Page;
|
import com.orion.visor.framework.common.validator.group.Page;
|
||||||
import com.orion.visor.framework.log.core.annotation.IgnoreLog;
|
import com.orion.visor.framework.log.core.annotation.IgnoreLog;
|
||||||
import com.orion.visor.framework.log.core.enums.IgnoreLogMode;
|
import com.orion.visor.framework.log.core.enums.IgnoreLogMode;
|
||||||
import com.orion.visor.framework.web.core.annotation.RestWrapper;
|
import com.orion.visor.framework.web.core.annotation.RestWrapper;
|
||||||
import com.orion.visor.module.asset.define.operator.ExecJobLogOperatorType;
|
import com.orion.visor.module.asset.define.operator.ExecJobLogOperatorType;
|
||||||
import com.orion.visor.module.asset.entity.request.exec.ExecInterruptRequest;
|
import com.orion.visor.module.asset.entity.request.exec.ExecInterruptRequest;
|
||||||
|
import com.orion.visor.module.asset.entity.request.exec.ExecLogClearRequest;
|
||||||
import com.orion.visor.module.asset.entity.request.exec.ExecLogQueryRequest;
|
import com.orion.visor.module.asset.entity.request.exec.ExecLogQueryRequest;
|
||||||
import com.orion.visor.module.asset.entity.request.exec.ExecLogTailRequest;
|
import com.orion.visor.module.asset.entity.request.exec.ExecLogTailRequest;
|
||||||
import com.orion.visor.module.asset.entity.vo.ExecHostLogVO;
|
import com.orion.visor.module.asset.entity.vo.ExecHostLogVO;
|
||||||
@@ -87,6 +87,14 @@ public class ExecJobLogController {
|
|||||||
return execLogService.getExecLogStatus(idList, SOURCE);
|
return execLogService.getExecLogStatus(idList, SOURCE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/count")
|
||||||
|
@Operation(summary = "查询计划任务日志数量")
|
||||||
|
@PreAuthorize("@ss.hasPermission('asset:exec-job-log:query')")
|
||||||
|
public Long getExecJobLogCount(@Validated @RequestBody ExecLogQueryRequest request) {
|
||||||
|
request.setSource(SOURCE);
|
||||||
|
return execLogService.queryExecLogCount(request);
|
||||||
|
}
|
||||||
|
|
||||||
@OperatorLog(ExecJobLogOperatorType.DELETE)
|
@OperatorLog(ExecJobLogOperatorType.DELETE)
|
||||||
@DeleteMapping("/delete")
|
@DeleteMapping("/delete")
|
||||||
@Operation(summary = "删除计划任务日志")
|
@Operation(summary = "删除计划任务日志")
|
||||||
@@ -114,19 +122,11 @@ public class ExecJobLogController {
|
|||||||
return execHostLogService.deleteExecHostLogById(id);
|
return execHostLogService.deleteExecHostLogById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/query-count")
|
|
||||||
@Operation(summary = "查询计划任务日志数量")
|
|
||||||
@PreAuthorize("@ss.hasPermission('asset:exec-job-log:management:clear')")
|
|
||||||
public Long getExecJobLogCount(@RequestBody ExecLogQueryRequest request) {
|
|
||||||
request.setSource(SOURCE);
|
|
||||||
return execLogService.queryExecLogCount(request);
|
|
||||||
}
|
|
||||||
|
|
||||||
@OperatorLog(ExecJobLogOperatorType.CLEAR)
|
@OperatorLog(ExecJobLogOperatorType.CLEAR)
|
||||||
@PostMapping("/clear")
|
@PostMapping("/clear")
|
||||||
@Operation(summary = "清空计划任务日志")
|
@Operation(summary = "清空计划任务日志")
|
||||||
@PreAuthorize("@ss.hasPermission('asset:exec-job-log:management:clear')")
|
@PreAuthorize("@ss.hasPermission('asset:exec-job-log:management:clear')")
|
||||||
public Integer clearExecJobLog(@Validated(Clear.class) @RequestBody ExecLogQueryRequest request) {
|
public Integer clearExecJobLog(@Validated @RequestBody ExecLogClearRequest request) {
|
||||||
request.setSource(SOURCE);
|
request.setSource(SOURCE);
|
||||||
return execLogService.clearExecLog(request);
|
return execLogService.clearExecLog(request);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package com.orion.visor.module.asset.controller;
|
|||||||
|
|
||||||
import com.orion.lang.define.wrapper.DataGrid;
|
import com.orion.lang.define.wrapper.DataGrid;
|
||||||
import com.orion.visor.framework.biz.operator.log.core.annotation.OperatorLog;
|
import com.orion.visor.framework.biz.operator.log.core.annotation.OperatorLog;
|
||||||
import com.orion.visor.framework.common.validator.group.Clear;
|
|
||||||
import com.orion.visor.framework.common.validator.group.Id;
|
import com.orion.visor.framework.common.validator.group.Id;
|
||||||
import com.orion.visor.framework.common.validator.group.Page;
|
import com.orion.visor.framework.common.validator.group.Page;
|
||||||
import com.orion.visor.framework.log.core.annotation.IgnoreLog;
|
import com.orion.visor.framework.log.core.annotation.IgnoreLog;
|
||||||
@@ -10,6 +9,7 @@ import com.orion.visor.framework.log.core.enums.IgnoreLogMode;
|
|||||||
import com.orion.visor.framework.web.core.annotation.DemoDisableApi;
|
import com.orion.visor.framework.web.core.annotation.DemoDisableApi;
|
||||||
import com.orion.visor.framework.web.core.annotation.RestWrapper;
|
import com.orion.visor.framework.web.core.annotation.RestWrapper;
|
||||||
import com.orion.visor.module.asset.define.operator.HostConnectLogOperatorType;
|
import com.orion.visor.module.asset.define.operator.HostConnectLogOperatorType;
|
||||||
|
import com.orion.visor.module.asset.entity.request.host.HostConnectLogClearRequest;
|
||||||
import com.orion.visor.module.asset.entity.request.host.HostConnectLogQueryRequest;
|
import com.orion.visor.module.asset.entity.request.host.HostConnectLogQueryRequest;
|
||||||
import com.orion.visor.module.asset.entity.vo.HostConnectLogVO;
|
import com.orion.visor.module.asset.entity.vo.HostConnectLogVO;
|
||||||
import com.orion.visor.module.asset.service.HostConnectLogService;
|
import com.orion.visor.module.asset.service.HostConnectLogService;
|
||||||
@@ -50,6 +50,13 @@ public class HostConnectLogController {
|
|||||||
return hostConnectLogService.getHostConnectLogPage(request);
|
return hostConnectLogService.getHostConnectLogPage(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/count")
|
||||||
|
@Operation(summary = "查询主机连接日志数量")
|
||||||
|
@PreAuthorize("@ss.hasPermission('asset:host-connect-log:management:query')")
|
||||||
|
public Long getHostConnectLogCount(@Validated @RequestBody HostConnectLogQueryRequest request) {
|
||||||
|
return hostConnectLogService.getHostConnectLogCount(request);
|
||||||
|
}
|
||||||
|
|
||||||
@IgnoreLog(IgnoreLogMode.RET)
|
@IgnoreLog(IgnoreLogMode.RET)
|
||||||
@PostMapping("/session")
|
@PostMapping("/session")
|
||||||
@Operation(summary = "查询全部主机连接会话")
|
@Operation(summary = "查询全部主机连接会话")
|
||||||
@@ -74,18 +81,11 @@ public class HostConnectLogController {
|
|||||||
return hostConnectLogService.deleteHostConnectLog(idList);
|
return hostConnectLogService.deleteHostConnectLog(idList);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/query-count")
|
|
||||||
@Operation(summary = "查询主机连接日志数量")
|
|
||||||
@PreAuthorize("@ss.hasPermission('asset:host-connect-log:management:clear')")
|
|
||||||
public Long getHostConnectLogCount(@RequestBody HostConnectLogQueryRequest request) {
|
|
||||||
return hostConnectLogService.getHostConnectLogCount(request);
|
|
||||||
}
|
|
||||||
|
|
||||||
@OperatorLog(HostConnectLogOperatorType.CLEAR)
|
@OperatorLog(HostConnectLogOperatorType.CLEAR)
|
||||||
@PostMapping("/clear")
|
@PostMapping("/clear")
|
||||||
@Operation(summary = "清空主机连接日志")
|
@Operation(summary = "清空主机连接日志")
|
||||||
@PreAuthorize("@ss.hasPermission('asset:host-connect-log:management:clear')")
|
@PreAuthorize("@ss.hasPermission('asset:host-connect-log:management:clear')")
|
||||||
public Integer clearHostConnectLog(@Validated(Clear.class) @RequestBody HostConnectLogQueryRequest request) {
|
public Integer clearHostConnectLog(@Validated @RequestBody HostConnectLogClearRequest request) {
|
||||||
return hostConnectLogService.clearHostConnectLog(request);
|
return hostConnectLogService.clearHostConnectLog(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -112,6 +112,14 @@ public class HostController {
|
|||||||
return hostService.getHostPage(request);
|
return hostService.getHostPage(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@DemoDisableApi
|
||||||
|
@PostMapping("/count")
|
||||||
|
@Operation(summary = "查询主机数量")
|
||||||
|
@PreAuthorize("@ss.hasPermission('asset:host:query')")
|
||||||
|
public Long getHostExportCount(@Validated @RequestBody HostQueryRequest request) {
|
||||||
|
return hostService.getHostCount(request);
|
||||||
|
}
|
||||||
|
|
||||||
@DemoDisableApi
|
@DemoDisableApi
|
||||||
@OperatorLog(HostOperatorType.DELETE)
|
@OperatorLog(HostOperatorType.DELETE)
|
||||||
@DeleteMapping("/delete")
|
@DeleteMapping("/delete")
|
||||||
|
|||||||
@@ -2,12 +2,12 @@ package com.orion.visor.module.asset.controller;
|
|||||||
|
|
||||||
import com.orion.lang.define.wrapper.DataGrid;
|
import com.orion.lang.define.wrapper.DataGrid;
|
||||||
import com.orion.visor.framework.biz.operator.log.core.annotation.OperatorLog;
|
import com.orion.visor.framework.biz.operator.log.core.annotation.OperatorLog;
|
||||||
import com.orion.visor.framework.common.validator.group.Clear;
|
|
||||||
import com.orion.visor.framework.common.validator.group.Page;
|
import com.orion.visor.framework.common.validator.group.Page;
|
||||||
import com.orion.visor.framework.log.core.annotation.IgnoreLog;
|
import com.orion.visor.framework.log.core.annotation.IgnoreLog;
|
||||||
import com.orion.visor.framework.log.core.enums.IgnoreLogMode;
|
import com.orion.visor.framework.log.core.enums.IgnoreLogMode;
|
||||||
import com.orion.visor.framework.web.core.annotation.RestWrapper;
|
import com.orion.visor.framework.web.core.annotation.RestWrapper;
|
||||||
import com.orion.visor.module.asset.define.operator.UploadTaskOperatorType;
|
import com.orion.visor.module.asset.define.operator.UploadTaskOperatorType;
|
||||||
|
import com.orion.visor.module.asset.entity.request.upload.UploadTaskClearRequest;
|
||||||
import com.orion.visor.module.asset.entity.request.upload.UploadTaskCreateRequest;
|
import com.orion.visor.module.asset.entity.request.upload.UploadTaskCreateRequest;
|
||||||
import com.orion.visor.module.asset.entity.request.upload.UploadTaskQueryRequest;
|
import com.orion.visor.module.asset.entity.request.upload.UploadTaskQueryRequest;
|
||||||
import com.orion.visor.module.asset.entity.request.upload.UploadTaskRequest;
|
import com.orion.visor.module.asset.entity.request.upload.UploadTaskRequest;
|
||||||
@@ -95,6 +95,13 @@ public class UploadTaskController {
|
|||||||
return uploadTaskService.getUploadTaskStatus(idList, queryFiles);
|
return uploadTaskService.getUploadTaskStatus(idList, queryFiles);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/count")
|
||||||
|
@Operation(summary = "查询上传任务数量")
|
||||||
|
@PreAuthorize("@ss.hasPermission('asset:upload-task:query')")
|
||||||
|
public Long getUploadTaskCount(@RequestBody UploadTaskQueryRequest request) {
|
||||||
|
return uploadTaskService.getUploadTaskCount(request);
|
||||||
|
}
|
||||||
|
|
||||||
@OperatorLog(UploadTaskOperatorType.DELETE)
|
@OperatorLog(UploadTaskOperatorType.DELETE)
|
||||||
@DeleteMapping("/delete")
|
@DeleteMapping("/delete")
|
||||||
@Operation(summary = "删除上传任务")
|
@Operation(summary = "删除上传任务")
|
||||||
@@ -113,18 +120,11 @@ public class UploadTaskController {
|
|||||||
return uploadTaskService.deleteUploadTaskByIdList(idList);
|
return uploadTaskService.deleteUploadTaskByIdList(idList);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/query-count")
|
|
||||||
@Operation(summary = "查询上传任务数量")
|
|
||||||
@PreAuthorize("@ss.hasPermission('asset:upload-task:management:clear')")
|
|
||||||
public Long getUploadTaskCount(@RequestBody UploadTaskQueryRequest request) {
|
|
||||||
return uploadTaskService.getUploadTaskCount(request);
|
|
||||||
}
|
|
||||||
|
|
||||||
@OperatorLog(UploadTaskOperatorType.CLEAR)
|
@OperatorLog(UploadTaskOperatorType.CLEAR)
|
||||||
@PostMapping("/clear")
|
@PostMapping("/clear")
|
||||||
@Operation(summary = "清空上传任务")
|
@Operation(summary = "清空上传任务")
|
||||||
@PreAuthorize("@ss.hasPermission('asset:upload-task:management:clear')")
|
@PreAuthorize("@ss.hasPermission('asset:upload-task:management:clear')")
|
||||||
public Integer clearUploadTask(@Validated(Clear.class) @RequestBody UploadTaskQueryRequest request) {
|
public Integer clearUploadTask(@Validated @RequestBody UploadTaskClearRequest request) {
|
||||||
return uploadTaskService.clearUploadTask(request);
|
return uploadTaskService.clearUploadTask(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package com.orion.visor.module.asset.entity.request.exec;
|
||||||
|
|
||||||
|
import com.orion.visor.framework.common.entity.DataClearRequest;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import javax.validation.constraints.Max;
|
||||||
|
import javax.validation.constraints.Min;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量执行日志 清理请求对象
|
||||||
|
*
|
||||||
|
* @author Jiahang Li
|
||||||
|
* @version 1.0.1
|
||||||
|
* @since 2024-3-11 11:31
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Schema(name = "ExecLogClearRequest", description = "批量执行日志 清理请求对象")
|
||||||
|
public class ExecLogClearRequest extends ExecLogQueryRequest implements DataClearRequest {
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Min(value = 1)
|
||||||
|
@Max(value = 1000)
|
||||||
|
@Schema(description = "清理数量限制")
|
||||||
|
private Integer limit;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,15 +1,10 @@
|
|||||||
package com.orion.visor.module.asset.entity.request.exec;
|
package com.orion.visor.module.asset.entity.request.exec;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.orion.visor.framework.common.constant.Const;
|
|
||||||
import com.orion.visor.framework.common.entity.PageRequest;
|
import com.orion.visor.framework.common.entity.PageRequest;
|
||||||
import com.orion.visor.framework.common.validator.group.Clear;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
|
|
||||||
import javax.validation.constraints.Max;
|
|
||||||
import javax.validation.constraints.Min;
|
|
||||||
import javax.validation.constraints.NotNull;
|
|
||||||
import javax.validation.constraints.Size;
|
import javax.validation.constraints.Size;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -67,16 +62,4 @@ public class ExecLogQueryRequest extends PageRequest {
|
|||||||
@Schema(description = "状态")
|
@Schema(description = "状态")
|
||||||
private List<String> statusList;
|
private List<String> statusList;
|
||||||
|
|
||||||
@NotNull(groups = Clear.class)
|
|
||||||
@Min(value = 1, groups = Clear.class)
|
|
||||||
@Max(value = 1000, groups = Clear.class)
|
|
||||||
@Schema(description = "清理数量限制")
|
|
||||||
private Integer clearLimit;
|
|
||||||
|
|
||||||
public void setClearLimit(Integer clearLimit) {
|
|
||||||
this.clearLimit = clearLimit;
|
|
||||||
this.setPage(Const.N_1);
|
|
||||||
this.setLimit(clearLimit);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package com.orion.visor.module.asset.entity.request.host;
|
||||||
|
|
||||||
|
import com.orion.visor.framework.common.entity.DataClearRequest;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import javax.validation.constraints.Max;
|
||||||
|
import javax.validation.constraints.Min;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主机连接日志 清理请求对象
|
||||||
|
*
|
||||||
|
* @author Jiahang Li
|
||||||
|
* @version 1.0.0
|
||||||
|
* @since 2023-12-26 22:09
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Schema(name = "HostConnectLogClearRequest", description = "主机连接日志 清理请求对象")
|
||||||
|
public class HostConnectLogClearRequest extends HostConnectLogQueryRequest implements DataClearRequest {
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Min(value = 1)
|
||||||
|
@Max(value = 2000)
|
||||||
|
@Schema(description = "清理数量限制")
|
||||||
|
private Integer limit;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,15 +1,11 @@
|
|||||||
package com.orion.visor.module.asset.entity.request.host;
|
package com.orion.visor.module.asset.entity.request.host;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.orion.visor.framework.common.constant.Const;
|
|
||||||
import com.orion.visor.framework.common.entity.PageRequest;
|
import com.orion.visor.framework.common.entity.PageRequest;
|
||||||
import com.orion.visor.framework.common.validator.group.Clear;
|
|
||||||
import com.orion.visor.framework.common.validator.group.Id;
|
import com.orion.visor.framework.common.validator.group.Id;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
|
|
||||||
import javax.validation.constraints.Max;
|
|
||||||
import javax.validation.constraints.Min;
|
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
import javax.validation.constraints.Size;
|
import javax.validation.constraints.Size;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
@@ -70,16 +66,4 @@ public class HostConnectLogQueryRequest extends PageRequest {
|
|||||||
@Schema(description = "状态")
|
@Schema(description = "状态")
|
||||||
private List<String> statusList;
|
private List<String> statusList;
|
||||||
|
|
||||||
@NotNull(groups = Clear.class)
|
|
||||||
@Min(value = 1, groups = Clear.class)
|
|
||||||
@Max(value = 2000, groups = Clear.class)
|
|
||||||
@Schema(description = "清理数量限制")
|
|
||||||
private Integer clearLimit;
|
|
||||||
|
|
||||||
public void setClearLimit(Integer clearLimit) {
|
|
||||||
this.clearLimit = clearLimit;
|
|
||||||
this.setPage(Const.N_1);
|
|
||||||
this.setLimit(clearLimit);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package com.orion.visor.module.asset.entity.request.upload;
|
||||||
|
|
||||||
|
import com.orion.visor.framework.common.entity.DataClearRequest;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import javax.validation.constraints.Max;
|
||||||
|
import javax.validation.constraints.Min;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上传任务 清理请求对象
|
||||||
|
*
|
||||||
|
* @author Jiahang Li
|
||||||
|
* @version 1.0.7
|
||||||
|
* @since 2024-5-7 22:15
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Schema(name = "UploadTaskClearRequest", description = "上传任务 清理请求对象")
|
||||||
|
public class UploadTaskClearRequest extends UploadTaskQueryRequest implements DataClearRequest {
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Min(value = 1)
|
||||||
|
@Max(value = 2000)
|
||||||
|
@Schema(description = "清理数量限制")
|
||||||
|
private Integer limit;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,15 +1,10 @@
|
|||||||
package com.orion.visor.module.asset.entity.request.upload;
|
package com.orion.visor.module.asset.entity.request.upload;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.orion.visor.framework.common.constant.Const;
|
|
||||||
import com.orion.visor.framework.common.entity.PageRequest;
|
import com.orion.visor.framework.common.entity.PageRequest;
|
||||||
import com.orion.visor.framework.common.validator.group.Clear;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
|
|
||||||
import javax.validation.constraints.Max;
|
|
||||||
import javax.validation.constraints.Min;
|
|
||||||
import javax.validation.constraints.NotNull;
|
|
||||||
import javax.validation.constraints.Size;
|
import javax.validation.constraints.Size;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
@@ -49,16 +44,4 @@ public class UploadTaskQueryRequest extends PageRequest {
|
|||||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
private Date[] createTimeRange;
|
private Date[] createTimeRange;
|
||||||
|
|
||||||
@NotNull(groups = Clear.class)
|
|
||||||
@Min(value = 1, groups = Clear.class)
|
|
||||||
@Max(value = 2000, groups = Clear.class)
|
|
||||||
@Schema(description = "清理数量限制")
|
|
||||||
private Integer clearLimit;
|
|
||||||
|
|
||||||
public void setClearLimit(Integer clearLimit) {
|
|
||||||
this.clearLimit = clearLimit;
|
|
||||||
this.setPage(Const.N_1);
|
|
||||||
this.setLimit(clearLimit);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package com.orion.visor.module.asset.handler.host.exec.log;
|
package com.orion.visor.module.asset.handler.host.exec.log;
|
||||||
|
|
||||||
import com.orion.visor.framework.common.annotation.Keep;
|
import com.orion.lang.annotation.Keep;
|
||||||
import com.orion.visor.framework.common.constant.ExtraFieldConst;
|
import com.orion.visor.framework.common.constant.ExtraFieldConst;
|
||||||
import com.orion.visor.framework.common.file.FileClient;
|
import com.orion.visor.framework.common.file.FileClient;
|
||||||
import com.orion.visor.framework.websocket.core.utils.WebSockets;
|
import com.orion.visor.framework.websocket.core.utils.WebSockets;
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.orion.visor.module.asset.service;
|
|||||||
|
|
||||||
import com.orion.lang.define.wrapper.DataGrid;
|
import com.orion.lang.define.wrapper.DataGrid;
|
||||||
import com.orion.visor.module.asset.entity.dto.ExecLogTailDTO;
|
import com.orion.visor.module.asset.entity.dto.ExecLogTailDTO;
|
||||||
|
import com.orion.visor.module.asset.entity.request.exec.ExecLogClearRequest;
|
||||||
import com.orion.visor.module.asset.entity.request.exec.ExecLogQueryRequest;
|
import com.orion.visor.module.asset.entity.request.exec.ExecLogQueryRequest;
|
||||||
import com.orion.visor.module.asset.entity.request.exec.ExecLogTailRequest;
|
import com.orion.visor.module.asset.entity.request.exec.ExecLogTailRequest;
|
||||||
import com.orion.visor.module.asset.entity.vo.ExecLogStatusVO;
|
import com.orion.visor.module.asset.entity.vo.ExecLogStatusVO;
|
||||||
@@ -93,7 +94,7 @@ public interface ExecLogService {
|
|||||||
* @param request request
|
* @param request request
|
||||||
* @return effect
|
* @return effect
|
||||||
*/
|
*/
|
||||||
Integer clearExecLog(ExecLogQueryRequest request);
|
Integer clearExecLog(ExecLogClearRequest request);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 中断命令执行
|
* 中断命令执行
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.orion.visor.module.asset.service;
|
|||||||
|
|
||||||
import com.orion.lang.define.wrapper.DataGrid;
|
import com.orion.lang.define.wrapper.DataGrid;
|
||||||
import com.orion.visor.module.asset.entity.domain.HostConnectLogDO;
|
import com.orion.visor.module.asset.entity.domain.HostConnectLogDO;
|
||||||
|
import com.orion.visor.module.asset.entity.request.host.HostConnectLogClearRequest;
|
||||||
import com.orion.visor.module.asset.entity.request.host.HostConnectLogCreateRequest;
|
import com.orion.visor.module.asset.entity.request.host.HostConnectLogCreateRequest;
|
||||||
import com.orion.visor.module.asset.entity.request.host.HostConnectLogQueryRequest;
|
import com.orion.visor.module.asset.entity.request.host.HostConnectLogQueryRequest;
|
||||||
import com.orion.visor.module.asset.entity.vo.HostConnectLogVO;
|
import com.orion.visor.module.asset.entity.vo.HostConnectLogVO;
|
||||||
@@ -95,7 +96,7 @@ public interface HostConnectLogService {
|
|||||||
* @param request request
|
* @param request request
|
||||||
* @return effect
|
* @return effect
|
||||||
*/
|
*/
|
||||||
Integer clearHostConnectLog(HostConnectLogQueryRequest request);
|
Integer clearHostConnectLog(HostConnectLogClearRequest request);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 强制断开主机连接
|
* 强制断开主机连接
|
||||||
|
|||||||
@@ -80,6 +80,14 @@ public interface HostService {
|
|||||||
*/
|
*/
|
||||||
DataGrid<HostVO> getHostPage(HostQueryRequest request);
|
DataGrid<HostVO> getHostPage(HostQueryRequest request);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询主机数量
|
||||||
|
*
|
||||||
|
* @param request request
|
||||||
|
* @return count
|
||||||
|
*/
|
||||||
|
Long getHostCount(HostQueryRequest request);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过 id 删除主机
|
* 通过 id 删除主机
|
||||||
*
|
*
|
||||||
@@ -110,4 +118,9 @@ public interface HostService {
|
|||||||
*/
|
*/
|
||||||
Long getCurrentUpdateConfigHostId();
|
Long getCurrentUpdateConfigHostId();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 清除缓存
|
||||||
|
*/
|
||||||
|
void clearCache();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.orion.visor.module.asset.service;
|
package com.orion.visor.module.asset.service;
|
||||||
|
|
||||||
import com.orion.lang.define.wrapper.DataGrid;
|
import com.orion.lang.define.wrapper.DataGrid;
|
||||||
|
import com.orion.visor.module.asset.entity.request.upload.UploadTaskClearRequest;
|
||||||
import com.orion.visor.module.asset.entity.request.upload.UploadTaskCreateRequest;
|
import com.orion.visor.module.asset.entity.request.upload.UploadTaskCreateRequest;
|
||||||
import com.orion.visor.module.asset.entity.request.upload.UploadTaskQueryRequest;
|
import com.orion.visor.module.asset.entity.request.upload.UploadTaskQueryRequest;
|
||||||
import com.orion.visor.module.asset.entity.request.upload.UploadTaskRequest;
|
import com.orion.visor.module.asset.entity.request.upload.UploadTaskRequest;
|
||||||
@@ -66,7 +67,7 @@ public interface UploadTaskService {
|
|||||||
* @param request request
|
* @param request request
|
||||||
* @return count
|
* @return count
|
||||||
*/
|
*/
|
||||||
Integer clearUploadTask(UploadTaskQueryRequest request);
|
Integer clearUploadTask(UploadTaskClearRequest request);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除上传任务
|
* 删除上传任务
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.orion.visor.module.asset.service.impl;
|
package com.orion.visor.module.asset.service.impl;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.orion.lang.annotation.Keep;
|
||||||
import com.orion.lang.function.Functions;
|
import com.orion.lang.function.Functions;
|
||||||
import com.orion.lang.id.UUIds;
|
import com.orion.lang.id.UUIds;
|
||||||
import com.orion.lang.utils.Strings;
|
import com.orion.lang.utils.Strings;
|
||||||
@@ -11,7 +12,6 @@ import com.orion.lang.utils.json.matcher.ReplacementFormatter;
|
|||||||
import com.orion.lang.utils.json.matcher.ReplacementFormatters;
|
import com.orion.lang.utils.json.matcher.ReplacementFormatters;
|
||||||
import com.orion.lang.utils.time.Dates;
|
import com.orion.lang.utils.time.Dates;
|
||||||
import com.orion.visor.framework.biz.operator.log.core.utils.OperatorLogs;
|
import com.orion.visor.framework.biz.operator.log.core.utils.OperatorLogs;
|
||||||
import com.orion.visor.framework.common.annotation.Keep;
|
|
||||||
import com.orion.visor.framework.common.constant.Const;
|
import com.orion.visor.framework.common.constant.Const;
|
||||||
import com.orion.visor.framework.common.constant.ErrorMessage;
|
import com.orion.visor.framework.common.constant.ErrorMessage;
|
||||||
import com.orion.visor.framework.common.constant.FileConst;
|
import com.orion.visor.framework.common.constant.FileConst;
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.orion.visor.module.asset.service.impl;
|
|||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.orion.lang.annotation.Keep;
|
||||||
import com.orion.lang.define.wrapper.DataGrid;
|
import com.orion.lang.define.wrapper.DataGrid;
|
||||||
import com.orion.lang.id.UUIds;
|
import com.orion.lang.id.UUIds;
|
||||||
import com.orion.lang.utils.Arrays1;
|
import com.orion.lang.utils.Arrays1;
|
||||||
@@ -12,7 +13,6 @@ import com.orion.lang.utils.io.Files1;
|
|||||||
import com.orion.lang.utils.io.Streams;
|
import com.orion.lang.utils.io.Streams;
|
||||||
import com.orion.spring.SpringHolder;
|
import com.orion.spring.SpringHolder;
|
||||||
import com.orion.visor.framework.biz.operator.log.core.utils.OperatorLogs;
|
import com.orion.visor.framework.biz.operator.log.core.utils.OperatorLogs;
|
||||||
import com.orion.visor.framework.common.annotation.Keep;
|
|
||||||
import com.orion.visor.framework.common.constant.Const;
|
import com.orion.visor.framework.common.constant.Const;
|
||||||
import com.orion.visor.framework.common.constant.ErrorMessage;
|
import com.orion.visor.framework.common.constant.ErrorMessage;
|
||||||
import com.orion.visor.framework.common.constant.FileConst;
|
import com.orion.visor.framework.common.constant.FileConst;
|
||||||
@@ -31,6 +31,7 @@ import com.orion.visor.module.asset.entity.domain.ExecHostLogDO;
|
|||||||
import com.orion.visor.module.asset.entity.domain.ExecLogDO;
|
import com.orion.visor.module.asset.entity.domain.ExecLogDO;
|
||||||
import com.orion.visor.module.asset.entity.dto.ExecHostLogTailDTO;
|
import com.orion.visor.module.asset.entity.dto.ExecHostLogTailDTO;
|
||||||
import com.orion.visor.module.asset.entity.dto.ExecLogTailDTO;
|
import com.orion.visor.module.asset.entity.dto.ExecLogTailDTO;
|
||||||
|
import com.orion.visor.module.asset.entity.request.exec.ExecLogClearRequest;
|
||||||
import com.orion.visor.module.asset.entity.request.exec.ExecLogQueryRequest;
|
import com.orion.visor.module.asset.entity.request.exec.ExecLogQueryRequest;
|
||||||
import com.orion.visor.module.asset.entity.request.exec.ExecLogTailRequest;
|
import com.orion.visor.module.asset.entity.request.exec.ExecLogTailRequest;
|
||||||
import com.orion.visor.module.asset.entity.vo.ExecHostLogVO;
|
import com.orion.visor.module.asset.entity.vo.ExecHostLogVO;
|
||||||
@@ -219,17 +220,19 @@ public class ExecLogServiceImpl implements ExecLogService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Long queryExecLogCount(ExecLogQueryRequest request) {
|
public Long queryExecLogCount(ExecLogQueryRequest request) {
|
||||||
return execLogDAO.selectCount(this.buildQueryWrapper(request));
|
return execLogDAO.of()
|
||||||
|
.wrapper(this.buildQueryWrapper(request))
|
||||||
|
.countMax(request.getLimit());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Integer clearExecLog(ExecLogQueryRequest request) {
|
public Integer clearExecLog(ExecLogClearRequest request) {
|
||||||
log.info("ExecLogService.clearExecLog start {}", JSON.toJSONString(request));
|
log.info("ExecLogService.clearExecLog start {}", JSON.toJSONString(request));
|
||||||
// 查询
|
// 查询
|
||||||
LambdaQueryWrapper<ExecLogDO> wrapper = this.buildQueryWrapper(request)
|
LambdaQueryWrapper<ExecLogDO> wrapper = this.buildQueryWrapper(request)
|
||||||
.select(ExecLogDO::getId)
|
.select(ExecLogDO::getId)
|
||||||
.last(SqlUtils.limit(request.getClearLimit()));
|
.last(SqlUtils.limit(request.getLimit()));
|
||||||
List<Long> idList = execLogDAO.selectList(wrapper)
|
List<Long> idList = execLogDAO.selectList(wrapper)
|
||||||
.stream()
|
.stream()
|
||||||
.map(ExecLogDO::getId)
|
.map(ExecLogDO::getId)
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import com.orion.visor.module.asset.convert.HostConnectLogConvert;
|
|||||||
import com.orion.visor.module.asset.dao.HostConnectLogDAO;
|
import com.orion.visor.module.asset.dao.HostConnectLogDAO;
|
||||||
import com.orion.visor.module.asset.entity.domain.HostConnectLogDO;
|
import com.orion.visor.module.asset.entity.domain.HostConnectLogDO;
|
||||||
import com.orion.visor.module.asset.entity.dto.HostConnectLogExtraDTO;
|
import com.orion.visor.module.asset.entity.dto.HostConnectLogExtraDTO;
|
||||||
|
import com.orion.visor.module.asset.entity.request.host.HostConnectLogClearRequest;
|
||||||
import com.orion.visor.module.asset.entity.request.host.HostConnectLogCreateRequest;
|
import com.orion.visor.module.asset.entity.request.host.HostConnectLogCreateRequest;
|
||||||
import com.orion.visor.module.asset.entity.request.host.HostConnectLogQueryRequest;
|
import com.orion.visor.module.asset.entity.request.host.HostConnectLogQueryRequest;
|
||||||
import com.orion.visor.module.asset.entity.vo.HostConnectLogVO;
|
import com.orion.visor.module.asset.entity.vo.HostConnectLogVO;
|
||||||
@@ -186,17 +187,19 @@ public class HostConnectLogServiceImpl implements HostConnectLogService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Long getHostConnectLogCount(HostConnectLogQueryRequest request) {
|
public Long getHostConnectLogCount(HostConnectLogQueryRequest request) {
|
||||||
return hostConnectLogDAO.selectCount(this.buildQueryWrapper(request));
|
return hostConnectLogDAO.of()
|
||||||
|
.wrapper(this.buildQueryWrapper(request))
|
||||||
|
.countMax(request.getLimit());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Integer clearHostConnectLog(HostConnectLogQueryRequest request) {
|
public Integer clearHostConnectLog(HostConnectLogClearRequest request) {
|
||||||
log.info("HostConnectLogService.clearHostConnectLog start {}", JSON.toJSONString(request));
|
log.info("HostConnectLogService.clearHostConnectLog start {}", JSON.toJSONString(request));
|
||||||
// 查询
|
// 查询
|
||||||
LambdaQueryWrapper<HostConnectLogDO> wrapper = this.buildQueryWrapper(request)
|
LambdaQueryWrapper<HostConnectLogDO> wrapper = this.buildQueryWrapper(request)
|
||||||
.select(HostConnectLogDO::getId)
|
.select(HostConnectLogDO::getId)
|
||||||
.last(SqlUtils.limit(request.getClearLimit()));
|
.last(SqlUtils.limit(request.getLimit()));
|
||||||
List<HostConnectLogDO> list = hostConnectLogDAO.selectList(wrapper);
|
List<HostConnectLogDO> list = hostConnectLogDAO.selectList(wrapper);
|
||||||
if (list.isEmpty()) {
|
if (list.isEmpty()) {
|
||||||
log.info("HostConnectLogService.clearHostConnectLog empty");
|
log.info("HostConnectLogService.clearHostConnectLog empty");
|
||||||
|
|||||||
@@ -271,6 +271,13 @@ public class HostServiceImpl implements HostService {
|
|||||||
return hosts;
|
return hosts;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long getHostCount(HostQueryRequest request) {
|
||||||
|
return hostDAO.of()
|
||||||
|
.wrapper(this.buildQueryWrapper(request))
|
||||||
|
.countMax(request.getLimit());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Integer deleteHostById(Long id) {
|
public Integer deleteHostById(Long id) {
|
||||||
return this.deleteHostByIdList(Lists.singleton(id));
|
return this.deleteHostByIdList(Lists.singleton(id));
|
||||||
@@ -315,10 +322,8 @@ public class HostServiceImpl implements HostService {
|
|||||||
return CURRENT_UPDATE_CONFIG_ID.get();
|
return CURRENT_UPDATE_CONFIG_ID.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
@Override
|
||||||
* 清除缓存
|
public void clearCache() {
|
||||||
*/
|
|
||||||
private void clearCache() {
|
|
||||||
RedisMaps.scanKeysDelete(HostCacheKeyDefine.HOST_INFO.format("*"));
|
RedisMaps.scanKeysDelete(HostCacheKeyDefine.HOST_INFO.format("*"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.orion.visor.module.asset.service.impl;
|
|||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.orion.lang.annotation.Keep;
|
||||||
import com.orion.lang.define.wrapper.DataGrid;
|
import com.orion.lang.define.wrapper.DataGrid;
|
||||||
import com.orion.lang.utils.Arrays1;
|
import com.orion.lang.utils.Arrays1;
|
||||||
import com.orion.lang.utils.Booleans;
|
import com.orion.lang.utils.Booleans;
|
||||||
@@ -12,7 +13,6 @@ import com.orion.lang.utils.collect.Maps;
|
|||||||
import com.orion.lang.utils.io.Files1;
|
import com.orion.lang.utils.io.Files1;
|
||||||
import com.orion.lang.utils.time.Dates;
|
import com.orion.lang.utils.time.Dates;
|
||||||
import com.orion.visor.framework.biz.operator.log.core.utils.OperatorLogs;
|
import com.orion.visor.framework.biz.operator.log.core.utils.OperatorLogs;
|
||||||
import com.orion.visor.framework.common.annotation.Keep;
|
|
||||||
import com.orion.visor.framework.common.constant.Const;
|
import com.orion.visor.framework.common.constant.Const;
|
||||||
import com.orion.visor.framework.common.constant.ErrorMessage;
|
import com.orion.visor.framework.common.constant.ErrorMessage;
|
||||||
import com.orion.visor.framework.common.enums.EndpointDefine;
|
import com.orion.visor.framework.common.enums.EndpointDefine;
|
||||||
@@ -31,10 +31,7 @@ import com.orion.visor.module.asset.dao.UploadTaskFileDAO;
|
|||||||
import com.orion.visor.module.asset.entity.domain.UploadTaskDO;
|
import com.orion.visor.module.asset.entity.domain.UploadTaskDO;
|
||||||
import com.orion.visor.module.asset.entity.domain.UploadTaskFileDO;
|
import com.orion.visor.module.asset.entity.domain.UploadTaskFileDO;
|
||||||
import com.orion.visor.module.asset.entity.dto.UploadTaskExtraDTO;
|
import com.orion.visor.module.asset.entity.dto.UploadTaskExtraDTO;
|
||||||
import com.orion.visor.module.asset.entity.request.upload.UploadTaskCreateRequest;
|
import com.orion.visor.module.asset.entity.request.upload.*;
|
||||||
import com.orion.visor.module.asset.entity.request.upload.UploadTaskFileRequest;
|
|
||||||
import com.orion.visor.module.asset.entity.request.upload.UploadTaskQueryRequest;
|
|
||||||
import com.orion.visor.module.asset.entity.request.upload.UploadTaskRequest;
|
|
||||||
import com.orion.visor.module.asset.entity.vo.*;
|
import com.orion.visor.module.asset.entity.vo.*;
|
||||||
import com.orion.visor.module.asset.enums.HostTypeEnum;
|
import com.orion.visor.module.asset.enums.HostTypeEnum;
|
||||||
import com.orion.visor.module.asset.enums.UploadTaskFileStatusEnum;
|
import com.orion.visor.module.asset.enums.UploadTaskFileStatusEnum;
|
||||||
@@ -219,16 +216,18 @@ public class UploadTaskServiceImpl implements UploadTaskService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Long getUploadTaskCount(UploadTaskQueryRequest request) {
|
public Long getUploadTaskCount(UploadTaskQueryRequest request) {
|
||||||
return uploadTaskDAO.selectCount(this.buildQueryWrapper(request));
|
return uploadTaskDAO.of()
|
||||||
|
.wrapper(this.buildQueryWrapper(request))
|
||||||
|
.countMax(request.getLimit());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
@Override
|
@Override
|
||||||
public Integer clearUploadTask(UploadTaskQueryRequest request) {
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public Integer clearUploadTask(UploadTaskClearRequest request) {
|
||||||
// 查询id
|
// 查询id
|
||||||
LambdaQueryWrapper<UploadTaskDO> wrapper = this.buildQueryWrapper(request)
|
LambdaQueryWrapper<UploadTaskDO> wrapper = this.buildQueryWrapper(request)
|
||||||
.select(UploadTaskDO::getId)
|
.select(UploadTaskDO::getId)
|
||||||
.last(SqlUtils.limit(request.getClearLimit()));
|
.last(SqlUtils.limit(request.getLimit()));
|
||||||
List<Long> idList = uploadTaskDAO.of(wrapper)
|
List<Long> idList = uploadTaskDAO.of(wrapper)
|
||||||
.list(UploadTaskDO::getId);
|
.list(UploadTaskDO::getId);
|
||||||
// 删除
|
// 删除
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package com.orion.visor.module.asset.task;
|
|||||||
import com.orion.lang.utils.time.Dates;
|
import com.orion.lang.utils.time.Dates;
|
||||||
import com.orion.visor.framework.common.utils.LockerUtils;
|
import com.orion.visor.framework.common.utils.LockerUtils;
|
||||||
import com.orion.visor.module.asset.define.config.AppExecLogAutoClearConfig;
|
import com.orion.visor.module.asset.define.config.AppExecLogAutoClearConfig;
|
||||||
import com.orion.visor.module.asset.entity.request.exec.ExecLogQueryRequest;
|
import com.orion.visor.module.asset.entity.request.exec.ExecLogClearRequest;
|
||||||
import com.orion.visor.module.asset.enums.ExecStatusEnum;
|
import com.orion.visor.module.asset.enums.ExecStatusEnum;
|
||||||
import com.orion.visor.module.asset.service.ExecLogService;
|
import com.orion.visor.module.asset.service.ExecLogService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -57,7 +57,7 @@ public class ExecLogFileAutoClearTask {
|
|||||||
.subDay(appExecLogAutoClearConfig.getKeepPeriod())
|
.subDay(appExecLogAutoClearConfig.getKeepPeriod())
|
||||||
.date();
|
.date();
|
||||||
// 清理
|
// 清理
|
||||||
ExecLogQueryRequest request = new ExecLogQueryRequest();
|
ExecLogClearRequest request = new ExecLogClearRequest();
|
||||||
request.setCreateTimeLe(createLessEq);
|
request.setCreateTimeLe(createLessEq);
|
||||||
request.setStatusList(ExecStatusEnum.FINISH_STATUS_LIST);
|
request.setStatusList(ExecStatusEnum.FINISH_STATUS_LIST);
|
||||||
execLogService.clearExecLog(request);
|
execLogService.clearExecLog(request);
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package com.orion.visor.module.asset.task;
|
|||||||
import com.orion.lang.utils.time.Dates;
|
import com.orion.lang.utils.time.Dates;
|
||||||
import com.orion.visor.framework.common.utils.LockerUtils;
|
import com.orion.visor.framework.common.utils.LockerUtils;
|
||||||
import com.orion.visor.module.asset.define.config.AppHostConnectLogAutoClearConfig;
|
import com.orion.visor.module.asset.define.config.AppHostConnectLogAutoClearConfig;
|
||||||
import com.orion.visor.module.asset.entity.request.host.HostConnectLogQueryRequest;
|
import com.orion.visor.module.asset.entity.request.host.HostConnectLogClearRequest;
|
||||||
import com.orion.visor.module.asset.enums.HostConnectStatusEnum;
|
import com.orion.visor.module.asset.enums.HostConnectStatusEnum;
|
||||||
import com.orion.visor.module.asset.service.HostConnectLogService;
|
import com.orion.visor.module.asset.service.HostConnectLogService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -57,7 +57,7 @@ public class HostConnectLogAutoClearTask {
|
|||||||
.subDay(appHostConnectLogAutoClearConfig.getKeepPeriod())
|
.subDay(appHostConnectLogAutoClearConfig.getKeepPeriod())
|
||||||
.date();
|
.date();
|
||||||
// 清理
|
// 清理
|
||||||
HostConnectLogQueryRequest request = new HostConnectLogQueryRequest();
|
HostConnectLogClearRequest request = new HostConnectLogClearRequest();
|
||||||
request.setCreateTimeLe(createLessEq);
|
request.setCreateTimeLe(createLessEq);
|
||||||
request.setStatusList(HostConnectStatusEnum.FINISH_STATUS_LIST);
|
request.setStatusList(HostConnectStatusEnum.FINISH_STATUS_LIST);
|
||||||
hostConnectLogService.clearHostConnectLog(request);
|
hostConnectLogService.clearHostConnectLog(request);
|
||||||
|
|||||||
@@ -2,12 +2,12 @@ package com.orion.visor.module.infra.controller;
|
|||||||
|
|
||||||
import com.orion.lang.define.wrapper.DataGrid;
|
import com.orion.lang.define.wrapper.DataGrid;
|
||||||
import com.orion.visor.framework.biz.operator.log.core.annotation.OperatorLog;
|
import com.orion.visor.framework.biz.operator.log.core.annotation.OperatorLog;
|
||||||
import com.orion.visor.framework.common.validator.group.Clear;
|
|
||||||
import com.orion.visor.framework.common.validator.group.Page;
|
import com.orion.visor.framework.common.validator.group.Page;
|
||||||
import com.orion.visor.framework.log.core.annotation.IgnoreLog;
|
import com.orion.visor.framework.log.core.annotation.IgnoreLog;
|
||||||
import com.orion.visor.framework.log.core.enums.IgnoreLogMode;
|
import com.orion.visor.framework.log.core.enums.IgnoreLogMode;
|
||||||
import com.orion.visor.framework.web.core.annotation.RestWrapper;
|
import com.orion.visor.framework.web.core.annotation.RestWrapper;
|
||||||
import com.orion.visor.module.infra.define.operator.OperatorLogOperatorType;
|
import com.orion.visor.module.infra.define.operator.OperatorLogOperatorType;
|
||||||
|
import com.orion.visor.module.infra.entity.request.operator.OperatorLogClearRequest;
|
||||||
import com.orion.visor.module.infra.entity.request.operator.OperatorLogQueryRequest;
|
import com.orion.visor.module.infra.entity.request.operator.OperatorLogQueryRequest;
|
||||||
import com.orion.visor.module.infra.entity.vo.OperatorLogVO;
|
import com.orion.visor.module.infra.entity.vo.OperatorLogVO;
|
||||||
import com.orion.visor.module.infra.service.OperatorLogService;
|
import com.orion.visor.module.infra.service.OperatorLogService;
|
||||||
@@ -57,10 +57,10 @@ public class OperatorLogController {
|
|||||||
return operatorLogService.deleteOperatorLog(idList);
|
return operatorLogService.deleteOperatorLog(idList);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/query-count")
|
@PostMapping("/count")
|
||||||
@Operation(summary = "查询操作日志数量")
|
@Operation(summary = "查询操作日志数量")
|
||||||
@PreAuthorize("@ss.hasPermission('infra:operator-log:management:clear')")
|
@PreAuthorize("@ss.hasPermission('infra:operator-log:query')")
|
||||||
public Long getOperatorLogCount(@RequestBody OperatorLogQueryRequest request) {
|
public Long getOperatorLogCount(@Validated @RequestBody OperatorLogQueryRequest request) {
|
||||||
return operatorLogService.getOperatorLogCount(request);
|
return operatorLogService.getOperatorLogCount(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -68,7 +68,7 @@ public class OperatorLogController {
|
|||||||
@PostMapping("/clear")
|
@PostMapping("/clear")
|
||||||
@Operation(summary = "清空操作日志")
|
@Operation(summary = "清空操作日志")
|
||||||
@PreAuthorize("@ss.hasPermission('infra:operator-log:management:clear')")
|
@PreAuthorize("@ss.hasPermission('infra:operator-log:management:clear')")
|
||||||
public Integer clearOperatorLog(@Validated(Clear.class) @RequestBody OperatorLogQueryRequest request) {
|
public Integer clearOperatorLog(@Validated @RequestBody OperatorLogClearRequest request) {
|
||||||
return operatorLogService.clearOperatorLog(request);
|
return operatorLogService.clearOperatorLog(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package com.orion.visor.module.infra.entity.request.operator;
|
||||||
|
|
||||||
|
import com.orion.visor.framework.common.entity.DataClearRequest;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import javax.validation.constraints.Max;
|
||||||
|
import javax.validation.constraints.Min;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作日志 清理请求对象
|
||||||
|
*
|
||||||
|
* @author Jiahang Li
|
||||||
|
* @version 1.0.0
|
||||||
|
* @since 2023-10-10 17:08
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Schema(name = "OperatorLogClearRequest", description = "操作日志 清理请求对象")
|
||||||
|
public class OperatorLogClearRequest extends OperatorLogQueryRequest implements DataClearRequest {
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Min(value = 1)
|
||||||
|
@Max(value = 2000)
|
||||||
|
@Schema(description = "清理数量限制")
|
||||||
|
private Integer limit;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,15 +1,10 @@
|
|||||||
package com.orion.visor.module.infra.entity.request.operator;
|
package com.orion.visor.module.infra.entity.request.operator;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.orion.visor.framework.common.constant.Const;
|
|
||||||
import com.orion.visor.framework.common.entity.PageRequest;
|
import com.orion.visor.framework.common.entity.PageRequest;
|
||||||
import com.orion.visor.framework.common.validator.group.Clear;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
|
|
||||||
import javax.validation.constraints.Max;
|
|
||||||
import javax.validation.constraints.Min;
|
|
||||||
import javax.validation.constraints.NotNull;
|
|
||||||
import javax.validation.constraints.Size;
|
import javax.validation.constraints.Size;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
@@ -53,16 +48,4 @@ public class OperatorLogQueryRequest extends PageRequest {
|
|||||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
private Date[] startTimeRange;
|
private Date[] startTimeRange;
|
||||||
|
|
||||||
@NotNull(groups = Clear.class)
|
|
||||||
@Min(value = 1, groups = Clear.class)
|
|
||||||
@Max(value = 2000, groups = Clear.class)
|
|
||||||
@Schema(description = "清理数量限制")
|
|
||||||
private Integer clearLimit;
|
|
||||||
|
|
||||||
public void setClearLimit(Integer clearLimit) {
|
|
||||||
this.clearLimit = clearLimit;
|
|
||||||
this.setPage(Const.N_1);
|
|
||||||
this.setLimit(clearLimit);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
package com.orion.visor.module.infra.handler.upload;
|
package com.orion.visor.module.infra.handler.upload;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.orion.lang.annotation.Keep;
|
||||||
import com.orion.lang.utils.io.Streams;
|
import com.orion.lang.utils.io.Streams;
|
||||||
import com.orion.visor.framework.common.annotation.Keep;
|
|
||||||
import com.orion.visor.framework.common.constant.ExtraFieldConst;
|
import com.orion.visor.framework.common.constant.ExtraFieldConst;
|
||||||
import com.orion.visor.framework.common.file.FileClient;
|
import com.orion.visor.framework.common.file.FileClient;
|
||||||
import com.orion.visor.framework.websocket.core.utils.WebSockets;
|
import com.orion.visor.framework.websocket.core.utils.WebSockets;
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.orion.visor.module.infra.service;
|
|||||||
|
|
||||||
import com.orion.lang.define.wrapper.DataGrid;
|
import com.orion.lang.define.wrapper.DataGrid;
|
||||||
import com.orion.visor.framework.biz.operator.log.core.model.OperatorLogModel;
|
import com.orion.visor.framework.biz.operator.log.core.model.OperatorLogModel;
|
||||||
|
import com.orion.visor.module.infra.entity.request.operator.OperatorLogClearRequest;
|
||||||
import com.orion.visor.module.infra.entity.request.operator.OperatorLogQueryRequest;
|
import com.orion.visor.module.infra.entity.request.operator.OperatorLogQueryRequest;
|
||||||
import com.orion.visor.module.infra.entity.vo.LoginHistoryVO;
|
import com.orion.visor.module.infra.entity.vo.LoginHistoryVO;
|
||||||
import com.orion.visor.module.infra.entity.vo.OperatorLogVO;
|
import com.orion.visor.module.infra.entity.vo.OperatorLogVO;
|
||||||
@@ -54,7 +55,7 @@ public interface OperatorLogService {
|
|||||||
* @param request request
|
* @param request request
|
||||||
* @return effect
|
* @return effect
|
||||||
*/
|
*/
|
||||||
Integer clearOperatorLog(OperatorLogQueryRequest request);
|
Integer clearOperatorLog(OperatorLogClearRequest request);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询用户登录日志
|
* 查询用户登录日志
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
package com.orion.visor.module.infra.service.impl;
|
package com.orion.visor.module.infra.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.orion.lang.annotation.Keep;
|
||||||
import com.orion.lang.utils.collect.Lists;
|
import com.orion.lang.utils.collect.Lists;
|
||||||
import com.orion.visor.framework.common.annotation.Keep;
|
|
||||||
import com.orion.visor.framework.common.utils.Valid;
|
import com.orion.visor.framework.common.utils.Valid;
|
||||||
import com.orion.visor.framework.redis.core.utils.RedisLists;
|
import com.orion.visor.framework.redis.core.utils.RedisLists;
|
||||||
import com.orion.visor.framework.redis.core.utils.barrier.CacheBarriers;
|
import com.orion.visor.framework.redis.core.utils.barrier.CacheBarriers;
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import com.orion.visor.module.infra.convert.OperatorLogConvert;
|
|||||||
import com.orion.visor.module.infra.dao.OperatorLogDAO;
|
import com.orion.visor.module.infra.dao.OperatorLogDAO;
|
||||||
import com.orion.visor.module.infra.define.operator.AuthenticationOperatorType;
|
import com.orion.visor.module.infra.define.operator.AuthenticationOperatorType;
|
||||||
import com.orion.visor.module.infra.entity.domain.OperatorLogDO;
|
import com.orion.visor.module.infra.entity.domain.OperatorLogDO;
|
||||||
|
import com.orion.visor.module.infra.entity.request.operator.OperatorLogClearRequest;
|
||||||
import com.orion.visor.module.infra.entity.request.operator.OperatorLogQueryRequest;
|
import com.orion.visor.module.infra.entity.request.operator.OperatorLogQueryRequest;
|
||||||
import com.orion.visor.module.infra.entity.vo.LoginHistoryVO;
|
import com.orion.visor.module.infra.entity.vo.LoginHistoryVO;
|
||||||
import com.orion.visor.module.infra.entity.vo.OperatorLogVO;
|
import com.orion.visor.module.infra.entity.vo.OperatorLogVO;
|
||||||
@@ -67,15 +68,17 @@ public class OperatorLogServiceImpl implements OperatorLogService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Long getOperatorLogCount(OperatorLogQueryRequest request) {
|
public Long getOperatorLogCount(OperatorLogQueryRequest request) {
|
||||||
return operatorLogDAO.selectCount(this.buildQueryWrapper(request));
|
return operatorLogDAO.of()
|
||||||
|
.wrapper(this.buildQueryWrapper(request))
|
||||||
|
.countMax(request.getLimit());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Integer clearOperatorLog(OperatorLogQueryRequest request) {
|
public Integer clearOperatorLog(OperatorLogClearRequest request) {
|
||||||
log.info("OperatorLogService.clearOperatorLog start {}", JSON.toJSONString(request));
|
log.info("OperatorLogService.clearOperatorLog start {}", JSON.toJSONString(request));
|
||||||
// 删除参数
|
// 删除参数
|
||||||
LambdaQueryWrapper<OperatorLogDO> wrapper = this.buildQueryWrapper(request);
|
LambdaQueryWrapper<OperatorLogDO> wrapper = this.buildQueryWrapper(request)
|
||||||
wrapper.last(SqlUtils.limit(request.getClearLimit()));
|
.last(SqlUtils.limit(request.getLimit()));
|
||||||
// 删除
|
// 删除
|
||||||
int effect = operatorLogDAO.delete(wrapper);
|
int effect = operatorLogDAO.delete(wrapper);
|
||||||
log.info("OperatorLogService.clearOperatorLog finish {}", effect);
|
log.info("OperatorLogService.clearOperatorLog finish {}", effect);
|
||||||
|
|||||||
@@ -2,9 +2,9 @@ package com.orion.visor.module.infra.service.impl;
|
|||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.orion.lang.annotation.Keep;
|
||||||
import com.orion.lang.utils.collect.Lists;
|
import com.orion.lang.utils.collect.Lists;
|
||||||
import com.orion.lang.utils.collect.Maps;
|
import com.orion.lang.utils.collect.Maps;
|
||||||
import com.orion.visor.framework.common.annotation.Keep;
|
|
||||||
import com.orion.visor.framework.redis.core.utils.RedisStrings;
|
import com.orion.visor.framework.redis.core.utils.RedisStrings;
|
||||||
import com.orion.visor.module.infra.convert.TagRelConvert;
|
import com.orion.visor.module.infra.convert.TagRelConvert;
|
||||||
import com.orion.visor.module.infra.dao.TagDAO;
|
import com.orion.visor.module.infra.dao.TagDAO;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { DataGrid, Pagination } from '@/types/global';
|
import type { ClearRequest, DataGrid, Pagination } from '@/types/global';
|
||||||
import type { TableData } from '@arco-design/web-vue/es/table/interface';
|
import type { TableData } from '@arco-design/web-vue/es/table/interface';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import qs from 'query-string';
|
import qs from 'query-string';
|
||||||
@@ -15,7 +15,12 @@ export interface HostConnectLogQueryRequest extends Pagination {
|
|||||||
token?: string;
|
token?: string;
|
||||||
status?: string;
|
status?: string;
|
||||||
startTimeRange?: string[];
|
startTimeRange?: string[];
|
||||||
clearLimit?: number;
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主机连接日志清理请求
|
||||||
|
*/
|
||||||
|
export interface HostConnectLogClearRequest extends HostConnectLogQueryRequest, ClearRequest {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -89,13 +94,13 @@ export function deleteHostConnectLog(idList: Array<number>) {
|
|||||||
* 查询主机连接日志数量
|
* 查询主机连接日志数量
|
||||||
*/
|
*/
|
||||||
export function getHostConnectLogCount(request: HostConnectLogQueryRequest) {
|
export function getHostConnectLogCount(request: HostConnectLogQueryRequest) {
|
||||||
return axios.post<number>('/asset/host-connect-log/query-count', request);
|
return axios.post<number>('/asset/host-connect-log/count', request);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 清空主机连接日志
|
* 清空主机连接日志
|
||||||
*/
|
*/
|
||||||
export function clearHostConnectLog(request: HostConnectLogQueryRequest) {
|
export function clearHostConnectLog(request: HostConnectLogClearRequest) {
|
||||||
return axios.post<number>('/asset/host-connect-log/clear', request);
|
return axios.post<number>('/asset/host-connect-log/clear', request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import type { SelectOptionData } from '@arco-design/web-vue';
|
||||||
import type { DataGrid, Pagination } from '@/types/global';
|
import type { DataGrid, Pagination } from '@/types/global';
|
||||||
import type { TableData } from '@arco-design/web-vue/es/table/interface';
|
import type { TableData } from '@arco-design/web-vue/es/table/interface';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
@@ -160,6 +161,13 @@ export function getHostPage(request: HostQueryRequest) {
|
|||||||
return axios.post<DataGrid<HostQueryResponse>>('/asset/host/query', request);
|
return axios.post<DataGrid<HostQueryResponse>>('/asset/host/query', request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询主机数量
|
||||||
|
*/
|
||||||
|
export function getHostCount(request: HostQueryRequest) {
|
||||||
|
return axios.post<number>('/asset/host/count', request);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过 id 删除主机
|
* 通过 id 删除主机
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import type { DataGrid } from '@/types/global';
|
import type { DataGrid } from '@/types/global';
|
||||||
import type {
|
import type {
|
||||||
ExecHostLogQueryResponse,
|
ExecHostLogQueryResponse,
|
||||||
|
ExecLogClearRequest,
|
||||||
ExecLogInterruptRequest,
|
ExecLogInterruptRequest,
|
||||||
ExecLogQueryRequest,
|
ExecLogQueryRequest,
|
||||||
ExecLogQueryResponse,
|
ExecLogQueryResponse,
|
||||||
@@ -80,13 +81,13 @@ export function deleteExecCommandHostLog(id: number) {
|
|||||||
* 查询批量执行日志数量
|
* 查询批量执行日志数量
|
||||||
*/
|
*/
|
||||||
export function getExecCommandLogCount(request: ExecLogQueryRequest) {
|
export function getExecCommandLogCount(request: ExecLogQueryRequest) {
|
||||||
return axios.post<number>('/asset/exec-command-log/query-count', request);
|
return axios.post<number>('/asset/exec-command-log/count', request);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 清空批量执行日志
|
* 清空批量执行日志
|
||||||
*/
|
*/
|
||||||
export function clearExecCommandLog(request: ExecLogQueryRequest) {
|
export function clearExecCommandLog(request: ExecLogClearRequest) {
|
||||||
return axios.post<number>('/asset/exec-command-log/clear', request);
|
return axios.post<number>('/asset/exec-command-log/clear', request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { Pagination } from '@/types/global';
|
import type { ClearRequest, Pagination } from '@/types/global';
|
||||||
import type { TableData } from '@arco-design/web-vue/es/table/interface';
|
import type { TableData } from '@arco-design/web-vue/es/table/interface';
|
||||||
import { createAppWebSocket } from '@/utils/http';
|
import { createAppWebSocket } from '@/utils/http';
|
||||||
|
|
||||||
@@ -13,7 +13,12 @@ export interface ExecLogQueryRequest extends Pagination {
|
|||||||
command?: string;
|
command?: string;
|
||||||
status?: string;
|
status?: string;
|
||||||
startTimeRange?: string[];
|
startTimeRange?: string[];
|
||||||
clearLimit?: number;
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 执行日志清理请求
|
||||||
|
*/
|
||||||
|
export interface ExecLogClearRequest extends ExecLogQueryRequest, ClearRequest {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { DataGrid, Pagination } from '@/types/global';
|
import type { ClearRequest, DataGrid, Pagination } from '@/types/global';
|
||||||
import type { TableData } from '@arco-design/web-vue/es/table/interface';
|
import type { TableData } from '@arco-design/web-vue/es/table/interface';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import qs from 'query-string';
|
import qs from 'query-string';
|
||||||
@@ -40,7 +40,12 @@ export interface UploadTaskQueryRequest extends Pagination {
|
|||||||
description?: string;
|
description?: string;
|
||||||
status?: string;
|
status?: string;
|
||||||
createTimeRange?: string[];
|
createTimeRange?: string[];
|
||||||
clearLimit?: number;
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上传任务清理请求
|
||||||
|
*/
|
||||||
|
export interface UploadTaskClearRequest extends UploadTaskQueryRequest, ClearRequest {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -170,12 +175,12 @@ export function batchDeleteUploadTask(idList: Array<number>) {
|
|||||||
* 查询主机连接日志数量
|
* 查询主机连接日志数量
|
||||||
*/
|
*/
|
||||||
export function getUploadTaskCount(request: UploadTaskQueryRequest) {
|
export function getUploadTaskCount(request: UploadTaskQueryRequest) {
|
||||||
return axios.post<number>('/asset/upload-task/query-count', request);
|
return axios.post<number>('/asset/upload-task/count', request);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 清空主机连接日志
|
* 清空主机连接日志
|
||||||
*/
|
*/
|
||||||
export function clearUploadTask(request: UploadTaskQueryRequest) {
|
export function clearUploadTask(request: UploadTaskClearRequest) {
|
||||||
return axios.post<number>('/asset/upload-task/clear', request);
|
return axios.post<number>('/asset/upload-task/clear', request);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import type { DataGrid } from '@/types/global';
|
import type { DataGrid } from '@/types/global';
|
||||||
import type {
|
import type {
|
||||||
ExecHostLogQueryResponse,
|
ExecHostLogQueryResponse,
|
||||||
|
ExecLogClearRequest,
|
||||||
ExecLogInterruptRequest,
|
ExecLogInterruptRequest,
|
||||||
ExecLogQueryRequest,
|
ExecLogQueryRequest,
|
||||||
ExecLogQueryResponse,
|
ExecLogQueryResponse,
|
||||||
@@ -73,13 +74,13 @@ export function deleteExecJobHostLog(id: number) {
|
|||||||
* 查询计划任务日志数量
|
* 查询计划任务日志数量
|
||||||
*/
|
*/
|
||||||
export function getExecJobLogCount(request: ExecLogQueryRequest) {
|
export function getExecJobLogCount(request: ExecLogQueryRequest) {
|
||||||
return axios.post<number>('/asset/exec-job-log/query-count', request);
|
return axios.post<number>('/asset/exec-job-log/count', request);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 清空计划任务日志
|
* 清空计划任务日志
|
||||||
*/
|
*/
|
||||||
export function clearExecJobLog(request: ExecLogQueryRequest) {
|
export function clearExecJobLog(request: ExecLogClearRequest) {
|
||||||
return axios.post<number>('/asset/exec-job-log/clear', request);
|
return axios.post<number>('/asset/exec-job-log/clear', request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,19 @@
|
|||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 应用信息查询响应
|
||||||
|
*/
|
||||||
|
export interface SystemLicenseResponse {
|
||||||
|
userCount: number;
|
||||||
|
hostCount: number;
|
||||||
|
release: string;
|
||||||
|
releaseName: string;
|
||||||
|
issueDate: number;
|
||||||
|
expireDate: number;
|
||||||
|
expireDay: number;
|
||||||
|
uuid: string;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 应用信息查询响应
|
* 应用信息查询响应
|
||||||
*/
|
*/
|
||||||
@@ -9,13 +23,20 @@ export interface AppInfoResponse {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 仓库版本信息查询响应
|
* 应用最新版本信息
|
||||||
*/
|
*/
|
||||||
export interface RepoReleaseResponse {
|
export interface AppReleaseResponse {
|
||||||
tag_name: string;
|
tagName: string;
|
||||||
body: string;
|
body: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询 license 信息
|
||||||
|
*/
|
||||||
|
export function getSystemLicenseInfo() {
|
||||||
|
return axios.get<SystemLicenseResponse>('/infra/system-setting/license');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询应用信息
|
* 查询应用信息
|
||||||
*/
|
*/
|
||||||
@@ -24,10 +45,10 @@ export function getSystemAppInfo() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取仓库最后版本信息
|
* 获取应用最新版本信息
|
||||||
*/
|
*/
|
||||||
export function getRepoLatestRelease() {
|
export function getAppLatestRelease() {
|
||||||
return axios.get<RepoReleaseResponse>('https://visor.orionsec.cn/releases-latest.json', {
|
return axios.get<AppReleaseResponse>('https://visor.orionsec.cn/releases-latest.json', {
|
||||||
// 不添加请求头 否则会报 401
|
// 不添加请求头 否则会报 401
|
||||||
setAuthorization: false,
|
setAuthorization: false,
|
||||||
// 返回原始输出
|
// 返回原始输出
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { DataGrid, Pagination } from '@/types/global';
|
import type { ClearRequest, DataGrid, Pagination } from '@/types/global';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import qs from 'query-string';
|
import qs from 'query-string';
|
||||||
|
|
||||||
@@ -13,7 +13,12 @@ export interface OperatorLogQueryRequest extends Pagination {
|
|||||||
riskLevel?: string;
|
riskLevel?: string;
|
||||||
result?: number;
|
result?: number;
|
||||||
startTimeRange?: string[];
|
startTimeRange?: string[];
|
||||||
clearLimit?: number;
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作日志清理参数
|
||||||
|
*/
|
||||||
|
export interface OperatorLogClearRequest extends OperatorLogQueryRequest, ClearRequest {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -65,12 +70,12 @@ export function deleteOperatorLog(idList: Array<number>) {
|
|||||||
* 查询操作日志数量
|
* 查询操作日志数量
|
||||||
*/
|
*/
|
||||||
export function getOperatorLogCount(request: OperatorLogQueryRequest) {
|
export function getOperatorLogCount(request: OperatorLogQueryRequest) {
|
||||||
return axios.post<number>('/infra/operator-log/query-count', request);
|
return axios.post<number>('/infra/operator-log/count', request);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 清空操作日志
|
* 清空操作日志
|
||||||
*/
|
*/
|
||||||
export function clearOperatorLog(request: OperatorLogQueryRequest) {
|
export function clearOperatorLog(request: OperatorLogClearRequest) {
|
||||||
return axios.post<number>('/infra/operator-log/clear', request);
|
return axios.post<number>('/infra/operator-log/clear', request);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,6 +30,10 @@ export interface Pagination {
|
|||||||
limit?: number;
|
limit?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface ClearRequest {
|
||||||
|
limit?: number;
|
||||||
|
}
|
||||||
|
|
||||||
export interface NodeData {
|
export interface NodeData {
|
||||||
[key: string]: any;
|
[key: string]: any;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,12 +55,12 @@
|
|||||||
:options="toOptions(connectTypeKey)"
|
:options="toOptions(connectTypeKey)"
|
||||||
allow-clear />
|
allow-clear />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<!-- 清理数量 -->
|
<!-- 数量限制 -->
|
||||||
<a-form-item field="clearLimit" label="清理数量">
|
<a-form-item field="limit" label="数量限制">
|
||||||
<a-input-number v-model="formModel.clearLimit"
|
<a-input-number v-model="formModel.limit"
|
||||||
:min="1"
|
:min="1"
|
||||||
:max="clearLimit"
|
:max="maxLimit"
|
||||||
:placeholder="`请输入最大清理数量 最大: ${clearLimit}`"
|
:placeholder="`请输入数量限制 最大: ${maxLimit}`"
|
||||||
hide-button
|
hide-button
|
||||||
allow-clear />
|
allow-clear />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
@@ -80,7 +80,7 @@
|
|||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import useLoading from '@/hooks/loading';
|
import useLoading from '@/hooks/loading';
|
||||||
import useVisible from '@/hooks/visible';
|
import useVisible from '@/hooks/visible';
|
||||||
import { connectStatusKey, connectTypeKey, clearLimit } from '../types/const';
|
import { connectStatusKey, connectTypeKey, maxClearLimit } from '../types/const';
|
||||||
import { getHostConnectLogCount, clearHostConnectLog } from '@/api/asset/host-connect-log';
|
import { getHostConnectLogCount, clearHostConnectLog } from '@/api/asset/host-connect-log';
|
||||||
import { Message, Modal } from '@arco-design/web-vue';
|
import { Message, Modal } from '@arco-design/web-vue';
|
||||||
import { useDictStore } from '@/store';
|
import { useDictStore } from '@/store';
|
||||||
@@ -101,14 +101,16 @@
|
|||||||
type: undefined,
|
type: undefined,
|
||||||
status: undefined,
|
status: undefined,
|
||||||
startTimeRange: undefined,
|
startTimeRange: undefined,
|
||||||
clearLimit,
|
limit: maxLimit.value,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const maxLimit = ref<number>(0);
|
||||||
const formModel = ref<HostConnectLogQueryRequest>({});
|
const formModel = ref<HostConnectLogQueryRequest>({});
|
||||||
|
|
||||||
// 打开
|
// 打开
|
||||||
const open = (record: any) => {
|
const open = (record: any) => {
|
||||||
|
maxLimit.value = maxClearLimit;
|
||||||
renderForm({ ...defaultForm(), ...record });
|
renderForm({ ...defaultForm(), ...record });
|
||||||
setVisible(true);
|
setVisible(true);
|
||||||
};
|
};
|
||||||
@@ -122,8 +124,8 @@
|
|||||||
|
|
||||||
// 确定
|
// 确定
|
||||||
const handlerOk = async () => {
|
const handlerOk = async () => {
|
||||||
if (!formModel.value.clearLimit) {
|
if (!formModel.value.limit) {
|
||||||
Message.error('请输入清理数量');
|
Message.error('请输入数量限制');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
@@ -148,7 +150,7 @@
|
|||||||
const doClear = (count: number) => {
|
const doClear = (count: number) => {
|
||||||
Modal.confirm({
|
Modal.confirm({
|
||||||
title: '删除清空',
|
title: '删除清空',
|
||||||
content: `确定要删除 ${Math.min(count, formModel.value.clearLimit || 0)} 条数据吗? 确定后将立即删除且无法恢复!`,
|
content: `确定要删除 ${count} 条数据吗? 确定后将立即删除且无法恢复!`,
|
||||||
onOk: async () => {
|
onOk: async () => {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -12,8 +12,8 @@ export const HostConnectStatus = {
|
|||||||
FORCE_OFFLINE: 'FORCE_OFFLINE',
|
FORCE_OFFLINE: 'FORCE_OFFLINE',
|
||||||
};
|
};
|
||||||
|
|
||||||
// 清理数量
|
// 最大清理数量
|
||||||
export const clearLimit = 2000;
|
export const maxClearLimit = 2000;
|
||||||
|
|
||||||
// 主机连接状态 字典项
|
// 主机连接状态 字典项
|
||||||
export const connectStatusKey = 'hostConnectStatus';
|
export const connectStatusKey = 'hostConnectStatus';
|
||||||
|
|||||||
@@ -14,7 +14,6 @@
|
|||||||
@close="handleClose">
|
@close="handleClose">
|
||||||
<a-spin class="full" :loading="loading">
|
<a-spin class="full" :loading="loading">
|
||||||
<a-form :model="formModel"
|
<a-form :model="formModel"
|
||||||
ref="formRef"
|
|
||||||
label-align="right"
|
label-align="right"
|
||||||
:auto-label-width="true">
|
:auto-label-width="true">
|
||||||
<!-- 执行时间 -->
|
<!-- 执行时间 -->
|
||||||
@@ -48,12 +47,12 @@
|
|||||||
:options="toOptions(execStatusKey)"
|
:options="toOptions(execStatusKey)"
|
||||||
placeholder="请选择执行状态" />
|
placeholder="请选择执行状态" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<!-- 清理数量 -->
|
<!-- 数量限制 -->
|
||||||
<a-form-item field="clearLimit" label="清理数量">
|
<a-form-item field="limit" label="数量限制">
|
||||||
<a-input-number v-model="formModel.clearLimit"
|
<a-input-number v-model="formModel.limit"
|
||||||
:min="1"
|
:min="1"
|
||||||
:max="clearLimit"
|
:max="maxLimit"
|
||||||
:placeholder="`请输入最大清理数量 最大: ${clearLimit}`"
|
:placeholder="`请输入数量限制 最大: ${maxLimit}`"
|
||||||
hide-button
|
hide-button
|
||||||
allow-clear />
|
allow-clear />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
@@ -77,7 +76,7 @@
|
|||||||
import { getExecCommandLogCount, clearExecCommandLog } from '@/api/exec/exec-command-log';
|
import { getExecCommandLogCount, clearExecCommandLog } from '@/api/exec/exec-command-log';
|
||||||
import { Message, Modal } from '@arco-design/web-vue';
|
import { Message, Modal } from '@arco-design/web-vue';
|
||||||
import { useDictStore } from '@/store';
|
import { useDictStore } from '@/store';
|
||||||
import { clearLimit } from '../types/const';
|
import { maxClearLimit } from '../types/const';
|
||||||
import UserSelector from '@/components/user/user/selector/index.vue';
|
import UserSelector from '@/components/user/user/selector/index.vue';
|
||||||
|
|
||||||
const emits = defineEmits(['clear']);
|
const emits = defineEmits(['clear']);
|
||||||
@@ -86,7 +85,7 @@
|
|||||||
const { loading, setLoading } = useLoading();
|
const { loading, setLoading } = useLoading();
|
||||||
const { toOptions } = useDictStore();
|
const { toOptions } = useDictStore();
|
||||||
|
|
||||||
const formRef = ref<any>();
|
const maxLimit = ref<number>(0);
|
||||||
const formModel = ref<ExecLogQueryRequest>({});
|
const formModel = ref<ExecLogQueryRequest>({});
|
||||||
|
|
||||||
const defaultForm = (): ExecLogQueryRequest => {
|
const defaultForm = (): ExecLogQueryRequest => {
|
||||||
@@ -97,12 +96,13 @@
|
|||||||
command: undefined,
|
command: undefined,
|
||||||
status: undefined,
|
status: undefined,
|
||||||
startTimeRange: undefined,
|
startTimeRange: undefined,
|
||||||
clearLimit,
|
limit: maxLimit.value,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
// 打开
|
// 打开
|
||||||
const open = (record: any) => {
|
const open = (record: any) => {
|
||||||
|
maxLimit.value = maxClearLimit;
|
||||||
renderForm({ ...defaultForm(), ...record });
|
renderForm({ ...defaultForm(), ...record });
|
||||||
setVisible(true);
|
setVisible(true);
|
||||||
};
|
};
|
||||||
@@ -116,8 +116,8 @@
|
|||||||
|
|
||||||
// 确定
|
// 确定
|
||||||
const handlerOk = async () => {
|
const handlerOk = async () => {
|
||||||
if (!formModel.value.clearLimit) {
|
if (!formModel.value.limit) {
|
||||||
Message.error('请输入清理数量');
|
Message.error('请输入数量限制');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
@@ -142,7 +142,7 @@
|
|||||||
const doClear = (count: number) => {
|
const doClear = (count: number) => {
|
||||||
Modal.confirm({
|
Modal.confirm({
|
||||||
title: '删除清空',
|
title: '删除清空',
|
||||||
content: `确定要删除 ${Math.min(count, formModel.value.clearLimit || 0)} 条数据吗? 确定后将立即删除且无法恢复!`,
|
content: `确定要删除 ${count} 条数据吗? 确定后将立即删除且无法恢复!`,
|
||||||
onOk: async () => {
|
onOk: async () => {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
// 清理数量
|
// 最大清理数量
|
||||||
export const clearLimit = 1000;
|
export const maxClearLimit = 1000;
|
||||||
|
|||||||
@@ -14,7 +14,6 @@
|
|||||||
@close="handleClose">
|
@close="handleClose">
|
||||||
<a-spin class="full" :loading="loading">
|
<a-spin class="full" :loading="loading">
|
||||||
<a-form :model="formModel"
|
<a-form :model="formModel"
|
||||||
ref="formRef"
|
|
||||||
label-align="right"
|
label-align="right"
|
||||||
:auto-label-width="true">
|
:auto-label-width="true">
|
||||||
<!-- 上传时间 -->
|
<!-- 上传时间 -->
|
||||||
@@ -49,12 +48,12 @@
|
|||||||
placeholder="请选择状态"
|
placeholder="请选择状态"
|
||||||
allow-clear />
|
allow-clear />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<!-- 清理数量 -->
|
<!-- 数量限制 -->
|
||||||
<a-form-item field="clearLimit" label="清理数量">
|
<a-form-item field="limit" label="数量限制">
|
||||||
<a-input-number v-model="formModel.clearLimit"
|
<a-input-number v-model="formModel.limit"
|
||||||
:min="1"
|
:min="1"
|
||||||
:max="clearLimit"
|
:max="maxLimit"
|
||||||
:placeholder="`请输入最大清理数量 最大: ${clearLimit}`"
|
:placeholder="`请输入数量限制 最大: ${maxLimit}`"
|
||||||
hide-button
|
hide-button
|
||||||
allow-clear />
|
allow-clear />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
@@ -74,7 +73,7 @@
|
|||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import useLoading from '@/hooks/loading';
|
import useLoading from '@/hooks/loading';
|
||||||
import useVisible from '@/hooks/visible';
|
import useVisible from '@/hooks/visible';
|
||||||
import { clearLimit, uploadTaskStatusKey } from '../types/const';
|
import { maxClearLimit, uploadTaskStatusKey } from '../types/const';
|
||||||
import { getUploadTaskCount, clearUploadTask } from '@/api/exec/upload-task';
|
import { getUploadTaskCount, clearUploadTask } from '@/api/exec/upload-task';
|
||||||
import { Message, Modal } from '@arco-design/web-vue';
|
import { Message, Modal } from '@arco-design/web-vue';
|
||||||
import { useDictStore } from '@/store';
|
import { useDictStore } from '@/store';
|
||||||
@@ -86,7 +85,7 @@
|
|||||||
const { loading, setLoading } = useLoading();
|
const { loading, setLoading } = useLoading();
|
||||||
const { toOptions } = useDictStore();
|
const { toOptions } = useDictStore();
|
||||||
|
|
||||||
const formRef = ref<any>();
|
const maxLimit = ref<number>(0);
|
||||||
const formModel = ref<UploadTaskQueryRequest>({});
|
const formModel = ref<UploadTaskQueryRequest>({});
|
||||||
|
|
||||||
const defaultForm = (): UploadTaskQueryRequest => {
|
const defaultForm = (): UploadTaskQueryRequest => {
|
||||||
@@ -96,11 +95,13 @@
|
|||||||
description: undefined,
|
description: undefined,
|
||||||
status: undefined,
|
status: undefined,
|
||||||
createTimeRange: undefined,
|
createTimeRange: undefined,
|
||||||
|
limit: maxLimit.value,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
// 打开
|
// 打开
|
||||||
const open = (record: any) => {
|
const open = (record: any) => {
|
||||||
|
maxLimit.value = maxClearLimit;
|
||||||
renderForm({ ...defaultForm(), ...record });
|
renderForm({ ...defaultForm(), ...record });
|
||||||
setVisible(true);
|
setVisible(true);
|
||||||
};
|
};
|
||||||
@@ -114,8 +115,8 @@
|
|||||||
|
|
||||||
// 确定
|
// 确定
|
||||||
const handlerOk = async () => {
|
const handlerOk = async () => {
|
||||||
if (!formModel.value.clearLimit) {
|
if (!formModel.value.limit) {
|
||||||
Message.error('请输入清理数量');
|
Message.error('请输入数量限制');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
@@ -140,7 +141,7 @@
|
|||||||
const doClear = (count: number) => {
|
const doClear = (count: number) => {
|
||||||
Modal.confirm({
|
Modal.confirm({
|
||||||
title: '删除清空',
|
title: '删除清空',
|
||||||
content: `确定要删除 ${Math.min(count, formModel.value.clearLimit || 0)} 条数据吗? 确定后将立即删除且无法恢复!`,
|
content: `确定要删除 ${count} 条数据吗? 确定后将立即删除且无法恢复!`,
|
||||||
onOk: async () => {
|
onOk: async () => {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -26,8 +26,8 @@ export const UploadTaskFileStatus = {
|
|||||||
CANCELED: 'CANCELED',
|
CANCELED: 'CANCELED',
|
||||||
};
|
};
|
||||||
|
|
||||||
// 清理数量
|
// 最大清理数量
|
||||||
export const clearLimit = 2000;
|
export const maxClearLimit = 2000;
|
||||||
|
|
||||||
// 上传任务状态 字典项
|
// 上传任务状态 字典项
|
||||||
export const uploadTaskStatusKey = 'uploadTaskStatus';
|
export const uploadTaskStatusKey = 'uploadTaskStatus';
|
||||||
|
|||||||
@@ -14,7 +14,6 @@
|
|||||||
@close="handleClose">
|
@close="handleClose">
|
||||||
<a-spin class="full" :loading="loading">
|
<a-spin class="full" :loading="loading">
|
||||||
<a-form :model="formModel"
|
<a-form :model="formModel"
|
||||||
ref="formRef"
|
|
||||||
label-align="right"
|
label-align="right"
|
||||||
:auto-label-width="true">
|
:auto-label-width="true">
|
||||||
<!-- 执行时间 -->
|
<!-- 执行时间 -->
|
||||||
@@ -43,12 +42,12 @@
|
|||||||
:options="toOptions(execStatusKey)"
|
:options="toOptions(execStatusKey)"
|
||||||
placeholder="请选择执行状态" />
|
placeholder="请选择执行状态" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<!-- 清理数量 -->
|
<!-- 数量限制 -->
|
||||||
<a-form-item field="clearLimit" label="清理数量">
|
<a-form-item field="limit" label="数量限制">
|
||||||
<a-input-number v-model="formModel.clearLimit"
|
<a-input-number v-model="formModel.limit"
|
||||||
:min="1"
|
:min="1"
|
||||||
:max="clearLimit"
|
:max="maxLimit"
|
||||||
:placeholder="`请输入最大清理数量 最大: ${clearLimit}`"
|
:placeholder="`请输入数量限制 最大: ${maxLimit}`"
|
||||||
hide-button
|
hide-button
|
||||||
allow-clear />
|
allow-clear />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
@@ -72,7 +71,7 @@
|
|||||||
import { getExecJobLogCount, clearExecJobLog } from '@/api/job/exec-job-log';
|
import { getExecJobLogCount, clearExecJobLog } from '@/api/job/exec-job-log';
|
||||||
import { Message, Modal } from '@arco-design/web-vue';
|
import { Message, Modal } from '@arco-design/web-vue';
|
||||||
import { useDictStore } from '@/store';
|
import { useDictStore } from '@/store';
|
||||||
import { clearLimit } from '../types/const';
|
import { maxClearLimit } from '../types/const';
|
||||||
import ExecJobSelector from '@/components/exec/job/selector/index.vue';
|
import ExecJobSelector from '@/components/exec/job/selector/index.vue';
|
||||||
|
|
||||||
const emits = defineEmits(['clear']);
|
const emits = defineEmits(['clear']);
|
||||||
@@ -81,7 +80,7 @@
|
|||||||
const { loading, setLoading } = useLoading();
|
const { loading, setLoading } = useLoading();
|
||||||
const { toOptions } = useDictStore();
|
const { toOptions } = useDictStore();
|
||||||
|
|
||||||
const formRef = ref<any>();
|
const maxLimit = ref<number>(0);
|
||||||
const formModel = ref<ExecLogQueryRequest>({});
|
const formModel = ref<ExecLogQueryRequest>({});
|
||||||
|
|
||||||
const defaultForm = (): ExecLogQueryRequest => {
|
const defaultForm = (): ExecLogQueryRequest => {
|
||||||
@@ -92,12 +91,13 @@
|
|||||||
command: undefined,
|
command: undefined,
|
||||||
status: undefined,
|
status: undefined,
|
||||||
startTimeRange: undefined,
|
startTimeRange: undefined,
|
||||||
clearLimit,
|
limit: maxLimit.value,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
// 打开
|
// 打开
|
||||||
const open = (record: any) => {
|
const open = (record: any) => {
|
||||||
|
maxLimit.value = maxClearLimit;
|
||||||
renderForm({ ...defaultForm(), ...record });
|
renderForm({ ...defaultForm(), ...record });
|
||||||
setVisible(true);
|
setVisible(true);
|
||||||
};
|
};
|
||||||
@@ -111,8 +111,8 @@
|
|||||||
|
|
||||||
// 确定
|
// 确定
|
||||||
const handlerOk = async () => {
|
const handlerOk = async () => {
|
||||||
if (!formModel.value.clearLimit) {
|
if (!formModel.value.limit) {
|
||||||
Message.error('请输入清理数量');
|
Message.error('请输入数量限制');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
@@ -137,7 +137,7 @@
|
|||||||
const doClear = (count: number) => {
|
const doClear = (count: number) => {
|
||||||
Modal.confirm({
|
Modal.confirm({
|
||||||
title: '删除清空',
|
title: '删除清空',
|
||||||
content: `确定要删除 ${Math.min(count, formModel.value.clearLimit || 0)} 条数据吗? 确定后将立即删除且无法恢复!`,
|
content: `确定要删除 ${count} 条数据吗? 确定后将立即删除且无法恢复!`,
|
||||||
onOk: async () => {
|
onOk: async () => {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
// 清理数量
|
// 最大清理数量
|
||||||
export const clearLimit = 1000;
|
export const maxClearLimit = 1000;
|
||||||
|
|||||||
@@ -4,13 +4,13 @@
|
|||||||
<!-- 不一致提示 -->
|
<!-- 不一致提示 -->
|
||||||
<a-alert v-if="app.version && webVersion !== app.version"
|
<a-alert v-if="app.version && webVersion !== app.version"
|
||||||
class="alert-wrapper">
|
class="alert-wrapper">
|
||||||
当前前端版本与后端版本不一致, 请使用 Ctrl + F5 刷新页面
|
当前前端版本与后端版本不一致, 请使用 Ctrl + F5 强制刷新页面
|
||||||
</a-alert>
|
</a-alert>
|
||||||
<!-- 升级提示 -->
|
<!-- 升级提示 -->
|
||||||
<a v-if="app.version && repo.tag_name && ('v' + app.version) !== repo.tag_name"
|
<a v-if="app.version && repo.tagName && ('v' + app.version) !== repo.tagName"
|
||||||
class="alert-href"
|
class="alert-href"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
:href="`https://github.com/dromara/orion-visor/releases/tag/${repo.tag_name}`">
|
:href="`https://github.com/dromara/orion-visor/releases/tag/${repo.tagName}`">
|
||||||
<a-alert class="alert-wrapper">
|
<a-alert class="alert-wrapper">
|
||||||
新版本已发布, 请及时升级版本
|
新版本已发布, 请及时升级版本
|
||||||
</a-alert>
|
</a-alert>
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
:column="1">
|
:column="1">
|
||||||
<!-- 机器码 -->
|
<!-- 机器码 -->
|
||||||
<a-descriptions-item label="机器码">
|
<a-descriptions-item label="机器码">
|
||||||
<span class="text-copy span-blue uuid-wrapper" @click="copy(app.uuid, true)">
|
<span class="text-copy uuid-wrapper" @click="copy(app.uuid, true)">
|
||||||
{{ app.uuid }}
|
{{ app.uuid }}
|
||||||
</span>
|
</span>
|
||||||
</a-descriptions-item>
|
</a-descriptions-item>
|
||||||
@@ -37,7 +37,7 @@
|
|||||||
</a-descriptions-item>
|
</a-descriptions-item>
|
||||||
<!-- 当前后端版本 -->
|
<!-- 当前后端版本 -->
|
||||||
<a-descriptions-item label="最新发布版本">
|
<a-descriptions-item label="最新发布版本">
|
||||||
{{ repo.tag_name }}
|
{{ repo.tagName }}
|
||||||
</a-descriptions-item>
|
</a-descriptions-item>
|
||||||
<!-- 当前后端版本 -->
|
<!-- 当前后端版本 -->
|
||||||
<a-descriptions-item label="最新更新日志">
|
<a-descriptions-item label="最新更新日志">
|
||||||
@@ -58,9 +58,9 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import type { AppInfoResponse, RepoReleaseResponse } from '@/api/system/setting';
|
import type { AppInfoResponse, AppReleaseResponse } from '@/api/system/setting';
|
||||||
import { onMounted, reactive } from 'vue';
|
import { onMounted, reactive } from 'vue';
|
||||||
import { getRepoLatestRelease, getSystemAppInfo } from '@/api/system/setting';
|
import { getAppLatestRelease, getSystemAppInfo } from '@/api/system/setting';
|
||||||
import { copy } from '@/hooks/copy';
|
import { copy } from '@/hooks/copy';
|
||||||
import { Message } from '@arco-design/web-vue';
|
import { Message } from '@arco-design/web-vue';
|
||||||
|
|
||||||
@@ -71,8 +71,8 @@
|
|||||||
uuid: '',
|
uuid: '',
|
||||||
});
|
});
|
||||||
|
|
||||||
const repo = reactive<RepoReleaseResponse>({
|
const repo = reactive<AppReleaseResponse>({
|
||||||
tag_name: '',
|
tagName: '',
|
||||||
body: '',
|
body: '',
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -86,14 +86,14 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// 加载仓库信息
|
// 加载版本信息
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
try {
|
try {
|
||||||
const { data } = await getRepoLatestRelease();
|
const { data } = await getAppLatestRelease();
|
||||||
repo.tag_name = data.tag_name;
|
repo.tagName = data.tagName;
|
||||||
repo.body = data.body;
|
repo.body = data.body;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
Message.error('获取仓库信息失败, 请等待后重试');
|
Message.error('获取应用最新版本失败, 请等待后重试');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -116,6 +116,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.uuid-wrapper {
|
.uuid-wrapper {
|
||||||
|
color: rgb(var(--arcoblue-6));
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -61,12 +61,12 @@
|
|||||||
placeholder="请选择执行结果"
|
placeholder="请选择执行结果"
|
||||||
allow-clear />
|
allow-clear />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<!-- 清理数量 -->
|
<!-- 数量限制 -->
|
||||||
<a-form-item field="clearLimit" label="清理数量">
|
<a-form-item field="limit" label="数量限制">
|
||||||
<a-input-number v-model="formModel.clearLimit"
|
<a-input-number v-model="formModel.limit"
|
||||||
:min="1"
|
:min="1"
|
||||||
:max="clearLimit"
|
:max="maxLimit"
|
||||||
:placeholder="`请输入最大清理数量 最大: ${clearLimit}`"
|
:placeholder="`请输入数量限制 最大: ${maxLimit}`"
|
||||||
hide-button
|
hide-button
|
||||||
allow-clear />
|
allow-clear />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
@@ -90,7 +90,7 @@
|
|||||||
import { getOperatorLogCount, clearOperatorLog } from '@/api/user/operator-log';
|
import { getOperatorLogCount, clearOperatorLog } from '@/api/user/operator-log';
|
||||||
import { Message, Modal } from '@arco-design/web-vue';
|
import { Message, Modal } from '@arco-design/web-vue';
|
||||||
import { useDictStore } from '@/store';
|
import { useDictStore } from '@/store';
|
||||||
import { operatorLogModuleKey, operatorLogResultKey, operatorLogTypeKey, operatorRiskLevelKey, clearLimit } from '../types/const';
|
import { operatorLogModuleKey, operatorLogResultKey, operatorLogTypeKey, operatorRiskLevelKey, maxClearLimit } from '../types/const';
|
||||||
import { labelFilter } from '@/types/form';
|
import { labelFilter } from '@/types/form';
|
||||||
import UserSelector from '@/components/user/user/selector/index.vue';
|
import UserSelector from '@/components/user/user/selector/index.vue';
|
||||||
|
|
||||||
@@ -105,10 +105,11 @@
|
|||||||
riskLevel: undefined,
|
riskLevel: undefined,
|
||||||
result: undefined,
|
result: undefined,
|
||||||
startTimeRange: undefined,
|
startTimeRange: undefined,
|
||||||
clearLimit,
|
limit: maxLimit.value,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const maxLimit = ref<number>(0);
|
||||||
const typeOptions = ref<SelectOptionData[]>(toOptions(operatorLogTypeKey));
|
const typeOptions = ref<SelectOptionData[]>(toOptions(operatorLogTypeKey));
|
||||||
const formModel = ref<OperatorLogQueryRequest>({});
|
const formModel = ref<OperatorLogQueryRequest>({});
|
||||||
|
|
||||||
@@ -116,6 +117,7 @@
|
|||||||
|
|
||||||
// 打开
|
// 打开
|
||||||
const open = (record: OperatorLogQueryRequest) => {
|
const open = (record: OperatorLogQueryRequest) => {
|
||||||
|
maxLimit.value = maxClearLimit;
|
||||||
renderForm({ ...defaultForm(), ...record });
|
renderForm({ ...defaultForm(), ...record });
|
||||||
setVisible(true);
|
setVisible(true);
|
||||||
};
|
};
|
||||||
@@ -146,8 +148,8 @@
|
|||||||
|
|
||||||
// 确定
|
// 确定
|
||||||
const handlerOk = async () => {
|
const handlerOk = async () => {
|
||||||
if (!formModel.value.clearLimit) {
|
if (!formModel.value.limit) {
|
||||||
Message.error('请输入清理数量');
|
Message.error('请输入数量限制');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
@@ -172,7 +174,7 @@
|
|||||||
const doClear = (count: number) => {
|
const doClear = (count: number) => {
|
||||||
Modal.confirm({
|
Modal.confirm({
|
||||||
title: '删除清空',
|
title: '删除清空',
|
||||||
content: `确定要删除 ${Math.min(count, formModel.value.clearLimit || 0)} 条数据吗? 确定后将立即删除且无法恢复!`,
|
content: `确定要删除 ${count} 条数据吗? 确定后将立即删除且无法恢复!`,
|
||||||
onOk: async () => {
|
onOk: async () => {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -27,8 +27,8 @@ export const getLogDetail = (record: OperatorLogQueryResponse): Record<string, a
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// 清理数量
|
// 最大清理数量
|
||||||
export const clearLimit = 2000;
|
export const maxClearLimit = 2000;
|
||||||
|
|
||||||
// 操作日志模块 字典项
|
// 操作日志模块 字典项
|
||||||
export const operatorLogModuleKey = 'operatorLogModule';
|
export const operatorLogModuleKey = 'operatorLogModule';
|
||||||
|
|||||||
Reference in New Issue
Block a user