Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
梦中观雨
cat
提交
cb618e64
C
cat
项目概览
梦中观雨
/
cat
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
cat
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
cb618e64
编写于
9月 30, 2014
作者:
L
leon.li
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add heartbeat rule page
上级
9eae9775
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
414 addition
and
3 deletion
+414
-3
cat-home/src/main/java/com/dianping/cat/system/config/HeartbeatRuleConfigManager.java
...ianping/cat/system/config/HeartbeatRuleConfigManager.java
+60
-0
cat-home/src/main/java/com/dianping/cat/system/page/config/Action.java
...main/java/com/dianping/cat/system/page/config/Action.java
+9
-1
cat-home/src/main/java/com/dianping/cat/system/page/config/Handler.java
...ain/java/com/dianping/cat/system/page/config/Handler.java
+20
-0
cat-home/src/main/java/com/dianping/cat/system/page/config/JspFile.java
...ain/java/com/dianping/cat/system/page/config/JspFile.java
+10
-2
cat-home/src/main/java/com/dianping/cat/system/page/config/JspViewer.java
...n/java/com/dianping/cat/system/page/config/JspViewer.java
+10
-0
cat-home/src/main/resources/META-INF/plexus/components.xml
cat-home/src/main/resources/META-INF/plexus/components.xml
+12
-0
cat-home/src/main/resources/freemaker/rule_heartbeatItems.ftl
...home/src/main/resources/freemaker/rule_heartbeatItems.ftl
+151
-0
cat-home/src/main/webapp/WEB-INF/tags/body.tag
cat-home/src/main/webapp/WEB-INF/tags/body.tag
+1
-0
cat-home/src/main/webapp/jsp/system/configTree.jsp
cat-home/src/main/webapp/jsp/system/configTree.jsp
+1
-0
cat-home/src/main/webapp/jsp/system/heartbeat/heartbeatConfigs.jsp
...src/main/webapp/jsp/system/heartbeat/heartbeatConfigs.jsp
+127
-0
cat-home/src/main/webapp/jsp/system/heartbeat/heartbeatRuleAdd.jsp
...src/main/webapp/jsp/system/heartbeat/heartbeatRuleAdd.jsp
+13
-0
未找到文件。
cat-home/src/main/java/com/dianping/cat/system/config/HeartbeatRuleConfigManager.java
0 → 100644
浏览文件 @
cb618e64
package
com.dianping.cat.system.config
;
import
org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable
;
import
org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException
;
import
org.unidal.dal.jdbc.DalNotFoundException
;
import
org.unidal.helper.Files
;
import
com.dianping.cat.Cat
;
import
com.dianping.cat.core.config.Config
;
import
com.dianping.cat.core.config.ConfigEntity
;
import
com.dianping.cat.home.rule.entity.MonitorRules
;
import
com.dianping.cat.home.rule.transform.DefaultSaxParser
;
public
class
HeartbeatRuleConfigManager
extends
BaseRuleConfigManager
implements
Initializable
{
private
static
final
String
CATEGORY_NAME
=
"heartbeat"
;
private
static
final
String
CONFIG_NAME
=
"heartbeatRuleConfig"
;
@Override
protected
String
getCategoryName
()
{
return
CATEGORY_NAME
;
}
@Override
protected
String
getConfigName
()
{
return
CONFIG_NAME
;
}
@Override
public
void
initialize
()
throws
InitializationException
{
try
{
Config
config
=
m_configDao
.
findByName
(
CONFIG_NAME
,
ConfigEntity
.
READSET_FULL
);
String
content
=
config
.
getContent
();
m_configId
=
config
.
getId
();
m_config
=
DefaultSaxParser
.
parse
(
content
);
}
catch
(
DalNotFoundException
e
)
{
try
{
String
content
=
Files
.
forIO
().
readFrom
(
this
.
getClass
().
getResourceAsStream
(
"/config/default-heartbeat-rule-config.xml"
),
"utf-8"
);
Config
config
=
m_configDao
.
createLocal
();
config
.
setName
(
CONFIG_NAME
);
config
.
setContent
(
content
);
m_configDao
.
insert
(
config
);
m_configId
=
config
.
getId
();
m_config
=
DefaultSaxParser
.
parse
(
content
);
}
catch
(
Exception
ex
)
{
Cat
.
logError
(
ex
);
}
}
catch
(
Exception
e
)
{
Cat
.
logError
(
e
);
}
if
(
m_config
==
null
)
{
m_config
=
new
MonitorRules
();
}
}
}
cat-home/src/main/java/com/dianping/cat/system/page/config/Action.java
浏览文件 @
cb618e64
...
...
@@ -70,7 +70,7 @@ public enum Action implements org.unidal.web.mvc.Action {
NETWORK_RULE_ADD_OR_UPDATE_SUBMIT
(
"networkRuleSubmit"
),
NETWORK_RULE_DELETE
(
"networkRulDelete"
),
SYSTEM_RULE_CONFIG_LIST
(
"systemRuleConfigList"
),
SYSTEM_RULE_ADD_OR_UPDATE
(
"systemRuleUpdate"
),
...
...
@@ -79,6 +79,14 @@ public enum Action implements org.unidal.web.mvc.Action {
SYSTEM_RULE_DELETE
(
"systemRulDelete"
),
HEARTBEAT_RULE_CONFIG_LIST
(
"heartbeatRuleConfigList"
),
HEARTBEAT_RULE_ADD_OR_UPDATE
(
"heartbeatRuleUpdate"
),
HEARTBEAT_RULE_ADD_OR_UPDATE_SUBMIT
(
"heartbeatRuleSubmit"
),
HEARTBEAT_RULE_DELETE
(
"heartbeatRulDelete"
),
ALERT_DEFAULT_RECEIVERS
(
"alertDefaultReceivers"
),
ALERT_POLICY
(
"alertPolicy"
),
...
...
cat-home/src/main/java/com/dianping/cat/system/page/config/Handler.java
浏览文件 @
cb618e64
...
...
@@ -64,6 +64,7 @@ import com.dianping.cat.system.config.BugConfigManager;
import
com.dianping.cat.system.config.BusinessRuleConfigManager
;
import
com.dianping.cat.system.config.DomainGroupConfigManager
;
import
com.dianping.cat.system.config.ExceptionConfigManager
;
import
com.dianping.cat.system.config.HeartbeatRuleConfigManager
;
import
com.dianping.cat.system.config.MetricGroupConfigManager
;
import
com.dianping.cat.system.config.NetGraphConfigManager
;
import
com.dianping.cat.system.config.NetworkRuleConfigManager
;
...
...
@@ -116,6 +117,9 @@ public class Handler implements PageHandler<Context> {
@Inject
private
SystemRuleConfigManager
m_systemRuleConfigManager
;
@Inject
private
HeartbeatRuleConfigManager
m_heartbeatRuleConfigManager
;
@Inject
private
WebRuleConfigManager
m_webRuleConfigManager
;
...
...
@@ -443,6 +447,22 @@ public class Handler implements PageHandler<Context> {
model
.
setOpState
(
deleteRule
(
m_systemRuleConfigManager
,
payload
.
getKey
()));
generateRuleItemList
(
m_systemRuleConfigManager
,
model
);
break
;
case
HEARTBEAT_RULE_CONFIG_LIST:
generateRuleItemList
(
m_heartbeatRuleConfigManager
,
model
);
break
;
case
HEARTBEAT_RULE_ADD_OR_UPDATE:
generateRuleEditContent
(
payload
.
getKey
(),
"?op=heartbeatRuleSubmit"
,
"rule_heartbeatItems.ftl"
,
"rule_configs.ftl"
,
m_heartbeatRuleConfigManager
,
model
);
break
;
case
HEARTBEAT_RULE_ADD_OR_UPDATE_SUBMIT:
model
.
setOpState
(
addSubmitRule
(
m_heartbeatRuleConfigManager
,
payload
.
getRuleId
(),
payload
.
getMetrics
(),
payload
.
getConfigs
()));
generateRuleItemList
(
m_heartbeatRuleConfigManager
,
model
);
break
;
case
HEARTBEAT_RULE_DELETE:
model
.
setOpState
(
deleteRule
(
m_heartbeatRuleConfigManager
,
payload
.
getKey
()));
generateRuleItemList
(
m_heartbeatRuleConfigManager
,
model
);
break
;
case
ALERT_DEFAULT_RECEIVERS:
String
alertDefaultReceivers
=
payload
.
getContent
();
String
allOnOrOff
=
payload
.
getAllOnOrOff
();
...
...
cat-home/src/main/java/com/dianping/cat/system/page/config/JspFile.java
浏览文件 @
cb618e64
...
...
@@ -53,6 +53,14 @@ public enum JspFile {
SYSTEM_RULE_DELETE
(
"/jsp/system/systemRule/systemConfigs.jsp"
),
HEARTBEAT_RULE_CONFIG_LIST
(
"/jsp/system/heartbeat/heartbeatConfigs.jsp"
),
HEARTBEAT_RULE_ADD_OR_UPDATE
(
"/jsp/system/heartbeat/heartbeatRuleAdd.jsp"
),
HEARTBEAT_RULE_ADD_OR_UPDATE_SUBMIT
(
"/jsp/system/heartbeat/heartbeatConfigs.jsp"
),
HEARTBEAT_RULE_DELETE
(
"/jsp/system/heartbeat/heartbeatConfigs.jsp"
),
ALERT_DEFAULT_RECEIVERS
(
"/jsp/system/defaultReceiver/alertDefaultReceivers.jsp"
),
ALERT_POLICY
(
"/jsp/system/alert/policy.jsp"
),
...
...
@@ -76,11 +84,11 @@ public enum JspFile {
NET_GRAPH_CONFIG_UPDATE
(
"/jsp/system/netGraphConfig/netGraphConfig.jsp"
),
WEB_RULE
(
"/jsp/system/webRule/webRule.jsp"
),
WEB_RULE_UPDATE
(
"/jsp/system/webRule/webRuleUpdate.jsp"
),
APP_RULE
(
"/jsp/system/appRule/appRule.jsp"
),
APP_RULE_UPDATE
(
"/jsp/system/appRule/appRuleUpdate.jsp"
),
APP_CONFIG_UPDATE
(
"/jsp/system/appConfig/appConfig.jsp"
),
...
...
cat-home/src/main/java/com/dianping/cat/system/page/config/JspViewer.java
浏览文件 @
cb618e64
...
...
@@ -92,6 +92,14 @@ public class JspViewer extends BaseJspViewer<SystemPage, Action, Context, Model>
return
JspFile
.
SYSTEM_RULE_ADD_OR_UPDATE_SUBMIT
.
getPath
();
case
SYSTEM_RULE_DELETE:
return
JspFile
.
SYSTEM_RULE_DELETE
.
getPath
();
case
HEARTBEAT_RULE_ADD_OR_UPDATE:
return
JspFile
.
HEARTBEAT_RULE_ADD_OR_UPDATE
.
getPath
();
case
HEARTBEAT_RULE_ADD_OR_UPDATE_SUBMIT:
return
JspFile
.
HEARTBEAT_RULE_ADD_OR_UPDATE_SUBMIT
.
getPath
();
case
HEARTBEAT_RULE_CONFIG_LIST:
return
JspFile
.
HEARTBEAT_RULE_CONFIG_LIST
.
getPath
();
case
HEARTBEAT_RULE_DELETE:
return
JspFile
.
HEARTBEAT_RULE_DELETE
.
getPath
();
case
ALERT_DEFAULT_RECEIVERS:
return
JspFile
.
ALERT_DEFAULT_RECEIVERS
.
getPath
();
case
ALERT_POLICY:
...
...
@@ -140,6 +148,8 @@ public class JspViewer extends BaseJspViewer<SystemPage, Action, Context, Model>
return
JspFile
.
THIRD_PARTY_CONFIG_UPDATE
.
getPath
();
case
ROUTER_CONFIG_UPDATE:
return
JspFile
.
ROUTER_CONFIG_UPDATE
.
getPath
();
default
:
break
;
}
throw
new
RuntimeException
(
"Unknown action: "
+
action
);
...
...
cat-home/src/main/resources/META-INF/plexus/components.xml
浏览文件 @
cb618e64
...
...
@@ -4794,6 +4794,9 @@
<requirement>
<role>
com.dianping.cat.system.config.SystemRuleConfigManager
</role>
</requirement>
<requirement>
<role>
com.dianping.cat.system.config.HeartbeatRuleConfigManager
</role>
</requirement>
<requirement>
<role>
com.dianping.cat.system.config.WebRuleConfigManager
</role>
</requirement>
...
...
@@ -4901,6 +4904,15 @@
</requirement>
</requirements>
</component>
<component>
<role>
com.dianping.cat.system.config.HeartbeatRuleConfigManager
</role>
<implementation>
com.dianping.cat.system.config.HeartbeatRuleConfigManager
</implementation>
<requirements>
<requirement>
<role>
com.dianping.cat.core.config.ConfigDao
</role>
</requirement>
</requirements>
</component>
<component>
<role>
com.dianping.cat.system.config.WebRuleConfigManager
</role>
<implementation>
com.dianping.cat.system.config.WebRuleConfigManager
</implementation>
...
...
cat-home/src/main/resources/freemaker/rule_heartbeatItems.ftl
0 → 100644
浏览文件 @
cb618e64
<style>
.metric,
.subCondition {
margin-bottom: 5px;
}
.condition,
.config {
margin-bottom: 10px;
border: 1px solid rgba(0, 0, 0, 0.2);
border-radius: 6px;
box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
margin-left: 20px;
}
</style>
<div id="metrics">
<strong class="text-success">匹配对象:</strong>
<input id="metricsStr" type="hidden"></>
<br>
<div class="metric">
项目:<textarea name="productlineText" class="productlineText input-small" type=" text" placeholder="支持正则"></textarea>
ip:<textarea name="metricText" class="metricText input-small" type=" text" placeholder="支持正则"></textarea>
监控类型:
<label class="checkbox inline">
<input name="count" class="count" type="checkbox">count
</label>
<label class="checkbox inline">
<input name="sum" class="sum" type="checkbox">sum
</label>
<label class="checkbox inline">
<input name="avg" class="avg" type="checkbox">avg
</label>
<button class="btn btn-danger btn-small delete-metric-button" type="button">
<i class="icon-trash icon-white"></i>
</button>
</div>
</div>
<button class="btn btn-success btn-small" id="add-metric-button" type="button">
添加匹配对象<i class="icon-plus icon-white"></i>
</button>
<br><br>
<script>
$(document).ready(function () {
$("#add-metric-button").click(function () {
var newMetric = $('<div class="metric"> 产品线:<textarea name="productlineText" class="productlineText input-small" type=" text" placeholder="支持正则"></textarea> 指标:<textarea name="metricText" class="metricText input-small" type=" text" placeholder="支持正则"></textarea> 监控类型: <label class="checkbox inline"> <input name="count" class="count" type="checkbox">count </label> <label class="checkbox inline"> <input name="sum" class="sum" type="checkbox">sum </label> <label class="checkbox inline"> <input name="avg" class="avg" type="checkbox">avg </label> <button class="btn btn-danger btn-small delete-metric-button" type="button"> <i class="icon-trash icon-white"></i> </button> </div>');
$("#metrics").append(newMetric);
})
$("#metrics").delegate(".delete-metric-button", "click", function () {
$(this).parent().remove();
})
drawMetricItems();
$("#modalSubmit").click(function () {
var metricsStr = generateMetricsJsonString();
$("#metricsStr").val(metricsStr)
})
})
function drawMetricItems() {
var metricsStr = '${metricItems}';
var metrics = null;
if (metricsStr == undefined || metricsStr == "") {
return;
}
try {
metrics = JSON.parse(metricsStr);
} catch (e) {
alert("读取规则错误!请刷新重试或联系leon.li@dianping.com");
return;
}
if (metrics != undefined) {
for (count in metrics) {
var metric = metrics[count];
var productlineText = metric["productText"];
var metricText = metric["metricItemText"];
if (count > 0) {
$("#add-metric-button").trigger("click");
}
var metricForm = $(".metric").last();
if (productlineText) {
metricForm.find(".productlineText").val(productlineText);
}
if (metricText) {
metricForm.find(".metricText").val(metricText);
}
if (metric["monitorCount"]) {
metricForm.find(".count").prop("checked", "true");
}
if (metric["monitorSum"]) {
metricForm.find(".sum").prop("checked", "true");
}
if (metric["monitorAvg"]) {
metricForm.find(".avg").prop("checked", "true");
}
}
}
}
function generateMetricsJsonString() {
var metricLength = $(".metric").length;
if (metricLength > 0) {
var metricList = [];
$(".metric").each(function () {
var metric = {};
var hasPro = false;
var productLineText = $(this).find(".productlineText").val();
var metricText = $(this).find(".metricText").val()
if (productLineText != "") {
metric["productText"] = productLineText;
hasPro = true;
}
if (metricText != "") {
metric["metricItemText"] = metricText;
hasPro = true;
}
if ($(this).find($("input[name='count']")).prop("checked") == true) {
metric["monitorCount"] = true;
hasPro = true;
}
if ($(this).find($("input[name='sum']")).prop("checked") == true) {
metric["monitorSum"] = true;
hasPro = true;
}
if ($(this).find($("input[name='avg']")).prop("checked") == true) {
metric["monitorAvg"] = true;
hasPro = true;
}
if (hasPro) {
metricList.push(metric);
}
});
if (metricList.length > 0) {
return JSON.stringify(metricList);
} else {
return "";
}
}
}
</script>
cat-home/src/main/webapp/WEB-INF/tags/body.tag
浏览文件 @
cb618e64
...
...
@@ -94,6 +94,7 @@
<li><a
style=
"padding:1px 30px"
href=
"/cat/s/config?op=netGraphConfigUpdate"
>
网络拓扑配置
</a></li>
<li
class=
'nav-header'
style=
"margin-top:0px;"
>
监控告警配置
</li>
<li><a
style=
"padding:1px 30px"
href=
"/cat/s/config?op=systemRuleConfigUpdate"
>
系统告警配置
</a></li>
<li><a
style=
"padding:1px 30px"
href=
"/cat/s/config?op=heartbeatRuleConfigList"
>
心跳告警配置
</a></li>
<li><a
style=
"padding:1px 30px"
href=
"/cat/s/config?op=alertPolicy"
>
告警策略配置
</a></li>
<li><a
style=
"padding:1px 30px"
href=
"/cat/s/config?op=alertDefaultReceivers"
>
默认告警人配置
</a></li>
<li
class=
'nav-header'
style=
"margin-top:0px;"
>
其他监控配置
</li>
...
...
cat-home/src/main/webapp/jsp/system/configTree.jsp
浏览文件 @
cb618e64
...
...
@@ -24,6 +24,7 @@
<li
class=
"text-left"
id=
"netGraphConfigUpdate"
><a
href=
"?op=netGraphConfigUpdate"
>
网络拓扑配置
</a></li>
<li
class=
'nav-header'
>
监控告警配置
</li>
<li
class=
"text-left"
id=
"systemRuleConfigList"
><a
href=
"?op=systemRuleConfigList"
>
系统告警配置
</a></li>
<li
class=
"text-left"
id=
"heartbeatRuleConfigList"
><a
href=
"?op=heartbeatRuleConfigList"
>
心跳告警配置
</a></li>
<li
class=
"text-left"
id=
"policy"
><a
href=
"?op=alertPolicy"
>
告警策略配置
</a></li>
<li
class=
"text-left"
id=
"alertDefaultReceivers"
><a
href=
"?op=alertDefaultReceivers"
>
默认告警人配置
</a></li>
<li
class=
'nav-header'
>
其他监控配置
</li>
...
...
cat-home/src/main/webapp/jsp/system/heartbeat/heartbeatConfigs.jsp
0 → 100644
浏览文件 @
cb618e64
<%@ page
contentType=
"text/html; charset=utf-8"
%>
<%@ taglib
prefix=
"a"
uri=
"/WEB-INF/app.tld"
%>
<%@ taglib
prefix=
"c"
uri=
"http://java.sun.com/jsp/jstl/core"
%>
<%@ taglib
prefix=
"res"
uri=
"http://www.unidal.org/webres"
%>
<%@ taglib
prefix=
"w"
uri=
"http://www.unidal.org/web/core"
%>
<jsp:useBean
id=
"ctx"
type=
"com.dianping.cat.system.page.config.Context"
scope=
"request"
/>
<jsp:useBean
id=
"payload"
type=
"com.dianping.cat.system.page.config.Payload"
scope=
"request"
/>
<jsp:useBean
id=
"model"
type=
"com.dianping.cat.system.page.config.Model"
scope=
"request"
/>
<a:body>
<res:useJs
value=
"
${
res
.
js
.
local
[
'jquery.validate.min.js'
]
}
"
target=
"head-js"
/>
<res:useJs
value=
"
${
res
.
js
.
local
[
'alarm_js'
]
}
"
target=
"head-js"
/>
<res:useJs
value=
"
${
res
.
js
.
local
[
'dependencyConfig_js'
]
}
"
target=
"head-js"
/>
<res:useCss
value=
"
${
res
.
css
.
local
[
'select2.css'
]
}
"
target=
"head-css"
/>
<res:useJs
value=
"
${
res
.
js
.
local
[
'select2.min.js'
]
}
"
target=
"head-js"
/>
<script
type=
"text/javascript"
>
$
(
document
).
ready
(
function
()
{
$
(
'
#heartbeatRuleConfigList
'
).
addClass
(
'
active
'
);
$
(
"
.delete
"
).
bind
(
"
click
"
,
function
()
{
return
confirm
(
"
确定要删除此规则吗(不可恢复)?
"
);
});
$
(
document
).
delegate
(
'
.update
'
,
'
click
'
,
function
(
e
){
var
anchor
=
this
,
el
=
$
(
anchor
);
if
(
e
.
ctrlKey
||
e
.
metaKey
){
return
true
;
}
else
{
e
.
preventDefault
();
}
$
.
ajax
({
type
:
"
post
"
,
url
:
anchor
.
href
,
success
:
function
(
response
,
textStatus
)
{
$
(
'
#ruleModalBody
'
).
html
(
response
);
$
(
'
#ruleModal
'
).
modal
();
$
(
"
#id
"
).
select2
();
metricValidate
();
}
});
});
$
(
document
).
delegate
(
"
#ruleSubmitButton
"
,
"
click
"
,
function
(){
$
(
"
#modalSubmit
"
).
trigger
(
"
click
"
);
})
var
state
=
'
${model.opState}
'
;
if
(
state
==
'
Success
'
){
$
(
'
#state
'
).
html
(
'
操作成功
'
);
}
else
{
$
(
'
#state
'
).
html
(
'
操作失败
'
);
}
setInterval
(
function
(){
$
(
'
#state
'
).
html
(
'
'
);
},
3000
);
});
</script>
<div
class=
"row-fluid"
>
<div
class=
"span2"
>
<%@include
file=
"../configTree.jsp"
%>
</div>
<div
class=
"span10"
>
<div
id=
"ruleModal"
class=
"modal hide fade"
style=
"width:650px"
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"ruleLabel"
aria-hidden=
"true"
>
<div
class=
"modal-header text-center"
>
<h3
id=
"ruleLabel"
>
HeartBeat规则配置
</h3>
</div>
<div
class=
"modal-body"
id=
"ruleModalBody"
>
</div>
<div
class=
"modal-footer"
>
<button
class=
"btn btn-primary"
id=
"ruleSubmitButton"
>
提交
</button>
<button
class=
"btn"
data-dismiss=
"modal"
aria-hidden=
"true"
>
关闭
</button>
</div>
</div>
<h4
id=
"state"
class=
"text-center text-error"
>
</h4>
<table
class=
"table table-striped table-bordered table-condensed table-hover"
>
<tr
class=
"text-success"
>
<th
width=
"20%"
><h5
class=
'text-center'
>
规则id
</h5></th>
<th
width=
"26%"
><h5
class=
'text-center'
>
项目配置
</h5></th>
<th
width=
"29%"
><h5
class=
'text-center'
>
ip配置
</h5></th>
<th
width=
"4%"
><h5
class=
'text-center'
>
次数
</h5></th>
<th
width=
"7%"
><h5
class=
'text-center'
>
平均值
</h5></th>
<th
width=
"4%"
><h5
class=
'text-center'
>
总和
</h5></th>
<th
width=
"10%"
><h5
class=
'text-center'
>
操作
</h5></th>
</tr>
<c:forEach
var=
"item"
items=
"
${
model
.
ruleItems
}
"
varStatus=
"status"
>
<tr>
<td>
${item.id}
</td>
<td>
${item.productlineText}
</td>
<td>
${item.metricText}
</td>
<td>
<c:if
test=
"
${
item
.
monitorCount
}
"
>
<span
class=
"text-error"
>
是
</span>
</c:if>
<c:if
test=
"
${
item
.
monitorCount
==
false
}
"
>
<span>
否
</span>
</c:if>
</td>
<td>
<c:if
test=
"
${
item
.
monitorAvg
}
"
>
<span
class=
"text-error"
>
是
</span>
</c:if>
<c:if
test=
"
${
item
.
monitorAvg
==
false
}
"
>
<span>
否
</span>
</c:if>
</td>
<td>
<c:if
test=
"
${
item
.
monitorSum
}
"
>
<span
class=
"text-error"
>
是
</span>
</c:if>
<c:if
test=
"
${
item
.
monitorSum
==
false
}
"
>
<span>
否
</span>
</c:if>
</td>
<td
style=
"text-align:center;white-space: nowrap"
>
<a
href=
"?op=heartbeatRuleUpdate&key=${item.id}"
class=
"btn update btn-primary btn-small"
>
修改规则
</a>
<a
href=
"?op=heartbeatRulDelete&key=${item.id}"
class=
"btn btn-primary btn-small btn-danger delete"
>
删除
</a>
</td>
</tr>
</c:forEach>
</table>
<a
href=
"?op=heartbeatRuleUpdate&key=${item.id}"
class=
"btn update btn-primary btn-small btn-success"
>
添加监控规则
<i
class=
"icon-plus icon-white"
></i></a>
</div>
</div>
</a:body>
\ No newline at end of file
cat-home/src/main/webapp/jsp/system/heartbeat/heartbeatRuleAdd.jsp
0 → 100644
浏览文件 @
cb618e64
<%@ page
contentType=
"text/html; charset=utf-8"
%>
<%@ taglib
prefix=
"a"
uri=
"/WEB-INF/app.tld"
%>
<%@ taglib
prefix=
"c"
uri=
"http://java.sun.com/jsp/jstl/core"
%>
<%@ taglib
prefix=
"res"
uri=
"http://www.unidal.org/webres"
%>
<%@ taglib
prefix=
"w"
uri=
"http://www.unidal.org/web/core"
%>
<%@taglib
uri=
"http://java.sun.com/jsp/jstl/functions"
prefix=
"fn"
%>
<jsp:useBean
id=
"model"
type=
"com.dianping.cat.system.page.config.Model"
scope=
"request"
/>
<form>
规则ID:
<input
id=
"ruleId"
type=
"text"
value=
"${model.id}"
/>
${model.content}
</form>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录