Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
梦中观雨
cat
提交
e1c62d6f
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,发现更多精彩内容 >>
提交
e1c62d6f
编写于
7月 24, 2014
作者:
Y
youyong205
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add the router config
上级
33560f1b
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
104 addition
and
25 deletion
+104
-25
cat-home/src/main/java/com/dianping/cat/system/page/config/Action.java
...main/java/com/dianping/cat/system/page/config/Action.java
+3
-1
cat-home/src/main/java/com/dianping/cat/system/page/config/Handler.java
...ain/java/com/dianping/cat/system/page/config/Handler.java
+11
-0
cat-home/src/main/java/com/dianping/cat/system/page/config/JspFile.java
...ain/java/com/dianping/cat/system/page/config/JspFile.java
+2
-0
cat-home/src/main/java/com/dianping/cat/system/page/config/JspViewer.java
...n/java/com/dianping/cat/system/page/config/JspViewer.java
+2
-0
cat-home/src/main/resources/META-INF/plexus/components.xml
cat-home/src/main/resources/META-INF/plexus/components.xml
+36
-24
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/router/routerConfig.jsp
cat-home/src/main/webapp/jsp/system/router/routerConfig.jsp
+49
-0
未找到文件。
cat-home/src/main/java/com/dianping/cat/system/page/config/Action.java
浏览文件 @
e1c62d6f
...
...
@@ -99,7 +99,9 @@ public enum Action implements org.unidal.web.mvc.Action {
APP_CONFIG_UPDATE
(
"appConfigUpdate"
),
THIRD_PARTY_CONFIG_UPDATE
(
"thirdPartyConfigUpdate"
);
THIRD_PARTY_CONFIG_UPDATE
(
"thirdPartyConfigUpdate"
),
ROUTER_CONFIG_UPDATE
(
"routerConfigUpdate"
);
private
String
m_name
;
...
...
cat-home/src/main/java/com/dianping/cat/system/page/config/Handler.java
浏览文件 @
e1c62d6f
...
...
@@ -55,6 +55,7 @@ import com.dianping.cat.system.config.ExceptionConfigManager;
import
com.dianping.cat.system.config.MetricGroupConfigManager
;
import
com.dianping.cat.system.config.NetGraphConfigManager
;
import
com.dianping.cat.system.config.NetworkRuleConfigManager
;
import
com.dianping.cat.system.config.RouterConfigManager
;
import
com.dianping.cat.system.config.SystemRuleConfigManager
;
import
com.dianping.cat.system.config.ThirdPartyConfigManager
;
...
...
@@ -122,6 +123,9 @@ public class Handler implements PageHandler<Context> {
@Inject
private
ThirdPartyConfigManager
m_thirdPartyConfigManager
;
@Inject
private
RouterConfigManager
m_routerConfigManager
;
private
void
deleteAggregationRule
(
Payload
payload
)
{
m_aggreationConfigManager
.
deleteAggregationRule
(
payload
.
getPattern
());
}
...
...
@@ -493,6 +497,13 @@ public class Handler implements PageHandler<Context> {
}
model
.
setContent
(
m_thirdPartyConfigManager
.
getConfig
().
toString
());
break
;
case
ROUTER_CONFIG_UPDATE:
String
routerConfig
=
payload
.
getContent
();
if
(!
StringUtils
.
isEmpty
(
routerConfig
))
{
model
.
setOpState
(
m_routerConfigManager
.
insert
(
routerConfig
));
}
model
.
setContent
(
m_routerConfigManager
.
getRouterConfig
().
toString
());
break
;
}
m_jspViewer
.
view
(
ctx
,
model
);
}
...
...
cat-home/src/main/java/com/dianping/cat/system/page/config/JspFile.java
浏览文件 @
e1c62d6f
...
...
@@ -65,6 +65,8 @@ public enum JspFile {
APP_CONFIG_UPDATE
(
"/jsp/system/appConfig/appConfig.jsp"
),
ROUTER_CONFIG_UPDATE
(
"/jsp/system/routerConfig/routerConfig.jsp"
),
THIRD_PARTY_CONFIG_UPDATE
(
"/jsp/system/thirdParty/thirdPartyConfig.jsp"
);
private
String
m_path
;
...
...
cat-home/src/main/java/com/dianping/cat/system/page/config/JspViewer.java
浏览文件 @
e1c62d6f
...
...
@@ -112,6 +112,8 @@ public class JspViewer extends BaseJspViewer<SystemPage, Action, Context, Model>
return
JspFile
.
APP_CONFIG_UPDATE
.
getPath
();
case
THIRD_PARTY_CONFIG_UPDATE:
return
JspFile
.
THIRD_PARTY_CONFIG_UPDATE
.
getPath
();
case
ROUTER_CONFIG_UPDATE:
return
JspFile
.
ROUTER_CONFIG_UPDATE
.
getPath
();
}
throw
new
RuntimeException
(
"Unknown action: "
+
action
);
...
...
cat-home/src/main/resources/META-INF/plexus/components.xml
浏览文件 @
e1c62d6f
...
...
@@ -446,6 +446,30 @@
</requirement>
</requirements>
</component>
<component>
<role>
com.dianping.cat.report.page.network.nettopology.NetGraphManager
</role>
<implementation>
com.dianping.cat.report.page.network.nettopology.NetGraphManager
</implementation>
<requirements>
<requirement>
<role>
com.dianping.cat.ServerConfigManager
</role>
</requirement>
<requirement>
<role>
com.dianping.cat.report.task.alert.RemoteMetricReportService
</role>
</requirement>
<requirement>
<role>
com.dianping.cat.report.service.ReportService
</role>
</requirement>
<requirement>
<role>
com.dianping.cat.report.page.network.nettopology.NetGraphBuilder
</role>
</requirement>
<requirement>
<role>
com.dianping.cat.report.task.alert.AlertInfo
</role>
</requirement>
<requirement>
<role>
com.dianping.cat.system.config.NetGraphConfigManager
</role>
</requirement>
</requirements>
</component>
<component>
<role>
com.dianping.cat.report.task.alert.sender.MailSender
</role>
<implementation>
com.dianping.cat.report.task.alert.sender.MailSender
</implementation>
...
...
@@ -564,30 +588,6 @@
<role>
com.dianping.cat.report.page.network.nettopology.NetGraphBuilder
</role>
<implementation>
com.dianping.cat.report.page.network.nettopology.NetGraphBuilder
</implementation>
</component>
<component>
<role>
com.dianping.cat.report.page.network.nettopology.NetGraphManager
</role>
<implementation>
com.dianping.cat.report.page.network.nettopology.NetGraphManager
</implementation>
<requirements>
<requirement>
<role>
com.dianping.cat.ServerConfigManager
</role>
</requirement>
<requirement>
<role>
com.dianping.cat.report.task.alert.RemoteMetricReportService
</role>
</requirement>
<requirement>
<role>
com.dianping.cat.report.service.ReportService
</role>
</requirement>
<requirement>
<role>
com.dianping.cat.report.page.network.nettopology.NetGraphBuilder
</role>
</requirement>
<requirement>
<role>
com.dianping.cat.report.task.alert.AlertInfo
</role>
</requirement>
<requirement>
<role>
com.dianping.cat.system.config.NetGraphConfigManager
</role>
</requirement>
</requirements>
</component>
<component>
<role>
com.dianping.cat.report.task.alert.business.BusinessAlertConfig
</role>
<implementation>
com.dianping.cat.report.task.alert.business.BusinessAlertConfig
</implementation>
...
...
@@ -4199,6 +4199,9 @@
<requirement>
<role>
com.dianping.cat.system.config.ThirdPartyConfigManager
</role>
</requirement>
<requirement>
<role>
com.dianping.cat.system.config.RouterConfigManager
</role>
</requirement>
</requirements>
</component>
<component>
...
...
@@ -4285,6 +4288,15 @@
</requirement>
</requirements>
</component>
<component>
<role>
com.dianping.cat.system.config.RouterConfigManager
</role>
<implementation>
com.dianping.cat.system.config.RouterConfigManager
</implementation>
<requirements>
<requirement>
<role>
com.dianping.cat.core.config.ConfigDao
</role>
</requirement>
</requirements>
</component>
<component>
<role>
com.dianping.cat.system.page.plugin.Handler
</role>
<implementation>
com.dianping.cat.system.page.plugin.Handler
</implementation>
...
...
cat-home/src/main/webapp/jsp/system/configTree.jsp
浏览文件 @
e1c62d6f
...
...
@@ -25,6 +25,7 @@
<li
class=
"text-right"
id=
"alertDefaultReceivers"
><a
href=
"?op=alertDefaultReceivers"
><strong>
默认告警配置
</strong></a></li>
<li
class=
"text-right"
id=
"types"
><a
href=
"?op=alertTypes"
><strong>
告警类型设置
</strong></a></li>
<li
class=
"text-right"
id=
"bugConfigUpdate"
><a
href=
"?op=bugConfigUpdate"
><strong>
异常类型配置
</strong></a></li>
<li
class=
"text-right"
id=
"routerConfigUpdate"
><a
href=
"?op=routerConfigUpdate"
><strong>
异常类型配置
</strong></a></li>
<li
class=
"text-right"
id=
"domainGroupConfigUpdate"
><a
href=
"?op=domainGroupConfigUpdate"
><strong>
机器分组配置
</strong></a></li>
</ul>
</div>
...
...
cat-home/src/main/webapp/jsp/system/router/routerConfig.jsp
0 → 100644
浏览文件 @
e1c62d6f
<%@ 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"
%>
<a:body>
<res:useJs
value=
"
${
res
.
js
.
local
[
'jquery.validate.min.js'
]
}
"
target=
"head-js"
/>
<res:useJs
value=
"
${
res
.
js
.
local
[
'dependencyConfig.js'
]
}
"
target=
"head-js"
/>
<res:useJs
value=
"
${
res
.
js
.
local
[
'alarm_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"
/>
<div
class=
"row-fluid"
>
<div
class=
"span2"
>
<%@include
file=
"../configTree.jsp"
%>
</div>
<div
class=
"span10"
>
<form
name=
"routerConfigUpdate"
id=
"form"
method=
"post"
action=
"${model.pageUri}?op=routerConfigUpdate"
>
<h4
class=
"text-center text-error"
id=
"state"
>
</h4>
<h4
class=
"text-center text-error"
>
服务器配置
</h4>
<table
class=
"table table-striped table-bordered table-condensed table-hover"
>
<tr>
<td><textarea
name=
"bug"
style=
"width:auto"
rows=
"20"
cols=
"150"
>
${model.bug}
</textarea></td>
</tr>
<tr>
<td
style=
"text-align:center"
><input
class=
'btn btn-primary'
id=
"addOrUpdateEdgeSubmit"
type=
"submit"
name=
"submit"
value=
"提交"
/></td>
</tr>
</table>
</form>
</div>
</div>
</a:body>
<script
type=
"text/javascript"
>
$
(
document
).
ready
(
function
()
{
$
(
'
#routerConfigUpdate
'
).
addClass
(
'
active
'
);
var
state
=
'
${model.opState}
'
;
if
(
state
==
'
Success
'
){
$
(
'
#state
'
).
html
(
'
操作成功
'
);
}
else
{
$
(
'
#state
'
).
html
(
'
操作失败
'
);
}
setInterval
(
function
(){
$
(
'
#state
'
).
html
(
'
'
);
},
3000
);
});
</script>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录