Skip to content

Commit 4a4ed8a

Browse files
committed
节点日志支持抽屉方式打开
1 parent 884064d commit 4a4ed8a

File tree

12 files changed

+53
-15
lines changed

12 files changed

+53
-15
lines changed

erupt-annotation/src/main/java/xyz/erupt/annotation/Erupt.java

-4
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,6 @@
6767
//布局配置
6868
Layout layout() default @Layout;
6969

70-
// @Comment("自定义页头")
71-
// @Match("#value.path() != ''")
72-
// Tpl header() default @Tpl(path = "");
73-
//
7470
// @Comment("画册视图定义")
7571
// @Match("#value.enable() == true")
7672
// Card cardView() default @Card(enable = false, galleryField = "", viewFields = {});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package xyz.erupt.annotation.sub_erupt;
2+
3+
public enum OpenWay {
4+
//抽屉
5+
DRAWER,
6+
//对话框
7+
MODAL
8+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package xyz.erupt.annotation.sub_erupt;
2+
3+
/**
4+
* @author YuePeng
5+
* date 2024/8/25 15:53
6+
*/
7+
public enum Placement {
8+
TOP,
9+
BOTTOM,
10+
LEFT,
11+
RIGHT
12+
}

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

+9
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,15 @@
3333
@Comment("弹出层宽度")
3434
String width() default "";
3535

36+
@Comment("弹出层高度")
37+
String height() default "";
38+
39+
@Comment("弹出层打开方式")
40+
OpenWay openWay() default OpenWay.MODAL;
41+
42+
@Comment("抽屉打开方向")
43+
Placement drawerPlacement() default Placement.RIGHT;
44+
3645
@Getter
3746
enum Engine {
3847
@Comment("原生H5, Native模式下不支持tplHandler")

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

+2-4
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@
1010
import xyz.erupt.annotation.EruptI18n;
1111
import xyz.erupt.annotation.constant.AnnotationConst;
1212
import xyz.erupt.annotation.expr.ExprBool;
13-
import xyz.erupt.annotation.sub_erupt.Layout;
14-
import xyz.erupt.annotation.sub_erupt.RowOperation;
15-
import xyz.erupt.annotation.sub_erupt.Tpl;
13+
import xyz.erupt.annotation.sub_erupt.*;
1614
import xyz.erupt.annotation.sub_field.Edit;
1715
import xyz.erupt.annotation.sub_field.EditType;
1816
import xyz.erupt.annotation.sub_field.View;
@@ -48,7 +46,7 @@
4846
title = "节点日志", mode = RowOperation.Mode.SINGLE,
4947
ifExpr = "item.version && item.version != '-'",
5048
show = @ExprBool(exprHandler = ViaMenuValueCtrl.class, params = CloudServerConst.ERUPT_CLOUD_NODE_LOG),
51-
type = RowOperation.Type.TPL, tpl = @Tpl(path = "/tpl/erupt-log.html", width = "85%")
49+
type = RowOperation.Type.TPL, tpl = @Tpl(path = "/tpl/erupt-log.html", height = "80%", openWay = OpenWay.DRAWER, drawerPlacement = Placement.BOTTOM)
5250
),
5351
}, layout = @Layout(tableLeftFixed = 1, pageSize = 30)
5452
)

erupt-upms/src/main/resources/tpl/erupt-log.html

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

1818
@font-face {
1919
font-family: 'Courier New';
20-
src: url('monitor/Courier-New.ttf');
20+
src: url('log/Courier-New.ttf');
2121
}
2222
</style>
2323
</head>
@@ -34,8 +34,23 @@
3434
let cloudNode = new URLSearchParams(location.search).get("_erupt") === 'CloudNode';
3535
if (cloudNode) {
3636
if (window.self !== window.top) {
37-
window.parent.document.getElementsByClassName("ant-modal-header")[0].remove();
38-
window.parent.document.getElementsByClassName("ant-modal-close-x")[0].style.color = "#fff";
37+
let interval;
38+
39+
function removeHeader() {
40+
try {
41+
// window.parent.document.getElementsByClassName("ant-modal-header")[0].remove();
42+
// window.parent.document.getElementsByClassName("ant-modal-close-x")[0].style.color = "#fff";
43+
window.parent.document.getElementsByClassName("ant-drawer-header")[0].remove();
44+
} catch (e) {
45+
console.warn(e);
46+
interval && clearInterval(interval);
47+
}
48+
}
49+
50+
removeHeader()
51+
interval = setInterval(() => {
52+
removeHeader()
53+
}, 100)
3954
}
4055
}
4156
const xterm = new Terminal({

erupt-web/src/main/resources/public/266.c57f2d264c9f36f2.js

-1
This file was deleted.

erupt-web/src/main/resources/public/266.ddd9323df76e6e45.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

erupt-web/src/main/resources/public/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,6 @@
4646
</div>
4747
<![endif]-->
4848
<app-root></app-root>
49-
<script src="runtime.2d916b1c30f84159.js" type="module"></script><script src="polyfills.827684443b3599b2.js" type="module"></script><script src="main.edf9f05f94530a4d.js" type="module"></script>
49+
<script src="runtime.3662cf2f1d7c5084.js" type="module"></script><script src="polyfills.827684443b3599b2.js" type="module"></script><script src="main.20cc715d5299c0f5.js" type="module"></script>
5050

5151
</body></html>

erupt-web/src/main/resources/public/main.20cc715d5299c0f5.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

erupt-web/src/main/resources/public/main.edf9f05f94530a4d.js

-1
This file was deleted.

erupt-web/src/main/resources/public/runtime.2d916b1c30f84159.js renamed to erupt-web/src/main/resources/public/runtime.3662cf2f1d7c5084.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)