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
zhengyouwei
8 years ago
Commit
014391844ac575eab758bf764ba80ff64972cf31
1 parent
247d4f70
master
...
dev_addtag_ui
dev_autoscal_java
dev_config_center
dev_deploy_image_ui
dev_deploy_node
dev_deploy_uic_ui
dev_deploy_yohosearchservice
dev_dock_release_ui
dev_docker2_ui
dev_host_topo_ui
dev_master
dev_mip_hbasesource
dev_mysql_ui
dev_nginx_checkbox
dev_nginx_ui
dev_sql分页
dev_store_ui
dev_switch_nginx
dev_ui_topo
feature/add-footer-div-20220127
monitor-ui-fyzh
monitor_ui
qcloudOnly
add
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
144 additions
and
45 deletions
monitor-ui-web/src/main/webapp/jsp/project/internal_domain.jsp
monitor-ui-web/src/main/webapp/jsp/project/internal_domain.jsp
View file @
0143918
...
...
@@ -81,10 +81,14 @@
style=
"height: 540px;color: black;overflow:auto;width: 300px;text-align: center;"
>
<div
class=
"span3"
>
<ul
class=
"site-stats"
>
<li
id=
"yohoops-aws-li"
onclick=
"searchKeysBefore('yohoops','aws')"
><strong>
yohoops.org.:aws
</strong></li>
<li
id=
"yohoops-qcloud-li"
onclick=
"searchKeysBefore('yohoops','qcloud')"
><strong>
yohoops.org.:qcloud
</strong></li>
<li
id=
"yohobuy-aws-li"
onclick=
"searchKeysBefore('yohobuy','aws')"
><strong>
yohobuy.com.:aws
</strong></li>
<li
id=
"yohobuy-qcloud-li"
onclick=
"searchKeysBefore('yohobuy','qcloud')"
><strong>
yohobuy.com.:qcloud
</strong></li>
<li
id=
"yohoops-aws-li"
onclick=
"searchKeysBefore('yohoops','aws')"
><strong>
yohoops.org.:aws
</strong>
</li>
<li
id=
"yohoops-qcloud-li"
onclick=
"searchKeysBefore('yohoops','qcloud')"
><strong>
yohoops.org.:qcloud
</strong>
</li>
<li
id=
"yohobuy-aws-li"
onclick=
"searchKeysBefore('yohobuy','aws')"
><strong>
yohobuy.com.:aws
</strong>
</li>
<li
id=
"yohobuy-qcloud-li"
onclick=
"searchKeysBefore('yohobuy','qcloud')"
><strong>
yohobuy.com.:qcloud
</strong>
</li>
</ul>
</div>
</div>
...
...
@@ -94,19 +98,24 @@
<div
class=
"widget-title"
style=
"height: 50px;"
>
<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"
>
TAG:
</span>
<select
id=
"tag-select"
name=
"tag-select-name"
class=
"form-control"
onchange=
"searchKeys()"
>
<option
value=
"ALL"
selected=
"selected"
></option>
<c:forEach
items=
"${tags }"
var=
"tag"
>
<option
value=
"${tag.groupName }"
>
${tag.groupName }
</option>
</c:forEach>
</select>
</div>
<div
class=
"input-group"
style=
"float: left;"
>
<span
class=
"input-group-addon"
>
TAG:
</span>
<select
id=
"tag-select"
name=
"tag-select-name"
class=
"form-control"
onchange=
"searchKeys()"
>
<option
value=
"ALL"
selected=
"selected"
></option>
<c:forEach
items=
"${tags }"
var=
"tag"
>
<option
value=
"${tag.groupName }"
>
${tag.groupName }
</option>
</c:forEach>
</select>
</div>
<button
id=
"addBtn"
class=
"btn btn-success"
style=
"margin-left: 18px;"
onclick=
"editConfig(0)"
>
新增
</button>
<button
id=
"commitBtn"
class=
"btn btn-primary"
style=
"margin-left: 18px;"
onclick=
"commit()"
>
提交至域名服务器
</button>
</div>
<button
id=
"addBtn"
class=
"btn btn-success"
style=
"margin-left: 18px;"
onclick=
"editConfig(0)"
>
新增
</button>
<button
id=
"commitBtn"
class=
"btn btn-primary"
style=
"margin-left: 18px;"
onclick=
"commit()"
>
提交至域名服务器
</button>
</div>
</div>
<div
class=
"widget-content nopadding"
>
<div
class=
"tree_container"
style=
"height: 540px;color: black;overflow:auto;"
>
...
...
@@ -137,7 +146,7 @@
<div
class=
"col-sm-8"
>
<input
type=
"text"
class=
"form-control"
id=
"domain-add"
name=
"domain-add"
size=
"150"
readonly=
"readonly"
/>
size=
"150"
readonly=
"readonly"
/>
</div>
</div>
...
...
@@ -155,7 +164,7 @@
<div
class=
"col-sm-8"
>
<input
type=
"text"
class=
"form-control"
id=
"name-add"
name=
"name-add"
size=
"150"
/>
size=
"150"
/>
</div>
</div>
...
...
@@ -244,19 +253,19 @@
title
:
"value"
,
field
:
"value"
,
width
:
"30%"
},{
},
{
title
:
"tag"
,
field
:
"tag"
,
width
:
"10%"
},{
},
{
title
:
"domain"
,
field
:
"domain"
,
width
:
"10%"
},{
},
{
title
:
"cloud"
,
field
:
"environment"
,
width
:
"10%"
},{
},
{
title
:
"操作"
,
formatter
:
function
(
value
,
rowData
,
rowIndex
)
{
var
div
=
$
(
"<div>"
);
...
...
@@ -269,21 +278,21 @@
}
$
(
"#detailTable"
).
table
(
table
);
searchKeysBefore
(
'yohoops'
,
'aws'
);
searchKeysBefore
(
'yohoops'
,
'aws'
);
});
function
searchKeysBefore
(
domain
,
cloud
)
{
function
searchKeysBefore
(
domain
,
cloud
)
{
var
currentDomain
=
$
(
"#current_domain"
).
val
();
var
currentCloud
=
$
(
"#current_cloud"
).
val
();
if
(
currentDomain
!=
''
)
{
$
(
"#"
+
currentDomain
+
"-"
+
currentCloud
+
"-li"
).
removeClass
(
"alert alert-danger"
);
$
(
"#"
+
currentDomain
+
"-"
+
currentCloud
+
"-li"
).
removeClass
(
"alert alert-danger"
);
}
$
(
"#current_domain"
).
val
(
domain
);
$
(
"#current_cloud"
).
val
(
cloud
);
$
(
"#"
+
domain
+
"-"
+
cloud
+
"-li"
).
addClass
(
"alert alert-danger"
);
$
(
"#"
+
domain
+
"-"
+
cloud
+
"-li"
).
addClass
(
"alert alert-danger"
);
searchKeys
();
}
...
...
@@ -292,28 +301,29 @@
var
currentDomain
=
$
(
"#current_domain"
).
val
();
var
currentCloud
=
$
(
"#current_cloud"
).
val
();
var
currentTag
=
$
(
"#tag-select"
).
val
();
if
(
currentDomain
==
'yohoops'
)
{
if
(
currentDomain
==
'yohoops'
)
{
currentDomain
=
'yohoops.org.'
;
}
else
{
}
else
{
currentDomain
=
'yohobuy.com.'
;
}
var
param
=
{
domain
:
currentDomain
,
environment
:
currentCloud
,
tag
:
currentTag
environment
:
currentCloud
,
tag
:
currentTag
}
$
(
"#detailTable"
).
table
(
"load"
,
param
);
};
}
;
//打开新增或修改页面
function
editConfig
(
id
)
{
var
currentDomain
=
$
(
"#current_domain"
).
val
();
if
(
currentDomain
==
'yohoops'
)
{
if
(
currentDomain
==
'yohoops'
)
{
currentDomain
=
'yohoops.org.'
;
}
else
{
}
else
{
currentDomain
=
'yohobuy.com.'
;
}
var
currentCloud
=
$
(
"#current_cloud"
).
val
();
...
...
@@ -345,9 +355,9 @@
$
(
"#name-add"
).
val
(
data
.
name
);
$
(
"#value-add"
).
val
(
data
.
value
);
$
(
"#type-add"
).
val
(
data
.
type
);
var
tagArr
=
data
.
tag
.
split
(
","
);
for
(
i
=
0
;
i
<
tagArr
.
length
;
i
++
){
$
(
":checkbox[value='"
+
tagArr
[
i
]
+
"']"
).
prop
(
"checked"
,
true
);
var
tagArr
=
data
.
tag
.
split
(
","
);
for
(
i
=
0
;
i
<
tagArr
.
length
;
i
++
)
{
$
(
":checkbox[value='"
+
tagArr
[
i
]
+
"']"
).
prop
(
"checked"
,
true
);
}
},
error
:
function
(
data
)
{
...
...
@@ -363,13 +373,13 @@
function
saveConfig
()
{
var
id
=
$
(
"#editId"
).
val
();
var
domain
=
$
(
"#domain-add"
).
val
();
var
cloud
=
$
(
"#cloud-add"
).
val
();
var
cloud
=
$
(
"#cloud-add"
).
val
();
var
name
=
$
(
"#name-add"
).
val
();
var
value
=
$
(
"#value-add"
).
val
();
var
type
=
$
(
"#type-add"
).
val
();
var
tags
=
""
;
$
(
"input[name='tag-add']:checked"
).
each
(
function
(){
tags
+=
$
(
this
).
attr
(
'value'
)
+
','
;
var
tags
=
""
;
$
(
"input[name='tag-add']:checked"
).
each
(
function
()
{
tags
+=
$
(
this
).
attr
(
'value'
)
+
','
;
});
if
(
name
==
null
||
name
==
""
)
{
...
...
@@ -393,14 +403,29 @@
});
return
;
}
if
(
type
==
"a"
&&
!
isIP
(
value
)){
$
(
"#configForm #messageAlert"
).
alerts
({
content
:
"IP格式不正确!"
,
type
:
"danger"
});
return
;
}
if
(
type
==
"cname"
&&
!
isDomain
(
value
)){
$
(
"#configForm #messageAlert"
).
alerts
({
content
:
"域名格式不正确!"
,
type
:
"danger"
});
return
;
}
var
param
=
{
id
:
id
,
domain
:
domain
,
environment
:
cloud
,
domain
:
domain
,
environment
:
cloud
,
name
:
name
,
value
:
value
,
type
:
type
,
tag
:
tags
type
:
type
,
tag
:
tags
}
$
.
ajax
({
type
:
'post'
,
...
...
@@ -448,7 +473,7 @@
if
(
!
data
||
data
.
code
!=
200
)
{
localAlert
(
'删除失败'
,
data
.
message
);
}
searchKeys
();
searchKeys
();
}
});
}
...
...
@@ -456,6 +481,80 @@
});
}
function
commit
()
{
var
currentDomain
=
$
(
"#current_domain"
).
val
();
if
(
currentDomain
==
'yohoops'
)
{
currentDomain
=
'yohoops.org.'
;
}
else
{
currentDomain
=
'yohobuy.com.'
;
}
var
currentCloud
=
$
(
"#current_cloud"
).
val
();
var
param
=
{
domain
:
currentDomain
,
environment
:
currentCloud
,
}
var
dialog
=
$
(
"<div>"
).
appendTo
(
$
(
"body"
));
dialog
.
dialog
({
title
:
"你确定刷新吗"
,
backdrop
:
"static"
,
content
:
"你确定要刷新到服务器吗?"
,
buttons
:
[{
text
:
"否"
,
className
:
"btn-danger"
,
onclick
:
function
()
{
$
(
dialog
).
dialog
(
"hide"
);
}
},
{
text
:
"是"
,
className
:
"btn-success"
,
onclick
:
function
()
{
$
(
dialog
).
dialog
(
"hide"
);
$
.
ajax
({
url
:
contextPath
+
"/internalDns/refresh"
,
type
:
'post'
,
async
:
false
,
dataType
:
"json"
,
data
:
param
,
success
:
function
(
data
)
{
localAlert
(
'刷新结果'
,
data
.
data
);
}
});
}
}]
});
}
function
isIP
(
ip
)
{
var
reSpaceCheck
=
/^
(\d
+
)\.(\d
+
)\.(\d
+
)\.(\d
+
)
$/
;
if
(
reSpaceCheck
.
test
(
ip
))
{
ip
.
match
(
reSpaceCheck
);
if
(
RegExp
.
$1
<=
255
&&
RegExp
.
$1
>=
0
&&
RegExp
.
$2
<=
255
&&
RegExp
.
$2
>=
0
&&
RegExp
.
$3
<=
255
&&
RegExp
.
$3
>=
0
&&
RegExp
.
$4
<=
255
&&
RegExp
.
$4
>=
0
)
{
return
true
;
}
else
{
return
false
;
}
}
else
{
return
false
;
}
}
function
isDomain
(
domain
){
var
pattern
=
/
[
A-Za-z0-9_
]
+
(\.[
A-Za-z0-9_
]
+
)
+/
;
if
(
pattern
.
test
(
domain
)){
return
true
;
}
else
{
return
false
;
}
}
</script>
\ No newline at end of file
...
...
Please
register
or
login
to post a comment