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
Plain Diff
Browse Files
Authored by
mlge
7 years ago
Commit
bb129bfad83bd02b1c9a1aff6ae88a232d46f520
2 parents
debef27f
f9271878
master
...
dev_addtag_ui
dev_deploy_image_ui
feature/add-footer-div-20220127
Merge branch 'master' of
http://git.yoho.cn/ops/monitor-ui
into dev_master
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
25 additions
and
78 deletions
monitor-ui-common/src/main/java/com/ui/model/req/HostInfoReq.java
monitor-ui-common/src/main/java/com/ui/model/req/SetHostTagsReq.java
monitor-ui-ctrl/src/main/java/com/ui/common/TagTypeEnum.java
monitor-ui-ctrl/src/main/java/com/ui/ctrl/HostGroupCtrl.java
monitor-ui-web/src/main/webapp/jsp/host/editHostInfo.jsp
monitor-ui-web/src/main/webapp/jsp/host/hostInfoList.jsp
monitor-ui-web/src/main/webapp/jsp/host/setHostTags.jsp
monitor-ui-common/src/main/java/com/ui/model/req/HostInfoReq.java
View file @
bb129bf
...
...
@@ -25,6 +25,7 @@ public class HostInfoReq extends PageRequest {
private
int
cloudDetailType
;
private
String
tagids
;
private
String
tags
;
private
List
<
String
>
tagsList
;
...
...
monitor-ui-common/src/main/java/com/ui/model/req/SetHostTagsReq.java
View file @
bb129bf
...
...
@@ -9,4 +9,5 @@ import lombok.Data;
public
class
SetHostTagsReq
{
private
String
hostIds
;
private
String
tags
;
private
String
tagids
;
}
...
...
monitor-ui-ctrl/src/main/java/com/ui/common/TagTypeEnum.java
View file @
bb129bf
...
...
@@ -8,6 +8,8 @@ import java.util.*;
* tag类型
*/
public
enum
TagTypeEnum
{
SYS
(
"sys"
,
"系统"
),
MODULE
(
"mod"
,
"模块"
),
//CLOUD("cloud", "云类型"),
MIDDLEWARE
(
"mid"
,
"中间件"
),
APPLICATION
(
"app"
,
"应用服务"
),
...
...
monitor-ui-ctrl/src/main/java/com/ui/ctrl/HostGroupCtrl.java
View file @
bb129bf
...
...
@@ -39,7 +39,7 @@ public class HostGroupCtrl {
HttpRestClient
httpRestClient
;
@RequestMapping
(
"/toHostGroup"
)
public
ModelAndView
getHostGroups
(
Map
model
)
{
public
ModelAndView
toHostGroup
(
Map
model
)
{
model
.
put
(
"tagTypeList"
,
TagTypeEnum
.
getAllType
());
model
.
put
(
"tagTypeMapJson"
,
JSON
.
toJSONString
(
TagTypeEnum
.
getAllTypeMap
()));
return
new
ModelAndView
(
"host/hostGroupList"
,
model
);
...
...
monitor-ui-web/src/main/webapp/jsp/host/editHostInfo.jsp
View file @
bb129bf
...
...
@@ -47,11 +47,11 @@
var hostIp=$("#hostInfoForm #hostIp").val();
var cloudDetailType=$('#hostInfoForm #cloudDetailType option:selected').text();
var tags="";
$("input[name='appName']:checked").each(function(){
/*
$("input[name='appName']:checked").each(function(){
if(tags.indexOf($(this).attr('value')+'-')<0){
tags += $(this).attr('value')+'-';
}
});
});
*/
$("#hostInfoForm #alias").val(cloudDetailType+"-"+tags+hostIp);
}
...
...
@@ -61,36 +61,6 @@
}
$(function () {
/*$.ajax({
url : contextPath +"/hostGroup/getAllTagsGroupByType",
type : 'post',
async : false,
dataType : "json",
success : function(data) {
var contentHtml='';
contentHtml += "<table border=1>";
for (var key in tagTypes) {
contentHtml += "<tr>";
contentHtml += "<td width='60'>";
contentHtml += tagTypes[key] ;
contentHtml += "</td>";
contentHtml += "<td>";
$.each(data.data[key],function(n,value) {
if(n>0&&n%6==0){
contentHtml+='</br>';
}
contentHtml+='<input type="checkbox" name="appName" onchange="autoHostName();" value="'+value.groupName+'">' +value.groupName+' ';
});
contentHtml += "</td>";
contentHtml += "</tr>";
}
contentHtml += "</table>";
$("#hostInfoForm #appNameContent").html(contentHtml);
}
});*/
$.ajax({
url : contextPath +"/hostGroup/getAllTagsGroupTreegridByType",
type : 'post',
...
...
@@ -153,7 +123,7 @@
if(n>0&&n%6==0){
contentHtml+='</br>';
}
contentHtml+='<input type="checkbox" name="appName" onchange="autoHostName();"
value="'+value.groupName
+'">' +value.groupName+' ';
contentHtml+='<input type="checkbox" name="appName" onchange="autoHostName();"
text="'+value.groupName+'" value="'+value.id
+'">' +value.groupName+' ';
if(value.children!=null&&value.children.length>0){
contentHtml += constructTr(value.children);
}
...
...
monitor-ui-web/src/main/webapp/jsp/host/hostInfoList.jsp
View file @
bb129bf
...
...
@@ -351,30 +351,24 @@
btn
.
removeAttr
(
"disabled"
);
return
;
}
var
tagids
=
""
;
var
tags
=
""
;
$
(
"#hostInfoForm input[name='appName']:checked"
).
each
(
function
(){
if
(
tags
.
indexOf
(
$
(
this
).
attr
(
'value'
)
+
','
)
<
0
){
tags
+=
$
(
this
).
attr
(
'value'
)
+
','
;
if
(
tagids
.
indexOf
(
$
(
this
).
attr
(
'value'
)
+
','
)
<
0
){
tagids
+=
$
(
this
).
attr
(
'value'
)
+
','
;
}
if
(
tags
.
indexOf
(
$
(
this
).
attr
(
'text'
)
+
','
)
<
0
){
tags
+=
$
(
this
).
attr
(
'text'
)
+
','
;
}
});
var
cloudDetailType
=
$
(
"#hostInfoForm #cloudDetailType"
).
val
();
var
cloudType
=
2
;
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
();
//提交之前表单验证
if
(
!
$
(
"#hostInfoForm"
).
form
(
"validate"
))
{
btn
.
removeAttr
(
"disabled"
);
...
...
@@ -383,6 +377,7 @@
//提交表单--改成ajax方式
var
submitData
=
{
id
:
hoseInfoId
,
tagids
:
tagids
,
tags
:
tags
,
hostIp
:
hostIp
,
cloudType
:
cloudType
,
...
...
@@ -412,33 +407,6 @@
localAlert
(
'系统异常'
,
data
.
message
);
}
});
/* $("#hostInfoForm").form("submit", {
submitUrl : "saveHostInfo.do",
submitData : {
id : hoseInfoId,
tags:tags
},
onBeforeSubmit : function() {
if (!$(this).form("validate")) {
btn.removeAttr("disabled");
return false;
}
},
success : function(data) {
if (!data || data.code != 200) {
btn.removeAttr("disabled");
$("#hostInfoForm #messageAlert").alerts({
content : data.message,
type : "danger"
});
return;
}
$("#hostInfoTable").table("load");
$(dialog).dialog("hide");
}
});*/
}
}]
});
...
...
@@ -480,10 +448,14 @@
className
:
"btn-success"
,
onclick
:
function
()
{
var
btn
=
$
(
this
);
var
tagids
=
""
;
var
tags
=
""
;
$
(
"#tagsInfoForm input[name='appName']:checked"
).
each
(
function
(){
if
(
tags
.
indexOf
(
$
(
this
).
attr
(
'value'
)
+
','
)
<
0
){
tags
+=
$
(
this
).
attr
(
'value'
)
+
','
;
if
(
tagids
.
indexOf
(
$
(
this
).
attr
(
'value'
)
+
','
)
<
0
){
tagids
+=
$
(
this
).
attr
(
'value'
)
+
','
;
}
if
(
tags
.
indexOf
(
$
(
this
).
attr
(
'text'
)
+
','
)
<
0
){
tags
+=
$
(
this
).
attr
(
'text'
)
+
','
;
}
});
if
(
paramObj
.
hostIds
==
null
||
paramObj
.
hostIds
.
length
==
0
){
...
...
@@ -494,7 +466,7 @@
});
return
;
}
if
(
tags
==
null
||
tags
==
""
)
{
if
(
tags
==
null
||
tags
==
""
||
tagids
==
""
||
tagids
==
""
)
{
btn
.
removeAttr
(
"disabled"
);
$
(
"#tagsInfoForm #messageAlert"
).
alerts
({
content
:
"请至少选择一个标签!"
,
...
...
@@ -510,6 +482,7 @@
async
:
false
,
data
:
{
hostIds
:
JSON
.
stringify
(
paramObj
.
hostIds
),
tagids
:
tagids
,
tags
:
tags
},
dataType
:
"json"
,
...
...
monitor-ui-web/src/main/webapp/jsp/host/setHostTags.jsp
View file @
bb129bf
...
...
@@ -176,7 +176,7 @@
if(n>0&&n%6==0){
contentHtml+='</br>';
}
contentHtml+='<input type="checkbox" name="appName" onchange="autoHostName();"
value="'+value.groupName
+'">' +value.groupName+' ';
contentHtml+='<input type="checkbox" name="appName" onchange="autoHostName();"
text="'+value.groupName+'" value="'+value.id
+'">' +value.groupName+' ';
if(value.children!=null&&value.children.length>0){
contentHtml += constructTr(value.children);
}
...
...
Please
register
or
login
to post a comment