Skip to content

Commit ee430e0

Browse files
authored
Merge pull request #292 from erupts/develop
1.12.18
2 parents 63f85cc + 638c001 commit ee430e0

File tree

578 files changed

+16659
-470333
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

578 files changed

+16659
-470333
lines changed

deploy/erupt-cloud-server-docker/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ docker run -d \
2525
| spring-datasource | SPRING_DATASOURCE_PASSWORD | | 数据库连接密码 |
2626
| jpa | SPRING_JPA_SHOW_SQL | false | jpa是否展示sql |
2727
| jpa | SPRING_JPA_GENERATE_DDL | true | jpa是否生成ddl |
28-
| erupt | ERUPT_REDIS_SESSION | false | erupt是否开启redis会话 |
28+
| erupt | ERUPT_REDIS_SESSION | false | 是否使用Redis管理会话 |
2929
| erupt | ERUPT_CLOUD_NAME_SPACE | erupt-cloud: | cloud key 命名空间 |
3030
| erupt | ERUPT_NODE_EXPIRE_TIME | 60000 | node节点持久化时长,单位:ms |
3131
| erupt | ERUPT_NODE_SURVIVE_CHECK_TIME | 120000 | node节点存活检查周期,单位:ms |

deploy/erupt-cloud-server-docker/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>xyz.erupt</groupId>
88
<artifactId>erupt</artifactId>
9-
<version>1.12.17</version>
9+
<version>1.12.18</version>
1010
<relativePath>../../pom.xml</relativePath>
1111
</parent>
1212

erupt-admin/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<parent>
1010
<groupId>xyz.erupt</groupId>
1111
<artifactId>erupt</artifactId>
12-
<version>1.12.17</version>
12+
<version>1.12.18</version>
1313
<relativePath>../pom.xml</relativePath>
1414
</parent>
1515

erupt-annotation/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<parent>
1212
<groupId>xyz.erupt</groupId>
1313
<artifactId>erupt</artifactId>
14-
<version>1.12.17</version>
14+
<version>1.12.18</version>
1515
<relativePath>../pom.xml</relativePath>
1616
</parent>
1717
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package xyz.erupt.annotation.constant;
2+
3+
public enum PageEmbedType {
4+
IFRAME,
5+
MICRO_FRONTEND
6+
}

erupt-annotation/src/main/java/xyz/erupt/annotation/fun/DataProxy.java

+6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package xyz.erupt.annotation.fun;
22

33
import xyz.erupt.annotation.config.Comment;
4+
import xyz.erupt.annotation.model.Alert;
45
import xyz.erupt.annotation.model.Row;
56
import xyz.erupt.annotation.query.Condition;
67

