Toggle navigation
Toggle navigation
This project
Loading...
Sign in
ops
/
monitor-ui
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
Lixiaodi
8 years ago
Commit
ff6fd8caa1e9f571fba11847e0ac77e7d6ec7873
1 parent
1c36922c
hystrix配置管理代码上传
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
409 additions
and
1 deletions
monitor-ui-common/src/main/java/com/ui/contants/HttpUriContants.java
monitor-ui-common/src/main/java/com/ui/model/req/HystrixInfoReq.java
monitor-ui-ctrl/src/main/java/com/ui/ctrl/HystrixInfoCtrl.java
monitor-ui-web/src/main/webapp/jsp/hystrixInfo/hystrixInfoEdit.jsp
monitor-ui-web/src/main/webapp/jsp/hystrixInfo/hystrixInfoList.jsp
monitor-ui-web/src/main/webapp/script/common/genarate_left_panel.js
monitor-ui-common/src/main/java/com/ui/contants/HttpUriContants.java
View file @
ff6fd8c
...
...
@@ -145,6 +145,10 @@ public class HttpUriContants {
public
static
final
String
GET_DEGRADE_FUNCTION
=
"/degrade/getInitInfo"
;
public
static
final
String
GET_DEGRADE_INFO
=
"/degrade/getList"
;
public
static
final
String
EDIT_DEGRADE_INFO
=
"/degrade/change"
;
public
static
final
String
GET_HYSTRIX_FUNCTION
=
"/hystrixInfo/getInitInfo"
;
public
static
final
String
GET_HYSTRIX_INFO
=
"/hystrixInfo/getList"
;
public
static
final
String
EDIT_HYSTRIX_INFO
=
"/hystrixInfo/change"
;
/**
* 工单系统
...
...
monitor-ui-common/src/main/java/com/ui/model/req/HystrixInfoReq.java
0 → 100644
View file @
ff6fd8c
package
com
.
ui
.
model
.
req
;
import
lombok.Data
;
@Data
public
class
HystrixInfoReq
extends
PageRequest
{
private
int
id
;
private
String
configName
;
private
String
configValue
;
private
String
configDesc
;
/** 0:全部 1:属性默认值配置 2:接口超时配置 3:服务线程池配置. */
private
String
configCat
;
private
String
serverType
;
}
...
...
monitor-ui-ctrl/src/main/java/com/ui/ctrl/HystrixInfoCtrl.java
0 → 100644
View file @
ff6fd8c
package
com
.
ui
.
ctrl
;
import
java.util.List
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.Model
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.servlet.ModelAndView
;
import
com.ui.contants.HttpUriContants
;
import
com.ui.http.HttpRestClient
;
import
com.ui.model.BaseResponse
;
import
com.ui.model.req.HystrixInfoReq
;
@Controller
@RequestMapping
(
"hystrixInfo"
)
public
class
HystrixInfoCtrl
{
@Autowired
private
HttpRestClient
httpClient
;
@SuppressWarnings
(
"unchecked"
)
@RequestMapping
(
"/info"
)
public
ModelAndView
getHystrixInfoInitList
(
Model
model
)
{
BaseResponse
<
List
<
String
>>
categories
=
httpClient
.
defaultPost
(
HttpUriContants
.
GET_HYSTRIX_FUNCTION
,
null
,
BaseResponse
.
class
);
List
<
String
>
catList
=
categories
.
getData
();
if
(
catList
!=
null
&&
!
catList
.
isEmpty
())
{
model
.
addAttribute
(
"categories"
,
catList
);
}
return
new
ModelAndView
(
"hystrixInfo/hystrixInfoList"
);
}
@ResponseBody
@RequestMapping
(
"/getList"
)
public
BaseResponse
<?>
getHystrixInfoList
(
HystrixInfoReq
req
)
{
return
httpClient
.
defaultPost
(
HttpUriContants
.
GET_HYSTRIX_INFO
,
req
,
BaseResponse
.
class
);
}
@ResponseBody
@RequestMapping
(
"/edit"
)
public
BaseResponse
<?>
editHystrixInfo
(
HystrixInfoReq
req
)
{
return
httpClient
.
defaultPost
(
HttpUriContants
.
EDIT_HYSTRIX_INFO
,
req
,
BaseResponse
.
class
);
}
}
...
...
monitor-ui-web/src/main/webapp/jsp/hystrixInfo/hystrixInfoEdit.jsp
0 → 100644
View file @
ff6fd8c
<%@page language="java" contentType="text/html;charset=utf-8" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
<form class="form-horizontal" id="hystrixInfoForm" name="hystrixInfoForm">
<div class="form-group">
<label class="col-sm-2 control-label">配置项:</label>
<div class="col-sm-8">
<input type="text" class="form-control" id="configName" name="configName" maxlength="80" size="40" readonly="readonly"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">配置值:</label>
<div class="col-sm-8">
<input type="text" class="form-control" id="configValue" name="configValue" maxlength="200" size="40"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">配置描述:</label>
<div class="col-sm-8">
<input type="text" class="form-control" id="configDesc" name="configDesc" maxlength="200" size="40"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">配置类别:</label>
<div class="col-sm-8">
<input type="text" class="form-control" id="configCat" name="configCat" maxlength="100" size="40"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">服务器:</label>
<div class="col-sm-8">
<select id="serverType" name="serverType" class="form-control">
<option value="all">全部</option>
<option value="zookeeper_aws">aws</option>
<option value="zookeeper_qq">qCloud</option>
<option value="gray_qq">gray</option>
</select>
</div>
</div>
</form>
<script>
$(function(){
$("#hystrixInfoForm #configName").val(paramObj.configName);
$("#hystrixInfoForm #configValue").val(paramObj.configValue);
$("#hystrixInfoForm #configDesc").val(paramObj.configDesc);
$("#hystrixInfoForm #configCat").val(paramObj.configCat);
$("#hystrixInfoForm #serverType").val(paramObj.serverType);
})
</script>
\ No newline at end of file
...
...
monitor-ui-web/src/main/webapp/jsp/hystrixInfo/hystrixInfoList.jsp
0 → 100644
View file @
ff6fd8c
<
%@page language="java" contentType="text/html;charset=utf-8" %>
<
%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<
%
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta
http-equiv=
"Content-Type"
content=
"text/html; charset=UTF-8"
>
<link
rel=
"stylesheet"
href=
"<%=basePath %>css/bootstrap.min.css"
/>
<link
rel=
"stylesheet"
href=
"<%=basePath %>css/bootstrap-datetimepicker.css"
/>
<link
href=
"<%=basePath %>js/bootstrap-plugin/css/bootstrap.table.css"
rel=
"stylesheet"
media=
"screen"
/>
<link
rel=
"stylesheet"
href=
"<%=basePath %>css/bootstrap-responsive.min.css"
/>
<link
rel=
"stylesheet"
href=
"<%=basePath %>css/fullcalendar.css"
/>
<link
rel=
"stylesheet"
href=
"<%=basePath %>css/unicorn.main.css"
/>
<link
rel=
"stylesheet"
href=
"<%=basePath %>css/unicorn.grey.css"
/>
<link
rel=
"stylesheet"
href=
"<%=basePath %>css/jquery-ui.css"
/>
<link
rel=
"stylesheet"
href=
"<%=basePath %>css/uniform.css"
/>
<link
rel=
"stylesheet"
href=
"<%=basePath %>css/select2.css"
/>
<link
rel=
"stylesheet"
href=
"<%=basePath %>js/jstree/themes/proton/style.css"
/>
<link
rel=
"stylesheet"
href=
"<%=basePath %>css/select2.css"
/>
<link
rel=
"stylesheet"
href=
"<%=basePath %>css/yoho.css"
/>
<script
src=
"<%=basePath %>js/excanvas.min.js"
charset=
"UTF-8"
type=
"text/javascript"
></script>
<script
src=
"<%=basePath %>js/jquery-1.12.0.min.js"
charset=
"UTF-8"
type=
"text/javascript"
></script>
<script
src=
"<%=basePath %>js/jquery-ui.custom.js"
charset=
"UTF-8"
type=
"text/javascript"
></script>
<script
src=
"<%=basePath %>/js/bootstrap.min.js"
></script>
<script
src=
"<%=basePath %>/js/unicorn.js"
></script>
<script
src=
"<%=basePath %>js/bootstrap-plugin/datetimepicker/moment-with-locales.js"
charset=
"UTF-8"
type=
"text/javascript"
></script>
<script
src=
"<%=basePath %>js/bootstrap-plugin/datetimepicker/bootstrap-datetimepicker.js"
charset=
"UTF-8"
type=
"text/javascript"
></script>
<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/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>
<script
src=
"<%=basePath %>js/bootstrap-plugin/bootstrap.alerts.js"
charset=
"UTF-8"
type=
"text/javascript"
></script>
<script
src=
"<%=basePath %>js/bootstrap-plugin/bootstrap.accordion.js"
charset=
"UTF-8"
type=
"text/javascript"
></script>
<script
src=
"<%=basePath %>js/bootstrap-plugin/bootstrap.breadcrumb.js"
charset=
"UTF-8"
type=
"text/javascript"
></script>
<script
src=
"<%=basePath %>js/bootstrap-plugin/bootstrap.validate.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/layer/layer.js"
charset=
"UTF-8"
type=
"text/javascript"
></script>
<script
src=
"<%=basePath %>js/bootstrap-plugin/bootstrap.select.js"
charset=
"UTF-8"
type=
"text/javascript"
></script>
<script
src=
"<%=basePath %>js/jstree/jstree.js"
></script>
<script
src=
"<%=basePath %>js/jquery.toaster.js"
></script>
<link
href=
"<%=basePath %>css/jquery.tagsinput.css"
rel=
"stylesheet"
/>
<script
src=
"<%=basePath %>js/jquery.tagsinput.min.js"
type=
"text/javascript"
></script>
<script>
var
contextPath
=
'<%=basePath %>'
;
</script>
<title>
YOHO!运维
</title>
</head>
<body>
<!-- 头部 -->
<div
id=
"head"
>
</div>
<!-- 右侧具体内容 -->
<div
id=
"content"
>
<div
id=
"breadcrumb"
>
<a
href=
"#"
title=
"Go to Home"
class=
"tip-bottom"
><i
class=
"icon-home"
></i>
Home
</a>
<a
href=
"#"
class=
"current"
>
Hystrix配置
</a>
</div>
<div
class=
"container-fluid"
>
<div
class=
"widget-box"
>
<div
class=
"widget-title"
>
<h5>
hystrix配置筛选
</h5>
</div>
<div
class=
"widget-content nopadding"
>
<div
class=
"widget-title"
style=
"height: 98px;"
>
<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>
<select
id=
"serverType"
name=
"serverType"
class=
"form-control"
>
<!-- <option value="all">全部</option> -->
<option
value=
"zookeeper_aws"
>
aws
</option>
<option
value=
"zookeeper_qq"
>
qCloud
</option>
<option
value=
"gray_qq"
>
gray
</option>
</select>
</div>
<div
class=
"input-group"
style=
"float: left;"
>
<span
class=
"input-group-addon"
>
配置类别:
</span>
<select
id=
"configCat"
name=
"configCat"
class=
"form-control"
>
<option
value=
""
>
全部
</option>
<c:forEach
items=
"${categories }"
var=
"cat"
>
<option
value=
"${cat }"
>
${cat }
</option>
</c:forEach>
</select>
</div>
<div
class=
"input-group"
style=
"float: left;width: 600px;"
>
<span
class=
"input-group-addon"
>
配置项:
</span>
<input
type=
"text"
id=
"configName"
name=
"configName"
class=
"form-control"
placeholder=
""
/>
</div>
<button
id=
"searchHystrixInfoBtn"
class=
"btn btn-primary"
style=
"margin-left: 18px;"
>
搜索
</button>
</div>
</div>
</div>
<div
id=
"hystrixInfoTable"
>
</div>
</div>
</div>
</div>
</div>
</body>
<script
src=
"<%=basePath %>script/common/genarate_left_panel.js"
></script>
<script>
$
(
"#li_config"
).
addClass
(
"active open"
);
$
(
"#li_hystrix_info"
).
addClass
(
"active"
);
$
(
function
()
{
$
(
"#hystrixInfoTable"
).
table
({
url
:
contextPath
+
"hystrixInfo/getList?"
,
striped
:
true
,
pagination
:
true
,
pageSize
:
10
,
loadFilter
:
function
(
data
)
{
return
defaultLoadFilter
(
data
);
},
columns
:
[
{
title
:
"配置项"
,
width
:
"25%"
,
align
:
"left"
,
field
:
"configName"
},
{
title
:
"配置描述"
,
width
:
"20%"
,
field
:
"configDesc"
},
{
title
:
"配置类别"
,
width
:
"8%"
,
field
:
"configCat"
},
{
title
:
"服务器"
,
width
:
"8%"
,
field
:
"serverType"
,
formatter
:
function
(
value
,
rowData
,
rowIndex
)
{
if
(
value
==
"all"
){
return
"全部"
;
}
else
if
(
value
==
"zookeeper_aws"
){
return
"aws"
;
}
else
if
(
value
==
"zookeeper_qq"
){
return
"qCloud"
;
}
else
if
(
value
==
"gray_qq"
){
return
"gray"
;
}
else
{
return
"全部"
;
}
}
},
{
title
:
"配置值"
,
width
:
"15%"
,
field
:
"configValue"
},
{
title
:
"操作"
,
width
:
"8%"
,
formatter
:
function
(
value
,
rowData
,
rowIndex
)
{
var
div
=
$
(
"<div>"
);
//修改
var
editBtn
=
$
(
"<button data-target='#updateModal' data-toggle='modal'>"
).
addClass
(
"btn btn-xs btn-success"
).
html
(
"修改"
).
appendTo
(
div
);
editBtn
.
click
(
function
()
{
updateHystrixInfo
(
rowData
);
});
return
div
;
}
}],
});
});
function
updateHystrixInfo
(
rowData
){
paramObj
.
id
=
rowData
.
id
;
paramObj
.
configName
=
rowData
.
configName
;
paramObj
.
configValue
=
rowData
.
configValue
;
paramObj
.
configCat
=
rowData
.
configCat
;
paramObj
.
configDesc
=
rowData
.
configDesc
;
paramObj
.
serverType
=
rowData
.
serverType
;
var
dialog0
=
$
(
"<div>"
).
appendTo
(
$
(
"body"
));
dialog0
.
dialog
({
size
:
"modal-lg"
,
title
:
"修改路径"
,
backdrop
:
"static"
,
href
:
contextPath
+
"/jsp/hystrixInfo/hystrixInfoEdit.jsp"
,
buttons
:
[{
text
:
"关闭"
,
className
:
"btn-danger"
,
onclick
:
function
()
{
$
(
dialog0
).
dialog
(
"hide"
);
}
},
{
text
:
"提交"
,
className
:
"btn-success"
,
onclick
:
function
()
{
var
btn
=
$
(
this
);
$
(
dialog0
).
dialog
(
"hide"
);
$
(
"#hystrixInfoForm"
).
form
(
"submit"
,
{
submitUrl
:
contextPath
+
"hystrixInfo/edit.do"
,
submitData
:
{
id
:
rowData
.
id
},
onBeforeSubmit
:
function
()
{
if
(
!
$
(
this
).
form
(
"validate"
))
{
btn
.
removeAttr
(
"disabled"
);
return
false
;
}
},
success
:
function
(
data
)
{
var
mes
=
""
;
var
title
=
""
;
if
(
data
.
data
==
1
){
mes
=
"修改成功"
;
title
=
"修改成功"
;
}
else
{
title
=
"修改失败"
;
mes
=
data
.
message
;
}
var
dialog
=
$
(
"<div>"
).
appendTo
(
$
(
"body"
));
dialog
.
dialog
({
title
:
title
,
backdrop
:
"static"
,
content
:
mes
,
buttons
:
[{
text
:
"确定"
,
className
:
"btn-success"
,
onclick
:
function
()
{
$
(
dialog
).
dialog
(
"hide"
);
$
(
"#hystrixInfoTable"
).
table
(
"load"
);
}
}]
});
$
(
dialog0
).
dialog
(
"hide"
);
}
});
}
}]
});
}
//点击查询按钮
$
(
"#searchHystrixInfoBtn"
).
click
(
function
()
{
var
serverType
=
$
(
"#serverType"
).
val
();
var
configName
=
$
(
"#configName"
).
val
();
var
configValue
=
$
(
"#configValue"
).
val
();
var
configDesc
=
$
(
"#configDesc"
).
val
();
var
configCat
=
$
(
"#configCat"
).
val
();
var
serverType
=
$
(
"#serverType"
).
val
();;
$
(
"#hystrixInfoTable"
).
table
(
"load"
,
{
'serverType'
:
serverType
,
'configName'
:
configName
,
'configValue'
:
configValue
,
'configDesc'
:
configDesc
,
'configCat'
:
configCat
});
});
var
searchServerType
=
$
(
"#serverType"
).
val
();
</script>
</html>
\ No newline at end of file
...
...
monitor-ui-web/src/main/webapp/script/common/genarate_left_panel.js
View file @
ff6fd8c
...
...
@@ -48,10 +48,11 @@ innerHTML += "<li id='li_works'><a id='li_works_a' href=''><i class='icon icon-t
innerHTML
+=
"</ul></li>"
;
/*配置管理*/
innerHTML
+=
"<li class='submenu' id='li_config'><a id='li_config_a' href='#'><i class='icon icon-th-list'></i> <span>配置管理</span><span class='label'>
5
</span></a><ul>"
;
innerHTML
+=
"<li class='submenu' id='li_config'><a id='li_config_a' href='#'><i class='icon icon-th-list'></i> <span>配置管理</span><span class='label'>
6
</span></a><ul>"
;
innerHTML
+=
"<li id='li_zkMonitor'><a id='li_zkMonitor_a' href=''><i class='icon icon-th'></i> <span>ZK配置管理</span></a></li>"
;
innerHTML
+=
"<li id='li_nginxSync'><a id='li_nginxSync_a' href=''><i class='icon icon-th'></i> <span>Nginx配置同步</span></a></li>"
;
innerHTML
+=
"<li id='li_degrade_info'><a id='li_degrade_info_a' href=''><i class='icon icon-th'></i> <span>降级服务配置</span></a></li>"
;
innerHTML
+=
"<li id='li_hystrix_info'><a id='li_hystrix_info_a' href=''><i class='icon icon-th'></i> <span>Hystrix配置</span></a></li>"
;
innerHTML
+=
"<li id='li_aws_ebs'><a id='li_aws_ebs_a' href=''><i class='icon icon-th'></i> <span>AWS_EBS镜像任务</span></a></li>"
;
innerHTML
+=
"<li id='li_ips_compare'><a id='li_ips_compare_a' href=''><i class='icon icon-th'></i> <span>在线服务Ip配置对比</span></a></li>"
;
innerHTML
+=
"</ul></li>"
;
...
...
@@ -120,6 +121,7 @@ document.getElementById("li_nginxSync_a").setAttribute("href", path + "/nginxSyn
document
.
getElementById
(
"li_om_a"
).
setAttribute
(
"href"
,
path
+
"/project/toOm"
);
document
.
getElementById
(
"li_node_a"
).
setAttribute
(
"href"
,
path
+
"/project/toNode"
);
document
.
getElementById
(
"li_degrade_info_a"
).
setAttribute
(
"href"
,
path
+
"/degrade/info"
);
document
.
getElementById
(
"li_hystrix_info_a"
).
setAttribute
(
"href"
,
path
+
"/hystrixInfo/info"
);
document
.
getElementById
(
"li_addWork_a"
).
setAttribute
(
"href"
,
path
+
"/workSystem/toAddWork"
);
document
.
getElementById
(
"li_pendingWork_a"
).
setAttribute
(
"href"
,
path
+
"/workSystem/toPendingwork"
);
document
.
getElementById
(
"li_handledWork_a"
).
setAttribute
(
"href"
,
path
+
"/workSystem/toHandledWork"
);
...
...
Please
register
or
login
to post a comment