Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
javalover123888
SkyWalking
提交
7b7e9259
S
SkyWalking
项目概览
javalover123888
/
SkyWalking
与 Fork 源项目一致
Fork自
山不在高_有仙则灵 / SkyWalking
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
SkyWalking
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
7b7e9259
编写于
12月 23, 2015
作者:
Z
zhangxin10
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
完成授权文件下载功能
上级
05738419
变更
13
展开全部
隐藏空白更改
内联
并排
Showing
13 changed file
with
451 addition
and
297 deletion
+451
-297
skywalking-webui/src/main/java/com/ai/cloud/controller/AlarmRuleCtl.java
...i/src/main/java/com/ai/cloud/controller/AlarmRuleCtl.java
+4
-5
skywalking-webui/src/main/java/com/ai/cloud/controller/AuthFileCtl.java
...ui/src/main/java/com/ai/cloud/controller/AuthFileCtl.java
+103
-78
skywalking-webui/src/main/java/com/ai/cloud/dao/impl/AuthConfigMDAO.java
...i/src/main/java/com/ai/cloud/dao/impl/AuthConfigMDAO.java
+36
-0
skywalking-webui/src/main/java/com/ai/cloud/dao/impl/SystemConfigMDAO.java
...src/main/java/com/ai/cloud/dao/impl/SystemConfigMDAO.java
+37
-0
skywalking-webui/src/main/java/com/ai/cloud/dao/inter/IAuthConfigMDAO.java
...src/main/java/com/ai/cloud/dao/inter/IAuthConfigMDAO.java
+7
-0
skywalking-webui/src/main/java/com/ai/cloud/dao/inter/ISystemConfigMDAO.java
...c/main/java/com/ai/cloud/dao/inter/ISystemConfigMDAO.java
+7
-0
skywalking-webui/src/main/java/com/ai/cloud/service/impl/AuthFileSerImpl.java
.../main/java/com/ai/cloud/service/impl/AuthFileSerImpl.java
+20
-0
skywalking-webui/src/main/java/com/ai/cloud/service/impl/SystemConfigSerImpl.java
...n/java/com/ai/cloud/service/impl/SystemConfigSerImpl.java
+19
-0
skywalking-webui/src/main/java/com/ai/cloud/service/inter/IAuthFileSer.java
...rc/main/java/com/ai/cloud/service/inter/IAuthFileSer.java
+7
-0
skywalking-webui/src/main/java/com/ai/cloud/service/inter/ISystemConfigSer.java
...ain/java/com/ai/cloud/service/inter/ISystemConfigSer.java
+8
-0
skywalking-webui/src/main/java/com/ai/cloud/vo/mvo/SystemConfigMVO.java
...ui/src/main/java/com/ai/cloud/vo/mvo/SystemConfigMVO.java
+50
-0
skywalking-webui/src/main/resources/test.properties
skywalking-webui/src/main/resources/test.properties
+20
-0
skywalking-webui/src/main/webapp/ftl/applist.ftl
skywalking-webui/src/main/webapp/ftl/applist.ftl
+133
-214
未找到文件。
skywalking-webui/src/main/java/com/ai/cloud/controller/AlarmRuleCtl.java
浏览文件 @
7b7e9259
...
@@ -35,7 +35,7 @@ public class AlarmRuleCtl {
...
@@ -35,7 +35,7 @@ public class AlarmRuleCtl {
/***
/***
* 查询用户默认规则
* 查询用户默认规则
*
*
* @param root
* @param root
* @return
* @return
* @throws Exception
* @throws Exception
...
@@ -74,7 +74,7 @@ public class AlarmRuleCtl {
...
@@ -74,7 +74,7 @@ public class AlarmRuleCtl {
/***
/***
* 查询用户默认规则
* 查询用户默认规则
*
*
* @param root
* @param root
* @return
* @return
* @throws Exception
* @throws Exception
...
@@ -114,7 +114,7 @@ public class AlarmRuleCtl {
...
@@ -114,7 +114,7 @@ public class AlarmRuleCtl {
/***
/***
* 创建用户默认规则
* 创建用户默认规则
*
*
* @param root
* @param root
* @return
* @return
* @throws Exception
* @throws Exception
...
@@ -258,7 +258,7 @@ public class AlarmRuleCtl {
...
@@ -258,7 +258,7 @@ public class AlarmRuleCtl {
/***
/***
* 创建用户默认规则
* 创建用户默认规则
*
*
* @param root
* @param root
* @return
* @return
* @throws Exception
* @throws Exception
...
@@ -333,7 +333,6 @@ public class AlarmRuleCtl {
...
@@ -333,7 +333,6 @@ public class AlarmRuleCtl {
ruleMVO
.
setTodoType
(
todoType
);
ruleMVO
.
setTodoType
(
todoType
);
JSONObject
confArgs
=
new
JSONObject
();
JSONObject
confArgs
=
new
JSONObject
();
confArgs
.
put
(
"period"
,
period
);
confArgs
.
put
(
"period"
,
period
);
confArgs
.
put
(
"excludeExceptions"
,
json
.
get
(
"excludeExceptions"
));
if
(
Constants
.
TODO_TYPE_0
.
equals
(
todoType
))
{
if
(
Constants
.
TODO_TYPE_0
.
equals
(
todoType
))
{
// 设置邮件相关的信息
// 设置邮件相关的信息
JSONObject
mailInfo
=
new
JSONObject
();
JSONObject
mailInfo
=
new
JSONObject
();
...
...
skywalking-webui/src/main/java/com/ai/cloud/controller/AuthFileCtl.java
浏览文件 @
7b7e9259
package
com.ai.cloud.controller
;
package
com.ai.cloud.controller
;
import
java.io.BufferedInputStream
;
import
com.ai.cloud.service.inter.IAuthFileSer
;
import
java.io.BufferedOutputStream
;
import
com.ai.cloud.service.inter.ISystemConfigSer
;
import
java.io.OutputStream
;
import
com.ai.cloud.util.Constants
;
import
java.net.URLDecoder
;
import
com.ai.cloud.util.common.StringUtil
;
import
java.net.URLEncoder
;
import
com.alibaba.fastjson.JSONObject
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpSession
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.apache.logging.log4j.Logger
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
com.ai.cloud.util.Constants
;
import
javax.servlet.http.HttpServletRequest
;
import
com.ai.cloud.util.common.StringUtil
;
import
javax.servlet.http.HttpServletResponse
;
import
com.alibaba.fastjson.JSONObject
;
import
javax.servlet.http.HttpSession
;
import
java.io.BufferedInputStream
;
import
java.io.BufferedOutputStream
;
import
java.io.OutputStream
;
import
java.net.URLDecoder
;
import
java.net.URLEncoder
;
import
java.util.Map
;
import
java.util.Properties
;
@Controller
@Controller
public
class
AuthFileCtl
{
public
class
AuthFileCtl
{
private
static
Logger
logger
=
LogManager
.
getLogger
(
AlarmRuleCtl
.
class
);
private
static
Logger
logger
=
LogManager
.
getLogger
(
AlarmRuleCtl
.
class
);
@RequestMapping
(
"/exportAuth/{appCode}"
)
@Autowired
public
void
exportApplicationAuthFile
(
HttpServletRequest
request
,
HttpServletResponse
response
,
private
IAuthFileSer
authFileSer
;
@PathVariable
(
"appCode"
)
String
appCode
)
throws
Exception
{
HttpSession
session
=
request
.
getSession
();
@Autowired
String
uid
=
(
String
)
session
.
getAttribute
(
"uid"
);
private
ISystemConfigSer
systemConfigSer
;
JSONObject
reJson
=
new
JSONObject
();
@RequestMapping
(
"/exportAuth/{appCode}"
)
if
(
StringUtil
.
isBlank
(
uid
))
{
public
void
exportApplicationAuthFile
(
HttpServletRequest
request
,
HttpServletResponse
response
,
reJson
.
put
(
Constants
.
JSON_RESULT_KEY_RESULT
,
Constants
.
JSON_RESULT_KEY_RESULT_FAIL
);
@PathVariable
(
"appCode"
)
String
appCode
)
throws
Exception
{
reJson
.
put
(
Constants
.
JSON_RESULT_KEY_RESULT_MSG
,
"用户会话超时"
);
HttpSession
session
=
request
.
getSession
();
return
;
String
uid
=
(
String
)
session
.
getAttribute
(
"uid"
);
}
JSONObject
reJson
=
new
JSONObject
();
String
filepath
=
"sky-walking.auth"
;
response
.
reset
();
if
(
StringUtil
.
isBlank
(
uid
))
{
response
.
setContentType
(
"application/octet-stream"
);
reJson
.
put
(
Constants
.
JSON_RESULT_KEY_RESULT
,
Constants
.
JSON_RESULT_KEY_RESULT_FAIL
);
String
fileName
=
URLDecoder
.
decode
(
filepath
,
"utf-8"
);
reJson
.
put
(
Constants
.
JSON_RESULT_KEY_RESULT_MSG
,
"用户会话超时"
);
java
.
net
.
URLEncoder
.
encode
(
fileName
,
"utf-8"
);
return
;
response
.
addHeader
(
"Content-Disposition"
,
}
"attachment;"
+
"filename=\""
+
URLEncoder
.
encode
(
fileName
,
"utf-8"
)
+
"\""
);
String
filepath
=
"sky-walking.auth"
;
StringBuilder
sb
=
new
StringBuilder
(
""
);
response
.
reset
();
sb
.
append
(
"测试魂牵梦萦魂牵梦萦"
+
"\r\n"
);
response
.
setContentType
(
"application/octet-stream"
);
BufferedOutputStream
output
=
null
;
String
fileName
=
URLDecoder
.
decode
(
filepath
,
"utf-8"
);
BufferedInputStream
input
=
null
;
java
.
net
.
URLEncoder
.
encode
(
fileName
,
"utf-8"
);
OutputStream
os
=
null
;
response
.
addHeader
(
"Content-Disposition"
,
try
{
"attachment;"
+
"filename=\""
+
URLEncoder
.
encode
(
fileName
,
"utf-8"
)
+
"\""
);
os
=
response
.
getOutputStream
();
Properties
properties
=
authFileSer
.
queryAuthFile
();
byte
[]
byt
=
sb
.
toString
().
getBytes
();
String
propertyValue
;
os
.
write
(
byt
);
for
(
Map
.
Entry
<
Object
,
Object
>
value
:
properties
.
entrySet
())
{
}
catch
(
Exception
e
)
{
propertyValue
=
String
.
valueOf
(
value
.
getValue
());
logger
.
error
(
"导出 {} 应用制空权文件异常"
,
appCode
);
if
(
propertyValue
.
startsWith
(
"#"
))
{
e
.
printStackTrace
();
value
.
setValue
(
systemConfigSer
.
querySystemConfigByKey
(
propertyValue
.
substring
(
1
)).
getConfValue
());
}
finally
{
continue
;
os
.
flush
();
}
os
.
close
();
if
(
input
!=
null
)
{
if
(
propertyValue
.
startsWith
(
"$"
)){
input
.
close
();
if
(
request
.
getParameter
((
propertyValue
.
substring
(
1
)))
!=
null
)
{
}
value
.
setValue
(
request
.
getParameter
(
propertyValue
.
substring
(
1
)));
if
(
output
!=
null
)
{
}
output
.
close
();
}
}
}
}
properties
.
setProperty
(
"skywalking.user_id"
,
uid
);
return
;
properties
.
setProperty
(
"skywalking.application_code"
,
appCode
);
}
BufferedOutputStream
output
=
null
;
BufferedInputStream
input
=
null
;
@RequestMapping
(
"/confAuthInfo/{appCode}"
)
OutputStream
os
=
null
;
public
String
confAuthInfo
(
HttpServletRequest
request
,
HttpServletResponse
response
,
try
{
@PathVariable
(
"appCode"
)
String
appCode
)
throws
Exception
{
os
=
response
.
getOutputStream
();
HttpSession
session
=
request
.
getSession
();
//byte[] byt = sb.toString().getBytes();
String
uid
=
(
String
)
session
.
getAttribute
(
"uid"
);
properties
.
store
(
os
,
"test"
);
// os.write(byt);
JSONObject
reJson
=
new
JSONObject
();
}
catch
(
Exception
e
)
{
logger
.
error
(
"导出 {} 应用制空权文件异常"
,
appCode
);
if
(
StringUtil
.
isBlank
(
uid
))
{
e
.
printStackTrace
();
reJson
.
put
(
Constants
.
JSON_RESULT_KEY_RESULT
,
Constants
.
JSON_RESULT_KEY_RESULT_FAIL
);
}
finally
{
reJson
.
put
(
Constants
.
JSON_RESULT_KEY_RESULT_MSG
,
"用户会话超时"
);
os
.
flush
();
return
reJson
.
toJSONString
();
os
.
close
();
}
if
(
input
!=
null
)
{
input
.
close
();
return
reJson
.
toJSONString
();
}
}
if
(
output
!=
null
)
{
output
.
close
();
}
}
return
;
}
@RequestMapping
(
"/confAuthInfo/{appCode}"
)
public
String
confAuthInfo
(
HttpServletRequest
request
,
HttpServletResponse
response
,
@PathVariable
(
"appCode"
)
String
appCode
)
throws
Exception
{
HttpSession
session
=
request
.
getSession
();
String
uid
=
(
String
)
session
.
getAttribute
(
"uid"
);
JSONObject
reJson
=
new
JSONObject
();
if
(
StringUtil
.
isBlank
(
uid
))
{
reJson
.
put
(
Constants
.
JSON_RESULT_KEY_RESULT
,
Constants
.
JSON_RESULT_KEY_RESULT_FAIL
);
reJson
.
put
(
Constants
.
JSON_RESULT_KEY_RESULT_MSG
,
"用户会话超时"
);
return
reJson
.
toJSONString
();
}
return
reJson
.
toJSONString
();
}
}
}
skywalking-webui/src/main/java/com/ai/cloud/dao/impl/AuthConfigMDAO.java
0 → 100644
浏览文件 @
7b7e9259
package
com.ai.cloud.dao.impl
;
import
com.ai.cloud.dao.inter.IAuthConfigMDAO
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.jdbc.core.JdbcTemplate
;
import
org.springframework.jdbc.core.RowCallbackHandler
;
import
org.springframework.stereotype.Repository
;
import
java.sql.ResultSet
;
import
java.sql.SQLException
;
import
java.util.Properties
;
@Repository
public
class
AuthConfigMDAO
implements
IAuthConfigMDAO
{
@Autowired
private
JdbcTemplate
jdbcTemplate
;
private
static
Logger
logger
=
LogManager
.
getLogger
(
AuthConfigMDAO
.
class
);
@Override
public
Properties
queryAllAuthConfig
()
{
final
Properties
properties
=
new
Properties
();
String
sql
=
"select auth_file_config.key, auth_file_config.value from auth_file_config where auth_file_config.sts = ? "
;
final
Object
[]
params
=
new
Object
[]{
"A"
};
jdbcTemplate
.
query
(
sql
,
params
,
new
RowCallbackHandler
()
{
@Override
public
void
processRow
(
ResultSet
resultSet
)
throws
SQLException
{
properties
.
setProperty
(
resultSet
.
getString
(
"key"
),
resultSet
.
getString
(
"value"
));
}
});
return
properties
;
}
}
skywalking-webui/src/main/java/com/ai/cloud/dao/impl/SystemConfigMDAO.java
0 → 100644
浏览文件 @
7b7e9259
package
com.ai.cloud.dao.impl
;
import
com.ai.cloud.dao.inter.ISystemConfigMDAO
;
import
com.ai.cloud.vo.mvo.SystemConfigMVO
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.jdbc.core.JdbcTemplate
;
import
org.springframework.jdbc.core.RowCallbackHandler
;
import
org.springframework.stereotype.Repository
;
import
java.sql.ResultSet
;
import
java.sql.SQLException
;
@Repository
public
class
SystemConfigMDAO
implements
ISystemConfigMDAO
{
@Autowired
private
JdbcTemplate
jdbcTemplate
;
@Override
public
SystemConfigMVO
querySystemConfigByKey
(
String
key
)
{
final
SystemConfigMVO
systemConfigMVO
=
new
SystemConfigMVO
();
String
sql
=
"SELECT config_id, conf_key, conf_value, val_type, val_desc from system_config where conf_key = ? and sts = ?"
;
final
Object
[]
params
=
new
Object
[]{
key
,
"A"
};
jdbcTemplate
.
query
(
sql
,
params
,
new
RowCallbackHandler
()
{
@Override
public
void
processRow
(
ResultSet
resultSet
)
throws
SQLException
{
systemConfigMVO
.
setConfigId
(
resultSet
.
getString
(
"config_id"
));
systemConfigMVO
.
setConfKey
(
resultSet
.
getString
(
"conf_key"
));
systemConfigMVO
.
setConfValue
(
resultSet
.
getString
(
"conf_value"
));
systemConfigMVO
.
setValueType
(
resultSet
.
getString
(
"val_type"
));
systemConfigMVO
.
setValueDesc
(
resultSet
.
getString
(
"val_desc"
));
}
});
return
systemConfigMVO
;
}
}
skywalking-webui/src/main/java/com/ai/cloud/dao/inter/IAuthConfigMDAO.java
0 → 100644
浏览文件 @
7b7e9259
package
com.ai.cloud.dao.inter
;
import
java.util.Properties
;
public
interface
IAuthConfigMDAO
{
Properties
queryAllAuthConfig
();
}
skywalking-webui/src/main/java/com/ai/cloud/dao/inter/ISystemConfigMDAO.java
0 → 100644
浏览文件 @
7b7e9259
package
com.ai.cloud.dao.inter
;
import
com.ai.cloud.vo.mvo.SystemConfigMVO
;
public
interface
ISystemConfigMDAO
{
SystemConfigMVO
querySystemConfigByKey
(
String
key
);
}
skywalking-webui/src/main/java/com/ai/cloud/service/impl/AuthFileSerImpl.java
0 → 100644
浏览文件 @
7b7e9259
package
com.ai.cloud.service.impl
;
import
com.ai.cloud.dao.inter.IAuthConfigMDAO
;
import
com.ai.cloud.service.inter.IAuthFileSer
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.Properties
;
@Service
public
class
AuthFileSerImpl
implements
IAuthFileSer
{
@Autowired
private
IAuthConfigMDAO
authConfigMDAO
;
@Override
public
Properties
queryAuthFile
()
{
return
authConfigMDAO
.
queryAllAuthConfig
();
}
}
skywalking-webui/src/main/java/com/ai/cloud/service/impl/SystemConfigSerImpl.java
0 → 100644
浏览文件 @
7b7e9259
package
com.ai.cloud.service.impl
;
import
com.ai.cloud.dao.inter.ISystemConfigMDAO
;
import
com.ai.cloud.service.inter.ISystemConfigSer
;
import
com.ai.cloud.vo.mvo.SystemConfigMVO
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
@Service
public
class
SystemConfigSerImpl
implements
ISystemConfigSer
{
@Autowired
private
ISystemConfigMDAO
iSystemConfigMDAO
;
@Override
public
SystemConfigMVO
querySystemConfigByKey
(
String
key
)
{
return
iSystemConfigMDAO
.
querySystemConfigByKey
(
key
);
}
}
skywalking-webui/src/main/java/com/ai/cloud/service/inter/IAuthFileSer.java
0 → 100644
浏览文件 @
7b7e9259
package
com.ai.cloud.service.inter
;
import
java.util.Properties
;
public
interface
IAuthFileSer
{
Properties
queryAuthFile
();
}
skywalking-webui/src/main/java/com/ai/cloud/service/inter/ISystemConfigSer.java
0 → 100644
浏览文件 @
7b7e9259
package
com.ai.cloud.service.inter
;
import
com.ai.cloud.vo.mvo.SystemConfigMVO
;
public
interface
ISystemConfigSer
{
SystemConfigMVO
querySystemConfigByKey
(
String
key
);
}
skywalking-webui/src/main/java/com/ai/cloud/vo/mvo/SystemConfigMVO.java
0 → 100644
浏览文件 @
7b7e9259
package
com.ai.cloud.vo.mvo
;
public
class
SystemConfigMVO
{
private
String
configId
;
private
String
confKey
;
private
String
confValue
;
private
String
valueType
;
private
String
valueDesc
;
public
String
getConfigId
()
{
return
configId
;
}
public
void
setConfigId
(
String
configId
)
{
this
.
configId
=
configId
;
}
public
String
getConfKey
()
{
return
confKey
;
}
public
void
setConfKey
(
String
confKey
)
{
this
.
confKey
=
confKey
;
}
public
String
getConfValue
()
{
return
confValue
;
}
public
void
setConfValue
(
String
confValue
)
{
this
.
confValue
=
confValue
;
}
public
String
getValueType
()
{
return
valueType
;
}
public
void
setValueType
(
String
valueType
)
{
this
.
valueType
=
valueType
;
}
public
String
getValueDesc
()
{
return
valueDesc
;
}
public
void
setValueDesc
(
String
valueDesc
)
{
this
.
valueDesc
=
valueDesc
;
}
}
skywalking-webui/src/main/resources/test.properties
0 → 100644
浏览文件 @
7b7e9259
#test
#Wed Dec 23 15:24:10 CST 2015
buriedpoint.businesskey_max_length
=
300
sender.retry_get_sender_wait_interval
=
2000
buffer.pool_size
=
5
senderchecker.check_polling_time
=
200
sender.is_off
=
false
sender.max_send_length
=
20000
consumer.max_consumer
=
2
consumer.max_wait_time
=
5
sender.max_copy_num
=
2
skywalking.application_code
=
test
consumer.consumer_fail_retry_wait_interval
=
50
skywalking.user_id
=
1
buriedpoint.printf
=
false
buriedpoint.exclusive_exceptions
=
buriedpoint.max_exception_stack_length
=
4000
sender.connect_percent
=
100
buffer.buffer_max_size
=
18000
sender.servers_addr
=
127.0.0.1
\:
34000;
skywalking-webui/src/main/webapp/ftl/applist.ftl
浏览文件 @
7b7e9259
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录