@@ -74,6 +75,11 @@ default void excelImport(@Comment("POI文档对象") Object workbook) {
7475
default void excelImportProcess(@Comment("数据对象") List<MODEL> list) {
7576
}
7677

78+
@Comment("警告提示")
79+
default Alert alert(List<Condition> conditions) {
80+
return null;
81+
}
82+
7783

7884
@Comment("自定义行,可实现行计算等能力")
7985
default List<Row> extraRow(List<Condition> conditions) {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package xyz.erupt.annotation.fun;
2+
3+
import xyz.erupt.annotation.config.Comment;
4+
5+
import java.util.List;
6+
7+
/**
8+
* @author YuePeng
9+
* date 2019-07-25.
10+
*/
11+
public interface RowChoiceFetchHandler<T> {
12+
13+
@Comment("根据行数据获取下拉列表")
14+
List<VLModel> fetch(T t, String[] params);
15+
16+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package xyz.erupt.annotation.model;
2+
3+
import lombok.Getter;
4+
import lombok.NoArgsConstructor;
5+
import lombok.Setter;
6+
7+
/**
8+
* @author YuePeng
9+
* date 2025/1/1 21:04
10+
*/
11+
@Getter
12+
@Setter
13+
@NoArgsConstructor
14+
public class Alert {
15+
16+
private String message;
17+
18+
private boolean closeable = false;
19+
20+
private UiType uiType = UiType.info;
21+
22+
public static Alert info(String message) {
23+
return new Alert(message, false, UiType.info);
24+
}
25+
26+
public Alert(String message, boolean closeable, UiType uiType) {
27+
this.message = message;
28+
this.closeable = closeable;
29+
this.uiType = uiType;
30+
}
31+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package xyz.erupt.annotation.model;
2+
3+
/**
4+
* @author YuePeng
5+
* date 2025/1/1 21:06
6+
*/
7+
public enum UiType {
8+
success,
9+
info,
10+
warning,
11+
error
12+
}

erupt-annotation/src/main/java/xyz/erupt/annotation/sub_erupt/Tpl.java

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import lombok.Getter;
44
import xyz.erupt.annotation.config.Comment;
5+
import xyz.erupt.annotation.constant.PageEmbedType;
56

67
import java.beans.Transient;
78
import java.util.Map;
@@ -30,6 +31,9 @@
3031
@Comment("模板引擎")
3132
Engine engine() default Engine.FreeMarker;
3233

34+
@Comment("页面嵌入方式:Iframe or 微前端")
35+
PageEmbedType embedType() default PageEmbedType.IFRAME;
36+
3337
@Comment("弹出层宽度")
3438
String width() default "";
3539

erupt-annotation/src/main/java/xyz/erupt/annotation/sub_field/Edit.java

+3
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@
7878
@Match("#item.type().toString()=='CHOICE'")
7979
ChoiceType choiceType() default @ChoiceType;
8080

81+
@Match("#item.type().toString()=='MULTI_CHOICE'")
82+
MultiChoiceType multiChoiceType() default @MultiChoiceType;
83+
8184
@Match("#item.type().toString()=='TAGS'")
8285
TagsType tagsType() default @TagsType;
8386

erupt-annotation/src/main/java/xyz/erupt/annotation/sub_field/EditType.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@ public enum EditType {
3333
@EditTypeMapping(mapping = BoolType.class, desc = "布尔", allowType = {JavaTypeEnum.bool})
3434
BOOLEAN,
3535
@EditTypeSearch(vagueMethod = QueryExpression.IN)
36-
@EditTypeMapping(mapping = ChoiceType.class, desc = "选择框", allowType = {JavaTypeEnum.String, JavaTypeEnum.number})
36+
@EditTypeMapping(mapping = ChoiceType.class, desc = "单选", allowType = {JavaTypeEnum.String, JavaTypeEnum.number})
3737
CHOICE,
38+
@EditTypeMapping(mapping = MultiChoiceType.class, desc = "多选", allowType = {JavaTypeEnum.object}, excelOperator = false)
39+
MULTI_CHOICE,
3840
@EditTypeSearch
3941
@EditTypeMapping(mapping = TagsType.class, desc = "标签选择器", allowType = {JavaTypeEnum.String, JavaTypeEnum.number})
4042
TAGS,
@@ -74,7 +76,7 @@ public enum EditType {
7476
@EditTypeMapping(mapping = ReferenceTreeType.class, desc = "树引用(多对一)", allowType = {JavaTypeEnum.object})
7577
REFERENCE_TREE,
7678
@EditTypeSearch
77-
@EditTypeMapping(mapping = ReferenceTableType.class, desc = "表格引用(多对一)", allowType = {JavaTypeEnum.bool})
79+
@EditTypeMapping(mapping = ReferenceTableType.class, desc = "表格引用(多对一)", allowType = {JavaTypeEnum.object})
7880
REFERENCE_TABLE,
7981
@EditTypeMapping(mapping = CheckboxType.class, desc = "多选(多对多)", allowType = {JavaTypeEnum.object}, excelOperator = false)
8082
CHECKBOX,

erupt-annotation/src/main/java/xyz/erupt/annotation/sub_field/View.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
String desc() default "";
1919

20-
@Comment("可在模板中使用row变量,获取当前行的数据")
20+
@Comment("定义表格列弹出层模板,可在模板中使用row变量获取当前行的数据")
2121
Tpl tpl() default @Tpl(path = "", enable = false);
2222

2323
@Comment("列宽度(请指定单位如:%、px)")

erupt-annotation/src/main/java/xyz/erupt/annotation/sub_field/sub_edit/ChoiceType.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
String[] fetchHandlerParams() default {};
2525

2626
@Transient
27-
@Comment("动态获取选择项")
27+
@Comment("获取下拉列表")
2828
Class<? extends ChoiceFetchHandler>[] fetchHandler() default {};
2929

3030
@Transient
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
package xyz.erupt.annotation.sub_field.sub_edit;
2+
3+
import xyz.erupt.annotation.config.Comment;
4+
import xyz.erupt.annotation.fun.ChoiceFetchHandler;
5+
6+
import java.beans.Transient;
7+
8+
/**
9+
* @author YuePeng
10+
* date 2025-01-19.
11+
*/
12+
public @interface MultiChoiceType {
13+
14+
Type type() default Type.CHECKBOX;
15+
16+
@Transient
17+
@Comment("手动配置选择项")
18+
VL[] vl() default {};
19+
20+
@Transient
21+
@Comment("可被fetchHandler接口获取到")
22+
String[] fetchHandlerParams() default {};
23+
24+
@Transient
25+
@Comment("动态获取选择项")
26+
Class<? extends ChoiceFetchHandler>[] fetchHandler() default {};
27+
28+
enum Type {
29+
@Comment("下拉多选")
30+
SELECT,
31+
@Comment("多选框")
32+
CHECKBOX,
33+
}
34+
}

erupt-annotation/src/main/java/xyz/erupt/annotation/sub_field/sub_edit/VL.java

-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package xyz.erupt.annotation.sub_field.sub_edit;
22

3-
import java.beans.Transient;
4-
53
/**
64
* @author YuePeng
75
* date 2018-10-11.
@@ -14,6 +12,5 @@
1412

1513
boolean disable() default false;
1614

17-
@Transient
1815
String desc() default "";
1916
}

erupt-cloud/erupt-cloud-common/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<parent>
1010
<groupId>xyz.erupt</groupId>
1111
<artifactId>erupt</artifactId>
12-
<version>1.12.17</version>
12+
<version>1.12.18</version>
1313
<relativePath>../../pom.xml</relativePath>
1414
</parent>
1515

erupt-cloud/erupt-cloud-node-jpa/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<parent>
1010
<groupId>xyz.erupt</groupId>
1111
<artifactId>erupt</artifactId>
12-
<version>1.12.17</version>
12+
<version>1.12.18</version>
1313
<relativePath>../../pom.xml</relativePath>
1414
</parent>
1515

erupt-cloud/erupt-cloud-node/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<parent>
1010
<groupId>xyz.erupt</groupId>
1111
<artifactId>erupt</artifactId>
12-
<version>1.12.17</version>
12+
<version>1.12.18</version>
1313
<relativePath>../../pom.xml</relativePath>
1414
</parent>
1515

erupt-cloud/erupt-cloud-server/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<parent>
1010
<groupId>xyz.erupt</groupId>
1111
<artifactId>erupt</artifactId>
12-
<version>1.12.17</version>
12+
<version>1.12.18</version>
1313
<relativePath>../../pom.xml</relativePath>
1414
</parent>
1515

erupt-cloud/erupt-cloud-server/src/main/java/xyz/erupt/cloud/server/model/CloudNode.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import xyz.erupt.annotation.EruptField;
1010
import xyz.erupt.annotation.EruptI18n;
1111
import xyz.erupt.annotation.constant.AnnotationConst;
12+
import xyz.erupt.annotation.constant.PageEmbedType;
1213
import xyz.erupt.annotation.expr.ExprBool;
1314
import xyz.erupt.annotation.sub_erupt.*;
1415
import xyz.erupt.annotation.sub_field.Edit;
@@ -40,13 +41,13 @@
4041
@RowOperation(
4142
title = "查看令牌", icon = "fa fa-shield", mode = RowOperation.Mode.SINGLE,
4243
show = @ExprBool(exprHandler = ViaMenuValueCtrl.class, params = CloudServerConst.CLOUD_ACCESS_TOKEN_PERMISSION),
43-
type = RowOperation.Type.TPL, tpl = @Tpl(path = "/tpl/node-info.ftl")
44+
type = RowOperation.Type.TPL, tpl = @Tpl(path = "/tpl/node-info.ftl",embedType = PageEmbedType.MICRO_FRONTEND)
4445
),
4546
@RowOperation(
4647
title = "节点日志", mode = RowOperation.Mode.SINGLE,
4748
ifExpr = "item.version && item.version != '-'",
4849
show = @ExprBool(exprHandler = ViaMenuValueCtrl.class, params = CloudServerConst.ERUPT_CLOUD_NODE_LOG),
49-
type = RowOperation.Type.TPL, tpl = @Tpl(path = "/tpl/erupt-log.html", height = "80%", openWay = OpenWay.DRAWER, drawerPlacement = Placement.BOTTOM)
50+
type = RowOperation.Type.TPL, tpl = @Tpl(path = "/tpl/erupt-log.html", height = "80vh", openWay = OpenWay.DRAWER, drawerPlacement = Placement.BOTTOM)
5051
),
5152
}, layout = @Layout(tableLeftFixed = 1, pageSize = 30)
5253
)

erupt-cloud/erupt-cloud-server/src/main/resources/tpl/node-info.ftl

+1-7
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,9 @@
33
<head>
44
<meta charset="UTF-8">
55
<title>Title</title>
6-
<style>
7-
* {
8-
margin: 0;
9-
padding: 0;
10-
}
11-
</style>
126
</head>
137
<body>
14-
<h1 style="text-align: center;letter-spacing:16px;margin: 55px 0">
8+
<h1 style="text-align: center;letter-spacing:16px;padding: 55px 0">
159
<#list rows as row>
1610
${row.accessToken}
1711
</#list>

erupt-cloud/erupt-cloud-server/src/main/resources/tpl/node-instance.ftl

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
<html>
22
<head>
3-
<base href="${base}/">
43
<meta charset="UTF-8">
5-
<link rel="stylesheet" href="ant-design/antd.min.css">
4+
<link rel="stylesheet" href="${base}/ant-design/antd.min.css">
65
</head>
76
<body>
87
<div id="app">
@@ -21,9 +20,9 @@
2120
</a-list>
2221
</template>
2322
</div>
24-
<script src="ant-design/vue.min.js"></script>
25-
<script src="ant-design/antd.min.js"></script>
26-
<script src="ant-design/axios.min.js"></script>
23+
<script src="${base}/ant-design/vue.min.js"></script>
24+
<script src="${base}/ant-design/antd.min.js"></script>
25+
<script src="${base}/ant-design/axios.min.js"></script>
2726
<script>
2827
var vue = new Vue({
2928
el: '#app',

erupt-core/pom.xml

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<parent>
1111
<groupId>xyz.erupt</groupId>
1212
<artifactId>erupt</artifactId>
13-
<version>1.12.17</version>
13+
<version>1.12.18</version>
1414
<relativePath>../pom.xml</relativePath>
1515
</parent>
1616

@@ -45,6 +45,7 @@
4545
<dependency>
4646
<groupId>com.google.code.gson</groupId>
4747
<artifactId>gson</artifactId>
48+
<version>2.9.1</version>
4849
</dependency>
4950
<dependency>
5051
<groupId>org.fusesource.jansi</groupId>

erupt-core/src/main/java/xyz/erupt/core/cache/EruptCache.java

+5
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,15 @@
99
*/
1010
public interface EruptCache<V> {
1111

12+
// ttl with milliseconds
1213
V put(String key, V v, long ttl);
1314

1415
V get(String key);
1516

17+
void expire(String key, long ttl);
18+
19+
Long getExpire(String key);
20+
1621
default V getAndSet(String key, long timeout, Supplier<V> supplier) {
1722
return Optional.ofNullable(this.get(key)).orElseGet(() -> this.put(key, supplier.get(), timeout));
1823
}

0 commit comments

Comments
 (0)