Skip to content

Commit

Permalink
Merge pull request #292 from erupts/develop
Browse files Browse the repository at this point in the history
1.12.18
  • Loading branch information
erupts authored Jan 19, 2025
2 parents 63f85cc + 638c001 commit ee430e0
Show file tree
Hide file tree
Showing 578 changed files with 16,659 additions and 470,333 deletions.
2 changes: 1 addition & 1 deletion deploy/erupt-cloud-server-docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ docker run -d \
| spring-datasource | SPRING_DATASOURCE_PASSWORD | | 数据库连接密码 |
| jpa | SPRING_JPA_SHOW_SQL | false | jpa是否展示sql |
| jpa | SPRING_JPA_GENERATE_DDL | true | jpa是否生成ddl |
| erupt | ERUPT_REDIS_SESSION | false | erupt是否开启redis会话 |
| erupt | ERUPT_REDIS_SESSION | false | 是否使用Redis管理会话 |
| erupt | ERUPT_CLOUD_NAME_SPACE | erupt-cloud: | cloud key 命名空间 |
| erupt | ERUPT_NODE_EXPIRE_TIME | 60000 | node节点持久化时长,单位:ms |
| erupt | ERUPT_NODE_SURVIVE_CHECK_TIME | 120000 | node节点存活检查周期,单位:ms |
Expand Down
2 changes: 1 addition & 1 deletion deploy/erupt-cloud-server-docker/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>xyz.erupt</groupId>
<artifactId>erupt</artifactId>
<version>1.12.17</version>
<version>1.12.18</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
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.17</version>
<version>1.12.18</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.17</version>
<version>1.12.18</version>
<relativePath>../pom.xml</relativePath>
</parent>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package xyz.erupt.annotation.constant;

