Authored by qinchao

Merge branch 'monitor-ui-fyzh'

... ... @@ -25,11 +25,9 @@
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
</dependency>
<dependency>
<groupId>com.google.collections</groupId>
<artifactId>google-collections</artifactId>
<version>1.0-rc2</version>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
<dependency>
... ...
package com.ui.common;
//import com.google.common.collect.Lists;
import com.google.common.collect.Lists;
import java.util.HashMap;
... ...
... ... @@ -14,12 +14,17 @@
<dependencies>
<!-- <dependency>
<dependency>
<groupId>com.yoho.quartz</groupId>
<artifactId>yoho-quartz-server</artifactId>
<version>1.0-SNAPSHOT</version>
<version>1.3.4-SNAPSHOT</version>
</dependency>
-->
<!--<dependency>-->
<!--<groupId>com.google.guava</groupId>-->
<!--<artifactId>guava</artifactId>-->
<!--<version>16.0</version>-->
<!--</dependency>-->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
... ...
... ... @@ -75,34 +75,34 @@
<mvc:resources location="/script/" mapping="/script/**"/>
<mvc:resources location="/sql_format/" mapping="/sql_format/**"/>
<mvc:interceptors>
<!-- 登录验证 -->
<mvc:interceptor>
<mvc:mapping path="/**"/>
<mvc:exclude-mapping path="/bigdata/**"/>
<mvc:exclude-mapping path="/hystrix/**"/>
<mvc:exclude-mapping path="/user/**"/>
<mvc:exclude-mapping path="/img/**"/>
<mvc:exclude-mapping path="/css/**"/>
<mvc:exclude-mapping path="/js/**"/>
<mvc:exclude-mapping path="/fonts/**"/>
<mvc:exclude-mapping path="/script/**"/>
<mvc:exclude-mapping path="/sql_format/**"/>
<mvc:exclude-mapping path="/dashboard/**"/>
<mvc:exclude-mapping path="/app_**/**"/>
<mvc:exclude-mapping path="/deliverMessageVoice/**"/>
<mvc:exclude-mapping path="/deliverMessagetxt/**"/>
<mvc:exclude-mapping path="/systemTest/**"/>
<mvc:exclude-mapping path="/recvMonitAlarm"/>
<mvc:exclude-mapping path="/awsapi/sns" />
<mvc:exclude-mapping path="/testcommon/testUpLoadData" />
<mvc:exclude-mapping path="/workSystem/callbackTest" />
<mvc:exclude-mapping path="/cmdb/api" />
<mvc:exclude-mapping path="/outer/*" />
<mvc:exclude-mapping path="/dashboard/toDashboard" />
<bean class="com.ui.interceptor.AuthInterceptor"/>
</mvc:interceptor>
<!--<mvc:interceptors>-->
<!--&lt;!&ndash; 登录验证 &ndash;&gt;-->
<!--<mvc:interceptor>-->
<!--<mvc:mapping path="/**"/>-->
<!--<mvc:exclude-mapping path="/bigdata/**"/>-->
<!--<mvc:exclude-mapping path="/hystrix/**"/>-->
<!--<mvc:exclude-mapping path="/user/**"/>-->
<!--<mvc:exclude-mapping path="/img/**"/>-->
<!--<mvc:exclude-mapping path="/css/**"/>-->
<!--<mvc:exclude-mapping path="/js/**"/>-->
<!--<mvc:exclude-mapping path="/fonts/**"/>-->
<!--<mvc:exclude-mapping path="/script/**"/>-->
<!--<mvc:exclude-mapping path="/sql_format/**"/>-->
<!--<mvc:exclude-mapping path="/dashboard/**"/>-->
<!--<mvc:exclude-mapping path="/app_**/**"/>-->
<!--<mvc:exclude-mapping path="/deliverMessageVoice/**"/>-->
<!--<mvc:exclude-mapping path="/deliverMessagetxt/**"/>-->
<!--<mvc:exclude-mapping path="/systemTest/**"/>-->
<!--<mvc:exclude-mapping path="/recvMonitAlarm"/>-->
<!--<mvc:exclude-mapping path="/awsapi/sns" />-->
<!--<mvc:exclude-mapping path="/testcommon/testUpLoadData" />-->
<!--<mvc:exclude-mapping path="/workSystem/callbackTest" />-->
<!--<mvc:exclude-mapping path="/cmdb/api" />-->
<!--<mvc:exclude-mapping path="/outer/*" />-->
<!--<mvc:exclude-mapping path="/dashboard/toDashboard" />-->
<!--<bean class="com.ui.interceptor.AuthInterceptor"/>-->
<!--</mvc:interceptor>-->
</mvc:interceptors>
<!--</mvc:interceptors>-->
</beans>
\ No newline at end of file
... ...
monitor.service.url=http://127.0.0.1:8880/monitor
search.aws.url=http://192.168.102.216:8080/
search.qq.url=http://192.168.102.224:8080/
search.filePath=D:/Data/productList.txt
\ No newline at end of file
search.filePath=D:/Data/productList.txt
#zkAddress=192.168.102.211:2181
zkAddress=192.168.102.45:2181
job.run.log.limit=10
\ No newline at end of file
... ...
datasources:
yh_ops:
servers:
- 192.168.102.219:3306
- 192.168.102.219:3306
username: yh_test
password: 9nm0icOwt6bMHjMusIfMLw==
readOnlyInSlave: false
\ No newline at end of file
... ...
#==============================================================
#Configure DataSource
#==============================================================
org.quartz.dataSource.myDS.driver = com.mysql.jdbc.Driver
# test
org.quartz.dataSource.myDS.URL = jdbc:mysql://172.16.6.85:3306/jobmanager?useUnicode=true&amp;characterEncoding=UTF-8
org.quartz.dataSource.myDS.user = test
org.quartz.dataSource.myDS.password = t5/oMgwUCmO/GeMHBAQ2Cg==
# online
#org.quartz.dataSource.myDS.URL = jdbc:mysql://write.cms.yohoops.org:3306/yh_jobmanager?useUnicode=true&amp;characterEncoding=UTF-8
#org.quartz.dataSource.myDS.user = yh_vpc_bak
#org.quartz.dataSource.myDS.password = +BfhVxZQ4LuPKt+QxSy9naMwEu/zaKV31I9S8xDJIUA=
org.quartz.dataSource.myDS.maxConnections = 30
#org.quartz.dataSource.myDS.connectionProvider.class=com.yoho.quartz.dbconnectionpool.CusPoolingConnectionProvider
#==============================================================
#Configure ThreadPool
#==============================================================
#org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool
#org.quartz.threadPool.threadCount = 2
#org.quartz.threadPool.threadPriority = 5
#org.quartz.threadPool.threadsInheritContextClassLoaderOfInitializingThread = true
#=============================================================
# Alarm
##############################################################
# test
org.yoho.quartz.alarm.influxdb.url=http://192.168.102.22:8086
# online
#org.yoho.quartz.alarm.influxdb.url=http://172.31.50.75:8086
org.yoho.quartz.alarm.influxdb.username=root
org.yoho.quartz.alarm.influxdb.passwd=Z5BMngayHLUxyWLSv6+koA==
#org.yoho.quartz.alarm.influxdb.database=yoho-monitor
#org.yoho.quartz.alarm.influxdb.measurement=yoho_job_alarm
\ No newline at end of file
... ... @@ -7,7 +7,7 @@
<!-- Only one context -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath*:META-INF/spring/spring*.xml</param-value>
<param-value>classpath*:META-INF/spring/mybatis-datasource.xml,classpath*:META-INF/spring/spring*.xml</param-value>
</context-param>
<!--spring profile: restful client is local or zookeeper -->
<context-param>
... ...
... ... @@ -31,7 +31,8 @@
<script src="<%=basePath %>js/global.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.pagination.js" charset="UTF-8"
type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/jsquartz/bootstrap.table.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/jsquartz/bootstrap.table.js" charset="UTF-8"
type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.dialog.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.form.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.panel.js" charset="UTF-8" type="text/javascript"></script>
... ... @@ -63,13 +64,32 @@
<div class="widget-box">
<div class="widget-content nopadding">
<div id="jobInfoDiv">
<div id="jobInfoListTable"></div>
<div id="jobCreateJobBtm">
<button id="crtbtn" class="btn btn-primary" onclick="showCreatePage()">创建任务</button>
<div id="jobInfoDiv">
<%--<div id="jobSearch" class="input-group" style="float: left;">--%>
<%--<div class="form-inline" role="form" id="inBoxQueryDiv">--%>
<%--<span class="input-group-addon">模块名称:</span>--%>
<%--<input type="text" id="scheSearch" name="scheSearch" class="form-control" placeholder=""/>--%>
<%--</div>--%>
<%--<button id="searchBtn" class="btn btn-primary" style="margin-left: 18px;">搜索</button>--%>
<%--</div>--%>
<div class="widget-title" style="height: 53px;">
<div>
<div class="form-inline" role="form" id="inBoxQueryDiv"
style=" margin-top: 12px;margin-left: 25px;float: left;">
<div class="input-group" style="float: left;">
<span class="input-group-addon">模块名称:</span>
<input type="text" id="moduleName" name="moduleName" class="form-control" placeholder=""/>
</div>
<button id="searchBtn" class="btn btn-primary" style="margin-left: 18px;">搜索</button>
</div>
</div>
</div>
<%--<div id="jobCreateJobDiv"></div>--%>
<div id="jobInfoListTable"></div>
<div id="jobCreateJobBtm">
<button id="crtbtn" class="btn btn-primary" onclick="showCreatePage()">创建任务</button>
</div>
<%--<div id="jobCreateJobDiv"></div>--%>
</div>
</div>
</div>
... ... @@ -88,7 +108,7 @@
laydate.render({
elem: '#startTime', //指定元素
type:'datetime'
type: 'datetime'
});
$(function () {
... ... @@ -97,11 +117,11 @@
//var paramObj = {};
//$("#jobCreateJobDiv").hide();
//全局的panel的样式
var currentPage=1;
var currentPage = 1;
var panelStyle = "panel-primary";
$("#jobInfoDiv #jobInfoListTable").table(
{
url: contextPath+"/job/getAllJobs.do",
url: contextPath + "/job/getAllJobs.do",
queryParams: {},
title: "任务列表",
panelClass: panelStyle,
... ... @@ -149,6 +169,10 @@
field: "startDate"
},
{
title:"下次执行时间",
field:"nextFireTime"
},
{
title: "补偿策略",
field: "misfiredPolicy"
},
... ... @@ -179,6 +203,10 @@
field: "state"
},
{
title:"任务描述",
field:"desc"
},
{
title: "操作",
formatter: function (value, rowData, rowIndex) {
var div = $("<div>");
... ... @@ -276,7 +304,7 @@
}]
});
}
location.href = contextPath+"/job/toJob";
location.href = contextPath + "/job/toJob";
}
});
}
... ... @@ -285,9 +313,9 @@
function geturl() {
if (newstate == "PAUSE") {
return contextPath+"/job/pauseJob.do";
return contextPath + "/job/pauseJob.do";
} else if (newstate == "WAITING") {
return contextPath+"/job/startJob.do";
return contextPath + "/job/startJob.do";
}
}
}
... ... @@ -295,21 +323,21 @@
function showCreatePage() {
var dialog = $("<div>").appendTo($("body"));
dialog.dialog({
size : "modal-lg",
size: "modal-lg",
title: "创建任务",
backdrop: "static",
href: contextPath+"/job/toCreateJob",
href: contextPath + "/job/toCreateJob",
queryParams: {},
buttons : [{
text : "关闭",
className : "btn-danger",
onclick : function() {
buttons: [{
text: "关闭",
className: "btn-danger",
onclick: function () {
$(dialog).dialog("hide");
}
}, {
text : "提交",
className : "btn-success",
onclick : function() {
text: "提交",
className: "btn-success",
onclick: function () {
createJob();
}
}]
... ... @@ -333,48 +361,48 @@
var desc = $("#creatjobinfo #desc");
var jobinfo = {
"jobName": jobName.val(),
"jobGroup" : jobGroup.val(),
"module" : module.val(),
"jobType" : activemode.val(),
"priority" : priority.val(),
"desc" : desc.val(),
"jobClass" : processor.val(),
"misfiredPolicy" : misfiredPolicy.val(),
"cron" : cronexception.val(),
"startDate" : startTime.val(),
"repeatCount" : repeatCount.val(),
"interval" : interval.val(),
"jobContext" : context.val()
"jobGroup": jobGroup.val(),
"module": module.val(),
"jobType": activemode.val(),
"priority": priority.val(),
"desc": desc.val(),
"jobClass": processor.val(),
"misfiredPolicy": misfiredPolicy.val(),
"cron": cronexception.val(),
"startDate": startTime.val(),
"repeatCount": repeatCount.val(),
"interval": interval.val(),
"jobContext": context.val()
};
$.ajax({
url : contextPath+"/job/createJob.do",
contentType : "application/json; charset=utf-8",
data : JSON.stringify(jobinfo),
dataType : "json",
type : "POST",
success : function(data) {
url: contextPath + "/job/createJob.do",
contentType: "application/json; charset=utf-8",
data: JSON.stringify(jobinfo),
dataType: "json",
type: "POST",
success: function (data) {
if (!data) {
$("#creatjobinfo #messageAlert").alerts({
content : "创建任务失败",
type : "danger"
content: "创建任务失败",
type: "danger"
});
return;
}
if (data.code != 200) {
$("#creatjobinfo #messageAlert").alerts({
content : data.message,
type : "danger"
content: data.message,
type: "danger"
});
return;
}
$(dialog).dialog("hide");
location.href = contextPath+"/job/toJob";
},error: function (e) {
location.href = contextPath + "/job/toJob";
}, error: function (e) {
console.log(e);
$("#creatjobinfo #messageAlert").alerts({
content : "创建任务失败,发生error",
type : "danger"
content: "创建任务失败,发生error",
type: "danger"
});
return;
}
... ... @@ -383,15 +411,15 @@
function jobTypeDiv(Names) {
var Name;
for (var i=0;i<2;i++){ // 更改数字4可以改变选择的内容数量,在下拉总数值的基础上+1.比如:下拉菜单有5个值,则4变成6
var tempname="mune_x"+i
var NewsHot="x"+i // “X”是ID名称,比如:ID命名为“case1”,这里的“X”即为“case”
if (Names==tempname){
Nnews=document.getElementById(NewsHot)
Nnews.style.display='';
}else{
Nnews=document.getElementById(NewsHot)
Nnews.style.display='none';
for (var i = 0; i < 2; i++) { // 更改数字4可以改变选择的内容数量,在下拉总数值的基础上+1.比如:下拉菜单有5个值,则4变成6
var tempname = "mune_x" + i
var NewsHot = "x" + i // “X”是ID名称,比如:ID命名为“case1”,这里的“X”即为“case”
if (Names == tempname) {
Nnews = document.getElementById(NewsHot)
Nnews.style.display = '';
} else {
Nnews = document.getElementById(NewsHot)
Nnews.style.display = 'none';
}
}
... ... @@ -400,7 +428,7 @@
function editJob(job) {
var dialog = $("<div>").appendTo($("body"));
dialog.dialog({
size : "modal-lg",
size: "modal-lg",
title: "创建任务",
backdrop: "static",
content: buildCnt(job)
... ... @@ -516,7 +544,7 @@
var context = $("#editcontext");
var jobtype = $("#editactivemode");
var jobinfo = {
"id" : id.val(),
"id": id.val(),
"jobName": jobName.val(),
"jobGroup": jobGroup.val(),
"module": module.val(),
... ... @@ -529,7 +557,7 @@
// "scheduleName": scheduleName.val()
};
$.ajax({
url: contextPath+"/job/updateJob.do",
url: contextPath + "/job/updateJob.do",
contentType: "application/json; charset=utf-8",
data: JSON.stringify(jobinfo),
dataType: "json",
... ... @@ -551,7 +579,7 @@
$("#createJobBtn").removeAttr("disabled");
return;
}
location.href = contextPath+"/job/toJob";
location.href = contextPath + "/job/toJob";
}
});
}
... ... @@ -565,14 +593,22 @@
}
function showDetailJob(job) {
/* window.open(encodeURI("/jobs/html/showdetailjob.html?jobname=" + job.id
+ "&jobgroup=" + job.jobGroup + "&schedulename=" + job.scheduleName));*/
/* window.open(encodeURI("/jobs/html/showdetailjob.html?jobname=" + job.id
+ "&jobgroup=" + job.jobGroup + "&schedulename=" + job.scheduleName));*/
/*var param={};
param.jobname= job.id;
param.jobgroup= job.jobGroup;
param.module= job.module;
GobalStandardPost( contextPath+ "job/toJobDetail",param);*/
location.href = contextPath+"/job/toJobDetail?jobname="+job.id+"&jobgroup="+ job.jobGroup+"&module="+ job.module;
location.href = contextPath + "/job/toJobDetail?jobname=" + job.id + "&jobgroup=" + job.jobGroup + "&module=" + job.module;
}
//点击查询按钮
$("#searchBtn").click(function () {
var moduleName = $("#moduleName").val();
$("#jobInfoDiv #jobInfoListTable").table("load", {
'module': moduleName
});
});
</script>
... ...