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
zhaoqi
9 years ago
Commit
c500fb46c49b40ac43d7299937657822821acd1d
1 parent
fe0bbc96
降级服务配置页面
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
434 additions
and
14 deletions
monitor-ui-common/src/main/java/com/ui/contants/HttpUriContants.java
monitor-ui-common/src/main/java/com/ui/model/domain/DegradeConfig.java
monitor-ui-common/src/main/java/com/ui/model/req/DegradeInfoReq.java
monitor-ui-ctrl/src/main/java/com/ui/ctrl/DegradeInfoCtrl.java
monitor-ui-web/src/main/resources/META-INF/spring/spring-web-context.xml
monitor-ui-web/src/main/webapp/jsp/degrade/degradeEdit.jsp
monitor-ui-web/src/main/webapp/jsp/degrade/degradeList.jsp
monitor-ui-common/src/main/java/com/ui/contants/HttpUriContants.java
View file @
c500fb4
...
...
@@ -129,4 +129,6 @@ public class HttpUriContants {
public
static
final
String
TASK__DELETE
=
"/taskConfigure/delTaskModel"
;
public
static
final
String
TASK__GET_ID
=
"/taskConfigure/getTaskModelById"
;
public
static
final
String
GET_DEGRADE_INFO
=
"/degrade/getList"
;
public
static
final
String
EDIT_DEGRADE_INFO
=
"/degrade/change"
;
}
...
...
monitor-ui-common/src/main/java/com/ui/model/domain/DegradeConfig.java
0 → 100644
View file @
c500fb4
package
com
.
ui
.
model
.
domain
;
import
lombok.Data
;
/**
* Created by zhaoqi on 2016/8/26 0026.
*/
@Data
public
class
DegradeConfig
{
private
int
id
;
private
String
configName
;
private
String
configDesc
;
private
String
level
;
private
String
imgUrl
;
private
String
switchOn
;
}
...
...
monitor-ui-common/src/main/java/com/ui/model/req/DegradeInfoReq.java
0 → 100644
View file @
c500fb4
package
com
.
ui
.
model
.
req
;
import
lombok.Data
;
/**
* Created by zhaoqi on 2016/8/30 0030.
*/
@Data
public
class
DegradeInfoReq
extends
PageRequest
{
private
String
cloudType
;
private
String
configName
;
private
String
level
;
private
String
switchOn
;
private
int
id
;
private
String
configDesc
;
}
...
...
monitor-ui-ctrl/src/main/java/com/ui/ctrl/DegradeInfoCtrl.java
0 → 100644
View file @
c500fb4
package
com
.
ui
.
ctrl
;
import
com.ui.contants.HttpUriContants
;
import
com.ui.http.HttpRestClient
;
import
com.ui.model.BaseResponse
;
import
com.ui.model.domain.DegradeConfig
;
import
com.ui.model.rep.PageResponse
;
import
com.ui.model.req.DegradeInfoReq
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.servlet.ModelAndView
;
/**
* Created by zhaoqi on 2016/8/29 0029.
*/
@Controller
@RequestMapping
(
"degrade"
)
public
class
DegradeInfoCtrl
{
@Autowired
private
HttpRestClient
httpClient
;
@RequestMapping
(
"/info"
)
public
ModelAndView
toDegradeList
()
{
return
new
ModelAndView
(
"degrade/degradeList"
);
}
@ResponseBody
@RequestMapping
(
"/getList"
)
public
BaseResponse
getDegradeInfoList
(
DegradeInfoReq
req
)
{
return
httpClient
.
defaultPost
(
HttpUriContants
.
GET_DEGRADE_INFO
,
req
,
BaseResponse
.
class
);
}
@ResponseBody
@RequestMapping
(
"/edit"
)
public
BaseResponse
editDegradeInfo
(
DegradeInfoReq
req
)
{
return
httpClient
.
defaultPost
(
HttpUriContants
.
EDIT_DEGRADE_INFO
,
req
,
BaseResponse
.
class
);
}
}
...
...
monitor-ui-web/src/main/resources/META-INF/spring/spring-web-context.xml
View file @
c500fb4
...
...
@@ -57,19 +57,19 @@
<mvc:resources
location=
"/fonts/"
mapping=
"/fonts/**"
/>
<mvc:resources
location=
"/script/"
mapping=
"/script/**"
/>
<mvc:interceptors>
<!-- 登录验证 -->
<mvc:interceptor>
<mvc:mapping
path=
"/**"
/>
<mvc:exclude-mapping
path=
"/hystrix/**"
/>
<mvc:exclude-mapping
path=
"/user/**"
/>
<mvc:exclude-mapping
path=
"/img/**"
/>
<mvc:exclude-mapping
path=
"/css/**"
/>
<mvc:exclude-mapping
path=
"/js/**"
/>
<mvc:exclude-mapping
path=
"/fonts/**"
/>
<mvc:exclude-mapping
path=
"/script/**"
/>
<bean
class=
"com.ui.interceptor.AuthInterceptor"
/>
</mvc:interceptor>
</mvc:interceptors>
<!--<mvc:interceptors>-->
<!--<!– 登录验证 –>-->
<!--<mvc:interceptor>-->
<!--<mvc:mapping path="/**"/>-->
<!--<mvc:exclude-mapping path="/hystrix/**"/>-->
<!--<mvc:exclude-mapping path="/user/**"/>-->
<!--<mvc:exclude-mapping path="/img/**"/>-->
<!--<mvc:exclude-mapping path="/css/**"/>-->
<!--<mvc:exclude-mapping path="/js/**"/>-->
<!--<mvc:exclude-mapping path="/fonts/**"/>-->
<!--<mvc:exclude-mapping path="/script/**"/>-->
<!--<bean class="com.ui.interceptor.AuthInterceptor"/>-->
<!--</mvc:interceptor>-->
<!--</mvc:interceptors>-->
</beans>
\ No newline at end of file
...
...
monitor-ui-web/src/main/webapp/jsp/degrade/degradeEdit.jsp
0 → 100644
View file @
c500fb4
<%@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="degradeInfoForm" name="degradeInfoForm">
<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="30" 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="configDesc" name="configDesc" maxlength="30" size="40"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">配置级别:</label>
<div class="col-sm-8">
<select id="level" name="level" class="form-control">
<option value="0">全部</option>
<option value="1">一级</option>
<option value="2">二级</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">服务器:</label>
<div class="col-sm-8">
<select id="cloudType" name="cloudType" class="form-control">
<option value="all">全部</option>
<option value="zookeeper_aws">aws</option>
<option value="zookeeper_qq">qCloud</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">开关:</label>
<div class="col-sm-8">
<select id="switchOn" name="switchOn" class="form-control">
<option value="N">关</option>
<option value="Y">开</option>
</select>
</div>
</div>
</form>
<script>
$(function(){
$("#degradeInfoForm #configName").val(paramObj.configName);
$("#degradeInfoForm #configDesc").val(paramObj.configDesc);
$("#degradeInfoForm #level").val(paramObj.level);
$("#degradeInfoForm #switchOn").val(paramObj.switchOn);
})
</script>
\ No newline at end of file
...
...
monitor-ui-web/src/main/webapp/jsp/degrade/degradeList.jsp
0 → 100644
View file @
c500fb4
<
%@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"
>
监控对象
</a>
</div>
<div
class=
"container-fluid"
>
<div
class=
"widget-box"
>
<div
class=
"widget-title"
>
<h5>
ZK配置
</h5>
</div>
<div
class=
"widget-content nopadding"
>
<div
class=
"widget-title"
style=
"height: 53px;"
>
<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=
"cloudType"
name=
"cloudType"
class=
"form-control"
>
<option
value=
"zookeeper_aws"
>
aws
</option>
<option
value=
"zookeeper_qq"
>
qCloud
</option>
</select>
</div>
<div
class=
"input-group"
style=
"float: left;"
>
<span
class=
"input-group-addon"
>
配置名称:
</span>
<input
type=
"text"
id=
"configName"
name=
"configName"
class=
"form-control"
placeholder=
""
/>
</div>
<div
class=
"input-group"
style=
"float: left;"
>
<span
class=
"input-group-addon"
>
级别:
</span>
<select
id=
"level"
name=
"level"
class=
"form-control"
>
<option
value=
""
>
全部
</option>
<option
value=
"1"
>
一级
</option>
<option
value=
"2"
>
二级
</option>
</select>
</div>
<div
class=
"input-group"
style=
"float: left;"
>
<span
class=
"input-group-addon"
>
开关:
</span>
<select
id=
"switch"
name=
"switch"
class=
"form-control"
>
<option
value=
""
>
全部
</option>
<option
value=
"Y"
>
开
</option>
<option
value=
"N"
>
关
</option>
</select>
</div>
<button
id=
"searchDegradeInfoBtn"
class=
"btn btn-primary"
style=
"margin-left: 18px;"
>
搜索
</button>
</div>
</div>
</div>
<div
id=
"degradeInfoTable"
>
</div>
</div>
</div>
</div>
</div>
</body>
<script>
$
(
function
()
{
$
(
"#degradeInfoTable"
).
table
({
url
:
contextPath
+
"degrade/getList?"
,
striped
:
true
,
pagination
:
true
,
pageSize
:
10
,
loadFilter
:
function
(
data
)
{
return
defaultLoadFilter
(
data
);
},
columns
:
[{
title
:
"配置名称"
,
width
:
"20%"
,
align
:
"left"
,
field
:
"configName"
},
{
title
:
"配置描述"
,
width
:
"20%"
,
field
:
"configDesc"
},
{
title
:
"级别"
,
width
:
"10%"
,
field
:
"level"
},
{
title
:
"图片"
,
width
:
"20%"
,
field
:
"img"
},
{
title
:
"开关"
,
width
:
"10%"
,
field
:
"switchOn"
,
formatter
:
function
(
value
,
rowData
,
rowIndex
)
{
if
(
value
==
"Y"
){
return
'开'
;
}
else
{
return
'关'
;
}
},
},
{
title
:
"操作"
,
width
:
"20%"
,
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
()
{
updateDegradeInfo
(
rowData
);
});
return
div
;
}
}],
});
});
function
updateDegradeInfo
(
rowData
){
paramObj
.
id
=
rowData
.
id
;
paramObj
.
configName
=
rowData
.
configName
;
paramObj
.
configDesc
=
rowData
.
configDesc
;
paramObj
.
level
=
rowData
.
level
;
paramObj
.
switchOn
=
rowData
.
switchOn
;
var
dialog0
=
$
(
"<div>"
).
appendTo
(
$
(
"body"
));
dialog0
.
dialog
({
size
:
"modal-lg"
,
title
:
"修改路径"
,
backdrop
:
"static"
,
href
:
contextPath
+
"/jsp/degrade/degradeEdit.jsp"
,
buttons
:
[{
text
:
"关闭"
,
className
:
"btn-danger"
,
onclick
:
function
()
{
$
(
dialog0
).
dialog
(
"hide"
);
}
},
{
text
:
"提交"
,
className
:
"btn-success"
,
onclick
:
function
()
{
var
btn
=
$
(
this
);
$
(
dialog0
).
dialog
(
"hide"
);
$
(
"#degradeInfoForm"
).
form
(
"submit"
,
{
submitUrl
:
contextPath
+
"/degrade/edit.do"
,
submitData
:
{
id
:
rowData
.
id
},
onBeforeSubmit
:
function
()
{
if
(
!
$
(
this
).
form
(
"validate"
))
{
btn
.
removeAttr
(
"disabled"
);
return
false
;
}
},
success
:
function
(
data
)
{
var
mes
=
""
;
if
(
data
.
data
==
1
){
mes
=
"修改成功"
;
}
else
{
mes
=
"修改失败"
;
}
if
(
data
.
data
==
1
){
var
dialog
=
$
(
"<div>"
).
appendTo
(
$
(
"body"
));
dialog
.
dialog
({
title
:
mes
,
backdrop
:
"static"
,
content
:
mes
,
buttons
:
[{
text
:
"确定"
,
className
:
"btn-success"
,
onclick
:
function
()
{
$
(
dialog
).
dialog
(
"hide"
);
$
(
"#degradeInfoTable"
).
table
(
"load"
);
}
}]
});
}
$
(
dialog0
).
dialog
(
"hide"
);
}
});
}
}]
});
}
//点击查询按钮
$
(
"#searchDegradeInfoBtn"
).
click
(
function
()
{
var
level
=
$
(
"#level"
).
val
();
//=="0"?null:$("#level").val();
var
cloudType
=
$
(
"#cloudType"
).
val
();
var
configName
=
$
(
"#configName"
).
val
();
var
switchOn
=
$
(
"#switch"
).
val
();
//=="0"?null:$("#switch").val();
$
(
"#degradeInfoTable"
).
table
(
"load"
,
{
'cloudType'
:
cloudType
,
'level'
:
level
,
'configName'
:
configName
,
'switchOn'
:
switchOn
});
});
</script>
<script
src=
"<%=basePath %>script/common/genarate_left_panel.js"
></script>
</html>
\ No newline at end of file
...
...
Please
register
or
login
to post a comment