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
afa5ed31d3b18e1ea8f8b39f6726c7688711b580
1 parent
7e78eee4
nginx切换
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
9 deletions
monitor-ui-ctrl/src/main/java/com/ui/ctrl/TopoSwitchCtrl.java
monitor-ui-web/src/main/webapp/script/switch.js
monitor-ui-ctrl/src/main/java/com/ui/ctrl/TopoSwitchCtrl.java
View file @
afa5ed3
...
...
@@ -69,6 +69,9 @@ public class TopoSwitchCtrl {
List
<
String
>
az2HostIps
=(
List
<
String
>)(
map
.
get
(
"gatewayServerHosts"
).
get
(
0
).
get
(
"az2ServerHosts"
));
List
<
String
>
grayHostIps
=(
List
<
String
>)(
map
.
get
(
"gatewayServerHosts"
).
get
(
0
).
get
(
"grayServerHosts"
));
List
<
String
>
az1NginxIps
=(
List
<
String
>)(
map
.
get
(
"nginxServerHosts"
).
get
(
0
).
get
(
"az1NginxHosts"
));
List
<
String
>
az2NginxIps
=(
List
<
String
>)(
map
.
get
(
"nginxServerHosts"
).
get
(
0
).
get
(
"az2NginxHosts"
));
List
<
String
>
ls
=
topoSwitchUtil
.
getNginxLocationType
(
az1HostIps
,
az2HostIps
,
grayHostIps
,
qcloudList
);
String
qqApiNginx
=
ls
.
get
(
0
);
String
qqGrayNginx
=
ls
.
get
(
1
);
...
...
@@ -77,12 +80,16 @@ public class TopoSwitchCtrl {
String
az2ApiNginx
=
ls
.
get
(
0
);
String
az2GrayNginx
=
ls
.
get
(
1
);
resultMap
.
put
(
"az2ApiNginx"
,
az2ApiNginx
);
resultMap
.
put
(
"az2GrayNginx"
,
az2GrayNginx
);
resultMap
.
put
(
"qqApiNginx"
,
qqApiNginx
);
resultMap
.
put
(
"qqGrayNginx"
,
qqGrayNginx
);
resultMap
.
put
(
"az2ApiNginx"
,
az2ApiNginx
);
resultMap
.
put
(
"az2GrayNginx"
,
az2GrayNginx
);
resultMap
.
put
(
"defaultDns"
,
httpRestClient
.
defaultGet
(
HttpUriContants
.
CENTERSWITCH_DEFAULT_DNS
,
String
.
class
));
resultMap
.
put
(
"luaType"
,
topoSwitchUtil
.
getLuaType
());
//
resultMap
.
put
(
"az1NginxIps"
,
StringUtils
.
join
(
az1NginxIps
,
","
));
resultMap
.
put
(
"az2NginxIps"
,
StringUtils
.
join
(
az2NginxIps
,
","
));
}
catch
(
Exception
e
){
logger
.
error
(
" TopoSwitchCtrl - getNgixnStatus - err"
,
e
);
}
...
...
monitor-ui-web/src/main/webapp/script/switch.js
View file @
afa5ed3
...
...
@@ -37,7 +37,7 @@ function drawData(resp) {
scene
.
add
(
container_az2
);
container_az2
.
add
(
newNode
(
scene
,
appNodeX
+
380
,
appNodeY
+
180
,
1
,
1
));
container_az2
.
add
(
newNode
(
scene
,
appNodeX
+
380
,
appNodeY
+
450
,
1
,
1
));
container_az2
.
add
(
newNode
(
scene
,
appNodeX
+
5
50
,
appNodeY
+
180
,
1
,
1
));
container_az2
.
add
(
newNode
(
scene
,
appNodeX
+
6
50
,
appNodeY
+
180
,
1
,
1
));
var
askServer
=
newNode
(
scene
,
appNodeX
-
10
,
appNodeY
+
200
,
appNodeW
,
appNodeH
,
'问询服务器'
);
container_qq
.
add
(
askServer
);
...
...
@@ -49,15 +49,24 @@ function drawData(resp) {
var
qqElb
=
newNode
(
scene
,
appNodeX
+
80
,
appNodeY
+
200
,
appNodeW
,
appNodeH
,
'
qq
Elb'
);
var
qqElb
=
newNode
(
scene
,
appNodeX
+
80
,
appNodeY
+
200
,
appNodeW
,
appNodeH
,
'
az1
Elb'
);
container_qq
.
add
(
qqElb
);
var
qqNginx
=
newNode
(
scene
,
appNodeX
+
85
,
appNodeY
+
300
,
appNodeW
,
appNodeH
,
'qqNginx'
);
var
qqElbIp
=
newNode
(
scene
,
appNodeX
+
80
+
90
,
appNodeY
+
200
+
15
,
1
,
1
,
'123.206.1.98'
);
qqElbIp
.
textPosition
=
'Bottom_Right'
;
container_qq
.
add
(
qqElbIp
);
var
qqNginx
=
newNode
(
scene
,
appNodeX
+
85
,
appNodeY
+
300
,
appNodeW
,
appNodeH
,
'az1Nginx'
);
container_qq
.
add
(
qqNginx
);
var
link
=
newLink
(
scene
,
qqElb
,
qqNginx
);
link
.
arrowsRadius
=
10
;
//var qqNginxIp=newNode(scene,appNodeX+85+75,appNodeY+300-5,1,1,data.az1NginxIps);
//qqNginxIp.textPosition = 'Bottom_Right';
//container_qq.add(qqNginxIp);
var
qqGateway1
=
newNode
(
scene
,
appNodeX
+
110
,
appNodeY
+
420
,
appNodeW
,
appNodeH
,
'qqGateway'
);
var
qqGateway1
=
newNode
(
scene
,
appNodeX
+
110
,
appNodeY
+
420
,
appNodeW
,
appNodeH
,
'az1Gateway'
);
var
grayGateway
=
newNode
(
scene
,
appNodeX
+
250
,
appNodeY
+
440
,
appNodeW
,
appNodeH
,
'grayGateway'
);
container_qq
.
add
(
qqGateway1
);
container_qq
.
add
(
grayGateway
);
...
...
@@ -65,11 +74,22 @@ function drawData(resp) {
var
az2Elb
=
newNode
(
scene
,
appNodeX
+
420
,
appNodeY
+
200
,
appNodeW
,
appNodeH
,
'az2Elb'
);
container_az2
.
add
(
az2Elb
);
var
az2ElbIp
=
newNode
(
scene
,
appNodeX
+
420
+
90
,
appNodeY
+
200
+
15
,
1
,
1
,
'123.206.2.50'
);
az2ElbIp
.
textPosition
=
'Bottom_Right'
;
container_az2
.
add
(
az2ElbIp
);
var
az2Nginx
=
newNode
(
scene
,
appNodeX
+
425
,
appNodeY
+
300
,
appNodeW
,
appNodeH
,
'az2Nginx'
);
container_az2
.
add
(
az2Nginx
);
var
link
=
newLink
(
scene
,
az2Elb
,
az2Nginx
);
link
.
arrowsRadius
=
10
;
//var az2NginxIp=newNode(scene,appNodeX+425+75,appNodeY+300-5,1,1,data.az2NginxIps);
//az2NginxIp.textPosition = 'Bottom_Right';
//container_az2.add(az2NginxIp);
var
az2Gateway1
=
newNode
(
scene
,
appNodeX
+
450
,
appNodeY
+
420
,
appNodeW
,
appNodeH
,
'az2Gateway'
);
container_az2
.
add
(
az2Gateway1
);
...
...
@@ -516,13 +536,13 @@ function newNode(scene,x, y, w, h, text) {
node
.
setImage
(
contextPath
+
'img/pstn/host.png'
,
true
);
}
else
if
(
"问询服务器"
==
text
){
node
.
setImage
(
contextPath
+
'img/pstn/terminal.png'
,
true
);
}
else
if
(
"awsElb"
==
text
||
"qqElb"
==
text
||
"az2Elb"
==
text
){
}
else
if
(
"awsElb"
==
text
||
"qqElb"
==
text
||
"az
1Elb"
==
text
||
"az
2Elb"
==
text
){
node
.
setImage
(
contextPath
+
'img/pstn/cloud.png'
,
true
);
node
.
textPosition
=
'Middle_Center'
;
// 文字居中
}
else
if
(
"awsNginx"
==
text
||
"qqNginx"
==
text
||
"az2Nginx"
==
text
){
}
else
if
(
"awsNginx"
==
text
||
"qqNginx"
==
text
||
"az
1Nginx"
==
text
||
"az
2Nginx"
==
text
){
node
.
setImage
(
contextPath
+
'img/pstn/router2.png'
,
true
);
node
.
textPosition
=
'Top_Center'
;
// 文字居中
}
else
if
(
"awsGateway"
==
text
||
"qqGateway"
==
text
||
"az2Gateway"
==
text
){
}
else
if
(
"awsGateway"
==
text
||
"qqGateway"
==
text
||
"az
1Gateway"
==
text
||
"az
2Gateway"
==
text
){
node
.
setImage
(
contextPath
+
'img/pstn/msc.png'
,
true
);
//node.alarm = "";
//node.alarmColor = '0,255,0';
...
...
Please
register
or
login
to post a comment