Skip to content

Commit

Permalink
add query task log conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
yuan.cheng committed Nov 23, 2016
1 parent eeed907 commit d918d41
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
.idea
.DS_Store
target
/dist/
2 changes: 1 addition & 1 deletion lts-admin/src/main/resources/lts-admin.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ configs.zk.client=zkclient
# ------ 这个是Admin存储数据的地方,也可以和JobQueue的地址一样 ------
configs.jdbc.url=jdbc:mysql://127.0.0.1:3306/lts
configs.jdbc.username=root
configs.jdbc.password=root
configs.jdbc.password=qwer1234

# admin 数据使用mysql 默认 mysql, 可以自行扩展
jdbc.datasource.provider=mysql
Expand Down
2 changes: 1 addition & 1 deletion lts-admin/src/main/resources/lts-monitor.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ configs.job.queue=mysql
# ------ 1. 如果是mysql作为任务队列 ------
configs.jdbc.url=jdbc:mysql://127.0.0.1:3306/lts
configs.jdbc.username=root
configs.jdbc.password=root
configs.jdbc.password=qwer1234

# ------ 2. 如果是mongo作为任务队列 ------
configs.mongo.addresses=127.0.0.1:27017
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@
</div>
</div>
</div>
`
</div>

<div class="modal inmodal" id="job-edit-modal" role="dialog" aria-hidden="true" style="display: none;">
Expand Down
30 changes: 30 additions & 0 deletions lts-admin/src/main/webapp/WEB-INF/views/templates/jobLogger.vm
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,36 @@
</select>
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 control-label">日志类型</label>

<div class="col-sm-3">
<select class="form-control selectpicker" name="taskTrackerNodeGroup">
<option value="">-- 不限 --</option>
#foreach ($nodeGroup in $taskTrackerNodeGroups)
#if ($taskTrackerNodeGroup == $nodeGroup.name)
<option value="$nodeGroup.name" selected>$nodeGroup.name</option>
#else
<option value="$nodeGroup.name">$nodeGroup.name</option>
#end
#end
</select>
</div>
<label class="col-sm-1 control-label">执行结果</label>

<div class="col-sm-3">
<select class="form-control selectpicker" name="taskTrackerNodeGroup">
<option value="">-- 不限 --</option>
#foreach ($nodeGroup in $taskTrackerNodeGroups)
#if ($taskTrackerNodeGroup == $nodeGroup.name)
<option value="$nodeGroup.name" selected>$nodeGroup.name</option>
#else
<option value="$nodeGroup.name">$nodeGroup.name</option>
#end
#end
</select>
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 control-label">时间</label>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.github.ltsopensource.biz.logger.domain;

import com.github.ltsopensource.admin.request.PaginationReq;
import com.sun.org.apache.xpath.internal.operations.Bool;

import java.util.Date;

Expand All @@ -14,6 +15,12 @@ public class JobLoggerRequest extends PaginationReq {

private String taskTrackerNodeGroup;

private String logType;

private String level;

private String success;

private Date startLogTime;

private Date endLogTime;
Expand Down Expand Up @@ -42,6 +49,30 @@ public void setTaskTrackerNodeGroup(String taskTrackerNodeGroup) {
this.taskTrackerNodeGroup = taskTrackerNodeGroup;
}

public String getLogType() {
return logType;
}

public void setLogType(String logType) {
this.logType = logType;
}

public String getLevel() {
return level;
}

public void setLevel(String level) {
this.level = level;
}

public String getSuccess() {
return success;
}

public void setSuccess(String success) {
this.success = success;
}

public Date getStartLogTime() {
return startLogTime;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import com.github.ltsopensource.store.jdbc.builder.SelectSql;
import com.github.ltsopensource.store.jdbc.builder.WhereSql;
import com.github.ltsopensource.store.jdbc.dbutils.JdbcTypeUtils;
import com.sun.tools.internal.ws.wsdl.document.soap.SOAPUse;

import java.util.List;

Expand Down Expand Up @@ -147,6 +148,9 @@ private WhereSql buildWhereSql(JobLoggerRequest request) {
.andOnNotEmpty("task_id = ?", request.getTaskId())
.andOnNotEmpty("real_task_id = ?", request.getRealTaskId())
.andOnNotEmpty("task_tracker_node_group = ?", request.getTaskTrackerNodeGroup())
.andOnNotEmpty("log_type = ?", request.getLogType())
.andOnNotEmpty("level = ?", request.getLevel())
.andOnNotEmpty("success = ?", request.getSuccess())
.andBetween("log_time", JdbcTypeUtils.toTimestamp(request.getStartLogTime()), JdbcTypeUtils.toTimestamp(request.getEndLogTime()))
;
}
Expand Down

0 comments on commit d918d41

Please sign in to comment.