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
qinchao
7 years ago
Commit
c755179eb0f307b782ccdc007a304e1da26c5196
2 parents
70be8100
5dabb0f5
master
...
dev_addtag_ui
dev_deploy_image_ui
dev_deploy_node
dev_host_topo_ui
dev_nginx_checkbox
dev_nginx_ui
dev_switch_nginx
dev_ui_topo
feature/add-footer-div-20220127
monitor-ui-fyzh
Merge branch 'master' of
http://git.yoho.cn/ops/monitor-ui
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
92 additions
and
26 deletions
monitor-ui-ctrl/src/main/java/com/ui/ctrl/InternalDnsCtrl.java
monitor-ui-web/src/main/webapp/jsp/manager/taskConfigure.jsp
monitor-ui-web/src/main/webapp/jsp/project/internal_domain.jsp
monitor-ui-ctrl/src/main/java/com/ui/ctrl/InternalDnsCtrl.java
View file @
c755179
package
com
.
ui
.
ctrl
;
import
com.alibaba.fastjson.JSON
;
import
com.ui.common.TagTypeEnum
;
import
com.ui.contants.HttpUriContants
;
import
com.ui.http.HttpRestClient
;
import
com.ui.model.BaseResponse
;
...
...
@@ -38,10 +40,12 @@ public class InternalDnsCtrl {
@RequestMapping
(
"/toInternalDns"
)
public
ModelAndView
toInternalDns
(
Model
model
)
{
TagReq
req
=
new
TagReq
();
ModelAndView
mv
=
new
ModelAndView
(
"project/internal_domain"
);
TagReq
req
=
new
TagReq
();
BaseResponse
response
=
httpRestClient
.
defaultPost
(
HttpUriContants
.
HOST_ALL_GROUPS
,
req
,
BaseResponse
.
class
);
model
.
addAttribute
(
"tags"
,
response
.
getData
());
return
new
ModelAndView
(
"project/internal_domain"
);
mv
.
addObject
(
"tags"
,
response
.
getData
());
//获取标签列表
mv
.
addObject
(
"tagTypeMapJson"
,
JSON
.
toJSONString
(
TagTypeEnum
.
getAllTypeMap
()));
//获取标签map 层级结构的
return
mv
;
}
@RequestMapping
(
"save"
)
...
...
monitor-ui-web/src/main/webapp/jsp/manager/taskConfigure.jsp
View file @
c755179
...
...
@@ -140,8 +140,10 @@
<label
class=
"col-sm-2 control-label"
>
<span
style=
"color:red"
>
*
</span>
SQL:
</label>
<div
class=
"col-sm-8"
>
<input
type=
"text"
class=
"form-control"
id=
"influxSql"
name=
"influxSql"
placeholder=
"SQL"
size=
"40"
/>
<textarea
rows=
"3"
cols=
"40"
id=
"influxSql"
name=
"influxSql"
placeholder=
"SQL"
></textarea>
<
%--
<input
type=
"text"
class=
"form-control"
id=
"influxSql"
name=
"influxSql"
placeholder=
"SQL"
size=
"40"
/>
--%>
</div>
</div>
<!-- <div class="form-group">
...
...
@@ -163,8 +165,9 @@
<label
class=
"col-sm-2 control-label"
>
<span
style=
"color:red"
>
*
</span>
短信:
</label>
<div
class=
"col-sm-8"
>
<input
type=
"text"
class=
"form-control"
id=
"sms"
name=
"sms"
placeholder=
"短信,${_}替换符"
size=
"40"
/>
<textarea
rows=
"3"
cols=
"40"
id=
"sms"
name=
"sms"
placeholder=
"短信,${_}替换符"
></textarea>
<
%--
<input
type=
"text"
class=
"form-control"
id=
"sms"
name=
"sms"
placeholder=
"短信,${_}替换符"
size=
"40"
/>
--%>
</div>
</div>
<div
class=
"form-group"
>
...
...
@@ -319,13 +322,14 @@
field
:
"id"
,
width
:
"5%"
},
{
title
:
"列名"
,
field
:
"fields"
,
width
:
"12%"
title
:
"短信内容"
,
field
:
"sms"
,
align
:
"left"
,
width
:
"20%"
},
{
title
:
"数据库"
,
field
:
"database"
,
width
:
"
10
%"
width
:
"
8
%"
},
{
title
:
"告警类型"
,
field
:
"type"
,
...
...
@@ -380,7 +384,7 @@
},
{
title
:
"上次执行"
,
field
:
"lastTime"
,
width
:
"1
5
%"
width
:
"1
0
%"
},
{
title
:
"操作"
,
formatter
:
function
(
value
,
rowData
,
rowIndex
)
{
...
...
@@ -404,9 +408,11 @@
$
(
"input[name='influxdbs']"
).
val
(
""
);
$
(
"input[name='database']"
).
val
(
""
);
$
(
"input[name='tags']"
).
val
(
""
);
$
(
"input[name='influxSql']"
).
val
(
""
);
// $("input[name='influxSql']").val("");
$
(
"#influxSql"
).
val
(
""
);
$
(
"input[name='mobile']"
).
val
(
""
);
$
(
"input[name='sms']"
).
val
(
""
);
// $("input[name='sms']").val("");
$
(
"#sms"
).
val
(
""
);
$
(
"input[name='type']"
).
val
(
""
);
$
(
"input[name='interval']"
).
val
(
""
);
$
(
"input[name='relaxStartTime']"
).
val
(
""
);
...
...
@@ -435,9 +441,11 @@
$
(
"input[name='influxdbs']"
).
val
(
taskModel
.
influxdbs
);
$
(
"input[name='database']"
).
val
(
taskModel
.
database
);
$
(
"input[name='tags']"
).
val
(
taskModel
.
tags
);
$
(
"input[name='influxSql']"
).
val
(
taskModel
.
influxSql
);
// $("input[name='influxSql']").val(taskModel.influxSql);
$
(
"#influxSql"
).
val
(
taskModel
.
influxSql
);
$
(
"input[name='mobile']"
).
val
(
taskModel
.
mobile
);
$
(
"input[name='sms']"
).
val
(
taskModel
.
sms
);
// $("input[name='sms']").val(taskModel.sms);
$
(
"#sms"
).
val
(
taskModel
.
sms
);
$
(
"input[name='type']"
).
val
(
taskModel
.
type
);
$
(
"input[name='interval']"
).
val
(
taskModel
.
interval
);
$
(
"input[name='relaxStartTime']"
).
val
(
taskModel
.
relaxStartTime
);
...
...
@@ -504,9 +512,11 @@
var
influxdbs
=
$
(
"input[name='influxdbs']"
).
val
();
var
database
=
$
(
"input[name='database']"
).
val
();
var
tags
=
$
(
"input[name='tags']"
).
val
();
var
influxSql
=
$
(
"input[name='influxSql']"
).
val
();
// var influxSql = $("input[name='influxSql']").val();
var
influxSql
=
$
(
"#influxSql"
).
val
();
//var mobile = $("input[name='mobile']").val();
var
sms
=
$
(
"input[name='sms']"
).
val
();
// var sms = $("input[name='sms']").val();
var
sms
=
$
(
"#sms"
).
val
();
var
type
=
$
(
"input[name='type']"
).
val
();
var
interval
=
$
(
"input[name='interval']"
).
val
();
var
relaxStartTime
=
$
(
"input[name='relaxStartTime']"
).
val
();
...
...
monitor-ui-web/src/main/webapp/jsp/project/internal_domain.jsp
View file @
c755179
...
...
@@ -140,15 +140,15 @@
</div>
<div
class=
"modal fade"
id=
"myModal"
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"myModalLabel"
aria-hidden=
"true"
>
<div
class=
"modal-dialog"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header"
>
<div
class=
"modal fade"
id=
"myModal"
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"myModalLabel"
aria-hidden=
"true"
>
<div
class=
"modal-dialog"
>
<div
class=
"modal-content"
style=
"width: 850px;"
>
<div
class=
"modal-header"
style=
"width: 850px"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-hidden=
"true"
>
×
</button>
<h4
class=
"modal-title"
id=
"myModalLabel"
></h4>
</div>
<div
class=
"modal-body"
>
<div
class=
"modal-body"
style=
"width: 850px;height:560px;overflow-y: scroll;"
>
<form
id=
"configForm"
class=
"form-horizontal"
>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label"
>
<span
style=
"color:red"
>
*
</span>
域名:
</label>
...
...
@@ -201,11 +201,17 @@
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label"
>
标签:
</label>
<div
class=
"col-sm-8"
>
<c:forEach
items=
"${tags }"
var=
"tag"
varStatus=
"status"
>
<div
class=
"col-sm-9"
>
<div
class=
"col-sm-12"
id=
"appNameContent"
>
</div>
<
%--
<c:forEach
items=
"${tags }"
var=
"tag"
varStatus=
"status"
>
<input
type=
"checkbox"
name=
"tag-add"
value=
"${tag.groupName}"
>
${tag.groupName}
<c:if
test=
"${(status.index+1) % 4 == 0}"
><br></c:if>
</c:forEach>
</c:forEach>
--%>
</div>
</div>
...
...
@@ -565,5 +571,51 @@
}
}
//生成层级结构的标签
var
tagTypes
=
eval
(
$
{
tagTypeMapJson
});
//需要展示的最外层层级
$
(
function
()
{
//生成标签
$
.
ajax
({
url
:
contextPath
+
"/hostGroup/getAllTagsGroupTreegridByType"
,
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>"
;
if
(
key
==
"app"
||
key
==
"mid"
)
{
contentHtml
+=
constructTr
(
data
.
data
[
key
],
1
);
}
else
{
contentHtml
+=
constructTr
(
data
.
data
[
key
]);
}
contentHtml
+=
"</td>"
;
contentHtml
+=
"</tr>"
;
}
contentHtml
+=
"</table>"
;
$
(
"#appNameContent"
).
html
(
contentHtml
);
}
});
});
function
constructTr
(
treeData
){
var
contentHtml
=
""
;
$
.
each
(
treeData
,
function
(
n
,
value
)
{
if
(
n
>
0
&&
n
%
6
==
0
){
contentHtml
+=
'</br>'
;
}
contentHtml
+=
'<input type="checkbox" name="tag-add" value="'
+
value
.
groupName
+
'">'
+
value
.
groupName
+
' '
;
if
(
value
.
children
!=
null
&&
value
.
children
.
length
>
0
){
contentHtml
+=
constructTr
(
value
.
children
);
}
});
return
contentHtml
;
}
</script>
\ No newline at end of file
...
...
Please
register
or
login
to post a comment