Skip to content

Commit 64702b4

Browse files
committed
日志更新,druid监控菜单
1 parent a0df6de commit 64702b4

File tree

6 files changed

+85
-3
lines changed

6 files changed

+85
-3
lines changed

src/main/java/com/huiwan/gdata/common/constants/uri/SysUri.java

+3
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ public class SysUri extends Modules {
2525
public static final String SYS_LOG = "sys/log";
2626
/** 系统参数 **/
2727
public static final String SYS_PARAMETER = "sys/parameter";
28+
29+
/** 数据库监控 **/
30+
public static final String SYS_DRUID = "druid";
2831

2932
/** 临时操作区 **/
3033
public static final String SYS_TEMP_SERVICE = "sys/temp_service";

src/main/java/com/huiwan/gdata/modules/gdata/base/charset/bean/QueryCommBean.java

+13
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ public class QueryCommBean implements Cloneable {
3535

3636
public String copyId;//副本id
3737
public String file;//文件类型
38+
public String name;
39+
3840

3941

4042
public String getDt1() {
@@ -235,6 +237,17 @@ public String getFile() {
235237
public void setFile(String file) {
236238
this.file = file;
237239
}
240+
241+
242+
243+
244+
public String getName() {
245+
return name;
246+
}
247+
248+
public void setName(String name) {
249+
this.name = name;
250+
}
238251

239252
@Override
240253
public String toString() {

src/main/java/com/huiwan/gdata/modules/gdata/combat/service/impl/CombatLogServiceImpl.java

+8-2
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,12 @@ private StringBuffer getSQLString(QueryCommBean vo) {
438438
sbWhere.append(vo.getType());
439439
sbWhere.append("'");
440440
}
441+
442+
if (StringUtils.isNotBlank(vo.getName())) {// 如果不为空,
443+
sbWhere.append(" and cont->>'name'='");
444+
sbWhere.append(vo.getName());
445+
sbWhere.append("'");
446+
}
441447
//
442448
// if (StringUtils.isNotBlank(vo.getCommQueryString())) {// 见听对象
443449
// sbWhere.append(" and cont->>copyId='");
@@ -473,7 +479,7 @@ public List<Dict> getObjTypes(int type, String severId) {
473479
if (StringUtils.isNotBlank(severId)) {
474480
sql += " where server_id='" + severId + "'";
475481
}
476-
sql += " order by id desc LIMIT 1000";
482+
sql += " order by id desc LIMIT 1500";
477483
log.info("sql:>>>\n{}", sql.toString());
478484
List<Dict> data = gdataDao.selectObjectList(sql.toString(), type_rowMapper);
479485
// 排序去重
@@ -483,7 +489,7 @@ public List<Dict> getObjTypes(int type, String severId) {
483489
if (data != null && data.size() > 0) {
484490
for (Dict dict : data) {
485491
data_new.put(dict.getValue(), dict);
486-
if (data_new.size() >= 10) {
492+
if (data_new.size() >= 20) {
487493
break;
488494
}
489495
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
package com.huiwan.gdata.modules.sys.web;
2+
3+
import org.springframework.stereotype.Controller;
4+
import org.springframework.web.bind.annotation.RequestMapping;
5+
6+
import com.huiwan.gdata.common.annotatiions.MenuAnnot;
7+
import com.huiwan.gdata.common.constants.Modules;
8+
import com.huiwan.gdata.common.constants.uri.SysUri;
9+
10+
/**
11+
* 系统参数
12+
*
13+
* @author rui
14+
*
15+
*/
16+
@Controller
17+
@RequestMapping(SysUri.SYS_DRUID)
18+
@MenuAnnot(id = "sys:druid", name = "数据库监控", parentId = Modules.SYS, href = "/druid/index", sortNo = 7)
19+
public class DruidViewController extends SysBaseController {
20+
21+
22+
// @RequestMapping(value = "index", method = RequestMethod.GET)
23+
// public String getList(
24+
// @RequestParam(value = "pageIndex", defaultValue = "1") Integer pageIndex,
25+
// @RequestParam(value = "pagesize", defaultValue = "12") Integer pagesize,
26+
// Parameter parameter) {
27+
//
28+
//
29+
// return "redirect:/ toList ";
30+
// }
31+
32+
}

src/main/resources/pro1.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ sys.user.key=abcdxxxxxxxxxxxxxxxx
2323
#jpush.appKey=aee2aba4010a78f91b6945e7
2424

2525
#0=init all,1=init menu,2=init menu AND init admin,
26-
initLevel=5
26+
initLevel=1

src/main/webapp/views/modules/gdata/combat/combatLog.html

+28
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,14 @@
6565
</select>
6666
</div> </div>
6767
</td>
68+
<td>
69+
</td>
70+
<td>
71+
</td>
72+
</tr>
73+
74+
<tr>
75+
6876
<td>
6977
<div class="form-group" >
7078
<div class="input-group">
@@ -79,7 +87,16 @@
7987
监听对象id: <input class="input-xlarge" name="_object_sd_id" id="_object_sd_id" placeholder="请先把下拉选择设为手动输入" type="text"/>
8088
</div>
8189
</td>
90+
91+
<td>
92+
<div class="form-group" >
93+
<div class="input-group">
94+
对象名称: <input name="types" id="_object_name" class="chosen-select" style="width: 150px;"/>
95+
</div> </div>
96+
</td>
97+
8298
</tr>
99+
83100
<tr>
84101
<td>
85102
<div class="form-group" >
@@ -268,6 +285,15 @@ <h4 class="modal-title" id="openAttrsDivModalLabel">对象基础属性</h4>
268285
});
269286
}
270287
}
288+
//名称
289+
var _object_name=$("#_object_name").val();
290+
if (_object_name != "" && _object_name != null && _object_name != 'undefined') {
291+
parma = $.extend(parma, {
292+
name : _object_name,
293+
});
294+
}
295+
296+
271297

272298
return parma;
273299
}
@@ -290,6 +316,8 @@ <h4 class="modal-title" id="openAttrsDivModalLabel">对象基础属性</h4>
290316
function(){
291317
getPaginationTable(".rl-page-table",true);
292318
initAttrs();//属性刷新
319+
//监听对像 刷新
320+
initJianTingType();
293321

294322
});
295323

0 commit comments

Comments
 (0)