Skip to content

1.12.14 #257

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 47 commits into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
e34af20
update
erupts May 27, 2024
f51adda
fix(*): 1. 修复分布式node获取组配置时报缺少请求头参数问题。 2. 修复分布式节点node获取当前用户时404问题
shareloke May 28, 2024
fa9d836
!28 修复分布式node获取组配置时报缺少请求头参数问题、修复分布式节点node获取当前用户时404问题
erupts May 28, 2024
6fef303
update
erupts May 28, 2024
d57bcbc
提升用户体验,支持重置密码 md5代入,支持报表发布,报表名称代入
erupts May 30, 2024
125340f
解决 oneToOne在存储 json 场景时 view报错的 bug
erupts May 31, 2024
8e55fb8
修复 BUTTON 类按钮,关联 eruptClass表单,表单值报错的问题
erupts Jun 3, 2024
c411d03
upgrade to 1.12.14
erupts Jun 5, 2024
c786302
EruptLambdaQuery 支持 condition 语法
erupts Jun 11, 2024
a47cf79
重构 erupt-job模块,优化其易用性
erupts Jun 11, 2024
c1e52a5
重构 erupt-job模块,支持分布式事务
erupts Jun 12, 2024
934a920
choice 组件支持 trigger 配置,选择某个数据后可以带数据到其他表单
erupts Jun 13, 2024
28b2245
choice 组件支持 trigger 配置,选择某个数据后可以带数据到其他表单
erupts Jun 15, 2024
92a4314
支持 erupt.hot-build 配置,热部署erupt注解
erupts Jun 16, 2024
7b28a09
upgrade erupt-web
erupts Jun 19, 2024
79fa6d7
解决部分菜单名称i18n失效的问题
erupts Jun 19, 2024
86c3382
解决部分菜单名称i18n失效的问题
erupts Jun 19, 2024
8b0c630
EruptJobHandler增加name方法,用于定义job名称
erupts Jun 19, 2024
ffc1504
EruptJobHandler增加name方法,用于定义job名称
erupts Jun 19, 2024
a970656
EruptJobHandler支持cron与param配置,配置后支持自动填入
erupts Jun 19, 2024
5fa4759
EruptJobHandler支持cron与param配置,配置后支持自动填入
erupts Jun 19, 2024
1c53e94
增加日志缓冲区能力,支持内存级日志暂存
Jun 27, 2024
1f08833
update erupt-log
erupts Jun 27, 2024
b344560
优化菜单对象的修改 erupt 类名触发方法与代码逻辑,不会出现角色异常的提示
Jun 28, 2024
87c7ab5
优化日志处理逻辑
Jun 28, 2024
2fcc568
优化数据持久化逻辑,将 erupt 获取的对象定义为游离状态,防止影响后续的 dataProxy代码查询,避免获取重复对象值
Jun 28, 2024
1e797fb
支持在线日志追踪能力
Jun 28, 2024
6abfc98
解决日志不对其的问题
erupts Jun 28, 2024
fea4c25
调整日志默认字体为Courier New
erupts Jun 28, 2024
6edfdb1
调整日志默认字体为Courier New
erupts Jun 28, 2024
25266ec
完善日志接口权限控制
erupts Jun 28, 2024
8460315
@Erupt注解增加dataProxyParams配置,PreDataProxy注解增加params配置,此值可在dataProxy内被D…
erupts Jun 29, 2024
4ccb262
优化代码细节
erupts Jun 29, 2024
e1447a1
eruptDao增加detach方法用于移除已缓存的对象
erupts Jun 29, 2024
de031cf
erupt-cloud支持查看各节点的日志信息
erupts Jun 30, 2024
e3a0887
erupt-cloud支持查看各节点的日志信息
erupts Jun 30, 2024
94a637f
erupt-cloud支持查看各节点的日志信息
erupts Jun 30, 2024
2af42ab
支持日志最大暂存行数控制
erupts Jun 30, 2024
dd463fe
支持在线日志追踪能力
Jul 1, 2024
76b2b46
erupt-job 不强依赖 redis
Jul 1, 2024
fb5b5b1
解决 erupt-job 在分布式场景中,多机器任务不同步的问题
Jul 1, 2024
997c950
解决 erupt-job 在分布式场景中,多机器任务不同步的问题
Jul 1, 2024
73510d9
解决 erupt-job 在分布式场景中,多机器任务不同步的问题
Jul 1, 2024
0e35bb5
补充 i18n 名称
Jul 1, 2024
ab89d62
调整代码细节
erupts Jul 1, 2024
e404e13
upgrade 0.0.6
erupts Jul 1, 2024
ada659e
修复bi报表无限刷新的bug
erupts Jul 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion erupt-admin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>xyz.erupt</groupId>
<artifactId>erupt</artifactId>
<version>1.12.13</version>
<version>1.12.14</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion erupt-annotation/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<parent>
<groupId>xyz.erupt</groupId>
<artifactId>erupt</artifactId>
<version>1.12.13</version>
<version>1.12.14</version>
<relativePath>../pom.xml</relativePath>
</parent>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@
@Comment("数据行为代理接口,对增、删、改、查等行为做逻辑处理")
Class<? extends DataProxy<?>>[] dataProxy() default {};

