Skip to content

Commit fa80398

Browse files
committed
【Doe_V1.1.0】 调整页面样式
1 parent 8070b64 commit fa80398

File tree

3 files changed

+110
-7
lines changed

3 files changed

+110
-7
lines changed

mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/util/FileUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public static String readToString(String fileName) throws DoeException {
3030
FileInputStream in = new FileInputStream(file);
3131
int read = in.read(filecontent);
3232
in.close();
33-
log.info(String.format("read:{} filelength:{}", read, filelength));
33+
log.info("read:{} filelength:{}", read, filelength);
3434
} catch (IOException e) {
3535
throw new DoeException(StringUtil.format("can't load the file content, because {}.", e.getMessage()));
3636
}

mmc-dubbo-doe/src/main/resources/static/v3/js/pom.js

Whitespace-only changes.

mmc-dubbo-doe/src/main/resources/templates/pages/v3/editPom.html

Lines changed: 109 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,22 +38,33 @@ <h1>
3838
<div class="row">
3939
<div class="col-xs-12">
4040
<!-- PAGE CONTENT BEGINS -->
41-
4241
<div class="row">
43-
<textarea class="form-control" id="txtParams" rows="20"
44-
placeholder=""></textarea>
42+
<div class="col-xs-12">
43+
44+
<h4 class="smaller green" id="lblTitle"></h4>
45+
46+
<textarea class="form-control" id="txtParams" rows="20"
47+
placeholder=""></textarea>
48+
<span class="smaller-20 lighter green">编辑pom文件后,或可以在系统管理->系统配置->重启生效.</span>
49+
50+
</div>
4551
</div>
4652

4753

4854
<div class="row">
4955
<div class="clearfix form-actions">
5056
<div class="col-md-offset-3 col-md-9">
51-
<button class="btn btn-info" type="button" onclick="doLoad();">
57+
<button class="btn btn-success" id="bootbox-regular" onclick="doSave();">保存POM文件</button>
58+
&nbsp; &nbsp; &nbsp;
59+
<button class="btn btn-info" type="button" onclick="doParsePom();">
5260
<i class="icon-ok bigger-110"></i>
53-
加载
61+
解析POM文件
5462
</button>
5563
&nbsp; &nbsp; &nbsp;
56-
<button class="btn" id="bootbox-regular" onclick="doSave();">保存</button>
64+
<button class="btn btn-info" type="button" onclick="doReload();">
65+
<i class="icon-ok bigger-110"></i>
66+
重新加载JAR
67+
</button>
5768
&nbsp; &nbsp; &nbsp;
5869
<button class="btn" type="reset" onclick="doClear();">
5970
<i class="icon-undo bigger-110"></i>
@@ -93,11 +104,103 @@ <h1>
93104

94105
<script type="text/javascript">
95106

107+
var jobRef = ""; // 定时任务引用
108+
96109
function doClear() {
97110

98111
$("#txtParams").val("");
99112

100113
}
114+
function doRequest(requestId) {
115+
116+
var param = {"requestId": requestId};
117+
118+
Nora.Ajax("/doe/pom/doMsg", param, function (data) {
119+
if (data.success) {
120+
// on success
121+
$("#txtParams").scrollTop(500000);
122+
if (data.code == 1) {
123+
// continue get message
124+
var message = data.data;
125+
$("#txtParams").val($("#txtParams").val() + "\n" + message);
126+
127+
128+
} else if (data.code == 2) {
129+
// complete
130+
var message = data.data;
131+
// 替换所有的换行符
132+
$("#txtParams").val($("#txtParams").val() + "\n" + message);
133+
$("#lblTitle").text(data.msg);
134+
135+
clearInterval(jobRef);
136+
137+
} else {
138+
139+
// 阻止定时刷新
140+
clearInterval(jobRef);
141+
}
142+
143+
} else {
144+
// on fail
145+
// 阻止定时刷新
146+
clearInterval(jobRef);
147+
bootbox.alert(data.msg);
148+
}
149+
150+
}, function (data) {
151+
// on fail
152+
// 阻止定时刷新
153+
clearInterval(jobRef);
154+
bootbox.alert(data.msg);
155+
});
156+
}
157+
function doParsePom() {
158+
159+
var param = {};
160+
161+
Nora.Ajax("/doe/pom/doReparse", param, function (data) {
162+
if (data.success) {
163+
// on success
164+
var msg = data.msg;
165+
$("#txtParams").val("");
166+
$("#lblTitle").text(msg);
167+
var requestId = data.data.requestId;
168+
169+
getRealTimeMessage(requestId);
170+
171+
} else {
172+
bootbox.alert(data.msg);
173+
}
174+
175+
}, function (data) {
176+
// on fail
177+
bootbox.alert(data.msg);
178+
});
179+
}
180+
function getRealTimeMessage(requestId) {
181+
182+
if (null == requestId || requestId.length <= 0) {
183+
bootbox.alert("获取不到请求ID!");
184+
return;
185+
}
186+
187+
// 设置定时刷新
188+
jobRef = setInterval(function(){
189+
doRequest(requestId);
190+
},1000);
191+
192+
}
193+
function doReload() {
194+
195+
var param = {};
196+
Nora.Ajax("/doe/pom/doLoad", param, function (data) {
197+
198+
bootbox.alert(data.msg);
199+
200+
}, function (data) {
201+
bootbox.alert(data.msg);
202+
});
203+
}
101204
function doSave() {
102205

103206
var content = $("#txtParams").val();

0 commit comments

Comments
 (0)