Compare commits
21 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b207c5d253 | ||
|
|
5335a8d008 | ||
|
|
1e74659f15 | ||
|
|
58a1a7abd4 | ||
|
|
6c125a1c0d | ||
|
|
263436405c | ||
|
|
2296ca46a4 | ||
|
|
ffcb3baf44 | ||
|
|
501755231a | ||
|
|
f4ddeb3e6c | ||
|
|
40afc03203 | ||
|
|
7c479b1720 | ||
|
|
6c6f69ae24 | ||
|
|
d1cb056adf | ||
|
|
14dc8e0407 | ||
|
|
528cfc90f2 | ||
|
|
327bb72659 | ||
|
|
c6b248ab6f | ||
|
|
0ece84bdf1 | ||
|
|
61fa7a6e32 | ||
|
|
21e7d29077 |
@@ -6,6 +6,8 @@ SPRING_PROFILES_ACTIVE=prod
|
|||||||
DEMO_MODE=false
|
DEMO_MODE=false
|
||||||
|
|
||||||
API_CORS=true
|
API_CORS=true
|
||||||
|
API_HOST=0.0.0.0
|
||||||
|
# API_URL=http://127.0.0.1:9200/orion-visor/api
|
||||||
API_IP_HEADERS=X-Forwarded-For,X-Real-IP
|
API_IP_HEADERS=X-Forwarded-For,X-Real-IP
|
||||||
API_EXPOSE_TOKEN=pmqeHOyZaumHm0Wt
|
API_EXPOSE_TOKEN=pmqeHOyZaumHm0Wt
|
||||||
SECRET_KEY=uQeacXV8b3isvKLK
|
SECRET_KEY=uQeacXV8b3isvKLK
|
||||||
|
|||||||
2
.github/ISSUE_TEMPLATE/bug_report.yaml
vendored
2
.github/ISSUE_TEMPLATE/bug_report.yaml
vendored
@@ -17,6 +17,8 @@ body:
|
|||||||
required: true
|
required: true
|
||||||
- label: 我已搜索 [issue](https://github.com/dromara/orion-visor/issues) 并没有找到相关问题
|
- label: 我已搜索 [issue](https://github.com/dromara/orion-visor/issues) 并没有找到相关问题
|
||||||
required: true
|
required: true
|
||||||
|
- label: 我已 star 了此项目, 否则可能会被自动关闭
|
||||||
|
required: true
|
||||||
- type: input
|
- type: input
|
||||||
id: version
|
id: version
|
||||||
attributes:
|
attributes:
|
||||||
|
|||||||
@@ -38,8 +38,8 @@
|
|||||||
</a>
|
</a>
|
||||||
<a target="_blank"
|
<a target="_blank"
|
||||||
style="text-decoration: none !important;"
|
style="text-decoration: none !important;"
|
||||||
href="https://gitcode.com/dromara/orion-visor">
|
href="https://atomgit.com/dromara/orion-visor">
|
||||||
<img src="https://gitcode.com/dromara/orion-visor/star/badge.svg" alt="star"/>
|
<img src="https://atomgit.com/dromara/orion-visor/star/2025top.svg" alt="star" />
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
@@ -60,7 +60,7 @@
|
|||||||
* 🔗 演示地址: [https://dv.orionsec.cn/](https://dv.orionsec.cn/)
|
* 🔗 演示地址: [https://dv.orionsec.cn/](https://dv.orionsec.cn/)
|
||||||
* 🔏 演示账号: admin/admin
|
* 🔏 演示账号: admin/admin
|
||||||
* ⭐ 体验后可以点一下 `star`
|
* ⭐ 体验后可以点一下 `star`
|
||||||
这对我很重要! [github](https://github.com/dromara/orion-visor) [gitee](https://gitee.com/dromara/orion-visor) [gitcode](https://gitcode.com/dromara/orion-visor)
|
这对我很重要! [github](https://github.com/dromara/orion-visor) [gitee](https://gitee.com/dromara/orion-visor) [atomgit](https://atomgit.com/dromara/orion-visor)
|
||||||
* 🌈 如果本项目对你有帮助请帮忙推广一下 让更多的人知道此项目!
|
* 🌈 如果本项目对你有帮助请帮忙推广一下 让更多的人知道此项目!
|
||||||
* 🎭 演示环境部分功能不可用, 完整功能请本地部署!
|
* 🎭 演示环境部分功能不可用, 完整功能请本地部署!
|
||||||
|
|
||||||
@@ -171,6 +171,6 @@ QQ群: 755242157
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
## GitCode 最有影响力的开源项目 G-Star
|
## AtomGit 最有影响力的开源项目 G-Star
|
||||||
|
|
||||||

|

|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
version: '3.3'
|
# latest = 2.5.6
|
||||||
|
|
||||||
# latest = 2.5.5
|
|
||||||
|
|
||||||
# 支持以下源
|
# 支持以下源
|
||||||
# lijiahangmax/*
|
# lijiahangmax/*
|
||||||
@@ -50,6 +48,10 @@ services:
|
|||||||
SECRET_KEY: ${SECRET_KEY:-uQeacXV8b3isvKLK}
|
SECRET_KEY: ${SECRET_KEY:-uQeacXV8b3isvKLK}
|
||||||
API_EXPOSE_TOKEN: ${API_EXPOSE_TOKEN:-pmqeHOyZaumHm0Wt}
|
API_EXPOSE_TOKEN: ${API_EXPOSE_TOKEN:-pmqeHOyZaumHm0Wt}
|
||||||
API_IP_HEADERS: ${API_IP_HEADERS:-X-Forwarded-For,X-Real-IP}
|
API_IP_HEADERS: ${API_IP_HEADERS:-X-Forwarded-For,X-Real-IP}
|
||||||
|
# 这里需要改为具体的服务地址 (宿主机ip)
|
||||||
|
API_HOST: ${API_HOST:-0.0.0.0}
|
||||||
|
# 若 API_HOST 不满足, 可以修改这里 http://<ip>:<port>/orion-visor/api
|
||||||
|
API_URL: ${API_URL:-}
|
||||||
API_CORS: ${API_CORS:-true}
|
API_CORS: ${API_CORS:-true}
|
||||||
DEMO_MODE: ${DEMO_MODE:-false}
|
DEMO_MODE: ${DEMO_MODE:-false}
|
||||||
volumes:
|
volumes:
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ set -e
|
|||||||
source ./project-build.sh "$@"
|
source ./project-build.sh "$@"
|
||||||
|
|
||||||
# 版本号
|
# 版本号
|
||||||
version=2.5.5
|
version=2.5.6
|
||||||
# 是否推送镜像
|
# 是否推送镜像
|
||||||
push_image=false
|
push_image=false
|
||||||
# 是否构建 latest
|
# 是否构建 latest
|
||||||
@@ -140,7 +140,7 @@ function modify_dockerfiles() {
|
|||||||
if [ -f "$file" ]; then
|
if [ -f "$file" ]; then
|
||||||
echo "备份并修改: $file"
|
echo "备份并修改: $file"
|
||||||
cp "$file" "$file$backup_suffix"
|
cp "$file" "$file$backup_suffix"
|
||||||
sed -i 's/--platform=\TARGETPLATFORM//g' "$file"
|
sed -i "s/--platform=\$TARGETPLATFORM//g" "$file"
|
||||||
else
|
else
|
||||||
echo "文件不存在 -> $file"
|
echo "文件不存在 -> $file"
|
||||||
fi
|
fi
|
||||||
@@ -189,7 +189,7 @@ function push_image_to_registry() {
|
|||||||
# 推送版本
|
# 推送版本
|
||||||
docker push "${namespace}/${image_name}:${version}"
|
docker push "${namespace}/${image_name}:${version}"
|
||||||
# 推送 latest
|
# 推送 latest
|
||||||
if [ "latest_image" = true ]; then
|
if [ "$latest_image" = true ]; then
|
||||||
docker push "${namespace}/${image_name}:latest"
|
docker push "${namespace}/${image_name}:latest"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ set -e
|
|||||||
# DockerContext: orion-visor
|
# DockerContext: orion-visor
|
||||||
|
|
||||||
# 版本号
|
# 版本号
|
||||||
version=2.5.5
|
version=2.5.6
|
||||||
# 是否构建 service
|
# 是否构建 service
|
||||||
export build_service=false
|
export build_service=false
|
||||||
# 是否构建 ui
|
# 是否构建 ui
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ public interface AppConst extends OrionConst {
|
|||||||
/**
|
/**
|
||||||
* 同 ${orion.version} 迭代时候需要手动更改
|
* 同 ${orion.version} 迭代时候需要手动更改
|
||||||
*/
|
*/
|
||||||
String VERSION = "2.5.5";
|
String VERSION = "2.5.6";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 同 ${spring.application.name}
|
* 同 ${spring.application.name}
|
||||||
|
|||||||
@@ -55,4 +55,6 @@ public interface Const extends cn.orionsec.kit.lang.constant.Const, FieldConst,
|
|||||||
|
|
||||||
int BATCH_COUNT = 500;
|
int BATCH_COUNT = 500;
|
||||||
|
|
||||||
|
String IP_0000 = "0.0.0.0";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -210,6 +210,10 @@ public interface ErrorMessage {
|
|||||||
|
|
||||||
String PLEASE_SELECT_SUFFIX_FILE = "请选择 {} 类型的文件";
|
String PLEASE_SELECT_SUFFIX_FILE = "请选择 {} 类型的文件";
|
||||||
|
|
||||||
|
String SPEC_FORMAT_INCORRECT = "规格格式不正确";
|
||||||
|
|
||||||
|
String INFLUXDB_UNSUPPORTED = "InfluxDB 服务未开启";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否为业务异常
|
* 是否为业务异常
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
<url>https://github.com/dromara/orion-visor</url>
|
<url>https://github.com/dromara/orion-visor</url>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<revision>2.5.5</revision>
|
<revision>2.5.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>
|
||||||
|
|||||||
@@ -30,7 +30,9 @@ import com.influxdb.client.write.Point;
|
|||||||
import com.influxdb.query.FluxRecord;
|
import com.influxdb.query.FluxRecord;
|
||||||
import com.influxdb.query.FluxTable;
|
import com.influxdb.query.FluxTable;
|
||||||
import org.dromara.visor.common.constant.Const;
|
import org.dromara.visor.common.constant.Const;
|
||||||
|
import org.dromara.visor.common.constant.ErrorMessage;
|
||||||
import org.dromara.visor.common.entity.chart.TimeChartSeries;
|
import org.dromara.visor.common.entity.chart.TimeChartSeries;
|
||||||
|
import org.dromara.visor.common.utils.Assert;
|
||||||
import org.dromara.visor.framework.influxdb.core.query.FluxQueryBuilder;
|
import org.dromara.visor.framework.influxdb.core.query.FluxQueryBuilder;
|
||||||
|
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
@@ -66,6 +68,7 @@ public class InfluxdbUtils {
|
|||||||
* @param points points
|
* @param points points
|
||||||
*/
|
*/
|
||||||
public static void writePoints(List<Point> points) {
|
public static void writePoints(List<Point> points) {
|
||||||
|
Assert.notNull(client, ErrorMessage.INFLUXDB_UNSUPPORTED);
|
||||||
try (WriteApi api = client.makeWriteApi()) {
|
try (WriteApi api = client.makeWriteApi()) {
|
||||||
// 写入指标
|
// 写入指标
|
||||||
api.writePoints(points);
|
api.writePoints(points);
|
||||||
@@ -79,6 +82,7 @@ public class InfluxdbUtils {
|
|||||||
* @return points
|
* @return points
|
||||||
*/
|
*/
|
||||||
public static List<FluxTable> queryTable(String query) {
|
public static List<FluxTable> queryTable(String query) {
|
||||||
|
Assert.notNull(client, ErrorMessage.INFLUXDB_UNSUPPORTED);
|
||||||
return client.getQueryApi().query(query);
|
return client.getQueryApi().query(query);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ import org.dromara.visor.common.constant.ErrorMessage;
|
|||||||
import org.dromara.visor.common.utils.Assert;
|
import org.dromara.visor.common.utils.Assert;
|
||||||
#if($meta.enableCache)
|
#if($meta.enableCache)
|
||||||
import org.dromara.visor.framework.redis.core.utils.RedisMaps;
|
import org.dromara.visor.framework.redis.core.utils.RedisMaps;
|
||||||
|
import org.dromara.visor.framework.redis.core.utils.RedisUtils;
|
||||||
import org.dromara.visor.framework.redis.core.utils.barrier.CacheBarriers;
|
import org.dromara.visor.framework.redis.core.utils.barrier.CacheBarriers;
|
||||||
#end
|
#end
|
||||||
#foreach($pkg in ${customModuleFilePackages})
|
#foreach($pkg in ${customModuleFilePackages})
|
||||||
@@ -76,7 +77,7 @@ public class ${table.serviceImplName} implements ${table.serviceName} {
|
|||||||
log.info("${type}Service-create${type} id: {}, effect: {}", id, effect);
|
log.info("${type}Service-create${type} id: {}, effect: {}", id, effect);
|
||||||
#if($meta.enableCache)
|
#if($meta.enableCache)
|
||||||
// 删除缓存
|
// 删除缓存
|
||||||
RedisMaps.delete(${type}CacheKeyDefine.${typeConst});
|
RedisUtils.delete(${type}CacheKeyDefine.${typeConst});
|
||||||
#end
|
#end
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
@@ -98,7 +99,7 @@ public class ${table.serviceImplName} implements ${table.serviceName} {
|
|||||||
log.info("${type}Service-update${type}ById effect: {}", effect);
|
log.info("${type}Service-update${type}ById effect: {}", effect);
|
||||||
#if($meta.enableCache)
|
#if($meta.enableCache)
|
||||||
// 删除缓存
|
// 删除缓存
|
||||||
RedisMaps.delete(${type}CacheKeyDefine.${typeConst});
|
RedisUtils.delete(${type}CacheKeyDefine.${typeConst});
|
||||||
#end
|
#end
|
||||||
return effect;
|
return effect;
|
||||||
}
|
}
|
||||||
@@ -116,7 +117,7 @@ public class ${table.serviceImplName} implements ${table.serviceName} {
|
|||||||
log.info("${type}Service.update${type} effect: {}", effect);
|
log.info("${type}Service.update${type} effect: {}", effect);
|
||||||
#if($meta.enableCache)
|
#if($meta.enableCache)
|
||||||
// 删除缓存
|
// 删除缓存
|
||||||
RedisMaps.delete(${type}CacheKeyDefine.${typeConst});
|
RedisUtils.delete(${type}CacheKeyDefine.${typeConst});
|
||||||
#end
|
#end
|
||||||
return effect;
|
return effect;
|
||||||
}
|
}
|
||||||
@@ -237,7 +238,7 @@ public class ${table.serviceImplName} implements ${table.serviceName} {
|
|||||||
log.info("${type}Service.delete${type} effect: {}", effect);
|
log.info("${type}Service.delete${type} effect: {}", effect);
|
||||||
#if($meta.enableCache)
|
#if($meta.enableCache)
|
||||||
// 删除缓存
|
// 删除缓存
|
||||||
RedisMaps.delete(${type}CacheKeyDefine.${typeConst});
|
RedisUtils.delete(${type}CacheKeyDefine.${typeConst});
|
||||||
#end
|
#end
|
||||||
return effect;
|
return effect;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -169,7 +169,6 @@
|
|||||||
Message.success('删除成功');
|
Message.success('删除成功');
|
||||||
// 重新加载
|
// 重新加载
|
||||||
reload();
|
reload();
|
||||||
} catch (e) {
|
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
@@ -200,7 +199,6 @@
|
|||||||
pagination.total = data.total;
|
pagination.total = data.total;
|
||||||
pagination.current = request.page;
|
pagination.current = request.page;
|
||||||
pagination.pageSize = request.limit;
|
pagination.pageSize = request.limit;
|
||||||
} catch (e) {
|
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -135,8 +135,6 @@
|
|||||||
}
|
}
|
||||||
handleClose();
|
handleClose();
|
||||||
return true;
|
return true;
|
||||||
} catch (e) {
|
|
||||||
return false;
|
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -139,8 +139,6 @@
|
|||||||
}
|
}
|
||||||
handleClose();
|
handleClose();
|
||||||
return true;
|
return true;
|
||||||
} catch (e) {
|
|
||||||
return false;
|
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -202,7 +202,6 @@
|
|||||||
selectedKeys.value = [];
|
selectedKeys.value = [];
|
||||||
// 重新加载
|
// 重新加载
|
||||||
reload();
|
reload();
|
||||||
} catch (e) {
|
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
@@ -220,7 +219,6 @@
|
|||||||
Message.success('删除成功');
|
Message.success('删除成功');
|
||||||
// 重新加载
|
// 重新加载
|
||||||
reload();
|
reload();
|
||||||
} catch (e) {
|
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
@@ -246,7 +244,6 @@
|
|||||||
#if($vue.enableRowSelection)
|
#if($vue.enableRowSelection)
|
||||||
selectedKeys.value = [];
|
selectedKeys.value = [];
|
||||||
#end
|
#end
|
||||||
} catch (e) {
|
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ import org.dromara.visor.common.constant.AutoConfigureOrderConst;
|
|||||||
import org.dromara.visor.common.constant.FilterOrderConst;
|
import org.dromara.visor.common.constant.FilterOrderConst;
|
||||||
import org.dromara.visor.common.web.WebFilterCreator;
|
import org.dromara.visor.common.web.WebFilterCreator;
|
||||||
import org.dromara.visor.framework.web.configuration.config.ExposeApiConfig;
|
import org.dromara.visor.framework.web.configuration.config.ExposeApiConfig;
|
||||||
|
import org.dromara.visor.framework.web.configuration.config.OrionApiConfig;
|
||||||
import org.dromara.visor.framework.web.core.aspect.DemoDisableApiAspect;
|
import org.dromara.visor.framework.web.core.aspect.DemoDisableApiAspect;
|
||||||
import org.dromara.visor.framework.web.core.aspect.ExposeApiAspect;
|
import org.dromara.visor.framework.web.core.aspect.ExposeApiAspect;
|
||||||
import org.dromara.visor.framework.web.core.filter.TraceIdFilter;
|
import org.dromara.visor.framework.web.core.filter.TraceIdFilter;
|
||||||
@@ -71,7 +72,7 @@ import java.util.List;
|
|||||||
@DependsOn({"executorContext"})
|
@DependsOn({"executorContext"})
|
||||||
@AutoConfiguration
|
@AutoConfiguration
|
||||||
@AutoConfigureOrder(AutoConfigureOrderConst.FRAMEWORK_WEB)
|
@AutoConfigureOrder(AutoConfigureOrderConst.FRAMEWORK_WEB)
|
||||||
@EnableConfigurationProperties(ExposeApiConfig.class)
|
@EnableConfigurationProperties({ExposeApiConfig.class, OrionApiConfig.class})
|
||||||
public class OrionWebAutoConfiguration implements WebMvcConfigurer {
|
public class OrionWebAutoConfiguration implements WebMvcConfigurer {
|
||||||
|
|
||||||
@Value("${orion.prefix}")
|
@Value("${orion.prefix}")
|
||||||
|
|||||||
@@ -36,6 +36,11 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
|
|||||||
@ConfigurationProperties("orion.api.expose")
|
@ConfigurationProperties("orion.api.expose")
|
||||||
public class ExposeApiConfig {
|
public class ExposeApiConfig {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 对外服务地址
|
||||||
|
*/
|
||||||
|
private String host;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 对外服务请求头
|
* 对外服务请求头
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -0,0 +1,83 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||||
|
*
|
||||||
|
* https://visor.dromara.org
|
||||||
|
* https://visor.dromara.org.cn
|
||||||
|
* https://visor.orionsec.cn
|
||||||
|
*
|
||||||
|
* Members:
|
||||||
|
* Jiahang Li - ljh1553488six@139.com - author
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.dromara.visor.framework.web.configuration.config;
|
||||||
|
|
||||||
|
import cn.orionsec.kit.lang.utils.Strings;
|
||||||
|
import cn.orionsec.kit.lang.utils.net.IPs;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.dromara.visor.common.constant.Const;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* api 配置属性
|
||||||
|
*
|
||||||
|
* @author Jiahang Li
|
||||||
|
* @version 1.0.0
|
||||||
|
* @since 2025/12/8 14:00
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ConfigurationProperties("orion.api")
|
||||||
|
public class OrionApiConfig {
|
||||||
|
|
||||||
|
private static final String URL_TEMPLATE = "http://{}:{}{}";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公共 api 前缀
|
||||||
|
*/
|
||||||
|
private String prefix;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务端主机地址
|
||||||
|
*/
|
||||||
|
private String host;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务端口
|
||||||
|
*/
|
||||||
|
@Value("${server.port}")
|
||||||
|
private Integer port;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务端 url
|
||||||
|
*/
|
||||||
|
private String url;
|
||||||
|
|
||||||
|
public String getHost() {
|
||||||
|
if (Const.IP_0000.equalsIgnoreCase(host)) {
|
||||||
|
// 本机
|
||||||
|
return IPs.IP;
|
||||||
|
} else {
|
||||||
|
return host;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUrl() {
|
||||||
|
if (!Strings.isBlank(url)) {
|
||||||
|
return url;
|
||||||
|
}
|
||||||
|
// 构建
|
||||||
|
return Strings.format(URL_TEMPLATE, this.getHost(), port, prefix);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -33,6 +33,16 @@
|
|||||||
"type": "java.lang.Boolean",
|
"type": "java.lang.Boolean",
|
||||||
"description": "是否开启 cors 过滤器."
|
"description": "是否开启 cors 过滤器."
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "orion.api.host",
|
||||||
|
"type": "java.lang.String",
|
||||||
|
"description": "服务端主机地址."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "orion.api.url",
|
||||||
|
"type": "java.lang.String",
|
||||||
|
"description": "服务端接口地址."
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "orion.api.ip-headers",
|
"name": "orion.api.ip-headers",
|
||||||
"type": "java.lang.String",
|
"type": "java.lang.String",
|
||||||
|
|||||||
@@ -74,6 +74,10 @@ orion:
|
|||||||
api:
|
api:
|
||||||
# 是否允许跨域
|
# 是否允许跨域
|
||||||
cors: ${API_CORS:true}
|
cors: ${API_CORS:true}
|
||||||
|
# 服务端主机地址
|
||||||
|
host: ${API_HOST:0.0.0.0}
|
||||||
|
# 服务端接口地址 默认自动生成
|
||||||
|
url: ${API_URL:}
|
||||||
# 获取 IP 的请求头
|
# 获取 IP 的请求头
|
||||||
ip-headers: ${API_IP_HEADERS:X-Forwarded-For,X-Real-IP}
|
ip-headers: ${API_IP_HEADERS:X-Forwarded-For,X-Real-IP}
|
||||||
# 对外服务
|
# 对外服务
|
||||||
|
|||||||
@@ -175,6 +175,10 @@ orion:
|
|||||||
prefix: ${orion.prefix}/api
|
prefix: ${orion.prefix}/api
|
||||||
# 是否允许跨域
|
# 是否允许跨域
|
||||||
cors: true
|
cors: true
|
||||||
|
# 服务端主机地址
|
||||||
|
host: 0.0.0.0
|
||||||
|
# 服务端接口地址 默认自动生成
|
||||||
|
url:
|
||||||
# 获取 IP 的请求头
|
# 获取 IP 的请求头
|
||||||
ip-headers: X-Forwarded-For,X-Real-IP
|
ip-headers: X-Forwarded-For,X-Real-IP
|
||||||
# 对外服务
|
# 对外服务
|
||||||
|
|||||||
@@ -39,9 +39,9 @@ import java.util.function.Function;
|
|||||||
*/
|
*/
|
||||||
public class ReplaceVersion {
|
public class ReplaceVersion {
|
||||||
|
|
||||||
private static final String TARGET_VERSION = "2.5.4";
|
private static final String TARGET_VERSION = "2.5.5";
|
||||||
|
|
||||||
private static final String REPLACE_VERSION = "2.5.5";
|
private static final String REPLACE_VERSION = "2.5.6";
|
||||||
|
|
||||||
private static final String PATH = new File("").getAbsolutePath();
|
private static final String PATH = new File("").getAbsolutePath();
|
||||||
|
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ import org.springframework.web.multipart.MultipartFile;
|
|||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主机探针端点 api
|
* 主机探针端点 api
|
||||||
@@ -90,9 +91,8 @@ public class HostAgentController {
|
|||||||
@PostMapping("/install")
|
@PostMapping("/install")
|
||||||
@Operation(summary = "安装主机探针")
|
@Operation(summary = "安装主机探针")
|
||||||
@PreAuthorize("@ss.hasPermission('asset:host:install-agent')")
|
@PreAuthorize("@ss.hasPermission('asset:host:install-agent')")
|
||||||
public Boolean installAgent(@Validated @RequestBody HostAgentInstallRequest request) {
|
public Map<String, Long> installAgent(@Validated @RequestBody HostAgentInstallRequest request) {
|
||||||
hostAgentService.installAgent(request);
|
return hostAgentService.installAgent(request);
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@DemoDisableApi
|
@DemoDisableApi
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ import org.dromara.visor.module.asset.entity.vo.HostAgentStatusVO;
|
|||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主机探针 服务类
|
* 主机探针 服务类
|
||||||
@@ -49,8 +50,9 @@ public interface HostAgentService {
|
|||||||
* 安装探针
|
* 安装探针
|
||||||
*
|
*
|
||||||
* @param request request
|
* @param request request
|
||||||
|
* @return agentKey:installId
|
||||||
*/
|
*/
|
||||||
void installAgent(HostAgentInstallRequest request);
|
Map<String, Long> installAgent(HostAgentInstallRequest request);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 上传探针发布包
|
* 上传探针发布包
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.dromara.visor.module.asset.service.impl;
|
package org.dromara.visor.module.asset.service.impl;
|
||||||
|
|
||||||
|
import cn.orionsec.kit.lang.function.Functions;
|
||||||
import cn.orionsec.kit.lang.utils.Exceptions;
|
import cn.orionsec.kit.lang.utils.Exceptions;
|
||||||
import cn.orionsec.kit.lang.utils.Strings;
|
import cn.orionsec.kit.lang.utils.Strings;
|
||||||
import cn.orionsec.kit.lang.utils.collect.Lists;
|
import cn.orionsec.kit.lang.utils.collect.Lists;
|
||||||
@@ -31,7 +32,6 @@ import cn.orionsec.kit.lang.utils.io.FileReaders;
|
|||||||
import cn.orionsec.kit.lang.utils.io.Files1;
|
import cn.orionsec.kit.lang.utils.io.Files1;
|
||||||
import cn.orionsec.kit.lang.utils.io.compress.CompressTypeEnum;
|
import cn.orionsec.kit.lang.utils.io.compress.CompressTypeEnum;
|
||||||
import cn.orionsec.kit.lang.utils.io.compress.FileDecompressor;
|
import cn.orionsec.kit.lang.utils.io.compress.FileDecompressor;
|
||||||
import cn.orionsec.kit.lang.utils.net.IPs;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.dromara.visor.common.constant.Const;
|
import org.dromara.visor.common.constant.Const;
|
||||||
import org.dromara.visor.common.constant.ErrorMessage;
|
import org.dromara.visor.common.constant.ErrorMessage;
|
||||||
@@ -41,6 +41,8 @@ import org.dromara.visor.common.utils.Assert;
|
|||||||
import org.dromara.visor.common.utils.PathUtils;
|
import org.dromara.visor.common.utils.PathUtils;
|
||||||
import org.dromara.visor.framework.biz.operator.log.core.utils.OperatorLogs;
|
import org.dromara.visor.framework.biz.operator.log.core.utils.OperatorLogs;
|
||||||
import org.dromara.visor.framework.redis.core.utils.RedisStrings;
|
import org.dromara.visor.framework.redis.core.utils.RedisStrings;
|
||||||
|
import org.dromara.visor.framework.web.configuration.config.ExposeApiConfig;
|
||||||
|
import org.dromara.visor.framework.web.configuration.config.OrionApiConfig;
|
||||||
import org.dromara.visor.module.asset.convert.HostConvert;
|
import org.dromara.visor.module.asset.convert.HostConvert;
|
||||||
import org.dromara.visor.module.asset.dao.HostAgentLogDAO;
|
import org.dromara.visor.module.asset.dao.HostAgentLogDAO;
|
||||||
import org.dromara.visor.module.asset.dao.HostDAO;
|
import org.dromara.visor.module.asset.dao.HostDAO;
|
||||||
@@ -53,7 +55,6 @@ import org.dromara.visor.module.asset.enums.*;
|
|||||||
import org.dromara.visor.module.asset.handler.agent.intstall.AgentInstaller;
|
import org.dromara.visor.module.asset.handler.agent.intstall.AgentInstaller;
|
||||||
import org.dromara.visor.module.asset.handler.agent.model.AgentInstallParams;
|
import org.dromara.visor.module.asset.handler.agent.model.AgentInstallParams;
|
||||||
import org.dromara.visor.module.asset.service.HostAgentService;
|
import org.dromara.visor.module.asset.service.HostAgentService;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
@@ -77,8 +78,11 @@ public class HostAgentServiceImpl implements HostAgentService {
|
|||||||
|
|
||||||
private String localVersion;
|
private String localVersion;
|
||||||
|
|
||||||
@Value("${orion.api.expose.token}")
|
@Resource
|
||||||
private String exposeToken;
|
private OrionApiConfig orionApiConfig;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ExposeApiConfig exposeApiConfig;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private HostDAO hostDAO;
|
private HostDAO hostDAO;
|
||||||
@@ -130,7 +134,7 @@ public class HostAgentServiceImpl implements HostAgentService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void installAgent(HostAgentInstallRequest request) {
|
public Map<String, Long> installAgent(HostAgentInstallRequest request) {
|
||||||
// 查询主机信息
|
// 查询主机信息
|
||||||
List<Long> idList = request.getIdList();
|
List<Long> idList = request.getIdList();
|
||||||
List<HostDO> hosts = hostDAO.selectBatchIds(idList);
|
List<HostDO> hosts = hostDAO.selectBatchIds(idList);
|
||||||
@@ -178,6 +182,12 @@ public class HostAgentServiceImpl implements HostAgentService {
|
|||||||
// 执行任务
|
// 执行任务
|
||||||
AgentInstaller.start(params);
|
AgentInstaller.start(params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 返回
|
||||||
|
return agentLogs.stream()
|
||||||
|
.collect(Collectors.toMap(HostAgentLogDO::getAgentKey,
|
||||||
|
HostAgentLogDO::getId,
|
||||||
|
Functions.right()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -302,8 +312,8 @@ public class HostAgentServiceImpl implements HostAgentService {
|
|||||||
*/
|
*/
|
||||||
private Map<String, String> getReplaceVars() {
|
private Map<String, String> getReplaceVars() {
|
||||||
Map<String, String> map = new HashMap<>();
|
Map<String, String> map = new HashMap<>();
|
||||||
map.put("SERVER_HOST", IPs.IP);
|
map.put("SERVER_URL", orionApiConfig.getUrl());
|
||||||
map.put("SERVER_TOKEN", exposeToken);
|
map.put("SERVER_TOKEN", exposeApiConfig.getToken());
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,10 +22,13 @@
|
|||||||
*/
|
*/
|
||||||
package org.dromara.visor.module.asset.service.impl;
|
package org.dromara.visor.module.asset.service.impl;
|
||||||
|
|
||||||
|
import cn.orionsec.kit.lang.utils.Exceptions;
|
||||||
import cn.orionsec.kit.lang.utils.Strings;
|
import cn.orionsec.kit.lang.utils.Strings;
|
||||||
import cn.orionsec.kit.lang.utils.collect.Lists;
|
import cn.orionsec.kit.lang.utils.collect.Lists;
|
||||||
|
import cn.orionsec.kit.lang.utils.collect.Maps;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.dromara.visor.common.constant.Const;
|
import org.dromara.visor.common.constant.Const;
|
||||||
import org.dromara.visor.common.constant.ErrorMessage;
|
import org.dromara.visor.common.constant.ErrorMessage;
|
||||||
import org.dromara.visor.common.handler.data.model.GenericsDataModel;
|
import org.dromara.visor.common.handler.data.model.GenericsDataModel;
|
||||||
@@ -44,6 +47,7 @@ import org.dromara.visor.module.infra.enums.DataExtraTypeEnum;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
@@ -55,6 +59,7 @@ import java.util.stream.Collectors;
|
|||||||
* @version 1.0.0
|
* @version 1.0.0
|
||||||
* @since 2023/12/20 12:11
|
* @since 2023/12/20 12:11
|
||||||
*/
|
*/
|
||||||
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
public class HostExtraServiceImpl implements HostExtraService {
|
public class HostExtraServiceImpl implements HostExtraService {
|
||||||
|
|
||||||
@@ -156,40 +161,57 @@ public class HostExtraServiceImpl implements HostExtraService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void syncHostSpec(String key, String taskId, JSONObject spec) {
|
public void syncHostSpec(String key, String taskId, JSONObject spec) {
|
||||||
try {
|
// 查询主机id
|
||||||
// 查询主机id
|
Long id = hostDAO.selectIdByAgentKey(key);
|
||||||
Long id = hostDAO.selectIdByAgentKey(key);
|
Assert.notNull(id, ErrorMessage.HOST_ABSENT);
|
||||||
Assert.notNull(id, ErrorMessage.HOST_ABSENT);
|
// 设置已同步标识
|
||||||
// 设置已同步标识
|
spec.put(Const.SYNCED, true);
|
||||||
spec.put(Const.SYNCED, true);
|
// 查询配置信息
|
||||||
// 查询配置信息
|
String newSpec;
|
||||||
String newSpec;
|
HostSpecExtraModel beforeSpec = this.getHostSpecMap(Lists.singleton(id)).get(id);
|
||||||
HostSpecExtraModel beforeSpec = this.getHostSpecMap(Lists.singleton(id)).get(id);
|
if (beforeSpec == null) {
|
||||||
if (beforeSpec == null) {
|
// 新增
|
||||||
// 新增
|
newSpec = spec.toString();
|
||||||
newSpec = spec.toString();
|
} else {
|
||||||
} else {
|
// 合并
|
||||||
// 合并
|
JSONObject beforeSpecValue = JSON.parseObject(beforeSpec.serial());
|
||||||
JSONObject beforeSpecValue = JSON.parseObject(beforeSpec.serial());
|
spec.forEach((k, v) -> {
|
||||||
spec.forEach((k, v) -> {
|
// 获取原数据
|
||||||
if (v != null) {
|
Object beforeValue = beforeSpecValue.get(k);
|
||||||
beforeSpecValue.put(k, v);
|
// 检查是否存在
|
||||||
|
boolean present = false;
|
||||||
|
if (beforeValue != null) {
|
||||||
|
if (beforeValue instanceof String) {
|
||||||
|
present = !Strings.isBlank((String) beforeValue);
|
||||||
|
} else if (beforeValue instanceof Collection) {
|
||||||
|
present = !Lists.isEmpty((Collection<?>) beforeValue);
|
||||||
|
} else if (beforeValue instanceof Map) {
|
||||||
|
present = !Maps.isEmpty((Map<?, ?>) beforeValue);
|
||||||
|
} else {
|
||||||
|
present = true;
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
newSpec = beforeSpecValue.toJSONString();
|
// 不存在则覆盖
|
||||||
}
|
if (!present && v != null) {
|
||||||
// 修改规格
|
beforeSpecValue.put(k, v);
|
||||||
DataExtraSetDTO update = new DataExtraSetDTO();
|
}
|
||||||
update.setUserId(Const.SYSTEM_USER_ID);
|
});
|
||||||
update.setRelId(id);
|
newSpec = beforeSpecValue.toJSONString();
|
||||||
update.setItem(HostExtraItemEnum.SPEC.name());
|
|
||||||
update.setValue(newSpec);
|
|
||||||
dataExtraApi.setExtraItem(update, DataExtraTypeEnum.HOST);
|
|
||||||
// 回调成功
|
|
||||||
} catch (Exception e) {
|
|
||||||
// 回调失败
|
|
||||||
throw e;
|
|
||||||
}
|
}
|
||||||
|
// 检查是否能反解析 防止格式错误导致其他地方报错
|
||||||
|
try {
|
||||||
|
JSON.parseObject(newSpec, HostSpecExtraModel.class);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("HostExtraService-setHostSpec error: {}, spec: {}", e.getMessage(), newSpec, e);
|
||||||
|
throw Exceptions.app(ErrorMessage.SPEC_FORMAT_INCORRECT, e);
|
||||||
|
}
|
||||||
|
// 修改规格
|
||||||
|
DataExtraSetDTO update = new DataExtraSetDTO();
|
||||||
|
update.setUserId(Const.SYSTEM_USER_ID);
|
||||||
|
update.setRelId(id);
|
||||||
|
update.setItem(HostExtraItemEnum.SPEC.name());
|
||||||
|
update.setValue(newSpec);
|
||||||
|
dataExtraApi.setExtraItem(update, DataExtraTypeEnum.HOST);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ public class HostIdentityServiceImpl implements HostIdentityService {
|
|||||||
int effect = hostIdentityDAO.insert(record);
|
int effect = hostIdentityDAO.insert(record);
|
||||||
log.info("HostIdentityService-createHostIdentity effect: {}", effect);
|
log.info("HostIdentityService-createHostIdentity effect: {}", effect);
|
||||||
// 删除缓存
|
// 删除缓存
|
||||||
RedisMaps.delete(HostCacheKeyDefine.HOST_IDENTITY);
|
RedisUtils.delete(HostCacheKeyDefine.HOST_IDENTITY);
|
||||||
return record.getId();
|
return record.getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -143,7 +143,7 @@ public class HostIdentityServiceImpl implements HostIdentityService {
|
|||||||
int effect = hostIdentityDAO.update(updateRecord, wrapper);
|
int effect = hostIdentityDAO.update(updateRecord, wrapper);
|
||||||
log.info("HostIdentityService-updateHostIdentityById effect: {}", effect);
|
log.info("HostIdentityService-updateHostIdentityById effect: {}", effect);
|
||||||
// 删除缓存
|
// 删除缓存
|
||||||
RedisMaps.delete(HostCacheKeyDefine.HOST_IDENTITY);
|
RedisUtils.delete(HostCacheKeyDefine.HOST_IDENTITY);
|
||||||
return effect;
|
return effect;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ public class HostKeyServiceImpl implements HostKeyService {
|
|||||||
log.info("HostKeyService-createHostKey effect: {}", effect);
|
log.info("HostKeyService-createHostKey effect: {}", effect);
|
||||||
Long id = record.getId();
|
Long id = record.getId();
|
||||||
// 删除缓存
|
// 删除缓存
|
||||||
RedisMaps.delete(HostCacheKeyDefine.HOST_KEY);
|
RedisUtils.delete(HostCacheKeyDefine.HOST_KEY);
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -128,7 +128,7 @@ public class HostKeyServiceImpl implements HostKeyService {
|
|||||||
int effect = hostKeyDAO.updateById(updateRecord);
|
int effect = hostKeyDAO.updateById(updateRecord);
|
||||||
// 删除缓存
|
// 删除缓存
|
||||||
if (!record.getName().equals(updateRecord.getName())) {
|
if (!record.getName().equals(updateRecord.getName())) {
|
||||||
RedisMaps.delete(HostCacheKeyDefine.HOST_KEY);
|
RedisUtils.delete(HostCacheKeyDefine.HOST_KEY);
|
||||||
}
|
}
|
||||||
log.info("HostKeyService-updateHostKeyById effect: {}", effect);
|
log.info("HostKeyService-updateHostKeyById effect: {}", effect);
|
||||||
return effect;
|
return effect;
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ import org.dromara.visor.common.utils.Assert;
|
|||||||
import org.dromara.visor.framework.biz.operator.log.core.utils.OperatorLogs;
|
import org.dromara.visor.framework.biz.operator.log.core.utils.OperatorLogs;
|
||||||
import org.dromara.visor.framework.mybatis.core.query.DataQuery;
|
import org.dromara.visor.framework.mybatis.core.query.DataQuery;
|
||||||
import org.dromara.visor.framework.redis.core.utils.RedisMaps;
|
import org.dromara.visor.framework.redis.core.utils.RedisMaps;
|
||||||
|
import org.dromara.visor.framework.redis.core.utils.RedisUtils;
|
||||||
import org.dromara.visor.framework.redis.core.utils.barrier.CacheBarriers;
|
import org.dromara.visor.framework.redis.core.utils.barrier.CacheBarriers;
|
||||||
import org.dromara.visor.module.asset.convert.HostConvert;
|
import org.dromara.visor.module.asset.convert.HostConvert;
|
||||||
import org.dromara.visor.module.asset.dao.HostConfigDAO;
|
import org.dromara.visor.module.asset.dao.HostConfigDAO;
|
||||||
@@ -376,7 +377,7 @@ public class HostServiceImpl implements HostService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void clearCache() {
|
public void clearCache() {
|
||||||
RedisMaps.scanKeysDelete(HostCacheKeyDefine.HOST_INFO.format("*"));
|
RedisUtils.scanKeysDelete(HostCacheKeyDefine.HOST_INFO.format("*"));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,3 +1,25 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||||
|
*
|
||||||
|
* https://visor.dromara.org
|
||||||
|
* https://visor.dromara.org.cn
|
||||||
|
* https://visor.orionsec.cn
|
||||||
|
*
|
||||||
|
* Members:
|
||||||
|
* Jiahang Li - ljh1553488six@139.com - author
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
package org.dromara.visor.module.infra.entity.dto;
|
package org.dromara.visor.module.infra.entity.dto;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ import org.dromara.visor.common.utils.Assert;
|
|||||||
import org.dromara.visor.common.utils.Requests;
|
import org.dromara.visor.common.utils.Requests;
|
||||||
import org.dromara.visor.framework.biz.operator.log.core.utils.OperatorLogs;
|
import org.dromara.visor.framework.biz.operator.log.core.utils.OperatorLogs;
|
||||||
import org.dromara.visor.framework.redis.core.utils.RedisStrings;
|
import org.dromara.visor.framework.redis.core.utils.RedisStrings;
|
||||||
|
import org.dromara.visor.framework.redis.core.utils.RedisUtils;
|
||||||
import org.dromara.visor.framework.security.core.utils.SecurityUtils;
|
import org.dromara.visor.framework.security.core.utils.SecurityUtils;
|
||||||
import org.dromara.visor.module.common.config.AppLoginConfig;
|
import org.dromara.visor.module.common.config.AppLoginConfig;
|
||||||
import org.dromara.visor.module.infra.api.SystemMessageApi;
|
import org.dromara.visor.module.infra.api.SystemMessageApi;
|
||||||
@@ -420,7 +421,7 @@ public class AuthenticationServiceImpl implements AuthenticationService {
|
|||||||
}
|
}
|
||||||
// 删除续签信息
|
// 删除续签信息
|
||||||
if (Booleans.isTrue(appLoginConfig.getAllowRefresh())) {
|
if (Booleans.isTrue(appLoginConfig.getAllowRefresh())) {
|
||||||
RedisStrings.scanKeysDelete(UserCacheKeyDefine.LOGIN_REFRESH.format(id, "*"));
|
RedisUtils.scanKeysDelete(UserCacheKeyDefine.LOGIN_REFRESH.format(id, "*"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.dromara.visor.common.constant.Const;
|
import org.dromara.visor.common.constant.Const;
|
||||||
import org.dromara.visor.framework.mybatis.core.query.ThenLambdaWrapper;
|
import org.dromara.visor.framework.mybatis.core.query.ThenLambdaWrapper;
|
||||||
import org.dromara.visor.framework.redis.core.utils.RedisMaps;
|
import org.dromara.visor.framework.redis.core.utils.RedisMaps;
|
||||||
|
import org.dromara.visor.framework.redis.core.utils.RedisUtils;
|
||||||
import org.dromara.visor.framework.redis.core.utils.barrier.CacheBarriers;
|
import org.dromara.visor.framework.redis.core.utils.barrier.CacheBarriers;
|
||||||
import org.dromara.visor.module.infra.dao.DataExtraDAO;
|
import org.dromara.visor.module.infra.dao.DataExtraDAO;
|
||||||
import org.dromara.visor.module.infra.define.cache.DataExtraCacheKeyDefine;
|
import org.dromara.visor.module.infra.define.cache.DataExtraCacheKeyDefine;
|
||||||
@@ -92,7 +93,7 @@ public class DataExtraServiceImpl implements DataExtraService {
|
|||||||
insert.setValue(request.getValue());
|
insert.setValue(request.getValue());
|
||||||
dataExtraDAO.insert(insert);
|
dataExtraDAO.insert(insert);
|
||||||
// 删除缓存
|
// 删除缓存
|
||||||
RedisMaps.delete(DataExtraCacheKeyDefine.DATA_EXTRA.format(request.getUserId(), request.getType(), request.getItem()));
|
RedisUtils.delete(DataExtraCacheKeyDefine.DATA_EXTRA.format(request.getUserId(), request.getType(), request.getItem()));
|
||||||
return insert.getId();
|
return insert.getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -114,7 +115,7 @@ public class DataExtraServiceImpl implements DataExtraService {
|
|||||||
Set<String> keys = rows.stream()
|
Set<String> keys = rows.stream()
|
||||||
.map(s -> DataExtraCacheKeyDefine.DATA_EXTRA.format(s.getUserId(), s.getType(), s.getItem()))
|
.map(s -> DataExtraCacheKeyDefine.DATA_EXTRA.format(s.getUserId(), s.getType(), s.getItem()))
|
||||||
.collect(Collectors.toSet());
|
.collect(Collectors.toSet());
|
||||||
RedisMaps.delete(keys);
|
RedisUtils.delete(keys);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -133,7 +134,7 @@ public class DataExtraServiceImpl implements DataExtraService {
|
|||||||
// 更新
|
// 更新
|
||||||
int effect = dataExtraDAO.updateById(update);
|
int effect = dataExtraDAO.updateById(update);
|
||||||
// 删除缓存
|
// 删除缓存
|
||||||
RedisMaps.delete(DataExtraCacheKeyDefine.DATA_EXTRA.format(data.getUserId(), data.getType(), data.getItem()));
|
RedisUtils.delete(DataExtraCacheKeyDefine.DATA_EXTRA.format(data.getUserId(), data.getType(), data.getItem()));
|
||||||
return effect;
|
return effect;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -315,7 +316,7 @@ public class DataExtraServiceImpl implements DataExtraService {
|
|||||||
.map(s -> DataExtraCacheKeyDefine.DATA_EXTRA.format(s.getUserId(), s.getType(), s.getItem()))
|
.map(s -> DataExtraCacheKeyDefine.DATA_EXTRA.format(s.getUserId(), s.getType(), s.getItem()))
|
||||||
.distinct()
|
.distinct()
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
RedisMaps.delete(keys);
|
RedisUtils.delete(keys);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -346,7 +346,7 @@ public class DataPermissionServiceImpl implements DataPermissionService {
|
|||||||
.map(s -> DataPermissionCacheKeyDefine.DATA_PERMISSION_USER.format(value, s))
|
.map(s -> DataPermissionCacheKeyDefine.DATA_PERMISSION_USER.format(value, s))
|
||||||
.forEach(keys::add);
|
.forEach(keys::add);
|
||||||
}
|
}
|
||||||
RedisLists.delete(keys);
|
RedisUtils.delete(keys);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.dromara.visor.common.utils.Assert;
|
import org.dromara.visor.common.utils.Assert;
|
||||||
import org.dromara.visor.framework.redis.core.utils.RedisLists;
|
import org.dromara.visor.framework.redis.core.utils.RedisLists;
|
||||||
|
import org.dromara.visor.framework.redis.core.utils.RedisUtils;
|
||||||
import org.dromara.visor.framework.redis.core.utils.barrier.CacheBarriers;
|
import org.dromara.visor.framework.redis.core.utils.barrier.CacheBarriers;
|
||||||
import org.dromara.visor.framework.security.core.utils.SecurityUtils;
|
import org.dromara.visor.framework.security.core.utils.SecurityUtils;
|
||||||
import org.dromara.visor.module.infra.convert.FavoriteConvert;
|
import org.dromara.visor.module.infra.convert.FavoriteConvert;
|
||||||
@@ -79,7 +80,7 @@ public class FavoriteServiceImpl implements FavoriteService {
|
|||||||
// 插入
|
// 插入
|
||||||
favoriteDAO.insert(record);
|
favoriteDAO.insert(record);
|
||||||
// 删除缓存
|
// 删除缓存
|
||||||
RedisLists.delete(FavoriteCacheKeyDefine.FAVORITE.format(type, userId));
|
RedisUtils.delete(FavoriteCacheKeyDefine.FAVORITE.format(type, userId));
|
||||||
return record.getId();
|
return record.getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -91,7 +92,7 @@ public class FavoriteServiceImpl implements FavoriteService {
|
|||||||
// 删除库
|
// 删除库
|
||||||
int effect = favoriteDAO.deleteFavorite(type, userId, relId);
|
int effect = favoriteDAO.deleteFavorite(type, userId, relId);
|
||||||
// 删除缓存
|
// 删除缓存
|
||||||
RedisLists.delete(FavoriteCacheKeyDefine.FAVORITE.format(type, userId));
|
RedisUtils.delete(FavoriteCacheKeyDefine.FAVORITE.format(type, userId));
|
||||||
return effect;
|
return effect;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ import org.dromara.visor.common.utils.Assert;
|
|||||||
import org.dromara.visor.framework.biz.operator.log.core.utils.OperatorLogs;
|
import org.dromara.visor.framework.biz.operator.log.core.utils.OperatorLogs;
|
||||||
import org.dromara.visor.framework.mybatis.core.query.Conditions;
|
import org.dromara.visor.framework.mybatis.core.query.Conditions;
|
||||||
import org.dromara.visor.framework.redis.core.utils.RedisLists;
|
import org.dromara.visor.framework.redis.core.utils.RedisLists;
|
||||||
|
import org.dromara.visor.framework.redis.core.utils.RedisUtils;
|
||||||
import org.dromara.visor.framework.redis.core.utils.barrier.CacheBarriers;
|
import org.dromara.visor.framework.redis.core.utils.barrier.CacheBarriers;
|
||||||
import org.dromara.visor.module.infra.convert.TagConvert;
|
import org.dromara.visor.module.infra.convert.TagConvert;
|
||||||
import org.dromara.visor.module.infra.dao.TagDAO;
|
import org.dromara.visor.module.infra.dao.TagDAO;
|
||||||
@@ -116,7 +117,7 @@ public class TagServiceImpl implements TagService {
|
|||||||
int effect = tagDAO.updateById(updateRecord);
|
int effect = tagDAO.updateById(updateRecord);
|
||||||
log.info("HostProxyService-updateHostProxyById effect: {}", effect);
|
log.info("HostProxyService-updateHostProxyById effect: {}", effect);
|
||||||
// 删除缓存
|
// 删除缓存
|
||||||
RedisLists.delete(TagCacheKeyDefine.TAG_NAME.format(record.getType()));
|
RedisUtils.delete(TagCacheKeyDefine.TAG_NAME.format(record.getType()));
|
||||||
return effect;
|
return effect;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -201,7 +202,7 @@ public class TagServiceImpl implements TagService {
|
|||||||
.distinct()
|
.distinct()
|
||||||
.map(TagCacheKeyDefine.TAG_NAME::format)
|
.map(TagCacheKeyDefine.TAG_NAME::format)
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
RedisLists.delete(deleteKeys);
|
RedisUtils.delete(deleteKeys);
|
||||||
return effect;
|
return effect;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -225,7 +226,7 @@ public class TagServiceImpl implements TagService {
|
|||||||
.distinct()
|
.distinct()
|
||||||
.map(TagCacheKeyDefine.TAG_NAME::format)
|
.map(TagCacheKeyDefine.TAG_NAME::format)
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
RedisLists.delete(cacheKeys);
|
RedisUtils.delete(cacheKeys);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ import org.dromara.visor.common.constant.ErrorMessage;
|
|||||||
import org.dromara.visor.common.utils.Assert;
|
import org.dromara.visor.common.utils.Assert;
|
||||||
import org.dromara.visor.framework.biz.operator.log.core.utils.OperatorLogs;
|
import org.dromara.visor.framework.biz.operator.log.core.utils.OperatorLogs;
|
||||||
import org.dromara.visor.framework.redis.core.utils.RedisMaps;
|
import org.dromara.visor.framework.redis.core.utils.RedisMaps;
|
||||||
|
import org.dromara.visor.framework.redis.core.utils.RedisUtils;
|
||||||
import org.dromara.visor.framework.redis.core.utils.barrier.CacheBarriers;
|
import org.dromara.visor.framework.redis.core.utils.barrier.CacheBarriers;
|
||||||
import org.dromara.visor.module.monitor.convert.AlarmPolicyConvert;
|
import org.dromara.visor.module.monitor.convert.AlarmPolicyConvert;
|
||||||
import org.dromara.visor.module.monitor.dao.AlarmPolicyDAO;
|
import org.dromara.visor.module.monitor.dao.AlarmPolicyDAO;
|
||||||
@@ -114,7 +115,7 @@ public class AlarmPolicyServiceImpl implements AlarmPolicyService {
|
|||||||
// 重新加载上下文
|
// 重新加载上下文
|
||||||
alarmEngineContext.reloadPolicy(id);
|
alarmEngineContext.reloadPolicy(id);
|
||||||
// 删除缓存
|
// 删除缓存
|
||||||
RedisMaps.delete(AlarmPolicyCacheKeyDefine.ALARM_POLICY.format(record.getType()),
|
RedisUtils.delete(AlarmPolicyCacheKeyDefine.ALARM_POLICY.format(record.getType()),
|
||||||
AlarmPolicyCacheKeyDefine.ALARM_POLICY.format(Const.ALL));
|
AlarmPolicyCacheKeyDefine.ALARM_POLICY.format(Const.ALL));
|
||||||
// 设置日志参数
|
// 设置日志参数
|
||||||
OperatorLogs.add(OperatorLogs.ID, id);
|
OperatorLogs.add(OperatorLogs.ID, id);
|
||||||
@@ -137,7 +138,7 @@ public class AlarmPolicyServiceImpl implements AlarmPolicyService {
|
|||||||
// 重新加载上下文
|
// 重新加载上下文
|
||||||
alarmEngineContext.reloadPolicy(id);
|
alarmEngineContext.reloadPolicy(id);
|
||||||
// 删除缓存
|
// 删除缓存
|
||||||
RedisMaps.delete(AlarmPolicyCacheKeyDefine.ALARM_POLICY.format(record.getType()),
|
RedisUtils.delete(AlarmPolicyCacheKeyDefine.ALARM_POLICY.format(record.getType()),
|
||||||
AlarmPolicyCacheKeyDefine.ALARM_POLICY.format(Const.ALL));
|
AlarmPolicyCacheKeyDefine.ALARM_POLICY.format(Const.ALL));
|
||||||
return newId;
|
return newId;
|
||||||
}
|
}
|
||||||
@@ -165,7 +166,7 @@ public class AlarmPolicyServiceImpl implements AlarmPolicyService {
|
|||||||
// 重新加载上下文
|
// 重新加载上下文
|
||||||
alarmEngineContext.reloadPolicy(id);
|
alarmEngineContext.reloadPolicy(id);
|
||||||
// 删除缓存
|
// 删除缓存
|
||||||
RedisMaps.delete(AlarmPolicyCacheKeyDefine.ALARM_POLICY.format(record.getType()),
|
RedisUtils.delete(AlarmPolicyCacheKeyDefine.ALARM_POLICY.format(record.getType()),
|
||||||
AlarmPolicyCacheKeyDefine.ALARM_POLICY.format(Const.ALL));
|
AlarmPolicyCacheKeyDefine.ALARM_POLICY.format(Const.ALL));
|
||||||
return effect;
|
return effect;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ import org.dromara.visor.common.constant.ErrorMessage;
|
|||||||
import org.dromara.visor.common.utils.Assert;
|
import org.dromara.visor.common.utils.Assert;
|
||||||
import org.dromara.visor.framework.biz.operator.log.core.utils.OperatorLogs;
|
import org.dromara.visor.framework.biz.operator.log.core.utils.OperatorLogs;
|
||||||
import org.dromara.visor.framework.redis.core.utils.RedisMaps;
|
import org.dromara.visor.framework.redis.core.utils.RedisMaps;
|
||||||
|
import org.dromara.visor.framework.redis.core.utils.RedisUtils;
|
||||||
import org.dromara.visor.framework.redis.core.utils.barrier.CacheBarriers;
|
import org.dromara.visor.framework.redis.core.utils.barrier.CacheBarriers;
|
||||||
import org.dromara.visor.module.monitor.context.MonitorMetricsContext;
|
import org.dromara.visor.module.monitor.context.MonitorMetricsContext;
|
||||||
import org.dromara.visor.module.monitor.convert.MonitorMetricsConvert;
|
import org.dromara.visor.module.monitor.convert.MonitorMetricsConvert;
|
||||||
@@ -84,7 +85,7 @@ public class MonitorMetricsServiceImpl implements MonitorMetricsService {
|
|||||||
int effect = monitorMetricsDAO.insert(record);
|
int effect = monitorMetricsDAO.insert(record);
|
||||||
Long id = record.getId();
|
Long id = record.getId();
|
||||||
// 删除缓存
|
// 删除缓存
|
||||||
RedisMaps.delete(MonitorMetricsCacheKeyDefine.MONITOR_METRICS);
|
RedisUtils.delete(MonitorMetricsCacheKeyDefine.MONITOR_METRICS);
|
||||||
// 设置日志参数
|
// 设置日志参数
|
||||||
OperatorLogs.add(OperatorLogs.ID, id);
|
OperatorLogs.add(OperatorLogs.ID, id);
|
||||||
// 重新加载本地缓存
|
// 重新加载本地缓存
|
||||||
@@ -110,7 +111,7 @@ public class MonitorMetricsServiceImpl implements MonitorMetricsService {
|
|||||||
int effect = monitorMetricsDAO.updateById(updateRecord);
|
int effect = monitorMetricsDAO.updateById(updateRecord);
|
||||||
log.info("MonitorMetricsService-updateMonitorMetricsById effect: {}", effect);
|
log.info("MonitorMetricsService-updateMonitorMetricsById effect: {}", effect);
|
||||||
// 删除缓存
|
// 删除缓存
|
||||||
RedisMaps.delete(MonitorMetricsCacheKeyDefine.MONITOR_METRICS);
|
RedisUtils.delete(MonitorMetricsCacheKeyDefine.MONITOR_METRICS);
|
||||||
// 重新加载本地缓存
|
// 重新加载本地缓存
|
||||||
monitorMetricsContext.reloadMonitorMetrics(id);
|
monitorMetricsContext.reloadMonitorMetrics(id);
|
||||||
return effect;
|
return effect;
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.dromara.visor.common.constant.ErrorMessage;
|
import org.dromara.visor.common.constant.ErrorMessage;
|
||||||
import org.dromara.visor.common.utils.Assert;
|
import org.dromara.visor.common.utils.Assert;
|
||||||
import org.dromara.visor.framework.redis.core.utils.RedisMaps;
|
import org.dromara.visor.framework.redis.core.utils.RedisMaps;
|
||||||
|
import org.dromara.visor.framework.redis.core.utils.RedisUtils;
|
||||||
import org.dromara.visor.framework.redis.core.utils.barrier.CacheBarriers;
|
import org.dromara.visor.framework.redis.core.utils.barrier.CacheBarriers;
|
||||||
import org.dromara.visor.framework.security.core.utils.SecurityUtils;
|
import org.dromara.visor.framework.security.core.utils.SecurityUtils;
|
||||||
import org.dromara.visor.module.terminal.convert.CommandSnippetConvert;
|
import org.dromara.visor.module.terminal.convert.CommandSnippetConvert;
|
||||||
@@ -84,7 +85,7 @@ public class CommandSnippetServiceImpl implements CommandSnippetService {
|
|||||||
Long id = record.getId();
|
Long id = record.getId();
|
||||||
log.info("CommandSnippetService-createCommandSnippet id: {}, effect: {}", id, effect);
|
log.info("CommandSnippetService-createCommandSnippet id: {}, effect: {}", id, effect);
|
||||||
// 删除缓存
|
// 删除缓存
|
||||||
RedisMaps.delete(CommandSnippetCacheKeyDefine.SNIPPET.format(userId));
|
RedisUtils.delete(CommandSnippetCacheKeyDefine.SNIPPET.format(userId));
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -109,7 +110,7 @@ public class CommandSnippetServiceImpl implements CommandSnippetService {
|
|||||||
int effect = commandSnippetDAO.update(null, update);
|
int effect = commandSnippetDAO.update(null, update);
|
||||||
log.info("CommandSnippetService-updateCommandSnippetById effect: {}", effect);
|
log.info("CommandSnippetService-updateCommandSnippetById effect: {}", effect);
|
||||||
// 删除缓存
|
// 删除缓存
|
||||||
RedisMaps.delete(CommandSnippetCacheKeyDefine.SNIPPET.format(userId));
|
RedisUtils.delete(CommandSnippetCacheKeyDefine.SNIPPET.format(userId));
|
||||||
return effect;
|
return effect;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -169,7 +170,7 @@ public class CommandSnippetServiceImpl implements CommandSnippetService {
|
|||||||
public Integer setGroupNull(Long userId, Long groupId) {
|
public Integer setGroupNull(Long userId, Long groupId) {
|
||||||
int effect = commandSnippetDAO.setGroupIdWithNull(groupId);
|
int effect = commandSnippetDAO.setGroupIdWithNull(groupId);
|
||||||
// 删除缓存
|
// 删除缓存
|
||||||
RedisMaps.delete(CommandSnippetCacheKeyDefine.SNIPPET.format(userId));
|
RedisUtils.delete(CommandSnippetCacheKeyDefine.SNIPPET.format(userId));
|
||||||
return effect;
|
return effect;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -192,7 +193,7 @@ public class CommandSnippetServiceImpl implements CommandSnippetService {
|
|||||||
public Integer deleteByGroupId(Long userId, Long groupId) {
|
public Integer deleteByGroupId(Long userId, Long groupId) {
|
||||||
int effect = commandSnippetDAO.deleteByGroupId(groupId);
|
int effect = commandSnippetDAO.deleteByGroupId(groupId);
|
||||||
// 删除缓存
|
// 删除缓存
|
||||||
RedisMaps.delete(CommandSnippetCacheKeyDefine.SNIPPET.format(userId));
|
RedisUtils.delete(CommandSnippetCacheKeyDefine.SNIPPET.format(userId));
|
||||||
return effect;
|
return effect;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.dromara.visor.common.constant.ErrorMessage;
|
import org.dromara.visor.common.constant.ErrorMessage;
|
||||||
import org.dromara.visor.common.utils.Assert;
|
import org.dromara.visor.common.utils.Assert;
|
||||||
import org.dromara.visor.framework.redis.core.utils.RedisMaps;
|
import org.dromara.visor.framework.redis.core.utils.RedisMaps;
|
||||||
|
import org.dromara.visor.framework.redis.core.utils.RedisUtils;
|
||||||
import org.dromara.visor.framework.redis.core.utils.barrier.CacheBarriers;
|
import org.dromara.visor.framework.redis.core.utils.barrier.CacheBarriers;
|
||||||
import org.dromara.visor.framework.security.core.utils.SecurityUtils;
|
import org.dromara.visor.framework.security.core.utils.SecurityUtils;
|
||||||
import org.dromara.visor.module.terminal.convert.PathBookmarkConvert;
|
import org.dromara.visor.module.terminal.convert.PathBookmarkConvert;
|
||||||
@@ -84,7 +85,7 @@ public class PathBookmarkServiceImpl implements PathBookmarkService {
|
|||||||
Long id = record.getId();
|
Long id = record.getId();
|
||||||
log.info("PathBookmarkService-createPathBookmark id: {}, effect: {}", id, effect);
|
log.info("PathBookmarkService-createPathBookmark id: {}, effect: {}", id, effect);
|
||||||
// 删除缓存
|
// 删除缓存
|
||||||
RedisMaps.delete(PathBookmarkCacheKeyDefine.PATH_BOOKMARK.format(userId));
|
RedisUtils.delete(PathBookmarkCacheKeyDefine.PATH_BOOKMARK.format(userId));
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -109,7 +110,7 @@ public class PathBookmarkServiceImpl implements PathBookmarkService {
|
|||||||
int effect = pathBookmarkDAO.update(null, update);
|
int effect = pathBookmarkDAO.update(null, update);
|
||||||
log.info("PathBookmarkService-updatePathBookmarkById effect: {}", effect);
|
log.info("PathBookmarkService-updatePathBookmarkById effect: {}", effect);
|
||||||
// 删除缓存
|
// 删除缓存
|
||||||
RedisMaps.delete(PathBookmarkCacheKeyDefine.PATH_BOOKMARK.format(userId));
|
RedisUtils.delete(PathBookmarkCacheKeyDefine.PATH_BOOKMARK.format(userId));
|
||||||
return effect;
|
return effect;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -169,7 +170,7 @@ public class PathBookmarkServiceImpl implements PathBookmarkService {
|
|||||||
public Integer setGroupNull(Long userId, Long groupId) {
|
public Integer setGroupNull(Long userId, Long groupId) {
|
||||||
int effect = pathBookmarkDAO.setGroupIdWithNull(groupId);
|
int effect = pathBookmarkDAO.setGroupIdWithNull(groupId);
|
||||||
// 删除缓存
|
// 删除缓存
|
||||||
RedisMaps.delete(PathBookmarkCacheKeyDefine.PATH_BOOKMARK.format(userId));
|
RedisUtils.delete(PathBookmarkCacheKeyDefine.PATH_BOOKMARK.format(userId));
|
||||||
return effect;
|
return effect;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -192,7 +193,7 @@ public class PathBookmarkServiceImpl implements PathBookmarkService {
|
|||||||
public Integer deleteByGroupId(Long userId, Long groupId) {
|
public Integer deleteByGroupId(Long userId, Long groupId) {
|
||||||
int effect = pathBookmarkDAO.deleteByGroupId(groupId);
|
int effect = pathBookmarkDAO.deleteByGroupId(groupId);
|
||||||
// 删除缓存
|
// 删除缓存
|
||||||
RedisMaps.delete(PathBookmarkCacheKeyDefine.PATH_BOOKMARK.format(userId));
|
RedisUtils.delete(PathBookmarkCacheKeyDefine.PATH_BOOKMARK.format(userId));
|
||||||
return effect;
|
return effect;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,4 +3,4 @@ VITE_API_BASE_URL=http://127.0.0.1:9200/orion-visor/api
|
|||||||
# websocket 路径
|
# websocket 路径
|
||||||
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.5.5
|
VITE_APP_VERSION=2.5.6
|
||||||
|
|||||||
@@ -3,4 +3,4 @@ VITE_API_BASE_URL=/orion-visor/api
|
|||||||
# websocket 路径
|
# websocket 路径
|
||||||
VITE_WS_BASE_URL=/orion-visor/keep-alive
|
VITE_WS_BASE_URL=/orion-visor/keep-alive
|
||||||
# 版本号
|
# 版本号
|
||||||
VITE_APP_VERSION=2.5.5
|
VITE_APP_VERSION=2.5.6
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "orion-visor-ui",
|
"name": "orion-visor-ui",
|
||||||
"description": "Orion Visor UI",
|
"description": "Orion Visor UI",
|
||||||
"version": "2.5.5",
|
"version": "2.5.6",
|
||||||
"private": true,
|
"private": true,
|
||||||
"author": "Jiahang Li",
|
"author": "Jiahang Li",
|
||||||
"license": "Apache 2.0",
|
"license": "Apache 2.0",
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ export interface HostAgentInstallStatusUpdateRequest {
|
|||||||
* 安装主机探针
|
* 安装主机探针
|
||||||
*/
|
*/
|
||||||
export function installHostAgent(request: HostInstallAgentRequest) {
|
export function installHostAgent(request: HostInstallAgentRequest) {
|
||||||
return axios.post('/asset/host-agent/install', request);
|
return axios.post<Record<string, number>>('/asset/host-agent/install', request);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -58,15 +58,13 @@
|
|||||||
// 修改配置
|
// 修改配置
|
||||||
appStore.updateSettings({ [key]: value });
|
appStore.updateSettings({ [key]: value });
|
||||||
// 同步偏好
|
// 同步偏好
|
||||||
try {
|
await updatePreference({
|
||||||
await updatePreference({
|
type: 'SYSTEM',
|
||||||
type: 'SYSTEM',
|
item: key,
|
||||||
item: key,
|
value
|
||||||
value
|
});
|
||||||
});
|
|
||||||
} catch (e) {
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
|
|||||||
@@ -48,7 +48,6 @@
|
|||||||
setLoading(true);
|
setLoading(true);
|
||||||
try {
|
try {
|
||||||
treeData.value = await cacheStore.loadHostGroupTree();
|
treeData.value = await cacheStore.loadHostGroupTree();
|
||||||
} catch (e) {
|
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -163,7 +163,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (e) {
|
|
||||||
} finally {
|
} finally {
|
||||||
emits('setLoading', false);
|
emits('setLoading', false);
|
||||||
}
|
}
|
||||||
@@ -300,7 +299,6 @@
|
|||||||
});
|
});
|
||||||
// 移动分组
|
// 移动分组
|
||||||
moveNode(treeData.value, dragNode, dropNode, dropPosition);
|
moveNode(treeData.value, dragNode, dropNode, dropPosition);
|
||||||
} catch (e) {
|
|
||||||
} finally {
|
} finally {
|
||||||
emits('setLoading', false);
|
emits('setLoading', false);
|
||||||
}
|
}
|
||||||
@@ -312,7 +310,6 @@
|
|||||||
emits('setLoading', true);
|
emits('setLoading', true);
|
||||||
const groups = await cacheStore.loadHostGroupTree(force);
|
const groups = await cacheStore.loadHostGroupTree(force);
|
||||||
treeData.value = groups || [];
|
treeData.value = groups || [];
|
||||||
} catch (e) {
|
|
||||||
} finally {
|
} finally {
|
||||||
emits('setLoading', false);
|
emits('setLoading', false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -75,7 +75,6 @@
|
|||||||
username: s.username,
|
username: s.username,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
} catch (e) {
|
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,7 +57,6 @@
|
|||||||
value: s.id,
|
value: s.id,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
} catch (e) {
|
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -160,7 +160,6 @@
|
|||||||
hosts.value = data;
|
hosts.value = data;
|
||||||
// 设置主机搜索选项
|
// 设置主机搜索选项
|
||||||
filterOptions.value = getAuthorizedHostOptions(data.hostList);
|
filterOptions.value = getAuthorizedHostOptions(data.hostList);
|
||||||
} catch (e) {
|
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,7 +62,6 @@
|
|||||||
value: s.id,
|
value: s.id,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
} catch (e) {
|
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,7 +67,6 @@
|
|||||||
value: s.id,
|
value: s.id,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
} catch (e) {
|
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -284,6 +284,7 @@ export default class LogAppender implements ILogAppender {
|
|||||||
this.client.close();
|
this.client.close();
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
// ignored
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -139,7 +139,6 @@
|
|||||||
pagination.total = data.total;
|
pagination.total = data.total;
|
||||||
pagination.current = request.page;
|
pagination.current = request.page;
|
||||||
pagination.pageSize = request.limit;
|
pagination.pageSize = request.limit;
|
||||||
} catch (e) {
|
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,7 +66,6 @@
|
|||||||
setVisible(false);
|
setVisible(false);
|
||||||
Message.error('cron 表达式错误');
|
Message.error('cron 表达式错误');
|
||||||
}
|
}
|
||||||
} catch (e) {
|
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -125,7 +125,6 @@
|
|||||||
Message.success('回滚成功');
|
Message.success('回滚成功');
|
||||||
emits('updated');
|
emits('updated');
|
||||||
handleClear();
|
handleClear();
|
||||||
} catch (e) {
|
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
@@ -144,7 +143,6 @@
|
|||||||
pagination.total = data.total;
|
pagination.total = data.total;
|
||||||
pagination.current = request.page;
|
pagination.current = request.page;
|
||||||
pagination.pageSize = request.limit;
|
pagination.pageSize = request.limit;
|
||||||
} catch (e) {
|
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -126,7 +126,6 @@
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
} catch (e) {
|
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,7 +43,6 @@
|
|||||||
value: s.id,
|
value: s.id,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
} catch (e) {
|
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,7 +48,6 @@
|
|||||||
value: s.agentKey,
|
value: s.agentKey,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
} catch (e) {
|
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,7 +37,6 @@
|
|||||||
value: s.id,
|
value: s.id,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
} catch (e) {
|
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,7 +70,6 @@
|
|||||||
origin: s
|
origin: s
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
} catch (e) {
|
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -78,7 +78,6 @@
|
|||||||
title: '根目录',
|
title: '根目录',
|
||||||
children: render([...menus])
|
children: render([...menus])
|
||||||
}];
|
}];
|
||||||
} catch (e) {
|
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -96,10 +96,16 @@
|
|||||||
const reloadAllMessage = async () => {
|
const reloadAllMessage = async () => {
|
||||||
hasMore.value = true;
|
hasMore.value = true;
|
||||||
messageList.value = [];
|
messageList.value = [];
|
||||||
// 查询数量
|
try {
|
||||||
queryMessageCount();
|
await Promise.all([
|
||||||
// 加载列表
|
// 查询数量
|
||||||
await loadMessage();
|
queryMessageCount(),
|
||||||
|
// 加载列表
|
||||||
|
loadMessage()
|
||||||
|
]);
|
||||||
|
} catch (e) {
|
||||||
|
console.error('load message error', e);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// 获取数量
|
// 获取数量
|
||||||
@@ -108,7 +114,6 @@
|
|||||||
try {
|
try {
|
||||||
const { data } = await getSystemMessageCount(queryUnread.value);
|
const { data } = await getSystemMessageCount(queryUnread.value);
|
||||||
classifyCount.value = data;
|
classifyCount.value = data;
|
||||||
} catch (ex) {
|
|
||||||
} finally {
|
} finally {
|
||||||
setFetchLoading(false);
|
setFetchLoading(false);
|
||||||
}
|
}
|
||||||
@@ -135,17 +140,16 @@
|
|||||||
limit: messageLimit,
|
limit: messageLimit,
|
||||||
classify: currentClassify.value,
|
classify: currentClassify.value,
|
||||||
queryUnread: queryUnread.value,
|
queryUnread: queryUnread.value,
|
||||||
maxId,
|
maxId
|
||||||
});
|
});
|
||||||
data.forEach(s => {
|
data.forEach(s => {
|
||||||
messageList.value.push({
|
messageList.value.push({
|
||||||
...s,
|
...s,
|
||||||
content: clearHtmlTag(s.content),
|
content: clearHtmlTag(s.content),
|
||||||
contentHtml: replaceHtmlTag(s.content),
|
contentHtml: replaceHtmlTag(s.content)
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
hasMore.value = data.length === messageLimit;
|
hasMore.value = data.length === messageLimit;
|
||||||
} catch (ex) {
|
|
||||||
} finally {
|
} finally {
|
||||||
setFetchLoading(false);
|
setFetchLoading(false);
|
||||||
}
|
}
|
||||||
@@ -159,7 +163,6 @@
|
|||||||
await updateSystemMessageReadAll(currentClassify.value);
|
await updateSystemMessageReadAll(currentClassify.value);
|
||||||
// 修改状态
|
// 修改状态
|
||||||
messageList.value.forEach(s => s.status = MessageStatus.READ);
|
messageList.value.forEach(s => s.status = MessageStatus.READ);
|
||||||
} catch (ex) {
|
|
||||||
} finally {
|
} finally {
|
||||||
setMessageLoading(false);
|
setMessageLoading(false);
|
||||||
}
|
}
|
||||||
@@ -171,7 +174,6 @@
|
|||||||
try {
|
try {
|
||||||
// 清理消息
|
// 清理消息
|
||||||
await clearSystemMessage(currentClassify.value);
|
await clearSystemMessage(currentClassify.value);
|
||||||
} catch (ex) {
|
|
||||||
} finally {
|
} finally {
|
||||||
setMessageLoading(false);
|
setMessageLoading(false);
|
||||||
}
|
}
|
||||||
@@ -204,7 +206,6 @@
|
|||||||
// 移除
|
// 移除
|
||||||
const index = messageList.value.findIndex(s => s.id === message.id);
|
const index = messageList.value.findIndex(s => s.id === message.id);
|
||||||
messageList.value.splice(index, 1);
|
messageList.value.splice(index, 1);
|
||||||
} catch (ex) {
|
|
||||||
} finally {
|
} finally {
|
||||||
setMessageLoading(false);
|
setMessageLoading(false);
|
||||||
}
|
}
|
||||||
@@ -237,7 +238,7 @@
|
|||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
localStorage.setItem(MESSAGE_CONFIG_KEY, JSON.stringify({
|
localStorage.setItem(MESSAGE_CONFIG_KEY, JSON.stringify({
|
||||||
currentClassify: currentClassify.value,
|
currentClassify: currentClassify.value,
|
||||||
queryUnread: queryUnread.value,
|
queryUnread: queryUnread.value
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -45,7 +45,6 @@
|
|||||||
value: s.id,
|
value: s.id,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
} catch (e) {
|
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -94,7 +94,6 @@
|
|||||||
value: s.id,
|
value: s.id,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
} catch (e) {
|
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -94,7 +94,6 @@
|
|||||||
value: s.id,
|
value: s.id,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
} catch (e) {
|
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,7 +65,6 @@
|
|||||||
value: s.id,
|
value: s.id,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
} catch (e) {
|
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,7 +64,6 @@
|
|||||||
value: s.id,
|
value: s.id,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
} catch (e) {
|
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -127,8 +127,6 @@
|
|||||||
// 清空
|
// 清空
|
||||||
handlerClear();
|
handlerClear();
|
||||||
emits('updated');
|
emits('updated');
|
||||||
} catch (e) {
|
|
||||||
return false;
|
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ export const useCardFieldConfig = (table: string, originFieldConfig: CardFieldCo
|
|||||||
try {
|
try {
|
||||||
preferConfig = JSON.parse(localConfig as string);
|
preferConfig = JSON.parse(localConfig as string);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
preferConfig = {};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 解析配置
|
// 解析配置
|
||||||
@@ -92,6 +93,7 @@ export const useCardFieldConfig = (table: string, originFieldConfig: CardFieldCo
|
|||||||
try {
|
try {
|
||||||
preferConfig = JSON.parse(localConfig as string);
|
preferConfig = JSON.parse(localConfig as string);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
preferConfig = {};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 设置缓存
|
// 设置缓存
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ export default function useFavorite(type: FavoriteType) {
|
|||||||
await addFavorite(request);
|
await addFavorite(request);
|
||||||
record.favorite = true;
|
record.favorite = true;
|
||||||
}
|
}
|
||||||
} catch (e) {
|
|
||||||
} finally {
|
} finally {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ export const useQueryOrder = (table: string, defaultSort: number = ASC): QueryOr
|
|||||||
try {
|
try {
|
||||||
preferConfig = JSON.parse(localConfig as string);
|
preferConfig = JSON.parse(localConfig as string);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
preferConfig = {};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 解析配置
|
// 解析配置
|
||||||
@@ -57,6 +58,7 @@ export const useQueryOrder = (table: string, defaultSort: number = ASC): QueryOr
|
|||||||
try {
|
try {
|
||||||
preferConfig = JSON.parse(localConfig as string);
|
preferConfig = JSON.parse(localConfig as string);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
preferConfig = {};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 设置缓存
|
// 设置缓存
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ export const useTableColumns = (table: string, originColumns: Array<TableColumnD
|
|||||||
try {
|
try {
|
||||||
preferConfig = JSON.parse(localConfig as string);
|
preferConfig = JSON.parse(localConfig as string);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
preferConfig = {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 解析配置
|
// 解析配置
|
||||||
@@ -100,6 +101,7 @@ export const useTableColumns = (table: string, originColumns: Array<TableColumnD
|
|||||||
try {
|
try {
|
||||||
preferConfig = JSON.parse(localConfig as string);
|
preferConfig = JSON.parse(localConfig as string);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
preferConfig = {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 设置缓存
|
// 设置缓存
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import '@/assets/style/chart.less';
|
|||||||
import '@/assets/style/arco-extends.less';
|
import '@/assets/style/arco-extends.less';
|
||||||
import '@/api/interceptor';
|
import '@/api/interceptor';
|
||||||
import App from './App.vue';
|
import App from './App.vue';
|
||||||
|
import globalErrorHandler from '@/utils/monitor';
|
||||||
|
|
||||||
const app = createApp(App);
|
const app = createApp(App);
|
||||||
|
|
||||||
@@ -26,6 +27,9 @@ app.use(i18n);
|
|||||||
app.use(globalComponents);
|
app.use(globalComponents);
|
||||||
app.use(directive);
|
app.use(directive);
|
||||||
|
|
||||||
|
// 全局异常处理
|
||||||
|
globalErrorHandler(app);
|
||||||
|
|
||||||
app.mount('#app');
|
app.mount('#app');
|
||||||
|
|
||||||
// 监听 PWA 注册事件
|
// 监听 PWA 注册事件
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ export default defineStore('dict', {
|
|||||||
const { data } = await getDictValueList(unloadKeys);
|
const { data } = await getDictValueList(unloadKeys);
|
||||||
this.$patch(data as object);
|
this.$patch(data as object);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
} finally {
|
console.error('load dict error', e);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ export default defineStore('tips', {
|
|||||||
await setTipsTipped(key);
|
await setTipsTipped(key);
|
||||||
this.tippedKeys.push(key);
|
this.tippedKeys.push(key);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
console.error('set tipped error', e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -113,6 +113,7 @@ export default defineStore('user', {
|
|||||||
try {
|
try {
|
||||||
await userLogout();
|
await userLogout();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
console.error('logout error', e);
|
||||||
} finally {
|
} finally {
|
||||||
// 登出回调
|
// 登出回调
|
||||||
this.logoutCallBack();
|
this.logoutCallBack();
|
||||||
|
|||||||
@@ -40,5 +40,6 @@ export const playBellHz = (frequency: number = 400, duration: number = .15) => {
|
|||||||
source.connect(audioCtx.destination);
|
source.connect(audioCtx.destination);
|
||||||
source.start();
|
source.start();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
// ignored
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,28 +1,14 @@
|
|||||||
import type { App, ComponentPublicInstance } from 'vue';
|
import type { App, ComponentPublicInstance } from 'vue';
|
||||||
import axios from 'axios';
|
|
||||||
|
|
||||||
export default function handleError(Vue: App, baseUrl: string) {
|
/**
|
||||||
if (!baseUrl) {
|
* 全局异常处理
|
||||||
return;
|
*/
|
||||||
}
|
export default function globalErrorHandler(Vue: App) {
|
||||||
Vue.config.errorHandler = (
|
Vue.config.errorHandler = (
|
||||||
err: unknown,
|
err: unknown,
|
||||||
instance: ComponentPublicInstance | null,
|
instance: ComponentPublicInstance | null,
|
||||||
info: string
|
info: string
|
||||||
) => {
|
) => {
|
||||||
// send error info
|
console.error(info, err);
|
||||||
axios.post(`${baseUrl}/report-error`, {
|
|
||||||
err,
|
|
||||||
instance,
|
|
||||||
info,
|
|
||||||
// location: window.location.href,
|
|
||||||
// message: err.message,
|
|
||||||
// stack: err.stack,
|
|
||||||
// browserInfo: getBrowserInfo(),
|
|
||||||
// user info
|
|
||||||
// dom info
|
|
||||||
// url info
|
|
||||||
// ...
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -137,7 +137,6 @@
|
|||||||
// 无数据
|
// 无数据
|
||||||
Message.warning('当前条件未查询到数据');
|
Message.warning('当前条件未查询到数据');
|
||||||
}
|
}
|
||||||
} catch (e) {
|
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
@@ -159,7 +158,6 @@
|
|||||||
// 清空
|
// 清空
|
||||||
setVisible(false);
|
setVisible(false);
|
||||||
handlerClear();
|
handlerClear();
|
||||||
} catch (e) {
|
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -264,7 +264,6 @@
|
|||||||
selectedKeys.value = [];
|
selectedKeys.value = [];
|
||||||
// 重新加载
|
// 重新加载
|
||||||
reload();
|
reload();
|
||||||
} catch (e) {
|
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
@@ -280,7 +279,6 @@
|
|||||||
selectedKeys.value = [];
|
selectedKeys.value = [];
|
||||||
// 重新加载
|
// 重新加载
|
||||||
reload();
|
reload();
|
||||||
} catch (e) {
|
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
@@ -304,7 +302,6 @@
|
|||||||
pagination.current = request.page;
|
pagination.current = request.page;
|
||||||
pagination.pageSize = request.limit;
|
pagination.pageSize = request.limit;
|
||||||
selectedKeys.value = [];
|
selectedKeys.value = [];
|
||||||
} catch (e) {
|
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
@@ -328,7 +325,6 @@
|
|||||||
record.status = HostConnectStatus.FORCE_OFFLINE;
|
record.status = HostConnectStatus.FORCE_OFFLINE;
|
||||||
record.endTime = Date.now();
|
record.endTime = Date.now();
|
||||||
Message.success('已下线');
|
Message.success('已下线');
|
||||||
} catch (e) {
|
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ export const logColumns = [
|
|||||||
title: '连接主机',
|
title: '连接主机',
|
||||||
dataIndex: 'hostName',
|
dataIndex: 'hostName',
|
||||||
slotName: 'hostName',
|
slotName: 'hostName',
|
||||||
|
minWidth: 218,
|
||||||
align: 'left',
|
align: 'left',
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
default: true,
|
default: true,
|
||||||
|
|||||||
@@ -162,7 +162,6 @@
|
|||||||
setLoading(true);
|
setLoading(true);
|
||||||
const { data } = await getTerminalConnectSessions(formModel);
|
const { data } = await getTerminalConnectSessions(formModel);
|
||||||
tableRenderData.value = data;
|
tableRenderData.value = data;
|
||||||
} catch (e) {
|
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
@@ -177,7 +176,6 @@
|
|||||||
Message.success('已下线');
|
Message.success('已下线');
|
||||||
// 移除行
|
// 移除行
|
||||||
tableRenderData.value.splice(tableRenderData.value.findIndex(s => s.id === record.id), 1);
|
tableRenderData.value.splice(tableRenderData.value.findIndex(s => s.id === record.id), 1);
|
||||||
} catch (e) {
|
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ const columns = [
|
|||||||
title: '连接主机',
|
title: '连接主机',
|
||||||
dataIndex: 'hostName',
|
dataIndex: 'hostName',
|
||||||
slotName: 'hostName',
|
slotName: 'hostName',
|
||||||
|
minWidth: 218,
|
||||||
align: 'left',
|
align: 'left',
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
}, {
|
}, {
|
||||||
|
|||||||
@@ -239,7 +239,6 @@
|
|||||||
pagination.current = request.page;
|
pagination.current = request.page;
|
||||||
pagination.pageSize = request.limit;
|
pagination.pageSize = request.limit;
|
||||||
selectedKeys.value = [];
|
selectedKeys.value = [];
|
||||||
} catch (e) {
|
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
@@ -260,7 +259,6 @@
|
|||||||
selectedKeys.value = [];
|
selectedKeys.value = [];
|
||||||
// 重新加载
|
// 重新加载
|
||||||
reload();
|
reload();
|
||||||
} catch (e) {
|
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
@@ -276,7 +274,6 @@
|
|||||||
selectedKeys.value = [];
|
selectedKeys.value = [];
|
||||||
// 重新加载
|
// 重新加载
|
||||||
reload();
|
reload();
|
||||||
} catch (e) {
|
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -94,7 +94,6 @@
|
|||||||
const hosts = await cacheStore.loadHosts();
|
const hosts = await cacheStore.loadHosts();
|
||||||
selectedGroupHosts.value = data.map(s => hosts.find(h => h.id === s) as HostQueryResponse)
|
selectedGroupHosts.value = data.map(s => hosts.find(h => h.id === s) as HostQueryResponse)
|
||||||
.filter(Boolean);
|
.filter(Boolean);
|
||||||
} catch (e) {
|
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
@@ -120,7 +119,6 @@
|
|||||||
const { data } = await getAuthorizedHostGroup(request);
|
const { data } = await getAuthorizedHostGroup(request);
|
||||||
authorizedGroups.value = data;
|
authorizedGroups.value = data;
|
||||||
checkedGroups.value = data;
|
checkedGroups.value = data;
|
||||||
} catch (e) {
|
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
@@ -138,7 +136,6 @@
|
|||||||
Message.success('授权成功');
|
Message.success('授权成功');
|
||||||
// 清空缓存
|
// 清空缓存
|
||||||
cacheStore.reset('authorizedHost_ALL', 'authorizedHost_SSH');
|
cacheStore.reset('authorizedHost_ALL', 'authorizedHost_SSH');
|
||||||
} catch (e) {
|
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -81,7 +81,6 @@
|
|||||||
try {
|
try {
|
||||||
const { data } = await getAuthorizedHostIdentity(request);
|
const { data } = await getAuthorizedHostIdentity(request);
|
||||||
selectedKeys.value = data;
|
selectedKeys.value = data;
|
||||||
} catch (e) {
|
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
@@ -99,7 +98,6 @@
|
|||||||
Message.success('授权成功');
|
Message.success('授权成功');
|
||||||
// 清空缓存
|
// 清空缓存
|
||||||
cacheStore.reset('authorizedHostIdentities');
|
cacheStore.reset('authorizedHostIdentities');
|
||||||
} catch (e) {
|
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
@@ -136,7 +134,6 @@
|
|||||||
hostIdentities.value = await cacheStore.loadHostIdentities();
|
hostIdentities.value = await cacheStore.loadHostIdentities();
|
||||||
// 加载主机密钥
|
// 加载主机密钥
|
||||||
hostKeys.value = await cacheStore.loadHostKeys();
|
hostKeys.value = await cacheStore.loadHostKeys();
|
||||||
} catch (e) {
|
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,7 +57,6 @@
|
|||||||
try {
|
try {
|
||||||
const { data } = await getAuthorizedHostKey(request);
|
const { data } = await getAuthorizedHostKey(request);
|
||||||
selectedKeys.value = data;
|
selectedKeys.value = data;
|
||||||
} catch (e) {
|
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
@@ -75,7 +74,6 @@
|
|||||||
Message.success('授权成功');
|
Message.success('授权成功');
|
||||||
// 清空缓存
|
// 清空缓存
|
||||||
cacheStore.reset('authorizedHostKeys');
|
cacheStore.reset('authorizedHostKeys');
|
||||||
} catch (e) {
|
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
@@ -109,7 +107,6 @@
|
|||||||
setLoading(true);
|
setLoading(true);
|
||||||
try {
|
try {
|
||||||
hostKeys.value = await cacheStore.loadHostKeys();
|
hostKeys.value = await cacheStore.loadHostKeys();
|
||||||
} catch (e) {
|
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -101,7 +101,6 @@
|
|||||||
emits('loading', true);
|
emits('loading', true);
|
||||||
const { data } = await getHostGroupRelList(groupId as number);
|
const { data } = await getHostGroupRelList(groupId as number);
|
||||||
value.value = data.map(String);
|
value.value = data.map(String);
|
||||||
} catch (e) {
|
|
||||||
} finally {
|
} finally {
|
||||||
emits('loading', false);
|
emits('loading', false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -109,14 +109,16 @@
|
|||||||
|
|
||||||
// 保存主机
|
// 保存主机
|
||||||
const saveHost = async () => {
|
const saveHost = async () => {
|
||||||
|
if (!currentGroup.value?.key) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
try {
|
try {
|
||||||
await updateHostGroupRel({
|
await updateHostGroupRel({
|
||||||
groupId: currentGroup.value?.key as number,
|
groupId: currentGroup.value?.key,
|
||||||
hostIdList: currentGroupHost.value
|
hostIdList: currentGroupHost.value
|
||||||
});
|
});
|
||||||
Message.success('保存成功');
|
Message.success('保存成功');
|
||||||
} catch (e) {
|
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -221,7 +221,6 @@
|
|||||||
Message.success('删除成功');
|
Message.success('删除成功');
|
||||||
// 重新加载
|
// 重新加载
|
||||||
reload();
|
reload();
|
||||||
} catch (e) {
|
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
@@ -254,7 +253,6 @@
|
|||||||
pagination.total = data.total;
|
pagination.total = data.total;
|
||||||
pagination.current = request.page;
|
pagination.current = request.page;
|
||||||
pagination.pageSize = request.limit;
|
pagination.pageSize = request.limit;
|
||||||
} catch (e) {
|
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -182,8 +182,6 @@
|
|||||||
}
|
}
|
||||||
// 清空
|
// 清空
|
||||||
handlerClear();
|
handlerClear();
|
||||||
} catch (e) {
|
|
||||||
return false;
|
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -240,7 +240,6 @@
|
|||||||
Message.success('删除成功');
|
Message.success('删除成功');
|
||||||
// 重新加载
|
// 重新加载
|
||||||
reload();
|
reload();
|
||||||
} catch (e) {
|
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
@@ -256,7 +255,6 @@
|
|||||||
selectedKeys.value = [];
|
selectedKeys.value = [];
|
||||||
// 重新加载
|
// 重新加载
|
||||||
reload();
|
reload();
|
||||||
} catch (e) {
|
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
@@ -282,7 +280,6 @@
|
|||||||
pagination.current = request.page;
|
pagination.current = request.page;
|
||||||
pagination.pageSize = request.limit;
|
pagination.pageSize = request.limit;
|
||||||
selectedKeys.value = [];
|
selectedKeys.value = [];
|
||||||
} catch (e) {
|
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -127,7 +127,6 @@
|
|||||||
Message.success('删除成功');
|
Message.success('删除成功');
|
||||||
// 重新加载
|
// 重新加载
|
||||||
reload();
|
reload();
|
||||||
} catch (e) {
|
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
@@ -160,7 +159,6 @@
|
|||||||
pagination.total = data.total;
|
pagination.total = data.total;
|
||||||
pagination.current = request.page;
|
pagination.current = request.page;
|
||||||
pagination.pageSize = request.limit;
|
pagination.pageSize = request.limit;
|
||||||
} catch (e) {
|
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -232,8 +232,6 @@
|
|||||||
}
|
}
|
||||||
// 清空
|
// 清空
|
||||||
handlerClear();
|
handlerClear();
|
||||||
} catch (e) {
|
|
||||||
return false;
|
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -189,7 +189,6 @@
|
|||||||
Message.success('删除成功');
|
Message.success('删除成功');
|
||||||
// 重新加载
|
// 重新加载
|
||||||
reload();
|
reload();
|
||||||
} catch (e) {
|
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
@@ -205,7 +204,6 @@
|
|||||||
selectedKeys.value = [];
|
selectedKeys.value = [];
|
||||||
// 重新加载
|
// 重新加载
|
||||||
reload();
|
reload();
|
||||||
} catch (e) {
|
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
@@ -231,7 +229,6 @@
|
|||||||
pagination.current = request.page;
|
pagination.current = request.page;
|
||||||
pagination.pageSize = request.limit;
|
pagination.pageSize = request.limit;
|
||||||
selectedKeys.value = [];
|
selectedKeys.value = [];
|
||||||
} catch (e) {
|
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -351,7 +351,6 @@
|
|||||||
});
|
});
|
||||||
record.status = newStatus;
|
record.status = newStatus;
|
||||||
Message.success(`已${dict.label}`);
|
Message.success(`已${dict.label}`);
|
||||||
} catch (e) {
|
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
@@ -374,7 +373,6 @@
|
|||||||
Message.success('删除成功');
|
Message.success('删除成功');
|
||||||
// 重新加载
|
// 重新加载
|
||||||
reload();
|
reload();
|
||||||
} catch (e) {
|
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
@@ -408,7 +406,6 @@
|
|||||||
pagination.total = data.total;
|
pagination.total = data.total;
|
||||||
pagination.current = request.page;
|
pagination.current = request.page;
|
||||||
pagination.pageSize = request.limit;
|
pagination.pageSize = request.limit;
|
||||||
} catch (e) {
|
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -155,7 +155,6 @@
|
|||||||
renderForm({ ...detail, tags });
|
renderForm({ ...detail, tags });
|
||||||
// 响应类型
|
// 响应类型
|
||||||
emits('changeType', data.types);
|
emits('changeType', data.types);
|
||||||
} catch (e) {
|
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
@@ -209,7 +208,6 @@
|
|||||||
emits('updated', formModel.value.id);
|
emits('updated', formModel.value.id);
|
||||||
}
|
}
|
||||||
emits('changeType', formModel.value.types);
|
emits('changeType', formModel.value.types);
|
||||||
} catch (e) {
|
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -307,7 +307,6 @@
|
|||||||
// 查询规格信息
|
// 查询规格信息
|
||||||
const { data } = await getHostExtraItem<HostSpecExtraModel>({ hostId: props.hostId, item: 'SPEC' });
|
const { data } = await getHostExtraItem<HostSpecExtraModel>({ hostId: props.hostId, item: 'SPEC' });
|
||||||
formModel.value = data;
|
formModel.value = data;
|
||||||
} catch (e) {
|
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
@@ -343,7 +342,6 @@
|
|||||||
});
|
});
|
||||||
toggleEditing();
|
toggleEditing();
|
||||||
emits('updated');
|
emits('updated');
|
||||||
} catch (e) {
|
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -166,7 +166,6 @@
|
|||||||
// 测试连接
|
// 测试连接
|
||||||
await testHostConnect({ id: props.hostId, type: HostType.SSH.value });
|
await testHostConnect({ id: props.hostId, type: HostType.SSH.value });
|
||||||
Message.success('连接成功');
|
Message.success('连接成功');
|
||||||
} catch (e) {
|
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user