Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
387ed53328 | ||
|
|
c9cbc5fd55 | ||
|
|
ae03460a33 | ||
|
|
4b060a864a | ||
|
|
07e8e63ee6 | ||
|
|
ab1d4ed97f | ||
|
|
2bd7dfd5b8 | ||
|
|
c39049e5f5 |
13
README.md
13
README.md
@@ -51,12 +51,13 @@
|
|||||||
|
|
||||||
## 演示环境
|
## 演示环境
|
||||||
|
|
||||||
演示地址: http://101.43.254.243:1081/
|
* 🔗 演示地址: http://101.43.254.243:1081/
|
||||||
演示账号: admin/admin
|
* 🔏 演示账号: admin/admin
|
||||||
|
* ⭐ 体验后可以点一下 `star` 这对我很重要! [github](https://github.com/lijiahangmax/orion-visor) [gitee](https://gitee.com/lijiahangmax/orion-visor)
|
||||||
⭐ 体验后可以点一下 `star` 这对我很重要!
|
* 🌈 如果本项目对你有帮助请帮忙推广一下 让更多的人知道此项目!
|
||||||
🌈 如果本项目对你有帮助请帮忙推广一下 让更多的人知道此项目!
|
* 🎭 演示环境部分功能不可用, 完整功能请本地部署!
|
||||||
[github](https://github.com/lijiahangmax/orion-visor) [gitee](https://gitee.com/lijiahangmax/orion-visor)
|
* 📛 演示环境请不要随便删除数据!
|
||||||
|
* 📧 如果演示环境不可用请联系我!
|
||||||
|
|
||||||
## 快速开始
|
## 快速开始
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
version: '3.3'
|
version: '3.3'
|
||||||
services:
|
services:
|
||||||
orion-visor-service:
|
orion-visor-service:
|
||||||
image: registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-service:2.0.5
|
image: registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-service:2.0.6
|
||||||
ports:
|
ports:
|
||||||
- 1081:80
|
- 1081:80
|
||||||
environment:
|
environment:
|
||||||
@@ -20,7 +20,7 @@ services:
|
|||||||
- orion-visor-mysql
|
- orion-visor-mysql
|
||||||
- orion-visor-redis
|
- orion-visor-redis
|
||||||
orion-visor-mysql:
|
orion-visor-mysql:
|
||||||
image: registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-mysql:2.0.5
|
image: registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-mysql:2.0.6
|
||||||
privileged: true
|
privileged: true
|
||||||
ports:
|
ports:
|
||||||
- 3307:3306
|
- 3307:3306
|
||||||
@@ -34,7 +34,7 @@ services:
|
|||||||
- /data/orion-visor-space/docker-volumes/orion-visor-mysql/var-lib-mysql-files:/var/lib/mysql-files
|
- /data/orion-visor-space/docker-volumes/orion-visor-mysql/var-lib-mysql-files:/var/lib/mysql-files
|
||||||
- /data/orion-visor-space/docker-volumes/orion-visor-mysql/etc-mysql:/etc/mysql
|
- /data/orion-visor-space/docker-volumes/orion-visor-mysql/etc-mysql:/etc/mysql
|
||||||
orion-visor-redis:
|
orion-visor-redis:
|
||||||
image: registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-redis:2.0.5
|
image: registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-redis:2.0.6
|
||||||
privileged: true
|
privileged: true
|
||||||
ports:
|
ports:
|
||||||
- 6380:6379
|
- 6380:6379
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#/bin/bash
|
#/bin/bash
|
||||||
version=2.0.5
|
version=2.0.6
|
||||||
cp -r ../../sql ./sql
|
cp -r ../../sql ./sql
|
||||||
docker build -t orion-visor-mysql:${version} .
|
docker build -t orion-visor-mysql:${version} .
|
||||||
rm -rf ./sql
|
rm -rf ./sql
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#/bin/bash
|
#/bin/bash
|
||||||
version=2.0.5
|
version=2.0.6
|
||||||
docker build -t orion-visor-redis:${version} .
|
docker build -t orion-visor-redis:${version} .
|
||||||
docker tag orion-visor-redis:${version} registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-redis:${version}
|
docker tag orion-visor-redis:${version} registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-redis:${version}
|
||||||
docker push registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-redis:${version}
|
docker push registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-redis:${version}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#/bin/bash
|
#/bin/bash
|
||||||
version=2.0.5
|
version=2.0.6
|
||||||
mv ../../orion-visor-launch/target/orion-visor-launch.jar ./orion-visor-launch.jar
|
mv ../../orion-visor-launch/target/orion-visor-launch.jar ./orion-visor-launch.jar
|
||||||
mv ../../orion-visor-ui/dist ./dist
|
mv ../../orion-visor-ui/dist ./dist
|
||||||
docker build -t orion-visor-service:${version} .
|
docker build -t orion-visor-service:${version} .
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
<url>https://github.com/lijiahangmax/orion-visor</url>
|
<url>https://github.com/lijiahangmax/orion-visor</url>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<revision>2.0.5</revision>
|
<revision>2.0.6</revision>
|
||||||
<spring.boot.version>2.7.17</spring.boot.version>
|
<spring.boot.version>2.7.17</spring.boot.version>
|
||||||
<spring.boot.admin.version>2.7.15</spring.boot.admin.version>
|
<spring.boot.admin.version>2.7.15</spring.boot.admin.version>
|
||||||
<flatten.maven.plugin.version>1.5.0</flatten.maven.plugin.version>
|
<flatten.maven.plugin.version>1.5.0</flatten.maven.plugin.version>
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
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 {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -14,7 +14,7 @@ public interface AppConst extends OrionConst {
|
|||||||
/**
|
/**
|
||||||
* 同 ${orion.version} 迭代时候需要手动更改
|
* 同 ${orion.version} 迭代时候需要手动更改
|
||||||
*/
|
*/
|
||||||
String VERSION = "2.0.5";
|
String VERSION = "2.0.6";
|
||||||
|
|
||||||
String ORION_VISOR = "orion-visor";
|
String ORION_VISOR = "orion-visor";
|
||||||
|
|
||||||
|
|||||||
@@ -25,8 +25,6 @@ public interface Const extends com.orion.lang.constant.Const, FieldConst, CnCons
|
|||||||
|
|
||||||
Integer DEFAULT_SORT = 10;
|
Integer DEFAULT_SORT = 10;
|
||||||
|
|
||||||
int LOGIN_HISTORY_COUNT = 30;
|
|
||||||
|
|
||||||
Long NONE_ID = -1L;
|
Long NONE_ID = -1L;
|
||||||
|
|
||||||
Integer DEFAULT_VERSION = 1;
|
Integer DEFAULT_VERSION = 1;
|
||||||
|
|||||||
@@ -14,13 +14,19 @@ import lombok.Getter;
|
|||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public enum MovePosition {
|
public enum MovePosition {
|
||||||
|
|
||||||
// 拖拽到目标元素上
|
/**
|
||||||
|
* 拖拽到目标元素上
|
||||||
|
*/
|
||||||
TOP(-1),
|
TOP(-1),
|
||||||
|
|
||||||
// 拖拽到目标元素中
|
/**
|
||||||
|
* 拖拽到目标元素中
|
||||||
|
*/
|
||||||
IN(0),
|
IN(0),
|
||||||
|
|
||||||
// 拖拽到目标元素下
|
/**
|
||||||
|
* 拖拽到目标元素下
|
||||||
|
*/
|
||||||
BOTTOM(1),
|
BOTTOM(1),
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|||||||
@@ -36,24 +36,47 @@ public class BannerApplicationRunner implements ApplicationRunner {
|
|||||||
@Value("${management.endpoints.web.base-path:''}")
|
@Value("${management.endpoints.web.base-path:''}")
|
||||||
private String managementEndpoints;
|
private String managementEndpoints;
|
||||||
|
|
||||||
|
@Value("${springdoc.api-docs.enabled}")
|
||||||
|
private Boolean apiDocsEnabled;
|
||||||
|
|
||||||
|
@Value("${spring.datasource.druid.stat-view-servlet.enabled}")
|
||||||
|
private Boolean druidConsoleEnabled;
|
||||||
|
|
||||||
|
@Value("#{'${management.endpoints.web.exposure.include}' != 'shutdown'}")
|
||||||
|
private Boolean springBootActuatorEnabled;
|
||||||
|
|
||||||
|
@Value("${spring.boot.admin.client.enabled}")
|
||||||
|
private Boolean springBootAdminClientEnabled;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run(ApplicationArguments args) {
|
public void run(ApplicationArguments args) {
|
||||||
String line = AnsiAppender.create()
|
AnsiAppender appender = AnsiAppender.create()
|
||||||
.append(AnsiForeground.BRIGHT_GREEN, ":: orion-visor-launch v" + version + " 服务已启动(" + env + ") ::\n")
|
.append(AnsiForeground.BRIGHT_GREEN, ":: orion-visor-launch v" + version + " 服务已启动(" + env + ") ::\n");
|
||||||
.append(AnsiForeground.BRIGHT_GREEN, ":: swagger 文档 ")
|
// swagger 地址
|
||||||
.append(AnsiForeground.BRIGHT_BLUE, "http://127.0.0.1:" + port + "/doc.html\n")
|
if (apiDocsEnabled) {
|
||||||
.append(AnsiForeground.BRIGHT_GREEN, ":: druid console ")
|
appender.append(AnsiForeground.BRIGHT_GREEN, ":: swagger 文档 ")
|
||||||
.append(AnsiForeground.BRIGHT_BLUE, "http://127.0.0.1:" + port + "/druid/index.html\n")
|
.append(AnsiForeground.BRIGHT_BLUE, "http://127.0.0.1:" + port + "/doc.html\n");
|
||||||
.append(AnsiForeground.BRIGHT_GREEN, ":: actuator endpoint ")
|
}
|
||||||
.append(AnsiForeground.BRIGHT_BLUE, "http://127.0.0.1:" + port + managementEndpoints + "\n")
|
// druid 控制台
|
||||||
.append(AnsiForeground.BRIGHT_GREEN, ":: admin console ")
|
if (druidConsoleEnabled) {
|
||||||
.append(AnsiForeground.BRIGHT_BLUE, "http://127.0.0.1:" + port + adminSeverContextPath + "\n")
|
appender.append(AnsiForeground.BRIGHT_GREEN, ":: druid console ")
|
||||||
.append(AnsiForeground.BRIGHT_GREEN, ":: server 健康检测 ")
|
.append(AnsiForeground.BRIGHT_BLUE, "http://127.0.0.1:" + port + "/druid/index.html\n");
|
||||||
.append(AnsiForeground.BRIGHT_BLUE, "curl -X GET --location \"http://127.0.0.1:" + port + apiPrefix + "/server/bootstrap/health\"")
|
}
|
||||||
.toString();
|
// admin actuator 端点
|
||||||
|
if (springBootActuatorEnabled) {
|
||||||
|
appender.append(AnsiForeground.BRIGHT_GREEN, ":: actuator endpoint ")
|
||||||
|
.append(AnsiForeground.BRIGHT_BLUE, "http://127.0.0.1:" + port + managementEndpoints + "\n");
|
||||||
|
}
|
||||||
|
// admin server 控制台
|
||||||
|
if (springBootAdminClientEnabled) {
|
||||||
|
appender.append(AnsiForeground.BRIGHT_GREEN, ":: admin console ")
|
||||||
|
.append(AnsiForeground.BRIGHT_BLUE, "http://127.0.0.1:" + port + adminSeverContextPath + "\n");
|
||||||
|
}
|
||||||
|
appender.append(AnsiForeground.BRIGHT_GREEN, ":: server 健康检测 ")
|
||||||
|
.append(AnsiForeground.BRIGHT_BLUE, "curl -X GET --location \"http://127.0.0.1:" + port + apiPrefix + "/server/bootstrap/health\"");
|
||||||
Threads.start(() -> {
|
Threads.start(() -> {
|
||||||
Threads.sleep(1000L);
|
Threads.sleep(1000L);
|
||||||
System.out.println(line);
|
System.out.println(appender);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,4 +8,5 @@ ${AnsiColor.BRIGHT_GREEN}:: Application Name ${AnsiColor.BLUE}${spring.appli
|
|||||||
${AnsiColor.BRIGHT_GREEN}:: Application Version ${AnsiColor.BLUE}${orion.version}
|
${AnsiColor.BRIGHT_GREEN}:: Application Version ${AnsiColor.BLUE}${orion.version}
|
||||||
${AnsiColor.BRIGHT_GREEN}:: SpringBoot Version ${AnsiColor.BLUE}${spring-boot.version}
|
${AnsiColor.BRIGHT_GREEN}:: SpringBoot Version ${AnsiColor.BLUE}${spring-boot.version}
|
||||||
${AnsiColor.BRIGHT_GREEN}:: Active Profile ${AnsiColor.BLUE}${spring.profiles.active}
|
${AnsiColor.BRIGHT_GREEN}:: Active Profile ${AnsiColor.BLUE}${spring.profiles.active}
|
||||||
|
${AnsiColor.BRIGHT_GREEN}:: Demo Mode ${AnsiColor.BLUE}${orion.demo}
|
||||||
${AnsiColor.DEFAULT}
|
${AnsiColor.DEFAULT}
|
||||||
@@ -72,9 +72,9 @@ public class PrettyLogPrinterInterceptor extends AbstractLogPrinterInterceptor {
|
|||||||
}
|
}
|
||||||
Method method = invocation.getMethod();
|
Method method = invocation.getMethod();
|
||||||
// 方法签名
|
// 方法签名
|
||||||
requestLog.append("\tmethodSign: ").append(method.getDeclaringClass().getName()).append('#')
|
// requestLog.append("\tmethodSign: ").append(method.getDeclaringClass().getName()).append('#')
|
||||||
.append(method.getName()).append("\n");
|
// .append(method.getName()).append("\n");
|
||||||
// 参数
|
// 方法参数
|
||||||
requestLog.append("\tparameter: ").append(this.requestToString(method, invocation.getArguments()));
|
requestLog.append("\tparameter: ").append(this.requestToString(method, invocation.getArguments()));
|
||||||
log.info(requestLog.toString());
|
log.info(requestLog.toString());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,8 +73,8 @@ public class RowLogPrinterInterceptor extends AbstractLogPrinterInterceptor impl
|
|||||||
}
|
}
|
||||||
Method method = invocation.getMethod();
|
Method method = invocation.getMethod();
|
||||||
// 方法签名
|
// 方法签名
|
||||||
fields.put(METHOD_SIGN, method.getDeclaringClass().getName() + "#" + method.getName());
|
// fields.put(METHOD_SIGN, method.getDeclaringClass().getName() + "#" + method.getName());
|
||||||
// 参数
|
// 方法参数
|
||||||
fields.put(PARAMETER, this.requestToString(method, invocation.getArguments()));
|
fields.put(PARAMETER, this.requestToString(method, invocation.getArguments()));
|
||||||
log.info("api请求-开始 {}", JSON.toJSONString(fields));
|
log.info("api请求-开始 {}", JSON.toJSONString(fields));
|
||||||
fields.clear();
|
fields.clear();
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
|
|||||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Lazy;
|
import org.springframework.context.annotation.Lazy;
|
||||||
|
import org.springframework.context.annotation.Primary;
|
||||||
import org.springframework.data.redis.connection.RedisConnectionFactory;
|
import org.springframework.data.redis.connection.RedisConnectionFactory;
|
||||||
import org.springframework.data.redis.core.RedisTemplate;
|
import org.springframework.data.redis.core.RedisTemplate;
|
||||||
import org.springframework.data.redis.serializer.RedisSerializer;
|
import org.springframework.data.redis.serializer.RedisSerializer;
|
||||||
@@ -36,6 +37,7 @@ public class OrionRedisAutoConfiguration {
|
|||||||
* @param redisConnectionFactory factory
|
* @param redisConnectionFactory factory
|
||||||
* @return RedisTemplate
|
* @return RedisTemplate
|
||||||
*/
|
*/
|
||||||
|
@Primary
|
||||||
@Bean
|
@Bean
|
||||||
public RedisTemplate<String, String> redisTemplate(RedisConnectionFactory redisConnectionFactory) {
|
public RedisTemplate<String, String> redisTemplate(RedisConnectionFactory redisConnectionFactory) {
|
||||||
RedisTemplate<String, String> redisTemplate = new RedisTemplate<>();
|
RedisTemplate<String, String> redisTemplate = new RedisTemplate<>();
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
|||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Profile;
|
|
||||||
import org.springframework.http.HttpHeaders;
|
import org.springframework.http.HttpHeaders;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@@ -38,10 +37,9 @@ import java.util.Optional;
|
|||||||
* @version 1.0.0
|
* @version 1.0.0
|
||||||
* @since 2022/6/21 11:22
|
* @since 2022/6/21 11:22
|
||||||
*/
|
*/
|
||||||
@Profile({"dev"})
|
|
||||||
@ConditionalOnClass({OpenAPI.class})
|
@ConditionalOnClass({OpenAPI.class})
|
||||||
@EnableConfigurationProperties(SwaggerConfig.class)
|
@EnableConfigurationProperties(SwaggerConfig.class)
|
||||||
@ConditionalOnProperty(prefix = "springdoc.api-docs", name = "enabled", havingValue = "true", matchIfMissing = true)
|
@ConditionalOnProperty(name = "springdoc.api-docs.enabled", havingValue = "true")
|
||||||
@AutoConfiguration
|
@AutoConfiguration
|
||||||
@AutoConfigureOrder(AutoConfigureOrderConst.FRAMEWORK_SWAGGER)
|
@AutoConfigureOrder(AutoConfigureOrderConst.FRAMEWORK_SWAGGER)
|
||||||
public class OrionSwaggerAutoConfiguration {
|
public class OrionSwaggerAutoConfiguration {
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
package com.orion.visor.launch;
|
package com.orion.visor.launch;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.config.BeanDefinition;
|
||||||
|
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
|
||||||
|
import org.springframework.beans.factory.support.BeanNameGenerator;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||||
|
|
||||||
@@ -14,7 +17,19 @@ import org.springframework.boot.builder.SpringApplicationBuilder;
|
|||||||
public class LaunchApplication {
|
public class LaunchApplication {
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
new SpringApplicationBuilder(LaunchApplication.class).run(args);
|
new SpringApplicationBuilder(LaunchApplication.class)
|
||||||
|
.beanNameGenerator(new CustomBeanNameGenerator())
|
||||||
|
.run(args);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自定义 bean 名称生成器
|
||||||
|
*/
|
||||||
|
public static class CustomBeanNameGenerator implements BeanNameGenerator {
|
||||||
|
@Override
|
||||||
|
public String generateBeanName(BeanDefinition definition, BeanDefinitionRegistry registry) {
|
||||||
|
return definition.getBeanClassName();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ spring:
|
|||||||
initial-size: 0
|
initial-size: 0
|
||||||
min-idle: 1
|
min-idle: 1
|
||||||
max-active: 5
|
max-active: 5
|
||||||
|
stat-view-servlet:
|
||||||
|
enabled: false
|
||||||
redis:
|
redis:
|
||||||
host: 127.0.0.1
|
host: 127.0.0.1
|
||||||
port: 6379
|
port: 6379
|
||||||
@@ -15,6 +17,19 @@ spring:
|
|||||||
threads: 2
|
threads: 2
|
||||||
netty-threads: 2
|
netty-threads: 2
|
||||||
minimum-idle-size: 2
|
minimum-idle-size: 2
|
||||||
|
boot:
|
||||||
|
admin:
|
||||||
|
client:
|
||||||
|
enabled: false
|
||||||
|
server:
|
||||||
|
enabled: false
|
||||||
|
|
||||||
|
management:
|
||||||
|
endpoints:
|
||||||
|
enabled-by-default: false
|
||||||
|
web:
|
||||||
|
exposure:
|
||||||
|
include: shutdown
|
||||||
|
|
||||||
mybatis-plus:
|
mybatis-plus:
|
||||||
configuration:
|
configuration:
|
||||||
|
|||||||
@@ -10,10 +10,13 @@ spring:
|
|||||||
min-idle: 5
|
min-idle: 5
|
||||||
# 最大连接池数量
|
# 最大连接池数量
|
||||||
max-active: 20
|
max-active: 20
|
||||||
web-stat-filter:
|
# 控制台
|
||||||
enabled: true
|
|
||||||
stat-view-servlet:
|
stat-view-servlet:
|
||||||
enabled: true
|
enabled: true
|
||||||
|
login-username: ${DRUID_USERNAME:admin}
|
||||||
|
login-password: ${DRUID_PASSWORD:admin}
|
||||||
|
web-stat-filter:
|
||||||
|
enabled: true
|
||||||
filter:
|
filter:
|
||||||
stat:
|
stat:
|
||||||
enabled: true
|
enabled: true
|
||||||
@@ -31,6 +34,16 @@ spring:
|
|||||||
quartz:
|
quartz:
|
||||||
threadPool:
|
threadPool:
|
||||||
threadCount: 10
|
threadCount: 10
|
||||||
|
boot:
|
||||||
|
admin:
|
||||||
|
client:
|
||||||
|
enabled: true
|
||||||
|
server:
|
||||||
|
enabled: true
|
||||||
|
|
||||||
|
management:
|
||||||
|
endpoints:
|
||||||
|
enabled-by-default: true
|
||||||
|
|
||||||
springdoc:
|
springdoc:
|
||||||
api-docs:
|
api-docs:
|
||||||
@@ -40,6 +53,7 @@ springdoc:
|
|||||||
|
|
||||||
knife4j:
|
knife4j:
|
||||||
enable: false
|
enable: false
|
||||||
|
production: true
|
||||||
|
|
||||||
orion:
|
orion:
|
||||||
# 是否为演示模式
|
# 是否为演示模式
|
||||||
|
|||||||
@@ -40,13 +40,14 @@ spring:
|
|||||||
# 最大生存的时间
|
# 最大生存的时间
|
||||||
max-evictable-idle-time-millis: 900000
|
max-evictable-idle-time-millis: 900000
|
||||||
validation-query: SELECT 1
|
validation-query: SELECT 1
|
||||||
web-stat-filter:
|
# 控制台
|
||||||
enabled: true
|
|
||||||
stat-view-servlet:
|
stat-view-servlet:
|
||||||
enabled: true
|
enabled: true
|
||||||
url-pattern: /druid/*
|
url-pattern: /druid/*
|
||||||
login-username:
|
login-username:
|
||||||
login-password:
|
login-password:
|
||||||
|
web-stat-filter:
|
||||||
|
enabled: true
|
||||||
filter:
|
filter:
|
||||||
stat:
|
stat:
|
||||||
enabled: true
|
enabled: true
|
||||||
@@ -88,7 +89,7 @@ spring:
|
|||||||
misfireThreshold: 60000
|
misfireThreshold: 60000
|
||||||
clusterCheckinInterval: 5000
|
clusterCheckinInterval: 5000
|
||||||
isClustered: true
|
isClustered: true
|
||||||
#连接池
|
# 连接池
|
||||||
threadPool:
|
threadPool:
|
||||||
class: org.quartz.simpl.SimpleThreadPool
|
class: org.quartz.simpl.SimpleThreadPool
|
||||||
threadCount: 5
|
threadCount: 5
|
||||||
@@ -98,12 +99,16 @@ spring:
|
|||||||
admin:
|
admin:
|
||||||
context-path: /admin
|
context-path: /admin
|
||||||
client:
|
client:
|
||||||
|
enabled: true
|
||||||
url: http://127.0.0.1:${server.port}/${spring.boot.admin.context-path}
|
url: http://127.0.0.1:${server.port}/${spring.boot.admin.context-path}
|
||||||
instance:
|
instance:
|
||||||
service-host-type: IP
|
service-host-type: IP
|
||||||
|
server:
|
||||||
|
enabled: true
|
||||||
|
|
||||||
management:
|
management:
|
||||||
endpoints:
|
endpoints:
|
||||||
|
enabled-by-default: true
|
||||||
web:
|
web:
|
||||||
base-path: /actuator
|
base-path: /actuator
|
||||||
exposure:
|
exposure:
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package com.orion.visor.module.asset.handler.host.config.model;
|
|||||||
|
|
||||||
import com.orion.visor.framework.common.handler.data.model.GenericsDataModel;
|
import com.orion.visor.framework.common.handler.data.model.GenericsDataModel;
|
||||||
import com.orion.visor.framework.common.security.UpdatePasswordAction;
|
import com.orion.visor.framework.common.security.UpdatePasswordAction;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -24,61 +23,86 @@ import javax.validation.constraints.Size;
|
|||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@Schema(name = "HostSftpConfig", description = "主机 SSH 配置")
|
|
||||||
public class HostSshConfigModel implements GenericsDataModel, UpdatePasswordAction {
|
public class HostSshConfigModel implements GenericsDataModel, UpdatePasswordAction {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ssh 端口
|
||||||
|
*/
|
||||||
@NotNull
|
@NotNull
|
||||||
@Range(min = 1, max = 65535)
|
@Range(min = 1, max = 65535)
|
||||||
@Schema(description = "ssh 端口")
|
|
||||||
private Integer port;
|
private Integer port;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户名
|
||||||
|
*/
|
||||||
@Size(max = 128)
|
@Size(max = 128)
|
||||||
@Schema(description = "用户名")
|
|
||||||
private String username;
|
private String username;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 认证方式
|
||||||
|
*/
|
||||||
@NotBlank
|
@NotBlank
|
||||||
@Size(max = 12)
|
@Size(max = 12)
|
||||||
@Schema(description = "认证方式")
|
|
||||||
private String authType;
|
private String authType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 系统类型
|
||||||
|
*/
|
||||||
@NotBlank
|
@NotBlank
|
||||||
@Size(max = 12)
|
@Size(max = 12)
|
||||||
@Schema(description = "系统类型")
|
|
||||||
private String osType;
|
private String osType;
|
||||||
|
|
||||||
@Schema(description = "密码")
|
/**
|
||||||
|
* 密码
|
||||||
|
*/
|
||||||
private String password;
|
private String password;
|
||||||
|
|
||||||
@Schema(description = "身份id")
|
/**
|
||||||
|
* 身份id
|
||||||
|
*/
|
||||||
private Long identityId;
|
private Long identityId;
|
||||||
|
|
||||||
@Schema(description = "密钥id")
|
/**
|
||||||
|
* 密钥id
|
||||||
|
*/
|
||||||
private Long keyId;
|
private Long keyId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 连接超时时间
|
||||||
|
*/
|
||||||
@NotNull
|
@NotNull
|
||||||
@Range(min = 0, max = 100000)
|
@Range(min = 0, max = 100000)
|
||||||
@Schema(description = "连接超时时间")
|
|
||||||
private Integer connectTimeout;
|
private Integer connectTimeout;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* SSH输出编码
|
||||||
|
*/
|
||||||
@NotBlank
|
@NotBlank
|
||||||
@Size(max = 12)
|
@Size(max = 12)
|
||||||
@Schema(description = "SSH输出编码")
|
|
||||||
private String charset;
|
private String charset;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件名称编码
|
||||||
|
*/
|
||||||
@NotBlank
|
@NotBlank
|
||||||
@Size(max = 12)
|
@Size(max = 12)
|
||||||
@Schema(description = "文件名称编码")
|
|
||||||
private String fileNameCharset;
|
private String fileNameCharset;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件内容编码
|
||||||
|
*/
|
||||||
@NotBlank
|
@NotBlank
|
||||||
@Size(max = 12)
|
@Size(max = 12)
|
||||||
@Schema(description = "文件内容编码")
|
|
||||||
private String fileContentCharset;
|
private String fileContentCharset;
|
||||||
|
|
||||||
@Schema(description = "是否使用新密码 仅参数")
|
/**
|
||||||
|
* 是否使用新密码 仅参数
|
||||||
|
*/
|
||||||
private Boolean useNewPassword;
|
private Boolean useNewPassword;
|
||||||
|
|
||||||
@Schema(description = "是否已设置密码 仅返回")
|
/**
|
||||||
|
* 是否已设置密码 仅返回
|
||||||
|
*/
|
||||||
private Boolean hasPassword;
|
private Boolean hasPassword;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
package com.orion.visor.module.asset.handler.host.exec.command;
|
package com.orion.visor.module.asset.handler.host.exec.command;
|
||||||
|
|
||||||
import com.orion.visor.module.asset.define.AssetThreadPools;
|
import com.orion.visor.module.asset.define.AssetThreadPools;
|
||||||
import com.orion.visor.module.asset.handler.host.exec.command.dto.ExecCommandDTO;
|
|
||||||
import com.orion.visor.module.asset.handler.host.exec.command.handler.ExecTaskHandler;
|
import com.orion.visor.module.asset.handler.host.exec.command.handler.ExecTaskHandler;
|
||||||
|
import com.orion.visor.module.asset.handler.host.exec.command.model.ExecCommandDTO;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量执行命令执行器
|
* 批量执行命令执行器
|
||||||
|
|||||||
@@ -1,56 +0,0 @@
|
|||||||
package com.orion.visor.module.asset.handler.host.exec.command.dto;
|
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量执行启动主机对象
|
|
||||||
*
|
|
||||||
* @author Jiahang Li
|
|
||||||
* @version 1.0.0
|
|
||||||
* @since 2024/3/11 15:46
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
@Schema(name = "ExecCommandHostDTO", description = "批量执行启动主机对象")
|
|
||||||
public class ExecCommandHostDTO {
|
|
||||||
|
|
||||||
@Schema(description = "hostLogId")
|
|
||||||
private Long hostLogId;
|
|
||||||
|
|
||||||
@Schema(description = "hostId")
|
|
||||||
private Long hostId;
|
|
||||||
|
|
||||||
@Schema(description = "主机名称")
|
|
||||||
private String hostName;
|
|
||||||
|
|
||||||
@Schema(description = "主机地址")
|
|
||||||
private String hostAddress;
|
|
||||||
|
|
||||||
@Schema(description = "日志文件路径")
|
|
||||||
private String logPath;
|
|
||||||
|
|
||||||
@Schema(description = "脚本路径")
|
|
||||||
private String scriptPath;
|
|
||||||
|
|
||||||
@Schema(description = "执行命令")
|
|
||||||
private String command;
|
|
||||||
|
|
||||||
@Schema(description = "主机用户")
|
|
||||||
private String username;
|
|
||||||
|
|
||||||
@Schema(description = "命令编码")
|
|
||||||
private String charset;
|
|
||||||
|
|
||||||
@Schema(description = "文件名称编码")
|
|
||||||
private String fileNameCharset;
|
|
||||||
|
|
||||||
@Schema(description = "文件内容编码")
|
|
||||||
private String fileContentCharset;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -20,8 +20,8 @@ import com.orion.visor.framework.common.file.FileClient;
|
|||||||
import com.orion.visor.module.asset.dao.ExecHostLogDAO;
|
import com.orion.visor.module.asset.dao.ExecHostLogDAO;
|
||||||
import com.orion.visor.module.asset.entity.domain.ExecHostLogDO;
|
import com.orion.visor.module.asset.entity.domain.ExecHostLogDO;
|
||||||
import com.orion.visor.module.asset.enums.ExecHostStatusEnum;
|
import com.orion.visor.module.asset.enums.ExecHostStatusEnum;
|
||||||
import com.orion.visor.module.asset.handler.host.exec.command.dto.ExecCommandDTO;
|
import com.orion.visor.module.asset.handler.host.exec.command.model.ExecCommandDTO;
|
||||||
import com.orion.visor.module.asset.handler.host.exec.command.dto.ExecCommandHostDTO;
|
import com.orion.visor.module.asset.handler.host.exec.command.model.ExecCommandHostDTO;
|
||||||
import com.orion.visor.module.asset.handler.host.exec.log.manager.ExecLogManager;
|
import com.orion.visor.module.asset.handler.host.exec.log.manager.ExecLogManager;
|
||||||
import com.orion.visor.module.asset.service.HostTerminalService;
|
import com.orion.visor.module.asset.service.HostTerminalService;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ import com.orion.lang.utils.time.Dates;
|
|||||||
import com.orion.net.host.ssh.ExitCode;
|
import com.orion.net.host.ssh.ExitCode;
|
||||||
import com.orion.visor.framework.common.constant.Const;
|
import com.orion.visor.framework.common.constant.Const;
|
||||||
import com.orion.visor.module.asset.enums.ExecHostStatusEnum;
|
import com.orion.visor.module.asset.enums.ExecHostStatusEnum;
|
||||||
import com.orion.visor.module.asset.handler.host.exec.command.dto.ExecCommandDTO;
|
import com.orion.visor.module.asset.handler.host.exec.command.model.ExecCommandDTO;
|
||||||
import com.orion.visor.module.asset.handler.host.exec.command.dto.ExecCommandHostDTO;
|
import com.orion.visor.module.asset.handler.host.exec.command.model.ExecCommandHostDTO;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 命令执行器 ansi 日志输出
|
* 命令执行器 ansi 日志输出
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ package com.orion.visor.module.asset.handler.host.exec.command.handler;
|
|||||||
|
|
||||||
import com.orion.lang.support.timeout.TimeoutChecker;
|
import com.orion.lang.support.timeout.TimeoutChecker;
|
||||||
import com.orion.lang.support.timeout.TimeoutEndpoint;
|
import com.orion.lang.support.timeout.TimeoutEndpoint;
|
||||||
import com.orion.visor.module.asset.handler.host.exec.command.dto.ExecCommandDTO;
|
import com.orion.visor.module.asset.handler.host.exec.command.model.ExecCommandDTO;
|
||||||
import com.orion.visor.module.asset.handler.host.exec.command.dto.ExecCommandHostDTO;
|
import com.orion.visor.module.asset.handler.host.exec.command.model.ExecCommandHostDTO;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -18,9 +18,9 @@ import com.orion.visor.module.asset.define.message.ExecMessageDefine;
|
|||||||
import com.orion.visor.module.asset.entity.domain.ExecLogDO;
|
import com.orion.visor.module.asset.entity.domain.ExecLogDO;
|
||||||
import com.orion.visor.module.asset.enums.ExecHostStatusEnum;
|
import com.orion.visor.module.asset.enums.ExecHostStatusEnum;
|
||||||
import com.orion.visor.module.asset.enums.ExecStatusEnum;
|
import com.orion.visor.module.asset.enums.ExecStatusEnum;
|
||||||
import com.orion.visor.module.asset.handler.host.exec.command.dto.ExecCommandDTO;
|
|
||||||
import com.orion.visor.module.asset.handler.host.exec.command.dto.ExecCommandHostDTO;
|
|
||||||
import com.orion.visor.module.asset.handler.host.exec.command.manager.ExecTaskManager;
|
import com.orion.visor.module.asset.handler.host.exec.command.manager.ExecTaskManager;
|
||||||
|
import com.orion.visor.module.asset.handler.host.exec.command.model.ExecCommandDTO;
|
||||||
|
import com.orion.visor.module.asset.handler.host.exec.command.model.ExecCommandHostDTO;
|
||||||
import com.orion.visor.module.infra.api.SystemMessageApi;
|
import com.orion.visor.module.infra.api.SystemMessageApi;
|
||||||
import com.orion.visor.module.infra.entity.dto.message.SystemMessageDTO;
|
import com.orion.visor.module.infra.entity.dto.message.SystemMessageDTO;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package com.orion.visor.module.asset.handler.host.exec.command.dto;
|
package com.orion.visor.module.asset.handler.host.exec.command.model;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -19,31 +18,46 @@ import java.util.List;
|
|||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@Schema(name = "ExecCommandDTO", description = "批量执行启动对象")
|
|
||||||
public class ExecCommandDTO {
|
public class ExecCommandDTO {
|
||||||
|
|
||||||
@Schema(description = "logId")
|
/**
|
||||||
|
* logId
|
||||||
|
*/
|
||||||
private Long logId;
|
private Long logId;
|
||||||
|
|
||||||
@Schema(description = "用户id")
|
/**
|
||||||
|
* 用户id
|
||||||
|
*/
|
||||||
private Long userId;
|
private Long userId;
|
||||||
|
|
||||||
@Schema(description = "用户名")
|
/**
|
||||||
|
* 用户名
|
||||||
|
*/
|
||||||
private String username;
|
private String username;
|
||||||
|
|
||||||
@Schema(description = "执行描述")
|
/**
|
||||||
|
* 执行描述
|
||||||
|
*/
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
@Schema(description = "执行序列")
|
/**
|
||||||
|
* 执行序列
|
||||||
|
*/
|
||||||
private Integer execSeq;
|
private Integer execSeq;
|
||||||
|
|
||||||
@Schema(description = "超时时间")
|
/**
|
||||||
|
* 超时时间
|
||||||
|
*/
|
||||||
private Integer timeout;
|
private Integer timeout;
|
||||||
|
|
||||||
@Schema(description = "是否使用脚本执行")
|
/**
|
||||||
|
* 是否使用脚本执行
|
||||||
|
*/
|
||||||
private Boolean scriptExec;
|
private Boolean scriptExec;
|
||||||
|
|
||||||
@Schema(description = "执行主机")
|
/**
|
||||||
|
* 执行主机
|
||||||
|
*/
|
||||||
private List<ExecCommandHostDTO> hosts;
|
private List<ExecCommandHostDTO> hosts;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,76 @@
|
|||||||
|
package com.orion.visor.module.asset.handler.host.exec.command.model;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量执行启动主机对象
|
||||||
|
*
|
||||||
|
* @author Jiahang Li
|
||||||
|
* @version 1.0.0
|
||||||
|
* @since 2024/3/11 15:46
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class ExecCommandHostDTO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* hostLogId
|
||||||
|
*/
|
||||||
|
private Long hostLogId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* hostId
|
||||||
|
*/
|
||||||
|
private Long hostId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主机名称
|
||||||
|
*/
|
||||||
|
private String hostName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主机地址
|
||||||
|
*/
|
||||||
|
private String hostAddress;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 日志文件路径
|
||||||
|
*/
|
||||||
|
private String logPath;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 脚本路径
|
||||||
|
*/
|
||||||
|
private String scriptPath;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 执行命令
|
||||||
|
*/
|
||||||
|
private String command;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主机用户
|
||||||
|
*/
|
||||||
|
private String username;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 命令编码
|
||||||
|
*/
|
||||||
|
private String charset;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件名称编码
|
||||||
|
*/
|
||||||
|
private String fileNameCharset;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件内容编码
|
||||||
|
*/
|
||||||
|
private String fileContentCharset;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,5 +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.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;
|
||||||
@@ -29,6 +30,7 @@ import javax.annotation.Resource;
|
|||||||
@Component
|
@Component
|
||||||
public class ExecLogTailHandler extends AbstractWebSocketHandler {
|
public class ExecLogTailHandler extends AbstractWebSocketHandler {
|
||||||
|
|
||||||
|
@Keep
|
||||||
@Resource
|
@Resource
|
||||||
private FileClient logsFileClient;
|
private FileClient logsFileClient;
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package com.orion.visor.module.asset.handler.host.extra.model;
|
package com.orion.visor.module.asset.handler.host.extra.model;
|
||||||
|
|
||||||
import com.orion.visor.framework.common.handler.data.model.GenericsDataModel;
|
import com.orion.visor.framework.common.handler.data.model.GenericsDataModel;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -18,13 +17,16 @@ import lombok.NoArgsConstructor;
|
|||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@Schema(name = "HostLabelExtraModel", description = "主机拓展信息 - 标签模型")
|
|
||||||
public class HostLabelExtraModel implements GenericsDataModel {
|
public class HostLabelExtraModel implements GenericsDataModel {
|
||||||
|
|
||||||
@Schema(description = "别名")
|
/**
|
||||||
|
* 别名
|
||||||
|
*/
|
||||||
private String alias;
|
private String alias;
|
||||||
|
|
||||||
@Schema(description = "颜色")
|
/**
|
||||||
|
* 颜色
|
||||||
|
*/
|
||||||
private String color;
|
private String color;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package com.orion.visor.module.asset.handler.host.extra.model;
|
package com.orion.visor.module.asset.handler.host.extra.model;
|
||||||
|
|
||||||
import com.orion.visor.framework.common.handler.data.model.GenericsDataModel;
|
import com.orion.visor.framework.common.handler.data.model.GenericsDataModel;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -18,19 +17,26 @@ import lombok.NoArgsConstructor;
|
|||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@Schema(name = "HostExtraSshModel", description = "主机拓展信息 - ssh 模型")
|
|
||||||
public class HostSshExtraModel implements GenericsDataModel {
|
public class HostSshExtraModel implements GenericsDataModel {
|
||||||
|
|
||||||
@Schema(description = "认证方式")
|
/**
|
||||||
|
* 认证方式
|
||||||
|
*/
|
||||||
private String authType;
|
private String authType;
|
||||||
|
|
||||||
@Schema(description = "认证方式")
|
/**
|
||||||
|
* 认证方式
|
||||||
|
*/
|
||||||
private String username;
|
private String username;
|
||||||
|
|
||||||
@Schema(description = "主机密钥")
|
/**
|
||||||
|
* 主机密钥
|
||||||
|
*/
|
||||||
private Long keyId;
|
private Long keyId;
|
||||||
|
|
||||||
@Schema(description = "主机身份")
|
/**
|
||||||
|
* 主机身份
|
||||||
|
*/
|
||||||
private Long identityId;
|
private Long identityId;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package com.orion.visor.module.asset.handler.host.terminal.model;
|
package com.orion.visor.module.asset.handler.host.terminal.model;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
@@ -17,13 +16,16 @@ import lombok.experimental.SuperBuilder;
|
|||||||
@SuperBuilder
|
@SuperBuilder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@Schema(name = "TerminalBasePayload", description = "终端基础 payload")
|
|
||||||
public class TerminalBasePayload {
|
public class TerminalBasePayload {
|
||||||
|
|
||||||
@Schema(description = "会话id")
|
/**
|
||||||
|
* 会话id
|
||||||
|
*/
|
||||||
private String sessionId;
|
private String sessionId;
|
||||||
|
|
||||||
@Schema(description = "消息类型")
|
/**
|
||||||
|
* 消息类型
|
||||||
|
*/
|
||||||
private String type;
|
private String type;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
package com.orion.visor.module.asset.handler.host.terminal.model;
|
package com.orion.visor.module.asset.handler.host.terminal.model;
|
||||||
|
|
||||||
import com.orion.visor.framework.desensitize.core.annotation.DesensitizeObject;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -18,35 +16,51 @@ import lombok.NoArgsConstructor;
|
|||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@DesensitizeObject
|
|
||||||
@Schema(name = "TerminalConfig", description = "主机终端连接参数")
|
|
||||||
public class TerminalConfig {
|
public class TerminalConfig {
|
||||||
|
|
||||||
@Schema(description = "logId")
|
/**
|
||||||
|
* logId
|
||||||
|
*/
|
||||||
private Long logId;
|
private Long logId;
|
||||||
|
|
||||||
@Schema(description = "主机id")
|
/**
|
||||||
|
* 主机id
|
||||||
|
*/
|
||||||
private Long hostId;
|
private Long hostId;
|
||||||
|
|
||||||
@Schema(description = "主机名称")
|
/**
|
||||||
|
* 主机名称
|
||||||
|
*/
|
||||||
private String hostName;
|
private String hostName;
|
||||||
|
|
||||||
@Schema(description = "主机地址")
|
/**
|
||||||
|
* 主机地址
|
||||||
|
*/
|
||||||
private String address;
|
private String address;
|
||||||
|
|
||||||
@Schema(description = "cols")
|
/**
|
||||||
|
* cols
|
||||||
|
*/
|
||||||
private Integer cols;
|
private Integer cols;
|
||||||
|
|
||||||
@Schema(description = "rows")
|
/**
|
||||||
|
* rows
|
||||||
|
*/
|
||||||
private Integer rows;
|
private Integer rows;
|
||||||
|
|
||||||
@Schema(description = "SSH输出编码")
|
/**
|
||||||
|
* SSH输出编码
|
||||||
|
*/
|
||||||
private String charset;
|
private String charset;
|
||||||
|
|
||||||
@Schema(description = "文件名称编码")
|
/**
|
||||||
|
* 文件名称编码
|
||||||
|
*/
|
||||||
private String fileNameCharset;
|
private String fileNameCharset;
|
||||||
|
|
||||||
@Schema(description = "文件内容编码")
|
/**
|
||||||
|
* 文件内容编码
|
||||||
|
*/
|
||||||
private String fileContentCharset;
|
private String fileContentCharset;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package com.orion.visor.module.asset.handler.host.terminal.model.request;
|
package com.orion.visor.module.asset.handler.host.terminal.model.request;
|
||||||
|
|
||||||
import com.orion.visor.module.asset.handler.host.terminal.model.TerminalBasePayload;
|
import com.orion.visor.module.asset.handler.host.terminal.model.TerminalBasePayload;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
@@ -20,10 +19,11 @@ import lombok.experimental.SuperBuilder;
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@Schema(name = "SftpBaseRequest", description = "sftp 基础请求 实体对象")
|
|
||||||
public class SftpBaseRequest extends TerminalBasePayload {
|
public class SftpBaseRequest extends TerminalBasePayload {
|
||||||
|
|
||||||
@Schema(description = "path")
|
/**
|
||||||
|
* path
|
||||||
|
*/
|
||||||
private String path;
|
private String path;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package com.orion.visor.module.asset.handler.host.terminal.model.request;
|
package com.orion.visor.module.asset.handler.host.terminal.model.request;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
@@ -21,10 +20,11 @@ import lombok.experimental.SuperBuilder;
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@Schema(name = "SftpChangeModRequest", description = "sftp 修改文件权限 实体对象")
|
|
||||||
public class SftpChangeModRequest extends SftpBaseRequest {
|
public class SftpChangeModRequest extends SftpBaseRequest {
|
||||||
|
|
||||||
@Schema(description = "10进制的8进制 权限")
|
/**
|
||||||
|
* 10进制的8进制 权限
|
||||||
|
*/
|
||||||
private Integer mod;
|
private Integer mod;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package com.orion.visor.module.asset.handler.host.terminal.model.request;
|
package com.orion.visor.module.asset.handler.host.terminal.model.request;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
@@ -21,10 +20,11 @@ import lombok.experimental.SuperBuilder;
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@Schema(name = "SftpDownloadDirectoryFlatRequest", description = "sftp 下载文件夹展开文件 实体对象")
|
|
||||||
public class SftpDownloadFlatDirectoryRequest extends SftpBaseRequest {
|
public class SftpDownloadFlatDirectoryRequest extends SftpBaseRequest {
|
||||||
|
|
||||||
@Schema(description = "当前路径")
|
/**
|
||||||
|
* 当前路径
|
||||||
|
*/
|
||||||
private String currentPath;
|
private String currentPath;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package com.orion.visor.module.asset.handler.host.terminal.model.request;
|
package com.orion.visor.module.asset.handler.host.terminal.model.request;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
@@ -21,10 +20,11 @@ import lombok.experimental.SuperBuilder;
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@Schema(name = "SftpListRequest", description = "sftp 列表请求 实体对象")
|
|
||||||
public class SftpListRequest extends SftpBaseRequest {
|
public class SftpListRequest extends SftpBaseRequest {
|
||||||
|
|
||||||
@Schema(description = "是否显示隐藏文件")
|
/**
|
||||||
|
* 是否显示隐藏文件
|
||||||
|
*/
|
||||||
private Integer showHiddenFile;
|
private Integer showHiddenFile;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package com.orion.visor.module.asset.handler.host.terminal.model.request;
|
package com.orion.visor.module.asset.handler.host.terminal.model.request;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
@@ -21,10 +20,11 @@ import lombok.experimental.SuperBuilder;
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@Schema(name = "SftpMoveRequest", description = "sftp 移动文件 实体对象")
|
|
||||||
public class SftpMoveRequest extends SftpBaseRequest {
|
public class SftpMoveRequest extends SftpBaseRequest {
|
||||||
|
|
||||||
@Schema(description = "target")
|
/**
|
||||||
|
* target
|
||||||
|
*/
|
||||||
private String target;
|
private String target;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package com.orion.visor.module.asset.handler.host.terminal.model.request;
|
package com.orion.visor.module.asset.handler.host.terminal.model.request;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
@@ -21,10 +20,11 @@ import lombok.experimental.SuperBuilder;
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@Schema(name = "SftpSetContentRequest", description = "sftp 设置文件内容 实体对象")
|
|
||||||
public class SftpSetContentRequest extends SftpBaseRequest {
|
public class SftpSetContentRequest extends SftpBaseRequest {
|
||||||
|
|
||||||
@Schema(description = "content")
|
/**
|
||||||
|
* content
|
||||||
|
*/
|
||||||
private String content;
|
private String content;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package com.orion.visor.module.asset.handler.host.terminal.model.request;
|
package com.orion.visor.module.asset.handler.host.terminal.model.request;
|
||||||
|
|
||||||
import com.orion.visor.module.asset.handler.host.terminal.model.TerminalBasePayload;
|
import com.orion.visor.module.asset.handler.host.terminal.model.TerminalBasePayload;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
@@ -22,10 +21,11 @@ import lombok.experimental.SuperBuilder;
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@Schema(name = "SshInputRequest", description = "ssh 输入请求 实体对象")
|
|
||||||
public class SshInputRequest extends TerminalBasePayload {
|
public class SshInputRequest extends TerminalBasePayload {
|
||||||
|
|
||||||
@Schema(description = "command")
|
/**
|
||||||
|
* command
|
||||||
|
*/
|
||||||
private String command;
|
private String command;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package com.orion.visor.module.asset.handler.host.terminal.model.request;
|
package com.orion.visor.module.asset.handler.host.terminal.model.request;
|
||||||
|
|
||||||
import com.orion.visor.module.asset.handler.host.terminal.model.TerminalBasePayload;
|
import com.orion.visor.module.asset.handler.host.terminal.model.TerminalBasePayload;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
@@ -22,13 +21,16 @@ import lombok.experimental.SuperBuilder;
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@Schema(name = "SshResizeRequest", description = "ssh 修改大小请求 实体对象")
|
|
||||||
public class SshResizeRequest extends TerminalBasePayload {
|
public class SshResizeRequest extends TerminalBasePayload {
|
||||||
|
|
||||||
@Schema(description = "列数")
|
/**
|
||||||
|
* 列数
|
||||||
|
*/
|
||||||
private Integer cols;
|
private Integer cols;
|
||||||
|
|
||||||
@Schema(description = "行数")
|
/**
|
||||||
|
* 行数
|
||||||
|
*/
|
||||||
private Integer rows;
|
private Integer rows;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package com.orion.visor.module.asset.handler.host.terminal.model.request;
|
package com.orion.visor.module.asset.handler.host.terminal.model.request;
|
||||||
|
|
||||||
import com.orion.visor.module.asset.handler.host.terminal.model.TerminalBasePayload;
|
import com.orion.visor.module.asset.handler.host.terminal.model.TerminalBasePayload;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
@@ -22,13 +21,16 @@ import lombok.experimental.SuperBuilder;
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@Schema(name = "TerminalConnectRequest", description = "主机连接检查请求 实体对象")
|
|
||||||
public class TerminalCheckRequest extends TerminalBasePayload {
|
public class TerminalCheckRequest extends TerminalBasePayload {
|
||||||
|
|
||||||
@Schema(description = "主机id")
|
/**
|
||||||
|
* 主机id
|
||||||
|
*/
|
||||||
private Long hostId;
|
private Long hostId;
|
||||||
|
|
||||||
@Schema(description = "连接类型")
|
/**
|
||||||
|
* 连接类型
|
||||||
|
*/
|
||||||
private String connectType;
|
private String connectType;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package com.orion.visor.module.asset.handler.host.terminal.model.request;
|
package com.orion.visor.module.asset.handler.host.terminal.model.request;
|
||||||
|
|
||||||
import com.orion.visor.module.asset.handler.host.terminal.model.TerminalBasePayload;
|
import com.orion.visor.module.asset.handler.host.terminal.model.TerminalBasePayload;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
@@ -22,16 +21,21 @@ import lombok.experimental.SuperBuilder;
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@Schema(name = "TerminalConnectRequest", description = "终端连接请求 实体对象")
|
|
||||||
public class TerminalConnectRequest extends TerminalBasePayload {
|
public class TerminalConnectRequest extends TerminalBasePayload {
|
||||||
|
|
||||||
@Schema(description = "伪终端类型")
|
/**
|
||||||
|
* 伪终端类型
|
||||||
|
*/
|
||||||
private String terminalType;
|
private String terminalType;
|
||||||
|
|
||||||
@Schema(description = "列数")
|
/**
|
||||||
|
* 列数
|
||||||
|
*/
|
||||||
private Integer cols;
|
private Integer cols;
|
||||||
|
|
||||||
@Schema(description = "行数")
|
/**
|
||||||
|
* 行数
|
||||||
|
*/
|
||||||
private Integer rows;
|
private Integer rows;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package com.orion.visor.module.asset.handler.host.terminal.model.response;
|
package com.orion.visor.module.asset.handler.host.terminal.model.response;
|
||||||
|
|
||||||
import com.orion.visor.module.asset.handler.host.terminal.model.TerminalBasePayload;
|
import com.orion.visor.module.asset.handler.host.terminal.model.TerminalBasePayload;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
@@ -20,13 +19,16 @@ import lombok.experimental.SuperBuilder;
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@Schema(name = "SftpBaseResponse", description = "sftp 基础响应 实体对象")
|
|
||||||
public class SftpBaseResponse extends TerminalBasePayload {
|
public class SftpBaseResponse extends TerminalBasePayload {
|
||||||
|
|
||||||
@Schema(description = "结果")
|
/**
|
||||||
|
* 结果
|
||||||
|
*/
|
||||||
private Integer result;
|
private Integer result;
|
||||||
|
|
||||||
@Schema(description = "消息")
|
/**
|
||||||
|
* 消息
|
||||||
|
*/
|
||||||
private String msg;
|
private String msg;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package com.orion.visor.module.asset.handler.host.terminal.model.response;
|
package com.orion.visor.module.asset.handler.host.terminal.model.response;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
@@ -19,13 +18,16 @@ import lombok.experimental.SuperBuilder;
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@Schema(name = "SftpDownloadFlatDirectoryResponse", description = "sftp 下载文件夹展开文件 实体对象")
|
|
||||||
public class SftpDownloadFlatDirectoryResponse extends SftpBaseResponse {
|
public class SftpDownloadFlatDirectoryResponse extends SftpBaseResponse {
|
||||||
|
|
||||||
@Schema(description = "currentPath")
|
/**
|
||||||
|
* currentPath
|
||||||
|
*/
|
||||||
private String currentPath;
|
private String currentPath;
|
||||||
|
|
||||||
@Schema(description = "body")
|
/**
|
||||||
|
* body
|
||||||
|
*/
|
||||||
private String body;
|
private String body;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package com.orion.visor.module.asset.handler.host.terminal.model.response;
|
package com.orion.visor.module.asset.handler.host.terminal.model.response;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
@@ -19,37 +18,56 @@ import java.util.Date;
|
|||||||
@SuperBuilder
|
@SuperBuilder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@Schema(name = "SftpFileResponse", description = "sftp 文件响应 实体对象")
|
|
||||||
public class SftpFileVO {
|
public class SftpFileVO {
|
||||||
|
|
||||||
@Schema(description = "名称")
|
/**
|
||||||
|
* 名称
|
||||||
|
*/
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
@Schema(description = "绝对路径")
|
/**
|
||||||
|
* 绝对路径
|
||||||
|
*/
|
||||||
private String path;
|
private String path;
|
||||||
|
|
||||||
@Schema(description = "文件后缀")
|
/**
|
||||||
|
* 文件后缀
|
||||||
|
*/
|
||||||
private String suffix;
|
private String suffix;
|
||||||
|
|
||||||
@Schema(description = "文件大小(byte)")
|
/**
|
||||||
|
* 文件大小(byte)
|
||||||
|
*/
|
||||||
private Long size;
|
private Long size;
|
||||||
|
|
||||||
@Schema(description = "属性")
|
/**
|
||||||
|
* 属性
|
||||||
|
*/
|
||||||
private String attr;
|
private String attr;
|
||||||
|
|
||||||
@Schema(description = "是否为目录")
|
/**
|
||||||
|
* 是否为目录
|
||||||
|
*/
|
||||||
private Boolean isDir;
|
private Boolean isDir;
|
||||||
|
|
||||||
@Schema(description = "10进制表现的8进制权限")
|
/**
|
||||||
|
* 10进制表现的8进制权限
|
||||||
|
*/
|
||||||
private Integer permission;
|
private Integer permission;
|
||||||
|
|
||||||
@Schema(description = "用户id")
|
/**
|
||||||
|
* 用户id
|
||||||
|
*/
|
||||||
private Integer uid;
|
private Integer uid;
|
||||||
|
|
||||||
@Schema(description = "组id")
|
/**
|
||||||
|
* 组id
|
||||||
|
*/
|
||||||
private Integer gid;
|
private Integer gid;
|
||||||
|
|
||||||
@Schema(description = "更新时间")
|
/**
|
||||||
|
* 更新时间
|
||||||
|
*/
|
||||||
private Date modifyTime;
|
private Date modifyTime;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package com.orion.visor.module.asset.handler.host.terminal.model.response;
|
package com.orion.visor.module.asset.handler.host.terminal.model.response;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
@@ -19,13 +18,16 @@ import lombok.experimental.SuperBuilder;
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@Schema(name = "SftpGetContentResponse", description = "sftp 获取内容响应 实体对象")
|
|
||||||
public class SftpGetContentResponse extends SftpBaseResponse {
|
public class SftpGetContentResponse extends SftpBaseResponse {
|
||||||
|
|
||||||
@Schema(description = "path")
|
/**
|
||||||
|
* path
|
||||||
|
*/
|
||||||
private String path;
|
private String path;
|
||||||
|
|
||||||
@Schema(description = "content")
|
/**
|
||||||
|
* content
|
||||||
|
*/
|
||||||
private String content;
|
private String content;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package com.orion.visor.module.asset.handler.host.terminal.model.response;
|
package com.orion.visor.module.asset.handler.host.terminal.model.response;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
@@ -19,13 +18,16 @@ import lombok.experimental.SuperBuilder;
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@Schema(name = "SftpListResponse", description = "sftp 列表响应 实体对象")
|
|
||||||
public class SftpListResponse extends SftpBaseResponse {
|
public class SftpListResponse extends SftpBaseResponse {
|
||||||
|
|
||||||
@Schema(description = "path")
|
/**
|
||||||
|
* path
|
||||||
|
*/
|
||||||
private String path;
|
private String path;
|
||||||
|
|
||||||
@Schema(description = "body")
|
/**
|
||||||
|
* body
|
||||||
|
*/
|
||||||
private String body;
|
private String body;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package com.orion.visor.module.asset.handler.host.terminal.model.response;
|
package com.orion.visor.module.asset.handler.host.terminal.model.response;
|
||||||
|
|
||||||
import com.orion.visor.module.asset.handler.host.terminal.model.TerminalBasePayload;
|
import com.orion.visor.module.asset.handler.host.terminal.model.TerminalBasePayload;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
@@ -20,10 +19,11 @@ import lombok.experimental.SuperBuilder;
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@Schema(name = "SshOutputResponse", description = "ssh 输出响应 实体对象")
|
|
||||||
public class SshOutputResponse extends TerminalBasePayload {
|
public class SshOutputResponse extends TerminalBasePayload {
|
||||||
|
|
||||||
@Schema(description = "body")
|
/**
|
||||||
|
* body
|
||||||
|
*/
|
||||||
private String body;
|
private String body;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package com.orion.visor.module.asset.handler.host.terminal.model.response;
|
package com.orion.visor.module.asset.handler.host.terminal.model.response;
|
||||||
|
|
||||||
import com.orion.visor.module.asset.handler.host.terminal.model.TerminalBasePayload;
|
import com.orion.visor.module.asset.handler.host.terminal.model.TerminalBasePayload;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
@@ -20,13 +19,16 @@ import lombok.experimental.SuperBuilder;
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@Schema(name = "TerminalCheckResponse", description = "主机连接检查响应 实体对象")
|
|
||||||
public class TerminalCheckResponse extends TerminalBasePayload {
|
public class TerminalCheckResponse extends TerminalBasePayload {
|
||||||
|
|
||||||
@Schema(description = "检查结果")
|
/**
|
||||||
|
* 检查结果
|
||||||
|
*/
|
||||||
private Integer result;
|
private Integer result;
|
||||||
|
|
||||||
@Schema(description = "错误信息")
|
/**
|
||||||
|
* 错误信息
|
||||||
|
*/
|
||||||
private String msg;
|
private String msg;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package com.orion.visor.module.asset.handler.host.terminal.model.response;
|
package com.orion.visor.module.asset.handler.host.terminal.model.response;
|
||||||
|
|
||||||
import com.orion.visor.module.asset.handler.host.terminal.model.TerminalBasePayload;
|
import com.orion.visor.module.asset.handler.host.terminal.model.TerminalBasePayload;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
@@ -20,13 +19,16 @@ import lombok.experimental.SuperBuilder;
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@Schema(name = "TerminalCloseResponse", description = "主机连接关闭响应 实体对象")
|
|
||||||
public class TerminalCloseResponse extends TerminalBasePayload {
|
public class TerminalCloseResponse extends TerminalBasePayload {
|
||||||
|
|
||||||
@Schema(description = "是否为强制关闭")
|
/**
|
||||||
|
* 是否为强制关闭
|
||||||
|
*/
|
||||||
private Integer forceClose;
|
private Integer forceClose;
|
||||||
|
|
||||||
@Schema(description = "关闭信息")
|
/**
|
||||||
|
* 关闭信息
|
||||||
|
*/
|
||||||
private String msg;
|
private String msg;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package com.orion.visor.module.asset.handler.host.terminal.model.response;
|
package com.orion.visor.module.asset.handler.host.terminal.model.response;
|
||||||
|
|
||||||
import com.orion.visor.module.asset.handler.host.terminal.model.TerminalBasePayload;
|
import com.orion.visor.module.asset.handler.host.terminal.model.TerminalBasePayload;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
@@ -20,13 +19,16 @@ import lombok.experimental.SuperBuilder;
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@Schema(name = "TerminalConnectResponse", description = "终端连接响应 实体对象")
|
|
||||||
public class TerminalConnectResponse extends TerminalBasePayload {
|
public class TerminalConnectResponse extends TerminalBasePayload {
|
||||||
|
|
||||||
@Schema(description = "检查结果")
|
/**
|
||||||
|
* 检查结果
|
||||||
|
*/
|
||||||
private Integer result;
|
private Integer result;
|
||||||
|
|
||||||
@Schema(description = "错误信息")
|
/**
|
||||||
|
* 错误信息
|
||||||
|
*/
|
||||||
private String msg;
|
private String msg;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package com.orion.visor.module.asset.handler.host.transfer.model;
|
package com.orion.visor.module.asset.handler.host.transfer.model;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -17,13 +16,16 @@ import lombok.NoArgsConstructor;
|
|||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@Schema(name = "SftpFileBackupParams", description = "sftp 文件备份参数")
|
|
||||||
public class SftpFileBackupParams {
|
public class SftpFileBackupParams {
|
||||||
|
|
||||||
@Schema(description = "文件名称")
|
/**
|
||||||
|
* 文件名称
|
||||||
|
*/
|
||||||
private String fileName;
|
private String fileName;
|
||||||
|
|
||||||
@Schema(description = "时间戳")
|
/**
|
||||||
|
* 时间戳
|
||||||
|
*/
|
||||||
private Long timestamp;
|
private Long timestamp;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package com.orion.visor.module.asset.handler.host.transfer.model;
|
package com.orion.visor.module.asset.handler.host.transfer.model;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -17,16 +16,21 @@ import lombok.NoArgsConstructor;
|
|||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@Schema(name = "FileOperatorRequest", description = "文件操作请求 实体对象")
|
|
||||||
public class TransferOperatorRequest {
|
public class TransferOperatorRequest {
|
||||||
|
|
||||||
@Schema(description = "文件路径")
|
/**
|
||||||
|
* 文件路径
|
||||||
|
*/
|
||||||
private String path;
|
private String path;
|
||||||
|
|
||||||
@Schema(description = "type")
|
/**
|
||||||
|
* type
|
||||||
|
*/
|
||||||
private String type;
|
private String type;
|
||||||
|
|
||||||
@Schema(description = "主机id")
|
/**
|
||||||
|
* 主机id
|
||||||
|
*/
|
||||||
private Long hostId;
|
private Long hostId;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package com.orion.visor.module.asset.handler.host.transfer.model;
|
package com.orion.visor.module.asset.handler.host.transfer.model;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -17,28 +16,41 @@ import lombok.NoArgsConstructor;
|
|||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@Schema(name = "FileOperatorResponse", description = "文件操作响应 实体对象")
|
|
||||||
public class TransferOperatorResponse {
|
public class TransferOperatorResponse {
|
||||||
|
|
||||||
@Schema(description = "channelId")
|
/**
|
||||||
|
* channelId
|
||||||
|
*/
|
||||||
private String channelId;
|
private String channelId;
|
||||||
|
|
||||||
@Schema(description = "type")
|
/**
|
||||||
|
* type
|
||||||
|
*/
|
||||||
private String type;
|
private String type;
|
||||||
|
|
||||||
@Schema(description = "主机id")
|
/**
|
||||||
|
* 主机id
|
||||||
|
*/
|
||||||
private Long hostId;
|
private Long hostId;
|
||||||
|
|
||||||
@Schema(description = "是否成功")
|
/**
|
||||||
|
* 是否成功
|
||||||
|
*/
|
||||||
private Boolean success;
|
private Boolean success;
|
||||||
|
|
||||||
@Schema(description = "传输的大小")
|
/**
|
||||||
|
* 传输的大小
|
||||||
|
*/
|
||||||
private Integer currentSize;
|
private Integer currentSize;
|
||||||
|
|
||||||
@Schema(description = "transferToken")
|
/**
|
||||||
|
* transferToken
|
||||||
|
*/
|
||||||
private String transferToken;
|
private String transferToken;
|
||||||
|
|
||||||
@Schema(description = "消息")
|
/**
|
||||||
|
* 消息
|
||||||
|
*/
|
||||||
private String msg;
|
private String msg;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package com.orion.visor.module.asset.handler.host.upload.dto;
|
package com.orion.visor.module.asset.handler.host.upload.model;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -17,22 +16,31 @@ import lombok.NoArgsConstructor;
|
|||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@Schema(name = "FileUploadFileItemDTO", description = "文件上传文件对象")
|
|
||||||
public class FileUploadFileItemDTO {
|
public class FileUploadFileItemDTO {
|
||||||
|
|
||||||
@Schema(description = "id")
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
@Schema(description = "fileId")
|
/**
|
||||||
|
* fileId
|
||||||
|
*/
|
||||||
private String fileId;
|
private String fileId;
|
||||||
|
|
||||||
@Schema(description = "远程路径")
|
/**
|
||||||
|
* 远程路径
|
||||||
|
*/
|
||||||
private String remotePath;
|
private String remotePath;
|
||||||
|
|
||||||
@Schema(description = "当前大小")
|
/**
|
||||||
|
* 当前大小
|
||||||
|
*/
|
||||||
private Long current;
|
private Long current;
|
||||||
|
|
||||||
@Schema(description = "状态")
|
/**
|
||||||
|
* 状态
|
||||||
|
*/
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,8 +15,8 @@ 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.enums.UploadTaskFileStatusEnum;
|
import com.orion.visor.module.asset.enums.UploadTaskFileStatusEnum;
|
||||||
import com.orion.visor.module.asset.enums.UploadTaskStatusEnum;
|
import com.orion.visor.module.asset.enums.UploadTaskStatusEnum;
|
||||||
import com.orion.visor.module.asset.handler.host.upload.dto.FileUploadFileItemDTO;
|
|
||||||
import com.orion.visor.module.asset.handler.host.upload.manager.FileUploadTaskManager;
|
import com.orion.visor.module.asset.handler.host.upload.manager.FileUploadTaskManager;
|
||||||
|
import com.orion.visor.module.asset.handler.host.upload.model.FileUploadFileItemDTO;
|
||||||
import com.orion.visor.module.asset.handler.host.upload.uploader.FileUploader;
|
import com.orion.visor.module.asset.handler.host.upload.uploader.FileUploader;
|
||||||
import com.orion.visor.module.asset.handler.host.upload.uploader.IFileUploader;
|
import com.orion.visor.module.asset.handler.host.upload.uploader.IFileUploader;
|
||||||
import com.orion.visor.module.asset.service.UploadTaskService;
|
import com.orion.visor.module.asset.service.UploadTaskService;
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import com.orion.visor.module.asset.entity.domain.UploadTaskFileDO;
|
|||||||
import com.orion.visor.module.asset.entity.dto.HostTerminalConnectDTO;
|
import com.orion.visor.module.asset.entity.dto.HostTerminalConnectDTO;
|
||||||
import com.orion.visor.module.asset.enums.HostSshOsTypeEnum;
|
import com.orion.visor.module.asset.enums.HostSshOsTypeEnum;
|
||||||
import com.orion.visor.module.asset.enums.UploadTaskFileStatusEnum;
|
import com.orion.visor.module.asset.enums.UploadTaskFileStatusEnum;
|
||||||
import com.orion.visor.module.asset.handler.host.upload.dto.FileUploadFileItemDTO;
|
import com.orion.visor.module.asset.handler.host.upload.model.FileUploadFileItemDTO;
|
||||||
import com.orion.visor.module.asset.service.HostTerminalService;
|
import com.orion.visor.module.asset.service.HostTerminalService;
|
||||||
import com.orion.visor.module.asset.service.UploadTaskService;
|
import com.orion.visor.module.asset.service.UploadTaskService;
|
||||||
import com.orion.visor.module.asset.utils.SftpUtils;
|
import com.orion.visor.module.asset.utils.SftpUtils;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.orion.visor.module.asset.handler.host.upload.uploader;
|
package com.orion.visor.module.asset.handler.host.upload.uploader;
|
||||||
|
|
||||||
import com.orion.lang.able.SafeCloseable;
|
import com.orion.lang.able.SafeCloseable;
|
||||||
import com.orion.visor.module.asset.handler.host.upload.dto.FileUploadFileItemDTO;
|
import com.orion.visor.module.asset.handler.host.upload.model.FileUploadFileItemDTO;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ 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.PathConst;
|
import com.orion.visor.framework.common.constant.PathConst;
|
||||||
@@ -36,8 +37,8 @@ import com.orion.visor.module.asset.entity.vo.ExecLogVO;
|
|||||||
import com.orion.visor.module.asset.enums.*;
|
import com.orion.visor.module.asset.enums.*;
|
||||||
import com.orion.visor.module.asset.handler.host.config.model.HostSshConfigModel;
|
import com.orion.visor.module.asset.handler.host.config.model.HostSshConfigModel;
|
||||||
import com.orion.visor.module.asset.handler.host.exec.command.ExecTaskExecutors;
|
import com.orion.visor.module.asset.handler.host.exec.command.ExecTaskExecutors;
|
||||||
import com.orion.visor.module.asset.handler.host.exec.command.dto.ExecCommandDTO;
|
import com.orion.visor.module.asset.handler.host.exec.command.model.ExecCommandDTO;
|
||||||
import com.orion.visor.module.asset.handler.host.exec.command.dto.ExecCommandHostDTO;
|
import com.orion.visor.module.asset.handler.host.exec.command.model.ExecCommandHostDTO;
|
||||||
import com.orion.visor.module.asset.service.AssetAuthorizedDataService;
|
import com.orion.visor.module.asset.service.AssetAuthorizedDataService;
|
||||||
import com.orion.visor.module.asset.service.ExecCommandService;
|
import com.orion.visor.module.asset.service.ExecCommandService;
|
||||||
import com.orion.visor.module.asset.service.HostConfigService;
|
import com.orion.visor.module.asset.service.HostConfigService;
|
||||||
@@ -67,6 +68,7 @@ public class ExecCommandServiceImpl implements ExecCommandService {
|
|||||||
|
|
||||||
private static final int DESC_OMIT = 60;
|
private static final int DESC_OMIT = 60;
|
||||||
|
|
||||||
|
@Keep
|
||||||
@Resource
|
@Resource
|
||||||
private FileClient logsFileClient;
|
private FileClient logsFileClient;
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import com.orion.lang.utils.collect.Lists;
|
|||||||
import com.orion.lang.utils.io.Files1;
|
import com.orion.lang.utils.io.Files1;
|
||||||
import com.orion.lang.utils.io.Streams;
|
import com.orion.lang.utils.io.Streams;
|
||||||
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.PathConst;
|
import com.orion.visor.framework.common.constant.PathConst;
|
||||||
@@ -80,6 +81,7 @@ public class ExecLogServiceImpl implements ExecLogService {
|
|||||||
@Resource
|
@Resource
|
||||||
private HostConfigService hostConfigService;
|
private HostConfigService hostConfigService;
|
||||||
|
|
||||||
|
@Keep
|
||||||
@Resource
|
@Resource
|
||||||
private FileClient logsFileClient;
|
private FileClient logsFileClient;
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ 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.file.FileClient;
|
import com.orion.visor.framework.common.file.FileClient;
|
||||||
@@ -37,7 +38,7 @@ import com.orion.visor.module.asset.enums.HostConfigTypeEnum;
|
|||||||
import com.orion.visor.module.asset.enums.UploadTaskFileStatusEnum;
|
import com.orion.visor.module.asset.enums.UploadTaskFileStatusEnum;
|
||||||
import com.orion.visor.module.asset.enums.UploadTaskStatusEnum;
|
import com.orion.visor.module.asset.enums.UploadTaskStatusEnum;
|
||||||
import com.orion.visor.module.asset.handler.host.upload.FileUploadTasks;
|
import com.orion.visor.module.asset.handler.host.upload.FileUploadTasks;
|
||||||
import com.orion.visor.module.asset.handler.host.upload.dto.FileUploadFileItemDTO;
|
import com.orion.visor.module.asset.handler.host.upload.model.FileUploadFileItemDTO;
|
||||||
import com.orion.visor.module.asset.handler.host.upload.manager.FileUploadTaskManager;
|
import com.orion.visor.module.asset.handler.host.upload.manager.FileUploadTaskManager;
|
||||||
import com.orion.visor.module.asset.handler.host.upload.task.IFileUploadTask;
|
import com.orion.visor.module.asset.handler.host.upload.task.IFileUploadTask;
|
||||||
import com.orion.visor.module.asset.handler.host.upload.uploader.IFileUploader;
|
import com.orion.visor.module.asset.handler.host.upload.uploader.IFileUploader;
|
||||||
@@ -86,6 +87,7 @@ public class UploadTaskServiceImpl implements UploadTaskService {
|
|||||||
@Resource
|
@Resource
|
||||||
private FileUploadTaskManager fileUploadTaskManager;
|
private FileUploadTaskManager fileUploadTaskManager;
|
||||||
|
|
||||||
|
@Keep
|
||||||
@Resource
|
@Resource
|
||||||
private FileClient localFileClient;
|
private FileClient localFileClient;
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package com.orion.visor.module.asset.task;
|
|||||||
import com.orion.lang.utils.Strings;
|
import com.orion.lang.utils.Strings;
|
||||||
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.common.annotation.Keep;
|
||||||
import com.orion.visor.framework.common.file.FileClient;
|
import com.orion.visor.framework.common.file.FileClient;
|
||||||
import com.orion.visor.framework.common.utils.LockerUtils;
|
import com.orion.visor.framework.common.utils.LockerUtils;
|
||||||
import com.orion.visor.module.asset.dao.ExecHostLogDAO;
|
import com.orion.visor.module.asset.dao.ExecHostLogDAO;
|
||||||
@@ -37,6 +38,7 @@ public class ExecLogFileAutoClearTask {
|
|||||||
@Resource
|
@Resource
|
||||||
private AppExecLogConfig appExecLogConfig;
|
private AppExecLogConfig appExecLogConfig;
|
||||||
|
|
||||||
|
@Keep
|
||||||
@Resource
|
@Resource
|
||||||
private FileClient logsFileClient;
|
private FileClient logsFileClient;
|
||||||
|
|
||||||
|
|||||||
@@ -70,8 +70,8 @@ public class MineController {
|
|||||||
@IgnoreLog(IgnoreLogMode.RET)
|
@IgnoreLog(IgnoreLogMode.RET)
|
||||||
@GetMapping("/login-history")
|
@GetMapping("/login-history")
|
||||||
@Operation(summary = "查询当前用户登录日志")
|
@Operation(summary = "查询当前用户登录日志")
|
||||||
public List<LoginHistoryVO> getCurrentLoginHistory() {
|
public List<LoginHistoryVO> getCurrentLoginHistory(@RequestParam("count") Integer count) {
|
||||||
return mineService.getCurrentLoginHistory();
|
return mineService.getCurrentLoginHistory(count);
|
||||||
}
|
}
|
||||||
|
|
||||||
@IgnoreLog(IgnoreLogMode.RET)
|
@IgnoreLog(IgnoreLogMode.RET)
|
||||||
|
|||||||
@@ -182,8 +182,9 @@ public class SystemUserController {
|
|||||||
@GetMapping("/login-history")
|
@GetMapping("/login-history")
|
||||||
@Operation(summary = "查询用户登录日志")
|
@Operation(summary = "查询用户登录日志")
|
||||||
@PreAuthorize("@ss.hasPermission('infra:system-user:login-history')")
|
@PreAuthorize("@ss.hasPermission('infra:system-user:login-history')")
|
||||||
public List<LoginHistoryVO> getLoginHistory(@RequestParam("username") String username) {
|
public List<LoginHistoryVO> getLoginHistory(@RequestParam("username") String username,
|
||||||
return operatorLogService.getLoginHistory(username);
|
@RequestParam("count") Integer count) {
|
||||||
|
return operatorLogService.getLoginHistory(username, count);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ package com.orion.visor.module.infra.dao;
|
|||||||
|
|
||||||
import com.orion.visor.framework.mybatis.core.mapper.IMapper;
|
import com.orion.visor.framework.mybatis.core.mapper.IMapper;
|
||||||
import com.orion.visor.module.infra.entity.domain.SystemMessageDO;
|
import com.orion.visor.module.infra.entity.domain.SystemMessageDO;
|
||||||
import com.orion.visor.module.infra.entity.dto.SystemMessageCountDTO;
|
import com.orion.visor.module.infra.entity.po.SystemMessageCountPO;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
@@ -25,7 +25,7 @@ public interface SystemMessageDAO extends IMapper<SystemMessageDO> {
|
|||||||
* @param status status
|
* @param status status
|
||||||
* @return count
|
* @return count
|
||||||
*/
|
*/
|
||||||
List<SystemMessageCountDTO> selectSystemMessageCount(@Param("receiverId") Long receiverId,
|
List<SystemMessageCountPO> selectSystemMessageCount(@Param("receiverId") Long receiverId,
|
||||||
@Param("status") Integer status);
|
@Param("status") Integer status);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.orion.visor.module.infra.entity.dto;
|
package com.orion.visor.module.infra.entity.po;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
@@ -19,8 +19,8 @@ import java.io.Serializable;
|
|||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@Schema(name = "SystemMessageCountDTO", description = "系统消息数量对象")
|
@Schema(name = "SystemMessageCountPO", description = "系统消息数量对象")
|
||||||
public class SystemMessageCountDTO implements Serializable {
|
public class SystemMessageCountPO implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
package com.orion.visor.module.infra.handler.preference.model;
|
package com.orion.visor.module.infra.handler.preference.model;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -19,31 +18,49 @@ import lombok.NoArgsConstructor;
|
|||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class SystemPreferenceModel implements PreferenceModel {
|
public class SystemPreferenceModel implements PreferenceModel {
|
||||||
|
|
||||||
@Schema(description = "是否使用侧边菜单")
|
/**
|
||||||
|
* 是否使用侧边菜单
|
||||||
|
*/
|
||||||
private Boolean menu;
|
private Boolean menu;
|
||||||
|
|
||||||
@Schema(description = "是否使用顶部菜单")
|
/**
|
||||||
|
* 是否使用顶部菜单
|
||||||
|
*/
|
||||||
private Boolean topMenu;
|
private Boolean topMenu;
|
||||||
|
|
||||||
@Schema(description = "是否显示导航栏")
|
/**
|
||||||
|
* 是否显示导航栏
|
||||||
|
*/
|
||||||
private Boolean navbar;
|
private Boolean navbar;
|
||||||
|
|
||||||
@Schema(description = "是否显示页脚")
|
/**
|
||||||
|
* 是否显示页脚
|
||||||
|
*/
|
||||||
private Boolean footer;
|
private Boolean footer;
|
||||||
|
|
||||||
@Schema(description = "是否开启多页签")
|
/**
|
||||||
|
* 是否开启多页签
|
||||||
|
*/
|
||||||
private Boolean tabBar;
|
private Boolean tabBar;
|
||||||
|
|
||||||
@Schema(description = "是否开启色弱模式")
|
/**
|
||||||
|
* 是否开启色弱模式
|
||||||
|
*/
|
||||||
private Boolean colorWeak;
|
private Boolean colorWeak;
|
||||||
|
|
||||||
@Schema(description = "菜单宽度")
|
/**
|
||||||
|
* 菜单宽度
|
||||||
|
*/
|
||||||
private Integer menuWidth;
|
private Integer menuWidth;
|
||||||
|
|
||||||
@Schema(description = "表格默认页数")
|
/**
|
||||||
|
* 表格默认页数
|
||||||
|
*/
|
||||||
private Integer defaultTablePageSize;
|
private Integer defaultTablePageSize;
|
||||||
|
|
||||||
@Schema(description = "卡片默认页数")
|
/**
|
||||||
|
* 卡片默认页数
|
||||||
|
*/
|
||||||
private Integer defaultCardPageSize;
|
private Integer defaultCardPageSize;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package com.orion.visor.module.infra.handler.preference.model;
|
|||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.orion.lang.able.IJsonObject;
|
import com.orion.lang.able.IJsonObject;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -23,31 +22,49 @@ import java.util.List;
|
|||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class TerminalPreferenceModel implements PreferenceModel {
|
public class TerminalPreferenceModel implements PreferenceModel {
|
||||||
|
|
||||||
@Schema(description = "新建连接类型")
|
/**
|
||||||
|
* 新建连接类型
|
||||||
|
*/
|
||||||
private String newConnectionType;
|
private String newConnectionType;
|
||||||
|
|
||||||
@Schema(description = "终端主题")
|
/**
|
||||||
|
* 终端主题
|
||||||
|
*/
|
||||||
private JSONObject theme;
|
private JSONObject theme;
|
||||||
|
|
||||||
@Schema(description = "显示设置")
|
/**
|
||||||
|
* 显示设置
|
||||||
|
*/
|
||||||
private JSONObject displaySetting;
|
private JSONObject displaySetting;
|
||||||
|
|
||||||
@Schema(description = "操作栏设置")
|
/**
|
||||||
|
* 操作栏设置
|
||||||
|
*/
|
||||||
private JSONObject actionBarSetting;
|
private JSONObject actionBarSetting;
|
||||||
|
|
||||||
@Schema(description = "右键菜单设置")
|
/**
|
||||||
|
* 右键菜单设置
|
||||||
|
*/
|
||||||
private List<String> rightMenuSetting;
|
private List<String> rightMenuSetting;
|
||||||
|
|
||||||
@Schema(description = "交互设置")
|
/**
|
||||||
|
* 交互设置
|
||||||
|
*/
|
||||||
private JSONObject interactSetting;
|
private JSONObject interactSetting;
|
||||||
|
|
||||||
@Schema(description = "插件设置")
|
/**
|
||||||
|
* 插件设置
|
||||||
|
*/
|
||||||
private JSONObject pluginsSetting;
|
private JSONObject pluginsSetting;
|
||||||
|
|
||||||
@Schema(description = "会话设置")
|
/**
|
||||||
|
* 会话设置
|
||||||
|
*/
|
||||||
private JSONObject sessionSetting;
|
private JSONObject sessionSetting;
|
||||||
|
|
||||||
@Schema(description = "快捷键设置")
|
/**
|
||||||
|
* 快捷键设置
|
||||||
|
*/
|
||||||
private JSONObject shortcutSetting;
|
private JSONObject shortcutSetting;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@@ -56,28 +73,44 @@ public class TerminalPreferenceModel implements PreferenceModel {
|
|||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public static class DisplaySettingModel implements IJsonObject {
|
public static class DisplaySettingModel implements IJsonObject {
|
||||||
|
|
||||||
@Schema(description = "字体样式")
|
/**
|
||||||
|
* 字体样式
|
||||||
|
*/
|
||||||
private String fontFamily;
|
private String fontFamily;
|
||||||
|
|
||||||
@Schema(description = "字体大小")
|
/**
|
||||||
|
* 字体大小
|
||||||
|
*/
|
||||||
private Integer fontSize;
|
private Integer fontSize;
|
||||||
|
|
||||||
@Schema(description = "行高")
|
/**
|
||||||
|
* 行高
|
||||||
|
*/
|
||||||
private Double lineHeight;
|
private Double lineHeight;
|
||||||
|
|
||||||
@Schema(description = "字间距")
|
/**
|
||||||
|
* 字间距
|
||||||
|
*/
|
||||||
private Integer letterSpacing;
|
private Integer letterSpacing;
|
||||||
|
|
||||||
@Schema(description = "文本字重")
|
/**
|
||||||
|
* 文本字重
|
||||||
|
*/
|
||||||
private String fontWeight;
|
private String fontWeight;
|
||||||
|
|
||||||
@Schema(description = "加粗字重")
|
/**
|
||||||
|
* 加粗字重
|
||||||
|
*/
|
||||||
private String fontWeightBold;
|
private String fontWeightBold;
|
||||||
|
|
||||||
@Schema(description = "光标样式")
|
/**
|
||||||
|
* 光标样式
|
||||||
|
*/
|
||||||
private String cursorStyle;
|
private String cursorStyle;
|
||||||
|
|
||||||
@Schema(description = "光标闪烁")
|
/**
|
||||||
|
* 光标闪烁
|
||||||
|
*/
|
||||||
private Boolean cursorBlink;
|
private Boolean cursorBlink;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -88,34 +121,54 @@ public class TerminalPreferenceModel implements PreferenceModel {
|
|||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public static class InteractSettingModel implements IJsonObject {
|
public static class InteractSettingModel implements IJsonObject {
|
||||||
|
|
||||||
@Schema(description = "快速滚动")
|
/**
|
||||||
|
* 快速滚动
|
||||||
|
*/
|
||||||
private Boolean fastScrollModifier;
|
private Boolean fastScrollModifier;
|
||||||
|
|
||||||
@Schema(description = "点击移动光标")
|
/**
|
||||||
|
* 点击移动光标
|
||||||
|
*/
|
||||||
private Boolean altClickMovesCursor;
|
private Boolean altClickMovesCursor;
|
||||||
|
|
||||||
@Schema(description = "右键选中词条")
|
/**
|
||||||
|
* 右键选中词条
|
||||||
|
*/
|
||||||
private Boolean rightClickSelectsWord;
|
private Boolean rightClickSelectsWord;
|
||||||
|
|
||||||
@Schema(description = "选中自动复制")
|
/**
|
||||||
|
* 选中自动复制
|
||||||
|
*/
|
||||||
private Boolean selectionChangeCopy;
|
private Boolean selectionChangeCopy;
|
||||||
|
|
||||||
@Schema(description = "复制去除空格")
|
/**
|
||||||
|
* 复制去除空格
|
||||||
|
*/
|
||||||
private Boolean copyAutoTrim;
|
private Boolean copyAutoTrim;
|
||||||
|
|
||||||
@Schema(description = "粘贴去除空格")
|
/**
|
||||||
|
* 粘贴去除空格
|
||||||
|
*/
|
||||||
private Boolean pasteAutoTrim;
|
private Boolean pasteAutoTrim;
|
||||||
|
|
||||||
@Schema(description = "右键粘贴")
|
/**
|
||||||
|
* 右键粘贴
|
||||||
|
*/
|
||||||
private Boolean rightClickPaste;
|
private Boolean rightClickPaste;
|
||||||
|
|
||||||
@Schema(description = "启用右键菜单")
|
/**
|
||||||
|
* 启用右键菜单
|
||||||
|
*/
|
||||||
private Boolean enableRightClickMenu;
|
private Boolean enableRightClickMenu;
|
||||||
|
|
||||||
@Schema(description = "启用响铃")
|
/**
|
||||||
|
* 启用响铃
|
||||||
|
*/
|
||||||
private Boolean enableBell;
|
private Boolean enableBell;
|
||||||
|
|
||||||
@Schema(description = "单词分隔符")
|
/**
|
||||||
|
* 单词分隔符
|
||||||
|
*/
|
||||||
private String wordSeparator;
|
private String wordSeparator;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -126,16 +179,24 @@ public class TerminalPreferenceModel implements PreferenceModel {
|
|||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public static class PluginsSettingModel implements IJsonObject {
|
public static class PluginsSettingModel implements IJsonObject {
|
||||||
|
|
||||||
@Schema(description = "超链接插件")
|
/**
|
||||||
|
* 超链接插件
|
||||||
|
*/
|
||||||
private Boolean enableWeblinkPlugin;
|
private Boolean enableWeblinkPlugin;
|
||||||
|
|
||||||
@Schema(description = "WebGL 渲染插件")
|
/**
|
||||||
|
* WebGL 渲染插件
|
||||||
|
*/
|
||||||
private Boolean enableWebglPlugin;
|
private Boolean enableWebglPlugin;
|
||||||
|
|
||||||
@Schema(description = "unicode11 插件")
|
/**
|
||||||
|
* unicode11 插件
|
||||||
|
*/
|
||||||
private Boolean enableUnicodePlugin;
|
private Boolean enableUnicodePlugin;
|
||||||
|
|
||||||
@Schema(description = "图片渲染插件")
|
/**
|
||||||
|
* 图片渲染插件
|
||||||
|
*/
|
||||||
private Boolean enableImagePlugin;
|
private Boolean enableImagePlugin;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -146,10 +207,14 @@ public class TerminalPreferenceModel implements PreferenceModel {
|
|||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public static class SessionSettingModel implements IJsonObject {
|
public static class SessionSettingModel implements IJsonObject {
|
||||||
|
|
||||||
@Schema(description = "伪终端类型")
|
/**
|
||||||
|
* 伪终端类型
|
||||||
|
*/
|
||||||
private String terminalEmulationType;
|
private String terminalEmulationType;
|
||||||
|
|
||||||
@Schema(description = "保存在缓冲区的行数")
|
/**
|
||||||
|
* 保存在缓冲区的行数
|
||||||
|
*/
|
||||||
private Integer scrollBackLine;
|
private Integer scrollBackLine;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -160,10 +225,14 @@ public class TerminalPreferenceModel implements PreferenceModel {
|
|||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public static class ShortcutSettingModel implements IJsonObject {
|
public static class ShortcutSettingModel implements IJsonObject {
|
||||||
|
|
||||||
@Schema(description = "是否启用")
|
/**
|
||||||
|
* 是否启用
|
||||||
|
*/
|
||||||
private Boolean enabled;
|
private Boolean enabled;
|
||||||
|
|
||||||
@Schema(description = "快捷键定义")
|
/**
|
||||||
|
* 快捷键定义
|
||||||
|
*/
|
||||||
private List<ShortcutKeysModel> keys;
|
private List<ShortcutKeysModel> keys;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -174,55 +243,89 @@ public class TerminalPreferenceModel implements PreferenceModel {
|
|||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public static class ActionBarSettingModel implements IJsonObject {
|
public static class ActionBarSettingModel implements IJsonObject {
|
||||||
|
|
||||||
@Schema(description = "命令输入框")
|
/**
|
||||||
|
* 命令输入框
|
||||||
|
*/
|
||||||
private Boolean commandInput;
|
private Boolean commandInput;
|
||||||
|
|
||||||
@Schema(description = "连接状态")
|
/**
|
||||||
|
* 连接状态
|
||||||
|
*/
|
||||||
private Boolean connectStatus;
|
private Boolean connectStatus;
|
||||||
|
|
||||||
@Schema(description = "去顶部")
|
/**
|
||||||
|
* 去顶部
|
||||||
|
*/
|
||||||
private Boolean toTop;
|
private Boolean toTop;
|
||||||
|
|
||||||
@Schema(description = "去底部")
|
/**
|
||||||
|
* 去底部
|
||||||
|
*/
|
||||||
private Boolean toBottom;
|
private Boolean toBottom;
|
||||||
|
|
||||||
@Schema(description = "全选")
|
/**
|
||||||
|
* 全选
|
||||||
|
*/
|
||||||
private Boolean selectAll;
|
private Boolean selectAll;
|
||||||
|
|
||||||
@Schema(description = "搜索")
|
/**
|
||||||
|
* 搜索
|
||||||
|
*/
|
||||||
private Boolean search;
|
private Boolean search;
|
||||||
|
|
||||||
@Schema(description = "复制")
|
/**
|
||||||
|
* 复制
|
||||||
|
*/
|
||||||
private Boolean copy;
|
private Boolean copy;
|
||||||
|
|
||||||
@Schema(description = "粘贴")
|
/**
|
||||||
|
* 粘贴
|
||||||
|
*/
|
||||||
private Boolean paste;
|
private Boolean paste;
|
||||||
|
|
||||||
@Schema(description = "中断")
|
/**
|
||||||
|
* 中断
|
||||||
|
*/
|
||||||
private Boolean interrupt;
|
private Boolean interrupt;
|
||||||
|
|
||||||
@Schema(description = "回车")
|
/**
|
||||||
|
* 回车
|
||||||
|
*/
|
||||||
private Boolean enter;
|
private Boolean enter;
|
||||||
|
|
||||||
@Schema(description = "增大字号")
|
/**
|
||||||
|
* 增大字号
|
||||||
|
*/
|
||||||
private Boolean fontSizePlus;
|
private Boolean fontSizePlus;
|
||||||
|
|
||||||
@Schema(description = "减小字号")
|
/**
|
||||||
|
* 减小字号
|
||||||
|
*/
|
||||||
private Boolean fontSizeSubtract;
|
private Boolean fontSizeSubtract;
|
||||||
|
|
||||||
@Schema(description = "命令编辑器")
|
/**
|
||||||
|
* 命令编辑器
|
||||||
|
*/
|
||||||
private Boolean commandEditor;
|
private Boolean commandEditor;
|
||||||
|
|
||||||
@Schema(description = "打开 SFTP")
|
/**
|
||||||
|
* 打开 SFTP
|
||||||
|
*/
|
||||||
private Boolean openSftp;
|
private Boolean openSftp;
|
||||||
|
|
||||||
@Schema(description = "清空")
|
/**
|
||||||
|
* 清空
|
||||||
|
*/
|
||||||
private Boolean clear;
|
private Boolean clear;
|
||||||
|
|
||||||
@Schema(description = "断开连接")
|
/**
|
||||||
|
* 断开连接
|
||||||
|
*/
|
||||||
private Boolean disconnect;
|
private Boolean disconnect;
|
||||||
|
|
||||||
@Schema(description = "关闭终端")
|
/**
|
||||||
|
* 关闭终端
|
||||||
|
*/
|
||||||
private Boolean closeTab;
|
private Boolean closeTab;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -233,22 +336,34 @@ public class TerminalPreferenceModel implements PreferenceModel {
|
|||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public static class ShortcutKeysModel implements IJsonObject {
|
public static class ShortcutKeysModel implements IJsonObject {
|
||||||
|
|
||||||
@Schema(description = "快捷键操作")
|
/**
|
||||||
|
* 快捷键操作
|
||||||
|
*/
|
||||||
private String item;
|
private String item;
|
||||||
|
|
||||||
@Schema(description = "ctrl 按键")
|
/**
|
||||||
|
* ctrl 按键
|
||||||
|
*/
|
||||||
private Boolean ctrlKey;
|
private Boolean ctrlKey;
|
||||||
|
|
||||||
@Schema(description = "shift 按键")
|
/**
|
||||||
|
* shift 按键
|
||||||
|
*/
|
||||||
private Boolean shiftKey;
|
private Boolean shiftKey;
|
||||||
|
|
||||||
@Schema(description = "alt 按键")
|
/**
|
||||||
|
* alt 按键
|
||||||
|
*/
|
||||||
private Boolean altKey;
|
private Boolean altKey;
|
||||||
|
|
||||||
@Schema(description = "实际按键")
|
/**
|
||||||
|
* 实际按键
|
||||||
|
*/
|
||||||
private String code;
|
private String code;
|
||||||
|
|
||||||
@Schema(description = "是否启用")
|
/**
|
||||||
|
* 是否启用
|
||||||
|
*/
|
||||||
private Boolean enabled;
|
private Boolean enabled;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import org.springframework.stereotype.Component;
|
|||||||
* @version 1.0.0
|
* @version 1.0.0
|
||||||
* @since 2023/10/8 13:48
|
* @since 2023/10/8 13:48
|
||||||
*/
|
*/
|
||||||
@Component
|
@Component("systemPreferenceStrategy")
|
||||||
public class SystemPreferenceStrategy implements IPreferenceStrategy<SystemPreferenceModel> {
|
public class SystemPreferenceStrategy implements IPreferenceStrategy<SystemPreferenceModel> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import org.springframework.stereotype.Component;
|
|||||||
* @version 1.0.0
|
* @version 1.0.0
|
||||||
* @since 2023/12/8 14:46
|
* @since 2023/12/8 14:46
|
||||||
*/
|
*/
|
||||||
@Component
|
@Component("terminalPreferenceStrategy")
|
||||||
public class TerminalPreferenceStrategy implements IPreferenceStrategy<TerminalPreferenceModel> {
|
public class TerminalPreferenceStrategy implements IPreferenceStrategy<TerminalPreferenceModel> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.orion.visor.module.infra.handler.upload;
|
|||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
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;
|
||||||
@@ -34,6 +35,7 @@ public class FileUploadMessageDispatcher extends AbstractWebSocketHandler {
|
|||||||
|
|
||||||
private final ConcurrentHashMap<String, IFileUploadHandler> handlers = new ConcurrentHashMap<>();
|
private final ConcurrentHashMap<String, IFileUploadHandler> handlers = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
|
@Keep
|
||||||
@Resource
|
@Resource
|
||||||
private FileClient localFileClient;
|
private FileClient localFileClient;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package com.orion.visor.module.infra.handler.upload.model;
|
package com.orion.visor.module.infra.handler.upload.model;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -17,13 +16,16 @@ import lombok.NoArgsConstructor;
|
|||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@Schema(name = "FileUploadRequest", description = "文件上传请求 实体对象")
|
|
||||||
public class FileUploadRequest {
|
public class FileUploadRequest {
|
||||||
|
|
||||||
@Schema(description = "type")
|
/**
|
||||||
|
* type
|
||||||
|
*/
|
||||||
private String type;
|
private String type;
|
||||||
|
|
||||||
@Schema(description = "fileId")
|
/**
|
||||||
|
* fileId
|
||||||
|
*/
|
||||||
private String fileId;
|
private String fileId;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package com.orion.visor.module.infra.handler.upload.model;
|
package com.orion.visor.module.infra.handler.upload.model;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -17,16 +16,21 @@ import lombok.NoArgsConstructor;
|
|||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@Schema(name = "FileUploadResponse", description = "文件上传响应 实体对象")
|
|
||||||
public class FileUploadResponse {
|
public class FileUploadResponse {
|
||||||
|
|
||||||
@Schema(description = "type")
|
/**
|
||||||
|
* type
|
||||||
|
*/
|
||||||
private String type;
|
private String type;
|
||||||
|
|
||||||
@Schema(description = "fileId")
|
/**
|
||||||
|
* fileId
|
||||||
|
*/
|
||||||
private String fileId;
|
private String fileId;
|
||||||
|
|
||||||
@Schema(description = "路径")
|
/**
|
||||||
|
* 路径
|
||||||
|
*/
|
||||||
private String path;
|
private String path;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,9 +46,10 @@ public interface MineService {
|
|||||||
/**
|
/**
|
||||||
* 获取当前用户登录日志
|
* 获取当前用户登录日志
|
||||||
*
|
*
|
||||||
|
* @param count count
|
||||||
* @return 登录日志
|
* @return 登录日志
|
||||||
*/
|
*/
|
||||||
List<LoginHistoryVO> getCurrentLoginHistory();
|
List<LoginHistoryVO> getCurrentLoginHistory(Integer count);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取当前用户会话列表
|
* 获取当前用户会话列表
|
||||||
|
|||||||
@@ -60,8 +60,9 @@ public interface OperatorLogService {
|
|||||||
* 查询用户登录日志
|
* 查询用户登录日志
|
||||||
*
|
*
|
||||||
* @param username username
|
* @param username username
|
||||||
|
* @param count count
|
||||||
* @return rows
|
* @return rows
|
||||||
*/
|
*/
|
||||||
List<LoginHistoryVO> getLoginHistory(String username);
|
List<LoginHistoryVO> getLoginHistory(String username, Integer count);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import com.orion.lang.utils.Exceptions;
|
|||||||
import com.orion.lang.utils.collect.Lists;
|
import com.orion.lang.utils.collect.Lists;
|
||||||
import com.orion.lang.utils.crypto.Signatures;
|
import com.orion.lang.utils.crypto.Signatures;
|
||||||
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.security.LoginUser;
|
import com.orion.visor.framework.common.security.LoginUser;
|
||||||
@@ -65,6 +66,7 @@ public class AuthenticationServiceImpl implements AuthenticationService {
|
|||||||
@Resource
|
@Resource
|
||||||
private PermissionService permissionService;
|
private PermissionService permissionService;
|
||||||
|
|
||||||
|
@Keep
|
||||||
@Resource
|
@Resource
|
||||||
private RedisTemplate<String, String> redisTemplate;
|
private RedisTemplate<String, String> redisTemplate;
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ 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.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;
|
||||||
@@ -37,6 +38,7 @@ public class FavoriteServiceImpl implements FavoriteService {
|
|||||||
@Resource
|
@Resource
|
||||||
private FavoriteDAO favoriteDAO;
|
private FavoriteDAO favoriteDAO;
|
||||||
|
|
||||||
|
@Keep
|
||||||
@Resource
|
@Resource
|
||||||
private RedisTemplate<String, String> redisTemplate;
|
private RedisTemplate<String, String> redisTemplate;
|
||||||
|
|
||||||
|
|||||||
@@ -77,9 +77,9 @@ public class MineServiceImpl implements MineService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<LoginHistoryVO> getCurrentLoginHistory() {
|
public List<LoginHistoryVO> getCurrentLoginHistory(Integer count) {
|
||||||
String username = SecurityUtils.getLoginUsername();
|
String username = SecurityUtils.getLoginUsername();
|
||||||
return operatorLogService.getLoginHistory(username);
|
return operatorLogService.getLoginHistory(username, count);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -4,9 +4,10 @@ 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.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.Valid;
|
||||||
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.framework.biz.operator.log.core.utils.OperatorLogs;
|
import com.orion.visor.framework.biz.operator.log.core.utils.OperatorLogs;
|
||||||
import com.orion.visor.framework.common.constant.Const;
|
import com.orion.visor.framework.common.constant.ErrorMessage;
|
||||||
import com.orion.visor.module.infra.convert.OperatorLogConvert;
|
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;
|
||||||
@@ -81,7 +82,8 @@ public class OperatorLogServiceImpl implements OperatorLogService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<LoginHistoryVO> getLoginHistory(String username) {
|
public List<LoginHistoryVO> getLoginHistory(String username, Integer count) {
|
||||||
|
Valid.gt(count, 0, ErrorMessage.PARAM_ERROR);
|
||||||
// 条件
|
// 条件
|
||||||
OperatorLogQueryRequest request = new OperatorLogQueryRequest();
|
OperatorLogQueryRequest request = new OperatorLogQueryRequest();
|
||||||
request.setUsername(username);
|
request.setUsername(username);
|
||||||
@@ -89,7 +91,7 @@ public class OperatorLogServiceImpl implements OperatorLogService {
|
|||||||
LambdaQueryWrapper<OperatorLogDO> wrapper = this.buildQueryWrapper(request);
|
LambdaQueryWrapper<OperatorLogDO> wrapper = this.buildQueryWrapper(request);
|
||||||
// 查询
|
// 查询
|
||||||
return operatorLogDAO.of(wrapper)
|
return operatorLogDAO.of(wrapper)
|
||||||
.limit(Const.LOGIN_HISTORY_COUNT)
|
.limit(count)
|
||||||
.list(OperatorLogConvert.MAPPER::toLoginHistory);
|
.list(OperatorLogConvert.MAPPER::toLoginHistory);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import com.orion.visor.module.infra.dao.SystemMessageDAO;
|
|||||||
import com.orion.visor.module.infra.dao.SystemUserDAO;
|
import com.orion.visor.module.infra.dao.SystemUserDAO;
|
||||||
import com.orion.visor.module.infra.entity.domain.SystemMessageDO;
|
import com.orion.visor.module.infra.entity.domain.SystemMessageDO;
|
||||||
import com.orion.visor.module.infra.entity.domain.SystemUserDO;
|
import com.orion.visor.module.infra.entity.domain.SystemUserDO;
|
||||||
import com.orion.visor.module.infra.entity.dto.SystemMessageCountDTO;
|
import com.orion.visor.module.infra.entity.po.SystemMessageCountPO;
|
||||||
import com.orion.visor.module.infra.entity.request.message.SystemMessageCreateRequest;
|
import com.orion.visor.module.infra.entity.request.message.SystemMessageCreateRequest;
|
||||||
import com.orion.visor.module.infra.entity.request.message.SystemMessageQueryRequest;
|
import com.orion.visor.module.infra.entity.request.message.SystemMessageQueryRequest;
|
||||||
import com.orion.visor.module.infra.entity.vo.SystemMessageVO;
|
import com.orion.visor.module.infra.entity.vo.SystemMessageVO;
|
||||||
@@ -85,11 +85,11 @@ public class SystemMessageServiceImpl implements SystemMessageService {
|
|||||||
Long userId = SecurityUtils.getLoginUserId();
|
Long userId = SecurityUtils.getLoginUserId();
|
||||||
Integer status = queryUnread ? MessageStatusEnum.UNREAD.getStatus() : null;
|
Integer status = queryUnread ? MessageStatusEnum.UNREAD.getStatus() : null;
|
||||||
// 查询数量
|
// 查询数量
|
||||||
List<SystemMessageCountDTO> countList = systemMessageDAO.selectSystemMessageCount(userId, status);
|
List<SystemMessageCountPO> countList = systemMessageDAO.selectSystemMessageCount(userId, status);
|
||||||
// 返回
|
// 返回
|
||||||
return countList.stream()
|
return countList.stream()
|
||||||
.collect(Collectors.toMap(SystemMessageCountDTO::getClassify,
|
.collect(Collectors.toMap(SystemMessageCountPO::getClassify,
|
||||||
SystemMessageCountDTO::getCount,
|
SystemMessageCountPO::getCount,
|
||||||
Functions.right()));
|
Functions.right()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ 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.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;
|
||||||
@@ -38,6 +39,7 @@ public class TagRelServiceImpl implements TagRelService {
|
|||||||
@Resource
|
@Resource
|
||||||
private TagRelDAO tagRelDAO;
|
private TagRelDAO tagRelDAO;
|
||||||
|
|
||||||
|
@Keep
|
||||||
@Resource
|
@Resource
|
||||||
private RedisTemplate<String, String> redisTemplate;
|
private RedisTemplate<String, String> redisTemplate;
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
<result column="deleted" property="deleted"/>
|
<result column="deleted" property="deleted"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<resultMap id="CountResultMap" type="com.orion.visor.module.infra.entity.dto.SystemMessageCountDTO">
|
<resultMap id="CountResultMap" type="com.orion.visor.module.infra.entity.po.SystemMessageCountPO">
|
||||||
<result column="classify" property="classify"/>
|
<result column="classify" property="classify"/>
|
||||||
<result column="count" property="count"/>
|
<result column="count" property="count"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
VITE_API_BASE_URL= 'http://127.0.0.1:9200/orion-visor/api'
|
VITE_API_BASE_URL= 'http://127.0.0.1:9200/orion-visor/api'
|
||||||
VITE_WS_BASE_URL= 'ws://127.0.0.1:9200/orion-visor/keep-alive'
|
VITE_WS_BASE_URL= 'ws://127.0.0.1:9200/orion-visor/keep-alive'
|
||||||
VITE_APP_VERSION= '2.0.5'
|
VITE_APP_VERSION= '2.0.6'
|
||||||
|
VITE_APP_RELEASE= 'Community'
|
||||||
VITE_SFTP_PREVIEW_MB= 2
|
VITE_SFTP_PREVIEW_MB= 2
|
||||||
VITE_DEMO_MODE= false
|
VITE_DEMO_MODE= false
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
VITE_API_BASE_URL= '/orion-visor/api'
|
VITE_API_BASE_URL= '/orion-visor/api'
|
||||||
VITE_WS_BASE_URL= '/orion-visor/keep-alive'
|
VITE_WS_BASE_URL= '/orion-visor/keep-alive'
|
||||||
VITE_APP_VERSION= '2.0.5'
|
VITE_APP_VERSION= '2.0.6'
|
||||||
|
VITE_APP_RELEASE= 'Community'
|
||||||
VITE_SFTP_PREVIEW_MB= 2
|
VITE_SFTP_PREVIEW_MB= 2
|
||||||
VITE_DEMO_MODE= false
|
VITE_DEMO_MODE= false
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "orion-visor-ui",
|
"name": "orion-visor-ui",
|
||||||
"description": "Orion Visor UI",
|
"description": "Orion Visor UI",
|
||||||
"version": "2.0.5",
|
"version": "2.0.6",
|
||||||
"private": true,
|
"private": true,
|
||||||
"author": "Jiahang Li",
|
"author": "Jiahang Li",
|
||||||
"license": "Apache 2.0",
|
"license": "Apache 2.0",
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ export function deleteHostSftpLog(idList: Array<number>) {
|
|||||||
/**
|
/**
|
||||||
* 下载文件
|
* 下载文件
|
||||||
*/
|
*/
|
||||||
export function downloadWithTransferToken(channelId: string, transferToken: string) {
|
export function getDownloadTransferUrl(channelId: string, transferToken: string) {
|
||||||
window.open(`${httpBaseUrl}/asset/host-sftp/download?channelId=${channelId}&transferToken=${transferToken}`, 'newWindow');
|
return `${httpBaseUrl}/asset/host-sftp/download?channelId=${channelId}&transferToken=${transferToken}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -35,8 +35,8 @@ export function updateCurrentUser(request: UserUpdateRequest) {
|
|||||||
/**
|
/**
|
||||||
* 查询当前用户登录日志
|
* 查询当前用户登录日志
|
||||||
*/
|
*/
|
||||||
export function getCurrentLoginHistory() {
|
export function getCurrentLoginHistory(count: number) {
|
||||||
return axios.get<LoginHistoryQueryResponse[]>('/infra/mine/login-history');
|
return axios.get<LoginHistoryQueryResponse[]>('/infra/mine/login-history', { params: { count } });
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -192,6 +192,6 @@ export function offlineUserSession(request: UserSessionOfflineRequest) {
|
|||||||
/**
|
/**
|
||||||
* 查询登录日志
|
* 查询登录日志
|
||||||
*/
|
*/
|
||||||
export function getLoginHistory(username: string) {
|
export function getLoginHistory(username: string, count: number) {
|
||||||
return axios.get<LoginHistoryQueryResponse[]>('/infra/system-user/login-history', { params: { username } });
|
return axios.get<LoginHistoryQueryResponse[]>('/infra/system-user/login-history', { params: { username, count } });
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<a-link target="_blank" href="https://gitee.com/lijiahangmax/orion-visor">gitee</a-link>
|
<a-link target="_blank" href="https://gitee.com/lijiahangmax/orion-visor">gitee</a-link>
|
||||||
<a-link target="_blank" href="https://lijiahangmax.github.io/open-orion/orion-visor">文档</a-link>
|
<a-link target="_blank" href="https://lijiahangmax.github.io/open-orion/orion-visor">文档</a-link>
|
||||||
<a-link target="_blank" href="https://github.com/lijiahangmax/orion-visor/blob/main/LICENSE">License</a-link>
|
<a-link target="_blank" href="https://github.com/lijiahangmax/orion-visor/blob/main/LICENSE">License</a-link>
|
||||||
<a-link target="_blank" :href="`https://github.com/lijiahangmax/orion-visor/releases/tag/v${version}`">v{{ version }} Community</a-link>
|
<a-link target="_blank" :href="`https://github.com/lijiahangmax/orion-visor/releases/tag/v${version}`">v{{ version }} {{ release }}</a-link>
|
||||||
</a-space>
|
</a-space>
|
||||||
<span class="copyright">
|
<span class="copyright">
|
||||||
Copyright<icon-copyright /> 2023 - {{ new Date().getFullYear() }} Li Jiahang, All rights reserved.
|
Copyright<icon-copyright /> 2023 - {{ new Date().getFullYear() }} Li Jiahang, All rights reserved.
|
||||||
@@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
const version = import.meta.env.VITE_APP_VERSION;
|
const version = import.meta.env.VITE_APP_VERSION;
|
||||||
|
const release = import.meta.env.VITE_APP_RELEASE;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
|
|||||||
1
orion-visor-ui/src/env.d.ts
vendored
1
orion-visor-ui/src/env.d.ts
vendored
@@ -19,6 +19,7 @@ interface ImportMetaEnv {
|
|||||||
readonly VITE_API_BASE_URL: string;
|
readonly VITE_API_BASE_URL: string;
|
||||||
readonly VITE_WS_BASE_URL: string;
|
readonly VITE_WS_BASE_URL: string;
|
||||||
readonly VITE_APP_VERSION: string;
|
readonly VITE_APP_VERSION: string;
|
||||||
|
readonly VITE_APP_RELEASE: string;
|
||||||
readonly VITE_SFTP_PREVIEW_MB: string;
|
readonly VITE_SFTP_PREVIEW_MB: string;
|
||||||
readonly VITE_DEMO_MODE: string;
|
readonly VITE_DEMO_MODE: string;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -84,6 +84,27 @@ export function getParentPath(path: string) {
|
|||||||
return parent;
|
return parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 打开下载文件
|
||||||
|
*/
|
||||||
|
export function openDownloadFile(url: string) {
|
||||||
|
try {
|
||||||
|
// 创建隐藏的可下载链接
|
||||||
|
let element = document.createElement('a');
|
||||||
|
element.setAttribute('href', url);
|
||||||
|
element.setAttribute('download', '');
|
||||||
|
element.style.display = 'none';
|
||||||
|
// 将其附加到文档中
|
||||||
|
document.body.appendChild(element);
|
||||||
|
// 点击该下载链接
|
||||||
|
element.click();
|
||||||
|
// 移除已下载的链接
|
||||||
|
document.body.removeChild(element);
|
||||||
|
} catch (e) {
|
||||||
|
window.open(url, 'newWindow');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 下载文件
|
* 下载文件
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
// 执行
|
// 历史数量
|
||||||
export const historyCount = 20;
|
export const historyCount = 15;
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
import type { ISftpTransferManager, ISftpTransferUploader, SftpTransferItem } from '../types/terminal.type';
|
import type { ISftpTransferManager, ISftpTransferUploader, SftpTransferItem } from '../types/terminal.type';
|
||||||
import { ISftpTransferDownloader, SftpFile, TransferOperatorResponse } from '../types/terminal.type';
|
import { ISftpTransferDownloader, SftpFile, TransferOperatorResponse } from '../types/terminal.type';
|
||||||
import { TransferReceiverType, TransferStatus, TransferType } from '../types/terminal.const';
|
import { sessionCloseMsg, TransferReceiverType, TransferStatus, TransferType } from '../types/terminal.const';
|
||||||
import { Message } from '@arco-design/web-vue';
|
import { Message } from '@arco-design/web-vue';
|
||||||
import { getTerminalAccessToken, openHostTransferChannel } from '@/api/asset/host-terminal';
|
import { getTerminalAccessToken, openHostTransferChannel } from '@/api/asset/host-terminal';
|
||||||
import { nextId } from '@/utils';
|
import { nextId } from '@/utils';
|
||||||
import { downloadWithTransferToken } from '@/api/asset/host-sftp';
|
import { getDownloadTransferUrl } from '@/api/asset/host-sftp';
|
||||||
import SftpTransferUploader from './sftp-transfer-uploader';
|
import SftpTransferUploader from './sftp-transfer-uploader';
|
||||||
import SftpTransferDownloader from './sftp-transfer-downloader';
|
import SftpTransferDownloader from './sftp-transfer-downloader';
|
||||||
|
import { openDownloadFile } from '@/utils/file';
|
||||||
|
|
||||||
// sftp 传输管理器实现
|
// sftp 传输管理器实现
|
||||||
export default class SftpTransferManager implements ISftpTransferManager {
|
export default class SftpTransferManager implements ISftpTransferManager {
|
||||||
@@ -257,7 +258,10 @@ export default class SftpTransferManager implements ISftpTransferManager {
|
|||||||
|
|
||||||
// 接收开始下载响应
|
// 接收开始下载响应
|
||||||
private resolveDownloadStart(data: TransferOperatorResponse) {
|
private resolveDownloadStart(data: TransferOperatorResponse) {
|
||||||
downloadWithTransferToken(data.channelId as string, data.transferToken as string);
|
// 获取下载 url
|
||||||
|
const url = getDownloadTransferUrl(data.channelId as string, data.transferToken as string);
|
||||||
|
// 打开
|
||||||
|
openDownloadFile(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 接收下载进度响应
|
// 接收下载进度响应
|
||||||
@@ -287,6 +291,14 @@ export default class SftpTransferManager implements ISftpTransferManager {
|
|||||||
this.run = false;
|
this.run = false;
|
||||||
// 关闭传输进度
|
// 关闭传输进度
|
||||||
clearInterval(this.progressIntervalId);
|
clearInterval(this.progressIntervalId);
|
||||||
|
// 进行中和等待中的文件改为失败
|
||||||
|
this.transferList.forEach(s => {
|
||||||
|
if (s.status === TransferStatus.WAITING ||
|
||||||
|
s.status === TransferStatus.TRANSFERRING) {
|
||||||
|
s.status = TransferStatus.ERROR;
|
||||||
|
s.errorMessage = sessionCloseMsg;
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import type { InputPayload, ITerminalChannel, ITerminalOutputProcessor, ITerminalSessionManager, OutputPayload, Protocol, } from '../types/terminal.type';
|
import type { InputPayload, ITerminalChannel, ITerminalOutputProcessor, ITerminalSessionManager, Protocol, } from '../types/terminal.type';
|
||||||
import { OutputProtocol } from '../types/terminal.protocol';
|
import { format, OutputProtocol, parse } from '../types/terminal.protocol';
|
||||||
|
import { sessionCloseMsg } from '../types/terminal.const';
|
||||||
import { getTerminalAccessToken, openHostTerminalChannel } from '@/api/asset/host-terminal';
|
import { getTerminalAccessToken, openHostTerminalChannel } from '@/api/asset/host-terminal';
|
||||||
import { Message } from '@arco-design/web-vue';
|
import { Message } from '@arco-design/web-vue';
|
||||||
import TerminalOutputProcessor from './terminal-output-processor';
|
import TerminalOutputProcessor from './terminal-output-processor';
|
||||||
@@ -9,9 +10,12 @@ export default class TerminalChannel implements ITerminalChannel {
|
|||||||
|
|
||||||
private client?: WebSocket;
|
private client?: WebSocket;
|
||||||
|
|
||||||
|
private readonly sessionManager: ITerminalSessionManager;
|
||||||
|
|
||||||
private readonly processor: ITerminalOutputProcessor;
|
private readonly processor: ITerminalOutputProcessor;
|
||||||
|
|
||||||
constructor(sessionManager: ITerminalSessionManager) {
|
constructor(sessionManager: ITerminalSessionManager) {
|
||||||
|
this.sessionManager = sessionManager;
|
||||||
this.processor = new TerminalOutputProcessor(sessionManager, this);
|
this.processor = new TerminalOutputProcessor(sessionManager, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -29,6 +33,8 @@ export default class TerminalChannel implements ITerminalChannel {
|
|||||||
}
|
}
|
||||||
this.client.onclose = event => {
|
this.client.onclose = event => {
|
||||||
console.warn('terminal close', event);
|
console.warn('terminal close', event);
|
||||||
|
// 关闭回调
|
||||||
|
this.closeCallback();
|
||||||
};
|
};
|
||||||
this.client.onmessage = this.handlerMessage.bind(this);
|
this.client.onmessage = this.handlerMessage.bind(this);
|
||||||
}
|
}
|
||||||
@@ -66,6 +72,25 @@ export default class TerminalChannel implements ITerminalChannel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 关闭回调
|
||||||
|
private closeCallback(): void {
|
||||||
|
// 关闭时将手动触发 close 消息, 有可能是其他原因关闭的, 没有接收到 close 消息, 导致已断开是终端还是显示已连接
|
||||||
|
Object.values(this.sessionManager.sessions).forEach(s => {
|
||||||
|
if (!s?.connected) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// close 消息
|
||||||
|
const data = format(OutputProtocol.CLOSE, {
|
||||||
|
type: OutputProtocol.CLOSE.type,
|
||||||
|
sessionId: s.sessionId,
|
||||||
|
forceClose: 0,
|
||||||
|
msg: sessionCloseMsg,
|
||||||
|
});
|
||||||
|
// 触发 close 消息
|
||||||
|
this.handlerMessage({ data } as MessageEvent);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// 关闭
|
// 关闭
|
||||||
close(): void {
|
close(): void {
|
||||||
// 关闭 client
|
// 关闭 client
|
||||||
@@ -78,55 +103,3 @@ export default class TerminalChannel implements ITerminalChannel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 分隔符
|
|
||||||
export const SEPARATOR = '|';
|
|
||||||
|
|
||||||
// 解析参数
|
|
||||||
export const parse = (payload: string) => {
|
|
||||||
const protocols = Object.values(OutputProtocol);
|
|
||||||
const useProtocol = protocols.find(p => payload.startsWith(p.type + SEPARATOR) || p.type === payload);
|
|
||||||
if (!useProtocol) {
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
const template = useProtocol.template;
|
|
||||||
const res = {} as OutputPayload;
|
|
||||||
let curr = 0;
|
|
||||||
let len = payload.length;
|
|
||||||
for (let i = 0, pl = template.length; i < pl; i++) {
|
|
||||||
if (i == pl - 1) {
|
|
||||||
// 最后一次
|
|
||||||
res[template[i]] = payload.substring(curr, len);
|
|
||||||
} else {
|
|
||||||
// 非最后一次
|
|
||||||
let tmp = '';
|
|
||||||
for (; curr < len; curr++) {
|
|
||||||
const c = payload.charAt(curr);
|
|
||||||
if (c == SEPARATOR) {
|
|
||||||
res[template[i]] = tmp;
|
|
||||||
curr++;
|
|
||||||
break;
|
|
||||||
} else {
|
|
||||||
tmp += c;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return res;
|
|
||||||
};
|
|
||||||
|
|
||||||
// 格式化参数
|
|
||||||
export const format = (protocol: Protocol, payload: InputPayload) => {
|
|
||||||
payload.type = protocol.type;
|
|
||||||
return protocol.template
|
|
||||||
.map(i => getPayloadValueString(payload[i]))
|
|
||||||
.join(SEPARATOR);
|
|
||||||
};
|
|
||||||
|
|
||||||
// 获取默认值
|
|
||||||
export const getPayloadValueString = (value: unknown): any => {
|
|
||||||
if (value === undefined || value === null) {
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
return value;
|
|
||||||
};
|
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ export default class TerminalOutputProcessor implements ITerminalOutputProcessor
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 处理关闭消息
|
// 处理关闭消息
|
||||||
processClose({ sessionId, msg, forceClose }: OutputPayload): void {
|
processClose({ sessionId, forceClose, msg }: OutputPayload): void {
|
||||||
const session = this.sessionManager.getSession(sessionId);
|
const session = this.sessionManager.getSession(sessionId);
|
||||||
// 无需处理 (直接关闭 tab)
|
// 无需处理 (直接关闭 tab)
|
||||||
if (!session) {
|
if (!session) {
|
||||||
|
|||||||
@@ -19,17 +19,17 @@ import SftpSession from './sftp-session';
|
|||||||
// 终端会话管理器实现
|
// 终端会话管理器实现
|
||||||
export default class TerminalSessionManager implements ITerminalSessionManager {
|
export default class TerminalSessionManager implements ITerminalSessionManager {
|
||||||
|
|
||||||
private readonly channel: ITerminalChannel;
|
public sessions: Record<string, ITerminalSession>;
|
||||||
|
|
||||||
private sessions: Record<string, ITerminalSession>;
|
private readonly channel: ITerminalChannel;
|
||||||
|
|
||||||
private keepAliveTaskId?: any;
|
private keepAliveTaskId?: any;
|
||||||
|
|
||||||
private readonly dispatchResizeFn: () => {};
|
private readonly dispatchResizeFn: () => {};
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
this.channel = new TerminalChannel(this);
|
|
||||||
this.sessions = {};
|
this.sessions = {};
|
||||||
|
this.channel = new TerminalChannel(this);
|
||||||
this.dispatchResizeFn = useDebounceFn(this.dispatchResize).bind(this);
|
this.dispatchResizeFn = useDebounceFn(this.dispatchResize).bind(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -352,6 +352,9 @@ export const TransferReceiverType = {
|
|||||||
DOWNLOAD_ERROR: 'downloadError',
|
DOWNLOAD_ERROR: 'downloadError',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 会话关闭信息
|
||||||
|
export const sessionCloseMsg = 'session closed...';
|
||||||
|
|
||||||
// 打开 settingModal key
|
// 打开 settingModal key
|
||||||
export const openSettingModalKey = Symbol();
|
export const openSettingModalKey = Symbol();
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,8 @@
|
|||||||
|
import type { InputPayload, OutputPayload, Protocol } from './terminal.type';
|
||||||
|
|
||||||
|
// 分隔符
|
||||||
|
export const SEPARATOR = '|';
|
||||||
|
|
||||||
// 输入协议
|
// 输入协议
|
||||||
export const InputProtocol = {
|
export const InputProtocol = {
|
||||||
// 主机连接检查
|
// 主机连接检查
|
||||||
@@ -164,3 +169,52 @@ export const OutputProtocol = {
|
|||||||
processMethod: 'processSftpSetContent'
|
processMethod: 'processSftpSetContent'
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 解析参数
|
||||||
|
export const parse = (payload: string) => {
|
||||||
|
const protocols = Object.values(OutputProtocol);
|
||||||
|
const useProtocol = protocols.find(p => payload.startsWith(p.type + SEPARATOR) || p.type === payload);
|
||||||
|
if (!useProtocol) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
const template = useProtocol.template;
|
||||||
|
const res = {} as OutputPayload;
|
||||||
|
let curr = 0;
|
||||||
|
let len = payload.length;
|
||||||
|
for (let i = 0, pl = template.length; i < pl; i++) {
|
||||||
|
if (i == pl - 1) {
|
||||||
|
// 最后一次
|
||||||
|
res[template[i]] = payload.substring(curr, len);
|
||||||
|
} else {
|
||||||
|
// 非最后一次
|
||||||
|
let tmp = '';
|
||||||
|
for (; curr < len; curr++) {
|
||||||
|
const c = payload.charAt(curr);
|
||||||
|
if (c == SEPARATOR) {
|
||||||
|
res[template[i]] = tmp;
|
||||||
|
curr++;
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
|
tmp += c;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
};
|
||||||
|
|
||||||
|
// 格式化参数
|
||||||
|
export const format = (protocol: Protocol, payload: InputPayload | OutputPayload) => {
|
||||||
|
payload.type = protocol.type;
|
||||||
|
return protocol.template
|
||||||
|
.map(i => getPayloadValueString(payload[i]))
|
||||||
|
.join(SEPARATOR);
|
||||||
|
};
|
||||||
|
|
||||||
|
// 获取默认值
|
||||||
|
export const getPayloadValueString = (value: unknown): any => {
|
||||||
|
if (value === undefined || value === null) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
return value;
|
||||||
|
};
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user