@Comment("此值可在dataProxy内被DataProxyContext.get()方法中获取到")
String[] dataProxyParams() default {};

@Comment("树视图配置")
Tree tree() default @Tree;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package xyz.erupt.annotation;

import xyz.erupt.annotation.config.Comment;
import xyz.erupt.annotation.fun.DataProxy;

import java.lang.annotation.*;
Expand All @@ -11,4 +12,7 @@

Class<? extends DataProxy<?>> value();

@Comment("此值可在dataProxy内被DataProxyContext.get()方法中获取到")
String[] params() default {};

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package xyz.erupt.annotation.fun;

import xyz.erupt.annotation.config.Comment;

import java.util.Map;

/**
* @author YuePeng
* date 2019-07-25.
*/
public interface ChoiceTrigger {

@Comment("获取下拉列表")
@Comment("返回值会填充给key对应表单中")
Map<String, Object> trigger(Object value, String[] params);

}
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
*/
public @interface Link {

@Comment("erupt class to associate with. Note that this class needs to be configured with access permissions")
Class<?> linkErupt();

@Transient
String column() default "id";

@Comment("erupt class to associate with. Note that this class needs to be configured with access permissions")
Class<?> linkErupt();

@Transient
@Comment("Column in linkErupt → this.column = linkErupt.joinColumn")
String joinColumn();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package xyz.erupt.annotation.sub_field.sub_edit;

import xyz.erupt.annotation.config.Comment;
import xyz.erupt.annotation.config.Match;
import xyz.erupt.annotation.fun.ChoiceFetchHandler;
import xyz.erupt.annotation.fun.ChoiceTrigger;

import java.beans.Transient;

Expand All @@ -25,6 +27,14 @@
@Comment("动态获取选择项")
Class<? extends ChoiceFetchHandler>[] fetchHandler() default {};

@Transient
@Comment("可被trigger接口获取到")
String[] triggerParams() default {};

@Comment("选择数据时触发动作")
@Match("#item.trigger().getSimpleName() != 'ChoiceTrigger'")
Class<? extends ChoiceTrigger> trigger() default ChoiceTrigger.class;

@Comment("开启后在编辑等操作时会重新获取下拉列表")
boolean anewFetch() default false;

Expand All @@ -35,7 +45,8 @@
@Comment("联动过滤表达式,支持变量:")
@Comment("dependValue:依赖字段的值")
@Comment("vl.value: 下拉列表项的值")
@Comment("vl.label: 下拉列表项中文名称")
@Comment("vl.label: 下拉列表项名称")
@Comment("vl.desc: 下拉列表项备注")
String dependExpr() default "false";

enum Type {
Expand Down
2 changes: 1 addition & 1 deletion erupt-cloud/erupt-cloud-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>xyz.erupt</groupId>
<artifactId>erupt</artifactId>
<version>1.12.13</version>
<version>1.12.14</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion erupt-cloud/erupt-cloud-node-jpa/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>xyz.erupt</groupId>
<artifactId>erupt</artifactId>
<version>1.12.13</version>
<version>1.12.14</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion erupt-cloud/erupt-cloud-node/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>xyz.erupt</groupId>
<artifactId>erupt</artifactId>
<version>1.12.13</version>
<version>1.12.14</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public boolean getMenuCodePermission(String menuValue) {
}

public MetaUserinfo getRemoteUserInfo() {
String userinfo = HttpUtil.createGet(eruptNodeProp.getBalanceAddress() + CloudRestApiConst.ERUPT_USER_INFO + eruptNodeProp.getNodeName())
String userinfo = HttpUtil.createGet(eruptNodeProp.getBalanceAddress() + CloudRestApiConst.ERUPT_USER_INFO + "/" + eruptNodeProp.getNodeName())
.header(EruptMutualConst.TOKEN, MetaContext.getToken())
.header(CloudCommonConst.HEADER_ACCESS_TOKEN, eruptNodeProp.getAccessToken())
.execute().body();
Expand All @@ -47,9 +47,10 @@ public String getNodeConfig() {

public String getNodeGroupConfig() {
return HttpUtil.createGet(eruptNodeProp.getBalanceAddress() + CloudRestApiConst.NODE_GROUP_CONFIG + "/" + eruptNodeProp.getNodeName())
// 添加请求头参数
.header(CloudCommonConst.HEADER_ACCESS_TOKEN, eruptNodeProp.getAccessToken())
.form(CloudCommonConst.HEADER_ACCESS_TOKEN, eruptNodeProp.getAccessToken())
.execute().body();
}


}
2 changes: 1 addition & 1 deletion erupt-cloud/erupt-cloud-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>xyz.erupt</groupId>
<artifactId>erupt</artifactId>
<version>1.12.13</version>
<version>1.12.14</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,9 @@ public List<MetaMenu> initMenus() {
MetaMenu nodeMenu = MetaMenu.createEruptClassMenu(CloudNode.class, nodeManager, 20);
return Arrays.asList(nodeManager,
MetaMenu.createEruptClassMenu(CloudNodeGroup.class, nodeManager, 10, MenuTypeEnum.TREE), nodeMenu,
MetaMenu.createSimpleMenu(
CloudServerConst.CLOUD_ACCESS_TOKEN_PERMISSION, "查看令牌",
CloudServerConst.CLOUD_ACCESS_TOKEN_PERMISSION, nodeMenu, 20, MenuTypeEnum.BUTTON.getCode()
),
MetaMenu.createSimpleMenu(
CloudServerConst.CLOUD_NODE_MANAGER_PERMISSION, "节点管理",
CloudServerConst.CLOUD_NODE_MANAGER_PERMISSION, nodeMenu, 30, MenuTypeEnum.BUTTON.getCode()
)
MetaMenu.createSimpleMenu(CloudServerConst.CLOUD_ACCESS_TOKEN_PERMISSION, "查看令牌", CloudServerConst.CLOUD_ACCESS_TOKEN_PERMISSION, nodeMenu, 110, MenuTypeEnum.BUTTON.getCode()),
MetaMenu.createSimpleMenu(CloudServerConst.CLOUD_NODE_MANAGER_PERMISSION, "节点管理", CloudServerConst.CLOUD_NODE_MANAGER_PERMISSION, nodeMenu, 120, MenuTypeEnum.BUTTON.getCode()),
MetaMenu.createSimpleMenu(CloudServerConst.ERUPT_CLOUD_NODE_LOG, "节点日志", CloudServerConst.ERUPT_CLOUD_NODE_LOG, nodeMenu, 120, MenuTypeEnum.BUTTON.getCode())
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@
*/
public class CloudServerConst {

public static final String CLOUD_ACCESS_TOKEN_PERMISSION = "cloud_access_token_permission";

//节点管理权限
public static final String CLOUD_NODE_MANAGER_PERMISSION = "cloud_node_manager_permission";

//查看 access token
public static final String CLOUD_ACCESS_TOKEN_PERMISSION = "cloud_access_token_permission";

//节点日志
public static final String ERUPT_CLOUD_NODE_LOG = "erupt_cloud_node_log";

}
Original file line number Diff line number Diff line change
@@ -1,12 +1,26 @@
package xyz.erupt.cloud.server.controller;

import cn.hutool.http.HttpResponse;
import cn.hutool.http.HttpUtil;
import com.google.gson.reflect.TypeToken;
import org.springframework.web.bind.annotation.*;
import xyz.erupt.cloud.common.consts.CloudCommonConst;
import xyz.erupt.cloud.common.consts.CloudRestApiConst;
import xyz.erupt.cloud.server.base.CloudServerConst;
import xyz.erupt.cloud.server.node.MetaNode;
import xyz.erupt.cloud.server.node.NodeManager;
import xyz.erupt.core.config.GsonFactory;
import xyz.erupt.core.constant.EruptConst;
import xyz.erupt.core.constant.EruptMutualConst;
import xyz.erupt.core.constant.EruptRestPath;
import xyz.erupt.core.exception.EruptWebApiRuntimeException;
import xyz.erupt.core.log.LogMessage;
import xyz.erupt.upms.annotation.EruptMenuAuth;
import xyz.erupt.upms.service.EruptContextService;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
* @author YuePeng
Expand All @@ -19,11 +33,35 @@ public class EruptNodeController {
@Resource
private NodeManager nodeManager;

@Resource
private EruptContextService eruptContextService;

//移除实例
@GetMapping("/remove-instance/{nodeName}")
@EruptMenuAuth(CloudServerConst.CLOUD_NODE_MANAGER_PERMISSION)
public void removeInstance(@PathVariable String nodeName, @RequestParam("instance") String instance) {
nodeManager.removeNodeInstance(nodeName, instance);
}

//node节点日志
@GetMapping("/erupt-cloud-node-log")
@EruptMenuAuth(CloudServerConst.ERUPT_CLOUD_NODE_LOG)
public List<LogMessage> eruptNodeLog(@RequestParam String nodeName, @RequestParam Long size, @RequestParam(required = false) Long offset,
HttpServletResponse httpServletResponse) {
MetaNode metaNode = nodeManager.getNode(nodeName);
if (null == metaNode || metaNode.getLocations().isEmpty())
throw new EruptWebApiRuntimeException("'" + nodeName + "' node not ready");
HttpResponse httpResponse = HttpUtil.createGet(metaNode.getLocations().iterator().next() + EruptRestPath.ERUPT_TOOL + "/" + EruptConst.ERUPT_LOG)
.header(EruptMutualConst.TOKEN, eruptContextService.getCurrentToken()).header(CloudCommonConst.HEADER_ACCESS_TOKEN, metaNode.getAccessToken())
.form("size", size).form("offset", offset).execute();
if (httpResponse.getStatus() == 200) {
return GsonFactory.getGson().fromJson(httpResponse.body(), new TypeToken<List<LogMessage>>() {
}.getType()
);
} else {
httpServletResponse.setStatus(httpResponse.getStatus());
return null;
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,19 @@
@Table(name = "e_cloud_node")
@Erupt(
name = "节点配置", dataProxy = CloudNodeProcess.class,
rowOperation = @RowOperation(
title = "查看令牌", icon = "fa fa-shield", mode = RowOperation.Mode.SINGLE,
show = @ExprBool(exprHandler = ViaMenuValueCtrl.class, params = CloudServerConst.CLOUD_ACCESS_TOKEN_PERMISSION),
type = RowOperation.Type.TPL, tpl = @Tpl(path = "/tpl/node-info.ftl")
), layout = @Layout(tableLeftFixed = 1, pageSize = 30)
rowOperation = {
@RowOperation(
title = "查看令牌", icon = "fa fa-shield", mode = RowOperation.Mode.SINGLE,
show = @ExprBool(exprHandler = ViaMenuValueCtrl.class, params = CloudServerConst.CLOUD_ACCESS_TOKEN_PERMISSION),
type = RowOperation.Type.TPL, tpl = @Tpl(path = "/tpl/node-info.ftl")
),
@RowOperation(
title = "节点日志", mode = RowOperation.Mode.SINGLE,
ifExpr = "item.version && item.version != '-'",
show = @ExprBool(exprHandler = ViaMenuValueCtrl.class, params = CloudServerConst.ERUPT_CLOUD_NODE_LOG),
type = RowOperation.Type.TPL, tpl = @Tpl(path = "/tpl/erupt-log.html", width = "85%")
),
}, layout = @Layout(tableLeftFixed = 1, pageSize = 30)
)
@Component
@EruptI18n
Expand Down
9 changes: 7 additions & 2 deletions erupt-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<parent>
<groupId>xyz.erupt</groupId>
<artifactId>erupt</artifactId>
<version>1.12.13</version>
<version>1.12.14</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down Expand Up @@ -55,7 +55,12 @@
<dependency>
<groupId>${erupt.groupId}</groupId>
<artifactId>linq.j</artifactId>
<version>0.0.5</version>
<version>0.0.6</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-log4j2</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public class GsonFactory {
-> LocalDate.parse(json.getAsJsonPrimitive().getAsString(), DateTimeFormatter.ofPattern(DateUtil.DATE)))
.registerTypeAdapter(Long.class, (JsonSerializer<Long>) (src, type, jsonSerializationContext) -> new JsonPrimitive(src.toString()))
.registerTypeAdapter(Double.class, (JsonSerializer<Double>) (src, type, jsonSerializationContext) -> new JsonPrimitive(src.toString()))
// .registerTypeAdapter(Integer.class, (JsonSerializer<Integer>) (src, type, jsonSerializationContext) -> new JsonPrimitive(src.toString()))
.registerTypeAdapter(BigDecimal.class, (JsonSerializer<BigDecimal>) (src, type, jsonSerializationContext) -> new JsonPrimitive(src.toString()))
.serializeNulls().setExclusionStrategies(new EruptGsonExclusionStrategies());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@
*/
public class EruptConst {

public static final String ERUPT = "erupt";

public static final String BASE_PACKAGE = "xyz.erupt";

public static final String ERUPT_DIR = ".erupt";

public static final String DEFAULT_DATA_PROCESSOR = "jpa";

public static final String DOT = ".";

public static final String ERUPT_LOG = "erupt-log";
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/
public class EruptMutualConst {

public static final String ERUPT = "erupt";
public static final String ERUPT = EruptConst.ERUPT;

public static final String USER = "user";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ public class EruptRestPath {
//文件
public static final String ERUPT_FILE = ERUPT_API + "/file";


//工具
public static final String ERUPT_TOOL = ERUPT_API + "/tool";

//附件虚拟路径
public static final String ERUPT_ATTACHMENT = "/erupt-attachment";

Expand Down
Loading
Loading