Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
梦中观雨
cat
提交
123d441b
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,发现更多精彩内容 >>
提交
123d441b
编写于
5月 21, 2013
作者:
Y
yong.you
浏览文件
操作
浏览文件
下载
差异文件
refator config file
上级
c4c1ee3e
ead94df0
变更
23
隐藏空白更改
内联
并排
Showing
23 changed file
with
514 addition
and
43 deletion
+514
-43
cat-home/src/main/java/com/dianping/cat/report/view/NavigationBar.java
...main/java/com/dianping/cat/report/view/NavigationBar.java
+2
-2
cat-home/src/main/java/com/dianping/cat/system/SystemModule.java
...e/src/main/java/com/dianping/cat/system/SystemModule.java
+1
-1
cat-home/src/main/java/com/dianping/cat/system/SystemPage.java
...ome/src/main/java/com/dianping/cat/system/SystemPage.java
+1
-1
cat-home/src/main/java/com/dianping/cat/system/page/config/Action.java
...main/java/com/dianping/cat/system/page/config/Action.java
+11
-3
cat-home/src/main/java/com/dianping/cat/system/page/config/Context.java
...ain/java/com/dianping/cat/system/page/config/Context.java
+1
-1
cat-home/src/main/java/com/dianping/cat/system/page/config/Handler.java
...ain/java/com/dianping/cat/system/page/config/Handler.java
+76
-7
cat-home/src/main/java/com/dianping/cat/system/page/config/JspFile.java
...ain/java/com/dianping/cat/system/page/config/JspFile.java
+23
-0
cat-home/src/main/java/com/dianping/cat/system/page/config/JspViewer.java
...n/java/com/dianping/cat/system/page/config/JspViewer.java
+31
-0
cat-home/src/main/java/com/dianping/cat/system/page/config/Model.java
.../main/java/com/dianping/cat/system/page/config/Model.java
+23
-2
cat-home/src/main/java/com/dianping/cat/system/page/config/Payload.java
...ain/java/com/dianping/cat/system/page/config/Payload.java
+73
-4
cat-home/src/main/resources/META-INF/dal/jdbc/report-codegen.xml
...e/src/main/resources/META-INF/dal/jdbc/report-codegen.xml
+48
-7
cat-home/src/main/resources/META-INF/dal/jdbc/report-dal.xml
cat-home/src/main/resources/META-INF/dal/jdbc/report-dal.xml
+13
-0
cat-home/src/main/resources/META-INF/plexus/components.xml
cat-home/src/main/resources/META-INF/plexus/components.xml
+36
-5
cat-home/src/main/resources/META-INF/wizard/jdbc/wizard.xml
cat-home/src/main/resources/META-INF/wizard/jdbc/wizard.xml
+1
-0
cat-home/src/main/resources/META-INF/wizard/webapp/wizard.xml
...home/src/main/resources/META-INF/wizard/webapp/wizard.xml
+1
-1
cat-home/src/main/webapp/WEB-INF/tags/body.tag
cat-home/src/main/webapp/WEB-INF/tags/body.tag
+2
-2
cat-home/src/main/webapp/css/alarm.css
cat-home/src/main/webapp/css/alarm.css
+22
-0
cat-home/src/main/webapp/js/tableInit.js
cat-home/src/main/webapp/js/tableInit.js
+1
-1
cat-home/src/main/webapp/jsp/system/aggregation.jsp
cat-home/src/main/webapp/jsp/system/aggregation.jsp
+62
-0
cat-home/src/main/webapp/jsp/system/aggregationUpdate.jsp
cat-home/src/main/webapp/jsp/system/aggregationUpdate.jsp
+76
-0
cat-home/src/main/webapp/jsp/system/config.jsp
cat-home/src/main/webapp/jsp/system/config.jsp
+5
-0
cat-home/src/main/webapp/jsp/system/configTree.jsp
cat-home/src/main/webapp/jsp/system/configTree.jsp
+2
-2
cat-home/src/main/webapp/jsp/system/project.jsp
cat-home/src/main/webapp/jsp/system/project.jsp
+3
-4
未找到文件。
cat-home/src/main/java/com/dianping/cat/report/view/NavigationBar.java
浏览文件 @
123d441b
...
...
@@ -8,10 +8,10 @@ import com.dianping.cat.system.SystemPage;
public
class
NavigationBar
{
public
Page
[]
getSystemPages
()
{
return
new
Page
[]
{
SystemPage
.
ALARM
,
SystemPage
.
PROJECT
,
SystemPage
.
CONFIG
,
ReportPage
.
QUERY
,
...
...
cat-home/src/main/java/com/dianping/cat/system/SystemModule.java
浏览文件 @
123d441b
...
...
@@ -11,7 +11,7 @@ com.dianping.cat.system.page.alarm.Handler.class,
com
.
dianping
.
cat
.
system
.
page
.
login
.
Handler
.
class
,
com
.
dianping
.
cat
.
system
.
page
.
project
.
Handler
.
class
com
.
dianping
.
cat
.
system
.
page
.
config
.
Handler
.
class
})
public
class
SystemModule
extends
AbstractModule
{
...
...
cat-home/src/main/java/com/dianping/cat/system/SystemPage.java
浏览文件 @
123d441b
...
...
@@ -9,7 +9,7 @@ public enum SystemPage implements Page {
LOGIN
(
"login"
,
"login"
,
"Login"
,
"Login"
,
false
),
PROJECT
(
"project"
,
"project"
,
"C
onfig"
,
"Project"
,
true
);
CONFIG
(
"config"
,
"config"
,
"c
onfig"
,
"Project"
,
true
);
private
String
m_name
;
...
...
cat-home/src/main/java/com/dianping/cat/system/page/
project
/Action.java
→
cat-home/src/main/java/com/dianping/cat/system/page/
config
/Action.java
浏览文件 @
123d441b
package
com.dianping.cat.system.page.
project
;
package
com.dianping.cat.system.page.
config
;
public
enum
Action
implements
org
.
unidal
.
web
.
mvc
.
Action
{
ALL
(
"view
"
),
PROJECT_ALL
(
"projects
"
),
PROJECT_UPDATE
(
"update"
),
PROJECT_UPDATE_SUBMIT
(
"updateSubmit"
);
PROJECT_UPDATE_SUBMIT
(
"updateSubmit"
),
AGGREGATION_ALL
(
"aggregations"
),
AGGREGATION_UPDATE
(
"aggregationUpdate"
),
AGGREGATION_UPDATE_SUBMIT
(
"aggregationUpdateSubmit"
),
AGGREGATION_DELETE
(
"aggregationDelete"
);;
public
static
Action
getByName
(
String
name
,
Action
defaultAction
)
{
for
(
Action
action
:
Action
.
values
())
{
...
...
cat-home/src/main/java/com/dianping/cat/system/page/
project
/Context.java
→
cat-home/src/main/java/com/dianping/cat/system/page/
config
/Context.java
浏览文件 @
123d441b
package
com.dianping.cat.system.page.
project
;
package
com.dianping.cat.system.page.
config
;
import
com.dianping.cat.system.SystemContext
;
...
...
cat-home/src/main/java/com/dianping/cat/system/page/
project
/Handler.java
→
cat-home/src/main/java/com/dianping/cat/system/page/
config
/Handler.java
浏览文件 @
123d441b
package
com.dianping.cat.system.page.
project
;
package
com.dianping.cat.system.page.
config
;
import
java.io.IOException
;
import
java.util.ArrayList
;
...
...
@@ -19,6 +19,9 @@ import com.dainping.cat.consumer.core.dal.Project;
import
com.dainping.cat.consumer.core.dal.ProjectDao
;
import
com.dainping.cat.consumer.core.dal.ProjectEntity
;
import
com.dianping.cat.Cat
;
import
com.dianping.cat.home.dal.report.AggregationRule
;
import
com.dianping.cat.home.dal.report.AggregationRuleDao
;
import
com.dianping.cat.home.dal.report.AggregationRuleEntity
;
import
com.dianping.cat.report.view.DomainNavManager
;
import
com.dianping.cat.system.SystemPage
;
...
...
@@ -29,28 +32,31 @@ public class Handler implements PageHandler<Context> {
@Inject
private
ProjectDao
m_projectDao
;
@Inject
private
AggregationRuleDao
m_aggregationRuleDao
;
@Inject
private
DomainNavManager
m_domainNavManager
;
@Override
@PayloadMeta
(
Payload
.
class
)
@InboundActionMeta
(
name
=
"
project
"
)
@InboundActionMeta
(
name
=
"
config
"
)
public
void
handleInbound
(
Context
ctx
)
throws
ServletException
,
IOException
{
// display only, no action here
}
@Override
@OutboundActionMeta
(
name
=
"
project
"
)
@OutboundActionMeta
(
name
=
"
config
"
)
public
void
handleOutbound
(
Context
ctx
)
throws
ServletException
,
IOException
{
Model
model
=
new
Model
(
ctx
);
Payload
payload
=
ctx
.
getPayload
();
model
.
setPage
(
SystemPage
.
PROJECT
);
model
.
setPage
(
SystemPage
.
CONFIG
);
Action
action
=
payload
.
getAction
();
model
.
setAction
(
action
);
switch
(
action
)
{
case
ALL:
case
PROJECT_
ALL:
model
.
setProjects
(
queryAllProjects
());
break
;
case
PROJECT_UPDATE:
...
...
@@ -60,6 +66,20 @@ public class Handler implements PageHandler<Context> {
updateProject
(
payload
);
model
.
setProjects
(
queryAllProjects
());
break
;
case
AGGREGATION_ALL:
model
.
setAggregationRules
(
queryAllAggregationRules
());
break
;
case
AGGREGATION_UPDATE:
model
.
setAggregationRule
(
queryAggregationRuleById
(
payload
.
getId
()));
break
;
case
AGGREGATION_UPDATE_SUBMIT:
updateAggregationRule
(
payload
);
model
.
setAggregationRules
(
queryAllAggregationRules
());
break
;
case
AGGREGATION_DELETE:
deleteAggregationRule
(
payload
);
model
.
setAggregationRules
(
queryAllAggregationRules
());
break
;
}
m_jspViewer
.
view
(
ctx
,
model
);
}
...
...
@@ -87,7 +107,7 @@ public class Handler implements PageHandler<Context> {
}
@SuppressWarnings
(
"static-access"
)
private
void
updateProject
(
Payload
payload
)
{
private
void
updateProject
(
Payload
payload
)
{
int
projectId
=
payload
.
getProjectId
();
String
department
=
payload
.
getDepartment
();
String
email
=
payload
.
getEmail
();
...
...
@@ -112,6 +132,55 @@ public class Handler implements PageHandler<Context> {
}
}
private
void
updateAggregationRule
(
Payload
payload
)
{
AggregationRule
proto
=
new
AggregationRule
();
proto
.
setId
(
payload
.
getId
());
proto
.
setDisplayName
(
payload
.
getDisplayName
());
proto
.
setDomain
(
payload
.
getDomain
());
proto
.
setPattern
(
payload
.
getPattern
());
proto
.
setSample
(
payload
.
getSample
());
proto
.
setType
(
payload
.
getType
());
proto
.
setKeyId
(
payload
.
getId
());
try
{
if
(
proto
.
getKeyId
()
==
0
)
{
m_aggregationRuleDao
.
insert
(
proto
);
}
else
{
m_aggregationRuleDao
.
updateByPK
(
proto
,
AggregationRuleEntity
.
UPDATESET_FULL
);
}
}
catch
(
DalException
e
)
{
Cat
.
logError
(
e
);
}
}
private
List
<
AggregationRule
>
queryAllAggregationRules
()
{
List
<
AggregationRule
>
aggregationRules
=
new
ArrayList
<
AggregationRule
>();
try
{
aggregationRules
=
m_aggregationRuleDao
.
findAll
(
AggregationRuleEntity
.
READSET_FULL
);
}
catch
(
Exception
e
)
{
Cat
.
logError
(
e
);
}
return
aggregationRules
;
}
private
AggregationRule
queryAggregationRuleById
(
int
id
)
{
try
{
return
m_aggregationRuleDao
.
findByPK
(
id
,
AggregationRuleEntity
.
READSET_FULL
);
}
catch
(
DalException
e
)
{
Cat
.
logError
(
e
);
return
null
;
}
}
private
void
deleteAggregationRule
(
Payload
payload
)
{
AggregationRule
proto
=
new
AggregationRule
();
proto
.
setKeyId
(
payload
.
getId
());
try
{
m_aggregationRuleDao
.
deleteByPK
(
proto
);
}
catch
(
DalException
e
)
{
Cat
.
logError
(
e
);
}
}
class
ProjectCompartor
implements
Comparator
<
Project
>
{
@Override
...
...
@@ -131,6 +200,6 @@ public class Handler implements PageHandler<Context> {
return
department1
.
compareTo
(
department2
);
}
}
}
}
cat-home/src/main/java/com/dianping/cat/system/page/
project
/JspFile.java
→
cat-home/src/main/java/com/dianping/cat/system/page/
config
/JspFile.java
浏览文件 @
123d441b
package
com.dianping.cat.system.page.
project
;
package
com.dianping.cat.system.page.
config
;
public
enum
JspFile
{
ALL
(
"/jsp/system/project.jsp"
),
PROJECT_
ALL
(
"/jsp/system/project.jsp"
),
UPATE
(
"/jsp/system/projectUpdate.jsp"
),
;
PROJECT_UPATE
(
"/jsp/system/projectUpdate.jsp"
),
AGGREGATION_ALL
(
"/jsp/system/aggregation.jsp"
),
AGGREGATION_UPATE
(
"/jsp/system/aggregationUpdate.jsp"
),
;
private
String
m_path
;
...
...
cat-home/src/main/java/com/dianping/cat/system/page/
project
/JspViewer.java
→
cat-home/src/main/java/com/dianping/cat/system/page/
config
/JspViewer.java
浏览文件 @
123d441b
package
com.dianping.cat.system.page.
project
;
package
com.dianping.cat.system.page.
config
;
import
org.unidal.web.mvc.view.BaseJspViewer
;
...
...
@@ -10,13 +10,20 @@ public class JspViewer extends BaseJspViewer<SystemPage, Action, Context, Model>
Action
action
=
model
.
getAction
();
switch
(
action
)
{
case
ALL:
return
JspFile
.
ALL
.
getPath
();
case
PROJECT_
ALL:
return
JspFile
.
PROJECT_
ALL
.
getPath
();
case
PROJECT_UPDATE:
return
JspFile
.
UPATE
.
getPath
();
return
JspFile
.
PROJECT_
UPATE
.
getPath
();
case
PROJECT_UPDATE_SUBMIT:
return
JspFile
.
ALL
.
getPath
();
default
:
return
JspFile
.
PROJECT_ALL
.
getPath
();
case
AGGREGATION_ALL:
return
JspFile
.
AGGREGATION_ALL
.
getPath
();
case
AGGREGATION_DELETE:
return
JspFile
.
AGGREGATION_ALL
.
getPath
();
case
AGGREGATION_UPDATE:
return
JspFile
.
AGGREGATION_UPATE
.
getPath
();
case
AGGREGATION_UPDATE_SUBMIT:
return
JspFile
.
AGGREGATION_ALL
.
getPath
();
}
throw
new
RuntimeException
(
"Unknown action: "
+
action
);
...
...
cat-home/src/main/java/com/dianping/cat/system/page/
project
/Model.java
→
cat-home/src/main/java/com/dianping/cat/system/page/
config
/Model.java
浏览文件 @
123d441b
package
com.dianping.cat.system.page.
project
;
package
com.dianping.cat.system.page.
config
;
import
java.util.Collections
;
import
java.util.List
;
...
...
@@ -6,6 +6,7 @@ import java.util.List;
import
org.unidal.web.mvc.ViewModel
;
import
com.dainping.cat.consumer.core.dal.Project
;
import
com.dianping.cat.home.dal.report.AggregationRule
;
import
com.dianping.cat.system.SystemPage
;
public
class
Model
extends
ViewModel
<
SystemPage
,
Action
,
Context
>
{
...
...
@@ -14,6 +15,26 @@ public class Model extends ViewModel<SystemPage, Action, Context> {
private
List
<
Project
>
m_projects
;
private
AggregationRule
m_aggregationRule
;
private
List
<
AggregationRule
>
m_aggregationRules
;
public
AggregationRule
getAggregationRule
()
{
return
m_aggregationRule
;
}
public
void
setAggregationRule
(
AggregationRule
aggregationRule
)
{
m_aggregationRule
=
aggregationRule
;
}
public
List
<
AggregationRule
>
getAggregationRules
()
{
return
m_aggregationRules
;
}
public
void
setAggregationRules
(
List
<
AggregationRule
>
aggregationRules
)
{
m_aggregationRules
=
aggregationRules
;
}
public
Model
(
Context
ctx
)
{
super
(
ctx
);
}
...
...
@@ -24,7 +45,7 @@ public class Model extends ViewModel<SystemPage, Action, Context> {
@Override
public
Action
getDefaultAction
()
{
return
Action
.
ALL
;
return
Action
.
PROJECT_
ALL
;
}
public
String
getDomain
()
{
...
...
cat-home/src/main/java/com/dianping/cat/system/page/
project
/Payload.java
→
cat-home/src/main/java/com/dianping/cat/system/page/
config
/Payload.java
浏览文件 @
123d441b
package
com.dianping.cat.system.page.
project
;
package
com.dianping.cat.system.page.
config
;
import
org.unidal.web.mvc.ActionContext
;
import
org.unidal.web.mvc.ActionPayload
;
import
org.unidal.web.mvc.payload.annotation.FieldMeta
;
import
org.unidal.web.mvc.payload.annotation.ObjectMeta
;
import
com.dianping.cat.home.dal.report.AggregationRule
;
import
com.dianping.cat.system.SystemPage
;
public
class
Payload
implements
ActionPayload
<
SystemPage
,
Action
>
{
...
...
@@ -29,11 +31,29 @@ public class Payload implements ActionPayload<SystemPage, Action> {
@FieldMeta
(
"domain"
)
private
String
m_domain
;
@ObjectMeta
(
"aggregation"
)
private
AggregationRule
m_rule
=
new
AggregationRule
();
@FieldMeta
(
"id"
)
private
int
m_id
;
@FieldMeta
(
"type"
)
private
int
m_type
;
@FieldMeta
(
"pattern"
)
private
String
m_pattern
;
@FieldMeta
(
"display_name"
)
private
String
m_displayName
;
@FieldMeta
(
"sample"
)
private
String
m_sample
;
@Override
public
Action
getAction
()
{
if
(
m_action
==
null
)
{
m_action
=
Action
.
ALL
;
m_action
=
Action
.
PROJECT_
ALL
;
}
return
m_action
;
}
...
...
@@ -72,7 +92,7 @@ public class Payload implements ActionPayload<SystemPage, Action> {
}
public
void
setAction
(
String
action
)
{
m_action
=
Action
.
getByName
(
action
,
Action
.
ALL
);
m_action
=
Action
.
getByName
(
action
,
Action
.
PROJECT_
ALL
);
}
public
void
setDepartment
(
String
department
)
{
...
...
@@ -93,7 +113,7 @@ public class Payload implements ActionPayload<SystemPage, Action> {
@Override
public
void
setPage
(
String
page
)
{
m_page
=
SystemPage
.
getByName
(
page
,
SystemPage
.
PROJECT
);
m_page
=
SystemPage
.
getByName
(
page
,
SystemPage
.
CONFIG
);
}
public
void
setProjectId
(
int
projectId
)
{
...
...
@@ -107,4 +127,53 @@ public class Payload implements ActionPayload<SystemPage, Action> {
@Override
public
void
validate
(
ActionContext
<?>
ctx
)
{
}
public
int
getId
()
{
return
m_id
;
}
public
void
setId
(
int
id
)
{
m_id
=
id
;
}
public
int
getType
()
{
return
m_type
;
}
public
void
setType
(
int
type
)
{
m_type
=
type
;
}
public
String
getPattern
()
{
return
m_pattern
;
}
public
void
setPattern
(
String
pattern
)
{
m_pattern
=
pattern
;
}
public
String
getDisplayName
()
{
return
m_displayName
;
}
public
void
setDisplayName
(
String
displayName
)
{
m_displayName
=
displayName
;
}
public
String
getSample
()
{
return
m_sample
;
}
public
void
setSample
(
String
sample
)
{
m_sample
=
sample
;
}
public
AggregationRule
getRule
()
{
return
m_rule
;
}
public
void
setRule
(
AggregationRule
rule
)
{
m_rule
=
rule
;
}
}
cat-home/src/main/resources/META-INF/dal/jdbc/report-codegen.xml
浏览文件 @
123d441b
<?xml version="1.0" encoding="UTF-8"?>
<entities>
<entity
name=
"aggregation-rule"
table=
"aggregationRule"
alias=
"a"
>
<member
name=
"id"
field=
"id"
value-type=
"int"
length=
"10"
nullable=
"false"
key=
"true"
auto-increment=
"true"
/>
<member
name=
"type"
field=
"type"
value-type=
"int"
length=
"10"
nullable=
"false"
/>
<member
name=
"domain"
field=
"domain"
value-type=
"String"
length=
"50"
nullable=
"false"
/>
<member
name=
"pattern"
field=
"pattern"
value-type=
"String"
length=
"200"
nullable=
"false"
/>
<member
name=
"display-name"
field=
"display_name"
value-type=
"String"
length=
"200"
nullable=
"false"
/>
<member
name=
"sample"
field=
"sample"
value-type=
"String"
length=
"200"
/>
<member
name=
"create-date"
field=
"create_date"
value-type=
"Date"
nullable=
"false"
/>
<member
name=
"update-date"
field=
"update_date"
value-type=
"Date"
nullable=
"false"
/>
<var
name=
"key-id"
value-type=
"int"
key-member=
"id"
/>
<primary-key
name=
"PRIMARY"
members=
"id"
/>
<readsets>
<readset
name=
"FULL"
all=
"true"
/>
</readsets>
<updatesets>
<updateset
name=
"FULL"
all=
"true"
/>
</updatesets>
<query-defs>
<query
name=
"find-by-PK"
type=
"SELECT"
>
<param
name=
"key-id"
/>
<statement>
<![CDATA[SELECT <FIELDS/>
FROM
<TABLE/>
WHERE
<FIELD
name=
'id'
/>
= ${key-id}]]>
</statement>
</query>
<query
name=
"insert"
type=
"INSERT"
>
<statement>
<![CDATA[INSERT INTO <TABLE/>
(
<FIELDS/>
)
VALUES(
<VALUES/>
)]]>
</statement>
</query>
<query
name=
"update-by-PK"
type=
"UPDATE"
>
<param
name=
"key-id"
/>
<statement>
<![CDATA[UPDATE <TABLE/>
SET
<FIELDS/>
WHERE
<FIELD
name=
'id'
/>
= ${key-id}]]>
</statement>
</query>
<query
name=
"delete-by-PK"
type=
"DELETE"
>
<param
name=
"key-id"
/>
<statement>
<![CDATA[DELETE FROM <TABLE/>
WHERE
<FIELD
name=
'id'
/>
= ${key-id}]]>
</statement>
</query>
</query-defs>
</entity>
<entity
name=
"dailygraph"
table=
"dailygraph"
alias=
"d"
>
<member
name=
"id"
field=
"id"
value-type=
"int"
length=
"10"
nullable=
"false"
key=
"true"
auto-increment=
"true"
/>
<member
name=
"name"
field=
"name"
value-type=
"String"
length=
"20"
nullable=
"false"
/>
<member
name=
"ip"
field=
"ip"
value-type=
"String"
length=
"20"
/>
<member
name=
"domain"
field=
"domain"
value-type=
"String"
length=
"20"
nullable=
"false"
/>
<member
name=
"domain"
field=
"domain"
value-type=
"String"
length=
"20
0
"
nullable=
"false"
/>
<member
name=
"period"
field=
"period"
value-type=
"Date"
nullable=
"false"
/>
<member
name=
"type"
field=
"type"
value-type=
"int"
length=
"3"
nullable=
"false"
/>
<member
name=
"detail-content"
field=
"detail_content"
value-type=
"String"
length=
"16777215"
nullable=
"false"
/>
...
...
@@ -47,10 +88,10 @@
<member
name=
"id"
field=
"id"
value-type=
"int"
length=
"10"
nullable=
"false"
key=
"true"
auto-increment=
"true"
/>
<member
name=
"name"
field=
"name"
value-type=
"String"
length=
"20"
nullable=
"false"
/>
<member
name=
"ip"
field=
"ip"
value-type=
"String"
length=
"20"
nullable=
"false"
/>
<member
name=
"domain"
field=
"domain"
value-type=
"String"
length=
"
2
0"
nullable=
"false"
/>
<member
name=
"domain"
field=
"domain"
value-type=
"String"
length=
"
5
0"
nullable=
"false"
/>
<member
name=
"period"
field=
"period"
value-type=
"Date"
nullable=
"false"
/>
<member
name=
"type"
field=
"type"
value-type=
"int"
length=
"3"
nullable=
"false"
/>
<member
name=
"content"
field=
"content"
value-type=
"String"
length=
"
16777215
"
nullable=
"false"
/>
<member
name=
"content"
field=
"content"
value-type=
"String"
length=
"
2147483647
"
nullable=
"false"
/>
<member
name=
"creation-date"
field=
"creation_date"
value-type=
"Date"
nullable=
"false"
/>
<var
name=
"key-id"
value-type=
"int"
key-member=
"id"
/>
<primary-key
name=
"PRIMARY"
members=
"id"
/>
...
...
@@ -132,7 +173,7 @@
<member
name=
"id"
field=
"id"
value-type=
"int"
length=
"10"
nullable=
"false"
key=
"true"
auto-increment=
"true"
/>
<member
name=
"name"
field=
"name"
value-type=
"String"
length=
"20"
nullable=
"false"
/>
<member
name=
"ip"
field=
"ip"
value-type=
"String"
length=
"20"
/>
<member
name=
"domain"
field=
"domain"
value-type=
"String"
length=
"20"
nullable=
"false"
/>
<member
name=
"domain"
field=
"domain"
value-type=
"String"
length=
"20
0
"
nullable=
"false"
/>
<member
name=
"period"
field=
"period"
value-type=
"Date"
nullable=
"false"
/>
<member
name=
"type"
field=
"type"
value-type=
"int"
length=
"3"
nullable=
"false"
/>
<member
name=
"detail-content"
field=
"detail_content"
value-type=
"String"
length=
"16777215"
nullable=
"false"
/>
...
...
@@ -215,10 +256,10 @@
<member
name=
"id"
field=
"id"
value-type=
"int"
length=
"10"
nullable=
"false"
key=
"true"
auto-increment=
"true"
/>
<member
name=
"name"
field=
"name"
value-type=
"String"
length=
"20"
nullable=
"false"
/>
<member
name=
"ip"
field=
"ip"
value-type=
"String"
length=
"20"
nullable=
"false"
/>
<member
name=
"domain"
field=
"domain"
value-type=
"String"
length=
"
20"
nullable=
"false
"
/>
<member
name=
"domain"
field=
"domain"
value-type=
"String"
length=
"
50
"
/>
<member
name=
"period"
field=
"period"
value-type=
"Date"
nullable=
"false"
/>
<member
name=
"type"
field=
"type"
value-type=
"int"
length=
"3"
nullable=
"false"
/>
<member
name=
"content"
field=
"content"
value-type=
"String"
length=
"
16777215"
nullable=
"false
"
/>
<member
name=
"content"
field=
"content"
value-type=
"String"
length=
"
2147483647
"
/>
<member
name=
"creation-date"
field=
"creation_date"
value-type=
"Date"
nullable=
"false"
/>
<var
name=
"key-id"
value-type=
"int"
key-member=
"id"
/>
<primary-key
name=
"PRIMARY"
members=
"id"
/>
...
...
@@ -257,7 +298,7 @@
<member
name=
"id"
field=
"id"
value-type=
"int"
length=
"10"
nullable=
"false"
key=
"true"
auto-increment=
"true"
/>
<member
name=
"name"
field=
"name"
value-type=
"String"
length=
"20"
nullable=
"false"
/>
<member
name=
"ip"
field=
"ip"
value-type=
"String"
length=
"20"
nullable=
"false"
/>
<member
name=
"domain"
field=
"domain"
value-type=
"String"
length=
"
20"
nullable=
"false
"
/>
<member
name=
"domain"
field=
"domain"
value-type=
"String"
length=
"
50
"
/>
<member
name=
"period"
field=
"period"
value-type=
"Date"
nullable=
"false"
/>
<member
name=
"type"
field=
"type"
value-type=
"int"
length=
"3"
nullable=
"false"
/>
<member
name=
"content"
field=
"content"
value-type=
"String"
length=
"16777215"
nullable=
"false"
/>
...
...
cat-home/src/main/resources/META-INF/dal/jdbc/report-dal.xml
浏览文件 @
123d441b
...
...
@@ -442,6 +442,19 @@
]]>
</statement>
</query>
</query-defs>
</entity>
<entity
name=
"aggregation-rule"
table=
"aggregationRule"
alias=
"a"
>
<member
name=
"create-date"
insert-expr=
"NOW()"
/>
<member
name=
"update-date"
insert-expr=
"NOW()"
update-expr=
"NOW()"
/>
<query-defs>
<query
name=
"find-all"
type=
"SELECT"
multiple=
"true"
>
<statement>
<![CDATA[
SELECT <FIELDS/>
FROM
<TABLE/>
]]>
</statement>
</query>
</query-defs>
</entity>
<entity
name=
"event"
table=
"event"
alias=
"e"
>
<member
name=
"creation-date"
insert-expr=
"NOW()"
/>
...
...
cat-home/src/main/resources/META-INF/plexus/components.xml
浏览文件 @
123d441b
...
...
@@ -1202,6 +1202,16 @@
</requirement>
</requirements>
</component>
<component>
<role>
org.unidal.dal.jdbc.mapping.TableProvider
</role>
<role-hint>
aggregation-rule
</role-hint>
<implementation>
org.unidal.dal.jdbc.mapping.SimpleTableProvider
</implementation>
<configuration>
<logical-table-name>
aggregation-rule
</logical-table-name>
<physical-table-name>
aggregationRule
</physical-table-name>
<data-source-name>
cat
</data-source-name>
</configuration>
</component>
<component>
<role>
org.unidal.dal.jdbc.mapping.TableProvider
</role>
<role-hint>
dailygraph
</role-hint>
...
...
@@ -1272,6 +1282,15 @@
<data-source-name>
cat
</data-source-name>
</configuration>
</component>
<component>
<role>
com.dianping.cat.home.dal.report.AggregationRuleDao
</role>
<implementation>
com.dianping.cat.home.dal.report.AggregationRuleDao
</implementation>
<requirements>
<requirement>
<role>
org.unidal.dal.jdbc.QueryEngine
</role>
</requirement>
</requirements>
</component>
<component>
<role>
com.dianping.cat.home.dal.report.DailygraphDao
</role>
<implementation>
com.dianping.cat.home.dal.report.DailygraphDao
</implementation>
...
...
@@ -2772,23 +2791,26 @@
</requirements>
</component>
<component>
<role>
com.dianping.cat.system.page.
project
.Handler
</role>
<implementation>
com.dianping.cat.system.page.
project
.Handler
</implementation>
<role>
com.dianping.cat.system.page.
config
.Handler
</role>
<implementation>
com.dianping.cat.system.page.
config
.Handler
</implementation>
<requirements>
<requirement>
<role>
com.dianping.cat.system.page.
project
.JspViewer
</role>
<role>
com.dianping.cat.system.page.
config
.JspViewer
</role>
</requirement>
<requirement>
<role>
com.dainping.cat.consumer.core.dal.ProjectDao
</role>
</requirement>
<requirement>
<role>
com.dianping.cat.home.dal.report.AggregationRuleDao
</role>
</requirement>
<requirement>
<role>
com.dianping.cat.report.view.DomainNavManager
</role>
</requirement>
</requirements>
</component>
<component>
<role>
com.dianping.cat.system.page.
project
.JspViewer
</role>
<implementation>
com.dianping.cat.system.page.
project
.JspViewer
</implementation>
<role>
com.dianping.cat.system.page.
config
.JspViewer
</role>
<implementation>
com.dianping.cat.system.page.
config
.JspViewer
</implementation>
<requirements>
<requirement>
<role>
org.unidal.web.mvc.view.model.ModelHandler
</role>
...
...
@@ -2804,6 +2826,15 @@
</requirement>
</requirements>
</component>
<component>
<role>
com.dianping.cat.home.dal.report.AggregationRuleDao
</role>
<implementation>
com.dianping.cat.home.dal.report.AggregationRuleDao
</implementation>
<requirements>
<requirement>
<role>
org.unidal.dal.jdbc.QueryEngine
</role>
</requirement>
</requirements>
</component>
<component>
<role>
com.dianping.cat.report.view.DomainNavManager
</role>
<implementation>
com.dianping.cat.report.view.DomainNavManager
</implementation>
...
...
cat-home/src/main/resources/META-INF/wizard/jdbc/wizard.xml
浏览文件 @
123d441b
...
...
@@ -15,6 +15,7 @@
<table
name=
"weeklyreport"
/>
<table
name=
"monthreport"
/>
<table
name=
"location"
/>
<table
name=
"aggregationRule"
/>
<table
name=
"event"
/>
</group>
<group
name=
"alarm"
package=
"com.dianping.cat.home.dal.alarm"
>
...
...
cat-home/src/main/resources/META-INF/wizard/webapp/wizard.xml
浏览文件 @
123d441b
...
...
@@ -73,7 +73,7 @@
<page
name=
"login"
title=
"Login"
default=
"true"
path=
"login"
standalone=
"false"
>
<description>
Login
</description>
</page>
<page
name=
"
project"
title=
"Config"
path=
"project
"
>
<page
name=
"
config"
title=
"config"
path=
"config
"
>
<description>
Project
</description>
</page>
</module>
...
...
cat-home/src/main/webapp/WEB-INF/tags/body.tag
浏览文件 @
123d441b
...
...
@@ -55,7 +55,7 @@
</script>
<table
width=
"100%"
cellspacing=
"0"
cellpadding=
"0"
>
<tr>
<td
width=
"
80
%"
><ul
class=
"tabs"
>
<td
width=
"
75
%"
><ul
class=
"tabs"
>
<c:forEach
var=
"page"
items=
"${navBar.visiblePages}"
>
<c:if
test=
"${page.standalone}"
>
<li
${
model.page.name =
=
page.name
?
'
class=
"selected"
'
:
''}
><a
...
...
@@ -67,7 +67,7 @@
</c:if>
</c:forEach>
</ul></td>
<td
width=
"2
0
%"
><ul
class=
"tabs"
>
<td
width=
"2
5
%"
><ul
class=
"tabs"
>
<c:forEach
var=
"page"
items=
"${navBar.systemPages}"
>
<c:if
test=
"${page.standalone}"
>
<li
${
model.page.name =
=
page.name
?
'
class=
"selected"
'
:
''}
><a
...
...
cat-home/src/main/webapp/css/alarm.css
0 → 100644
浏览文件 @
123d441b
.body-content
{
height
:
1200px
;
text-align
:
left
;
width
:
100%
;
}
.content-left
{
float
:
left
;
width
:
15%
;
text-indent
:
1em
;
height
:
1200px
;
text-align
:
left
;
}
.content-right
{
float
:
left
;
width
:
85%
;
}
.alarm
th
.left
{
text-align
:
left
;
}
\ No newline at end of file
cat-home/src/main/webapp/js/tableInit.js
浏览文件 @
123d441b
...
...
@@ -19,5 +19,5 @@ function init(){
}
});
var
value
=
$
(
"
select[name='contents_length']
"
)[
0
];
value
.
value
=
25
;
value
.
value
=
50
;
}
\ No newline at end of file
cat-home/src/main/webapp/jsp/system/aggregation.jsp
0 → 100644
浏览文件 @
123d441b
<%@ 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>
<script
type=
"text/javascript"
>
$
(
document
).
ready
(
function
()
{
$
(
'
#aggregationList
'
).
addClass
(
'
active
'
);
});
</script>
<div>
<div
class=
"row-fluid"
>
<div
class=
"span2"
>
<%@include
file=
"./configTree.jsp"
%>
</div>
<div
class=
"span10"
>
<div>
</br>
<table
class=
"project"
id=
"contents"
width=
"100%"
>
<thead>
<tr
class=
"odd"
>
<th
width=
"15%"
>
报表类型
</th>
<th
width=
"10%"
>
域名
</th>
<th
width=
"10%"
>
规则
</th>
<th
width=
"15%"
>
显示名称
</th>
<th
width=
"8%"
>
示例
</th>
<th
width=
"5%"
>
操作
<a
class=
'btn btn-primary btn-small'
href=
"?op=aggregationUpdate"
>
新增
</a></th>
</tr></thead><tbody>
<c:forEach
var=
"item"
items=
"
${
model
.
aggregationRules
}
"
varStatus=
"status"
>
<tr
class=
"${status.index mod 2 != 0 ? 'odd' : 'even'}"
>
<c:choose>
<c:when
test=
"
${
item
.
type
==
1
}
"
>
<td>
transaction
</td>
</c:when>
<c:when
test=
"
${
item
.
type
==
2
}
"
>
<td>
event
</td>
</c:when>
<c:when
test=
"
${
item
.
type
==
3
}
"
>
<td>
problem
</c:when>
</c:choose>
<td>
${item.domain}
</td>
<td>
${item.pattern}
</td>
<td>
${item.displayName}
</td>
<td>
${item.sample}
</td>
<td><a
class=
'btn btn-small btn-primary'
href=
"?op=aggregationUpdate&id=${item.id}"
>
编辑
</a>
<a
class=
'btn btn-small btn-danger'
href=
"?op=aggregationDelete&id=${item.id}"
>
删除
</a></td>
</tr>
</c:forEach></tbody>
</tbody>
</table>
</div>
</div></div></div>
</a:body>
\ No newline at end of file
cat-home/src/main/webapp/jsp/system/aggregationUpdate.jsp
0 → 100644
浏览文件 @
123d441b
<%@ 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>
<div>
<div
class=
"row-fluid"
>
<div
class=
"span2"
>
<%@include
file=
"./configTree.jsp"
%>
</div>
<div
class=
"span10"
>
</br>
<form
name=
"aggregationUpdate"
id=
"form"
method=
"post"
action=
"${model.pageUri}?op=aggregationUpdateSubmit"
>
<table
style=
'width:60%'
class=
'table table-striped table-bordered'
>
<input
type=
"hidden"
name=
"id"
value=
"${model.aggregationRule.id}"
/>
<tr>
<td>
报表类型
</td>
<td><select
id=
"reportType"
name =
"type"
>
<c:choose>
<c:when
test=
"
${
model
.
aggregationRule
.
type
==
1
}
"
>
<option
value=
"1"
selected=
"selected"
>
transaction
</option>
<option
value=
"2"
>
event
</option>
<option
value=
"3"
>
problem
</option>
</c:when>
<c:when
test=
"
${
model
.
aggregationRule
.
type
==
2
}
"
>
<option
value=
"1"
>
transaction
</option>
<option
value=
"2"
selected=
"selected"
>
event
</option>
<option
value=
"3"
>
problem
</option>
</c:when>
<c:when
test=
"
${
model
.
aggregationRule
.
type
==
3
}
"
>
<option
value=
"1"
>
transaction
</option>
<option
value=
"2"
>
event
</option>
<option
value=
"3"
selected=
"selected"
>
problem
</option>
</c:when>
<c:otherwise>
<option
value=
"1"
selected=
"selected"
>
transaction
</option>
<option
value=
"2"
>
event
</option>
<option
value=
"3"
>
problem
</option>
</c:otherwise>
</c:choose>
</select>
</td>
<!-- td><input type="text" name="type" value="${model.aggregationRule.type}"/></td> -->
</tr>
<tr>
<td>
域名
</td>
<td><input
type=
"text"
class=
"input-xlarge"
value=
"FrontEnd"
placeholder=
"聚合规则作用的域名"
name=
"domain"
required
value=
"${model.aggregationRule.domain}"
/></td>
</tr>
<tr>
<td>
模板
</td>
<td><input
type=
"text"
class=
"input-xlarge"
placeholder=
"选择被聚合对象的模板"
name=
"pattern"
required
value=
"${model.aggregationRule.pattern}"
/></td>
</tr>
<tr>
<td>
显示名称
</td>
<td><input
type=
"text"
class=
"input-xlarge"
placeholder=
"聚合显示的名称"
name=
"display_name"
required
value=
"${model.aggregationRule.displayName}"
/></td>
</tr>
<tr>
<td>
示例
</td>
<td><input
type=
"text"
class=
"input-xlarge"
placeholder=
"被聚合对象的示例"
name=
"sample"
required
value=
"${model.aggregationRule.sample}"
/></td>
</tr>
<tr>
<td
style=
'text-align:center'
colspan=
'2'
><input
class=
' btn-small btn btn-primary'
type=
"submit"
name=
"submit"
value=
"submit"
/></td>
</tr>
</table>
</form>
</div></div></div>
</a:body>
<script
type=
"text/javascript"
>
$
(
document
).
ready
(
function
()
{
$
(
'
#aggregationList
'
).
addClass
(
'
active
'
);
});
</script>
\ No newline at end of file
cat-home/src/main/webapp/jsp/system/config.jsp
0 → 100644
浏览文件 @
123d441b
<%@ page
contentType=
"text/html; charset=utf-8"
%>
<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"
/>
View of config page under system
\ No newline at end of file
cat-home/src/main/webapp/jsp/system/configTree.jsp
浏览文件 @
123d441b
...
...
@@ -2,8 +2,8 @@
<div
class=
"well sidebar-nav"
>
<ul
class=
"nav nav-list"
>
<li
class=
'nav-header'
><h4>
全局配置信息
</h4></li>
<li
id=
"projectList"
><a
href=
"?"
><strong>
项目基本信息配置
</strong></a></li>
<li
id=
"
parrternList"
><a
href=
"?
"
><strong>
前端监控规则配置
</strong></a></li>
<li
id=
"projectList"
><a
href=
"?
op=projects
"
><strong>
项目基本信息配置
</strong></a></li>
<li
id=
"
aggregationList"
><a
href=
"?op=aggregations
"
><strong>
前端监控规则配置
</strong></a></li>
<li
id=
"bussinessConfigList"
><a
href=
"?"
><strong>
业务监控规则配置
</strong></a></li>
</ul>
</div>
...
...
cat-home/src/main/webapp/jsp/system/project.jsp
浏览文件 @
123d441b
...
...
@@ -4,13 +4,12 @@
<%@ 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.
project
.Context"
scope=
"request"
/>
<jsp:useBean
id=
"payload"
type=
"com.dianping.cat.system.page.
project
.Payload"
scope=
"request"
/>
<jsp:useBean
id=
"model"
type=
"com.dianping.cat.system.page.
project
.Model"
scope=
"request"
/>
<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
[
'alarm_js'
]
}
"
target=
"head-js"
/>
<res:useJs
value=
"
${
res
.
js
.
local
[
'bootstrap.min.js'
]
}
"
target=
"head-js"
/>
<res:useCss
value=
'
${
res
.
css
.
local
.
table_css
}
'
target=
"head-css"
/>
<res:useJs
value=
"
${
res
.
js
.
local
[
'jquery.dataTables.min.js'
]
}
"
target=
"head-js"
/>
<res:useJs
value=
"
${
res
.
js
.
local
[
'tableInit.js'
]
}
"
target=
"head-js"
/>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录