public enum PageEmbedType {
IFRAME,
MICRO_FRONTEND
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package xyz.erupt.annotation.fun;

import xyz.erupt.annotation.config.Comment;
import xyz.erupt.annotation.model.Alert;
import xyz.erupt.annotation.model.Row;
import xyz.erupt.annotation.query.Condition;

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

@Comment("警告提示")
default Alert alert(List<Condition> conditions) {
return null;
}


@Comment("自定义行,可实现行计算等能力")
default List<Row> extraRow(List<Condition> conditions) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package xyz.erupt.annotation.fun;

import xyz.erupt.annotation.config.Comment;

import java.util.List;

/**
* @author YuePeng
* date 2019-07-25.
*/
public interface RowChoiceFetchHandler<T> {

@Comment("根据行数据获取下拉列表")
List<VLModel> fetch(T t, String[] params);

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

import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

/**
* @author YuePeng
* date 2025/1/1 21:04
*/
@Getter
@Setter
@NoArgsConstructor
public class Alert {

private String message;

private boolean closeable = false;

private UiType uiType = UiType.info;

public static Alert info(String message) {
return new Alert(message, false, UiType.info);
}

public Alert(String message, boolean closeable, UiType uiType) {
this.message = message;
this.closeable = closeable;
this.uiType = uiType;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package xyz.erupt.annotation.model;

/**
* @author YuePeng
* date 2025/1/1 21:06
*/
public enum UiType {
success,
info,
warning,
error
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import lombok.Getter;
import xyz.erupt.annotation.config.Comment;
import xyz.erupt.annotation.constant.PageEmbedType;

import java.beans.Transient;
import java.util.Map;
Expand Down Expand Up @@ -30,6 +31,9 @@
@Comment("模板引擎")
Engine engine() default Engine.FreeMarker;

@Comment("页面嵌入方式:Iframe or 微前端")
PageEmbedType embedType() default PageEmbedType.IFRAME;

@Comment("弹出层宽度")
String width() default "";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@
@Match("#item.type().toString()=='CHOICE'")
ChoiceType choiceType() default @ChoiceType;

@Match("#item.type().toString()=='MULTI_CHOICE'")
MultiChoiceType multiChoiceType() default @MultiChoiceType;

@Match("#item.type().toString()=='TAGS'")
TagsType tagsType() default @TagsType;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@ public enum EditType {
@EditTypeMapping(mapping = BoolType.class, desc = "布尔", allowType = {JavaTypeEnum.bool})
BOOLEAN,
@EditTypeSearch(vagueMethod = QueryExpression.IN)
@EditTypeMapping(mapping = ChoiceType.class, desc = "选择框", allowType = {JavaTypeEnum.String, JavaTypeEnum.number})
@EditTypeMapping(mapping = ChoiceType.class, desc = "单选", allowType = {JavaTypeEnum.String, JavaTypeEnum.number})
CHOICE,
@EditTypeMapping(mapping = MultiChoiceType.class, desc = "多选", allowType = {JavaTypeEnum.object}, excelOperator = false)
MULTI_CHOICE,
@EditTypeSearch
@EditTypeMapping(mapping = TagsType.class, desc = "标签选择器", allowType = {JavaTypeEnum.String, JavaTypeEnum.number})
TAGS,
Expand Down Expand Up @@ -74,7 +76,7 @@ public enum EditType {
@EditTypeMapping(mapping = ReferenceTreeType.class, desc = "树引用(多对一)", allowType = {JavaTypeEnum.object})
REFERENCE_TREE,
@EditTypeSearch
@EditTypeMapping(mapping = ReferenceTableType.class, desc = "表格引用(多对一)", allowType = {JavaTypeEnum.bool})
@EditTypeMapping(mapping = ReferenceTableType.class, desc = "表格引用(多对一)", allowType = {JavaTypeEnum.object})
REFERENCE_TABLE,
@EditTypeMapping(mapping = CheckboxType.class, desc = "多选(多对多)", allowType = {JavaTypeEnum.object}, excelOperator = false)
CHECKBOX,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

String desc() default "";

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

@Comment("列宽度(请指定单位如:%、px)")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
String[] fetchHandlerParams() default {};

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

@Transient
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package xyz.erupt.annotation.sub_field.sub_edit;

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

import java.beans.Transient;

/**
* @author YuePeng
* date 2025-01-19.
*/
public @interface MultiChoiceType {

Type type() default Type.CHECKBOX;

@Transient
@Comment("手动配置选择项")
VL[] vl() default {};

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

@Transient
@Comment("动态获取选择项")
Class<? extends ChoiceFetchHandler>[] fetchHandler() default {};

enum Type {
@Comment("下拉多选")
SELECT,
@Comment("多选框")
CHECKBOX,
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package xyz.erupt.annotation.sub_field.sub_edit;

import java.beans.Transient;

/**
* @author YuePeng
* date 2018-10-11.
Expand All @@ -14,6 +12,5 @@

boolean disable() default false;

@Transient
String desc() default "";
}
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.17</version>
<version>1.12.18</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.17</version>
<version>1.12.18</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.17</version>
<version>1.12.18</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
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.17</version>
<version>1.12.18</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import xyz.erupt.annotation.EruptField;
import xyz.erupt.annotation.EruptI18n;
import xyz.erupt.annotation.constant.AnnotationConst;
import xyz.erupt.annotation.constant.PageEmbedType;
import xyz.erupt.annotation.expr.ExprBool;
import xyz.erupt.annotation.sub_erupt.*;
import xyz.erupt.annotation.sub_field.Edit;
Expand Down Expand Up @@ -40,13 +41,13 @@
@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")
type = RowOperation.Type.TPL, tpl = @Tpl(path = "/tpl/node-info.ftl",embedType = PageEmbedType.MICRO_FRONTEND)
),
@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", height = "80%", openWay = OpenWay.DRAWER, drawerPlacement = Placement.BOTTOM)
type = RowOperation.Type.TPL, tpl = @Tpl(path = "/tpl/erupt-log.html", height = "80vh", openWay = OpenWay.DRAWER, drawerPlacement = Placement.BOTTOM)
),
}, layout = @Layout(tableLeftFixed = 1, pageSize = 30)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,9 @@
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
* {
margin: 0;
padding: 0;
}
</style>
</head>
<body>
<h1 style="text-align: center;letter-spacing:16px;margin: 55px 0">
<h1 style="text-align: center;letter-spacing:16px;padding: 55px 0">
<#list rows as row>
${row.accessToken}
</#list>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<html>
<head>
<base href="${base}/">
<meta charset="UTF-8">
<link rel="stylesheet" href="ant-design/antd.min.css">
<link rel="stylesheet" href="${base}/ant-design/antd.min.css">
</head>
<body>
<div id="app">
Expand All @@ -21,9 +20,9 @@
</a-list>
</template>
</div>
<script src="ant-design/vue.min.js"></script>
<script src="ant-design/antd.min.js"></script>
<script src="ant-design/axios.min.js"></script>
<script src="${base}/ant-design/vue.min.js"></script>
<script src="${base}/ant-design/antd.min.js"></script>
<script src="${base}/ant-design/axios.min.js"></script>
<script>
var vue = new Vue({
el: '#app',
Expand Down
3 changes: 2 additions & 1 deletion 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.17</version>
<version>1.12.18</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down Expand Up @@ -45,6 +45,7 @@
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.9.1</version>
</dependency>
<dependency>
<groupId>org.fusesource.jansi</groupId>
Expand Down
5 changes: 5 additions & 0 deletions erupt-core/src/main/java/xyz/erupt/core/cache/EruptCache.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,15 @@
*/
public interface EruptCache<V> {

// ttl with milliseconds
V put(String key, V v, long ttl);

V get(String key);

void expire(String key, long ttl);

Long getExpire(String key);

default V getAndSet(String key, long timeout, Supplier<V> supplier) {
return Optional.ofNullable(this.get(key)).orElseGet(() -> this.put(key, supplier.get(), timeout));
}
Expand Down
Loading

0 comments on commit ee430e0

Please # to comment.