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
qinchao
7 years ago
Commit
5e4d858b88a7761ec390d64cfaa58b8fa26da55b
1 parent
d0f18bb0
可用区hostinfo
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
29 deletions
monitor-ui-common/src/main/java/com/ui/model/domain/HostInfo.java
monitor-ui-ctrl/src/main/java/com/ui/ctrl/JavaAPICtrl.java
monitor-ui-web/src/main/webapp/jsp/host/editHostInfo.jsp
monitor-ui-web/src/main/webapp/jsp/host/hostInfoList.jsp
monitor-ui-common/src/main/java/com/ui/model/domain/HostInfo.java
View file @
5e4d858
...
...
@@ -18,6 +18,9 @@ public class HostInfo implements Serializable {
private
int
cloudType
;
//云可用区类型,aws还是aws,而腾讯云分为腾讯云 和 腾讯云az2
private
int
cloudDetailType
;
private
String
tags
;
private
String
createTime
;
...
...
monitor-ui-ctrl/src/main/java/com/ui/ctrl/JavaAPICtrl.java
View file @
5e4d858
...
...
@@ -28,7 +28,6 @@ import java.util.Map;
@Controller
@RequestMapping
(
"javaApi"
)
public
class
JavaAPICtrl
{
Logger
log
=
LoggerFactory
.
getLogger
(
JavaAPICtrl
.
class
);
@Autowired
private
HttpRestClient
httpClient
;
...
...
@@ -51,13 +50,7 @@ public class JavaAPICtrl {
@ResponseBody
public
String
getJavaApiInfo
()
{
String
strType
=
""
;
log
.
debug
(
"get all type"
);
strType
=
httpClient
.
defaultGet
(
HttpUriContants
.
JAVA_API_GET
,
String
.
class
);
log
.
info
(
"all type: {}"
,
strType
);
return
strType
;
}
...
...
@@ -73,7 +66,6 @@ public class JavaAPICtrl {
@RequestMapping
(
"/save"
)
@ResponseBody
public
BaseResponse
saveApiInfo
(
JavaApiInfoReq
req
)
{
log
.
info
(
"java api save req : {}"
,
req
);
BaseResponse
rep
=
httpClient
.
defaultPost
(
HttpUriContants
.
JAVA_API_SAVE
,
req
,
BaseResponse
.
class
);
return
rep
;
}
...
...
@@ -82,7 +74,6 @@ public class JavaAPICtrl {
@RequestMapping
(
"/del"
)
@ResponseBody
public
BaseResponse
delApiInfo
(
@RequestParam
int
id
)
{
log
.
info
(
"java api del id : {}"
,
id
);
BaseResponse
rep
=
httpClient
.
defaultGet
(
HttpUriContants
.
JAVA_API_DEL
+
"?id="
+
id
,
BaseResponse
.
class
);
return
rep
;
}
...
...
@@ -91,7 +82,6 @@ public class JavaAPICtrl {
@RequestMapping
(
"/status"
)
@ResponseBody
public
BaseResponse
status
(
@RequestParam
(
"list"
)
String
strList
)
{
log
.
info
(
"status req : {}"
,
strList
);
BaseResponse
rep
;
try
{
List
<
JavaApiStatusReq
>
req
=
JSON
.
parseArray
(
strList
,
JavaApiStatusReq
.
class
);
...
...
@@ -147,7 +137,7 @@ public class JavaAPICtrl {
@RequestMapping
(
"/allStatus"
)
@ResponseBody
public
BaseResponse
allStatus
()
{
log
.
info
(
"get allStatus"
);
//
log.info("get allStatus");
BaseResponse
rep
;
try
{
rep
=
httpClient
.
defaultGet
(
HttpUriContants
.
JAVA_API_STATUS_ALL
,
BaseResponse
.
class
);
...
...
monitor-ui-web/src/main/webapp/jsp/host/editHostInfo.jsp
View file @
5e4d858
...
...
@@ -9,12 +9,12 @@
</div>
<div class="form-group" >
<label class="col-sm-2 control-label"> <span style="color:red">*</span>云
类型
:</label>
<label class="col-sm-2 control-label"> <span style="color:red">*</span>云
可用区
:</label>
<div class="col-sm-8">
<select id="cloud
Type" name="cloud
Type" class="form-control" onchange="autoHostName();">
<select id="cloud
DetailType" name="cloudDetail
Type" class="form-control" onchange="autoHostName();">
<option value="1">AWS</option>
<option value="2">腾讯云</option>
<option value="3">腾讯云az2</option>
<option value="21">腾讯云</option>
<option value="22">腾讯云az2</option>
</select>
</div>
</div>
...
...
@@ -44,14 +44,14 @@
function autoHostName(){
var hostIp=$("#hostInfoForm #hostIp").val();
var cloud
Type=$('#hostInfoForm #cloud
Type option:selected').text();
var cloud
DetailType=$('#hostInfoForm #cloudDetail
Type option:selected').text();
var tags="";
$("input[name='appName']:checked").each(function(){
if(tags.indexOf($(this).attr('value')+'-')<0){
tags += $(this).attr('value')+'-';
}
});
$("#hostInfoForm #alias").val(cloudType+"-"+tags+hostIp);
$("#hostInfoForm #alias").val(cloud
Detail
Type+"-"+tags+hostIp);
}
function endWithChars(str,endStr){
...
...
monitor-ui-web/src/main/webapp/jsp/host/hostInfoList.jsp
View file @
5e4d858
...
...
@@ -97,12 +97,12 @@
<input
type=
"text"
id=
"hostIp"
name=
"hostIp"
class=
"form-control"
placeholder=
""
style=
"width: 230px"
/>
</div>
<div
class=
"input-group"
style=
"float: left;"
>
<span
class=
"input-group-addon"
>
云类型:
</span>
<select
id=
"cloudType"
name=
"cloudType"
class=
"form-control"
>
<option
value=
"0"
>
全部
</option>
<span
class=
"input-group-addon"
>
云可用区:
</span>
<select
id=
"cloudDetailType"
name=
"cloudDetailType"
class=
"form-control"
>
<option
value=
""
>
全部
</option>
<option
value=
"1"
>
AWS
</option>
<option
value=
"2"
>
腾讯云
</option>
<option
value=
"3"
>
腾讯云az2
</option>
<option
value=
"21"
>
腾讯云
</option>
<option
value=
"22"
>
腾讯云az2
</option>
<
%--
<option
value=
"3"
>
其他
</option>
--%>
</select>
</div>
...
...
@@ -214,15 +214,17 @@
field
:
"hostIp"
,
width
:
"10%"
},
{
title
:
"云类型"
,
field
:
"cloudType"
,
title
:
"云可用区"
,
field
:
"cloudDetailType"
,
formatter
:
function
(
value
,
rowData
,
rowIndex
)
{
if
(
value
==
1
){
return
'AWS'
;
}
else
if
(
value
==
2
){
}
else
if
(
value
==
2
1
){
return
'腾讯云'
;
}
else
if
(
value
==
22
){
return
'腾讯云az2'
;
}
else
{
return
'其他'
;
return
value
;
}
},
width
:
"5%"
...
...
@@ -301,13 +303,13 @@
$
(
"#searchHostInfoBtn"
).
click
(
function
()
{
var
alias
=
$
(
"#alias"
).
val
();
var
hostIp
=
$
(
"#hostIp"
).
val
();
var
cloud
Type
=
$
(
"#cloud
Type"
).
val
();
var
cloud
DetailType
=
$
(
"#cloudDetail
Type"
).
val
();
var
tags
=
$
(
"#tags"
).
val
();
var
onlyShowTagsIsNull
=
$
(
"#tagsIsNull"
).
val
();
$
(
"#hostInfoTable"
).
table
(
"load"
,
{
'alias'
:
alias
,
'hostIp'
:
$
.
trim
(
hostIp
),
'cloud
Type'
:
cloud
Type
,
'cloud
DetailType'
:
cloudDetail
Type
,
'tags'
:
JSON
.
stringify
(
tags
),
'onlyShowTagsIsNull'
:
onlyShowTagsIsNull
});
...
...
@@ -351,7 +353,21 @@
tags
+=
$
(
this
).
attr
(
'value'
)
+
','
;
}
});
var
cloudType
=
$
(
"#hostInfoForm #cloudType"
).
val
();
var
cloudDetailType
=
$
(
"#hostInfoForm #cloudDetailType"
).
val
();
var
cloudType
=
0
;
if
(
cloudDetailType
==
1
){
cloudType
=
1
;
}
else
if
(
cloudDetailType
==
21
||
cloudDetailType
==
22
){
cloudType
=
cloudDetailType
-
20
;
}
if
(
cloudType
<=
0
){
$
(
"#hostInfoForm #messageAlert"
).
alerts
({
content
:
"请选择正确的云可用区类型!"
,
type
:
"danger"
});
}
var
alias
=
$
(
"#hostInfoForm #alias"
).
val
();
...
...
@@ -366,6 +382,7 @@
tags
:
tags
,
hostIp
:
hostIp
,
cloudType
:
cloudType
,
cloudDetailType
:
cloudDetailType
,
alias
:
alias
};
...
...
Please
register
or
login
to post a comment