Showing
8 changed files
with
22 additions
and
123 deletions
![](/ops/monitor-ui/raw/d1f27305758ac6f2fba8a57c07f760418e7f8ad0/monitor-ui-web/src/main/webapp/img/pstn/cloud.png)
6.08 KB
![](/ops/monitor-ui/raw/d1f27305758ac6f2fba8a57c07f760418e7f8ad0/monitor-ui-web/src/main/webapp/img/pstn/host.png)
4.36 KB
![](/ops/monitor-ui/raw/d1f27305758ac6f2fba8a57c07f760418e7f8ad0/monitor-ui-web/src/main/webapp/img/pstn/msc.png)
386 Bytes
![](/ops/monitor-ui/raw/d1f27305758ac6f2fba8a57c07f760418e7f8ad0/monitor-ui-web/src/main/webapp/img/pstn/router.png)
178 Bytes
![](/ops/monitor-ui/raw/d1f27305758ac6f2fba8a57c07f760418e7f8ad0/monitor-ui-web/src/main/webapp/img/pstn/router2.png)
316 Bytes
![](/ops/monitor-ui/raw/d1f27305758ac6f2fba8a57c07f760418e7f8ad0/monitor-ui-web/src/main/webapp/img/pstn/terminal.png)
564 Bytes
@@ -250,7 +250,7 @@ | @@ -250,7 +250,7 @@ | ||
250 | </div> | 250 | </div> |
251 | 251 | ||
252 | <script src="<%=basePath %>script/common/genarate_left_panel.js"></script> | 252 | <script src="<%=basePath %>script/common/genarate_left_panel.js"></script> |
253 | -<script src="<%=basePath %>script/switch.js?v=20171025-2"></script> | 253 | +<script src="<%=basePath %>script/switch.js?v=20171107-21"></script> |
254 | 254 | ||
255 | <script type="text/javascript"> | 255 | <script type="text/javascript"> |
256 | $("#li_switch").addClass("active open"); | 256 | $("#li_switch").addClass("active open"); |
@@ -6,124 +6,6 @@ $(document).ready(function () { | @@ -6,124 +6,6 @@ $(document).ready(function () { | ||
6 | * 展示画布 和 数据 | 6 | * 展示画布 和 数据 |
7 | * @param resp | 7 | * @param resp |
8 | */ | 8 | */ |
9 | -/*function drawData_bbbbbbbak(resp) { | ||
10 | - var data = resp.data; | ||
11 | - | ||
12 | - var canvas = document.getElementById('canvas'); | ||
13 | - var stage = new JTopo.Stage(canvas); | ||
14 | - //显示工具栏 | ||
15 | - //showJTopoToobar(stage); | ||
16 | - var scene = new JTopo.Scene(); | ||
17 | - stage.add(scene); | ||
18 | - scene.background = contextPath + "img/bg.jpg"; | ||
19 | - | ||
20 | - var appNodeX = 100; | ||
21 | - var appNodeY = 50; | ||
22 | - var appNodeW = 30; | ||
23 | - var appNodeH = 26; | ||
24 | - var appNode = newNode(scene,appNodeX,appNodeY,appNodeW,appNodeH,'APP'); | ||
25 | - | ||
26 | - var askServer = newNode(scene,appNodeX+600,appNodeY+100,appNodeW,appNodeH,'问询服务器'); | ||
27 | - var link = newFoldLink(scene,appNode, askServer, '问询'); | ||
28 | - link.arrowsRadius = 10; | ||
29 | - | ||
30 | - var awsElb = newNode(scene,appNodeX+200,appNodeY+200,appNodeW,appNodeH,'awsElb'); | ||
31 | - | ||
32 | - var awsNginx = newNode(scene,appNodeX+200,appNodeY+300,appNodeW,appNodeH,'awsNginx'); | ||
33 | - var link = newLink(scene,awsElb, awsNginx); | ||
34 | - link.arrowsRadius = 10; | ||
35 | - | ||
36 | - var awsGateway1 = newNode(scene,appNodeX+150,appNodeY+400,appNodeW,appNodeH,'awsGateway'); | ||
37 | - var awsGateway2 = newNode(scene,appNodeX+250,appNodeY+400,appNodeW,appNodeH,'awsGateway'); | ||
38 | - | ||
39 | - var qqElb = newNode(scene,appNodeX+400,appNodeY+200,appNodeW,appNodeH,'qqElb'); | ||
40 | - //var link = newFoldLink(scene,appNode, qqElb, '域名'); | ||
41 | - //link.arrowsRadius = 10; | ||
42 | - | ||
43 | - var qqNginx = newNode(scene,appNodeX+400,appNodeY+300,appNodeW,appNodeH,'qqNginx'); | ||
44 | - var link = newLink(scene,qqElb, qqNginx); | ||
45 | - link.arrowsRadius = 10; | ||
46 | - | ||
47 | - var qqGateway1 = newNode(scene,appNodeX+350,appNodeY+400,appNodeW,appNodeH,'qqGateway'); | ||
48 | - var qqGateway2 = newNode(scene,appNodeX+450,appNodeY+400,appNodeW,appNodeH,'qqGateway'); | ||
49 | - | ||
50 | - var appServerSe1 = newNode(scene,appNodeX+100,appNodeY-100,1,1); | ||
51 | - var appServerSe2 = newNode(scene,appNodeX+100,appNodeY+500,1,1); | ||
52 | - newLink(scene,appServerSe1, appServerSe2,"",10); | ||
53 | - | ||
54 | - var awsQqSe1 = newNode(scene,appNodeX+300,appNodeY-100,1,1); | ||
55 | - var awsQqSe2 = newNode(scene,appNodeX+300,appNodeY+500,1,1); | ||
56 | - newLink(scene,awsQqSe1, awsQqSe2,"",10); | ||
57 | - | ||
58 | - var app = newNode(scene,appNodeX,appNodeY-50,1,1,'app'); | ||
59 | - var aws = newNode(scene,appNodeX+200,appNodeY-50,1,1,'aws'); | ||
60 | - var qq = newNode(scene,appNodeX+400,appNodeY-50,1,1,'qq'); | ||
61 | - | ||
62 | - | ||
63 | - if('aws' == data.luaType){//app全部直连到aws | ||
64 | - var link = newLink(scene,appNode, awsElb, '直连'); | ||
65 | - link.arrowsRadius = 10; | ||
66 | - }else if('qq' == data.luaType){//app全部直连到qq | ||
67 | - var link = newLink(scene,appNode, qqElb, '直连'); | ||
68 | - link.arrowsRadius = 10; | ||
69 | - }else if('aws+qq' == data.luaType){//app分散直连 | ||
70 | - var link = newLink(scene,appNode, awsElb, '直连'); | ||
71 | - link.arrowsRadius = 10; | ||
72 | - var link = newLink(scene,appNode, qqElb, '直连'); | ||
73 | - link.arrowsRadius = 10; | ||
74 | - } | ||
75 | - | ||
76 | - if('aws' == data.awsApiNginx){//aws nginx 指向aws gateway | ||
77 | - var link = newLink(scene,awsNginx, awsGateway1,"online"); | ||
78 | - link.arrowsRadius = 10; | ||
79 | - }else{//aws nginx 指向qq gateway | ||
80 | - var link = newLink(scene,awsNginx, qqGateway1,"online"); | ||
81 | - link.arrowsRadius = 10; | ||
82 | - } | ||
83 | - | ||
84 | - if('aws' == data.awsGrayNginx){//aws nginx gray 指向aws gateway | ||
85 | - var link = newLink(scene,awsNginx, awsGateway2,"gray"); | ||
86 | - link.arrowsRadius = 10; | ||
87 | - }else{//aws nginx 指向qq gateway | ||
88 | - var link = newLink(scene,awsNginx, qqGateway2,"gray"); | ||
89 | - link.arrowsRadius = 10; | ||
90 | - } | ||
91 | - | ||
92 | - if('aws' == data.qqApiNginx){//qq nginx 指向aws gateway | ||
93 | - var link = newLink(scene,qqNginx, awsGateway1,"online"); | ||
94 | - link.arrowsRadius = 10; | ||
95 | - }else{//qq nginx 指向qq gateway | ||
96 | - var link = newLink(scene,qqNginx, qqGateway1,"online"); | ||
97 | - link.arrowsRadius = 10; | ||
98 | - } | ||
99 | - | ||
100 | - if('aws' == data.qqGrayNginx){//qq nginx gray 指向aws gateway | ||
101 | - var link = newLink(scene,qqNginx, awsGateway2,"gray"); | ||
102 | - link.arrowsRadius = 10; | ||
103 | - }else{//aws nginx 指向qq gateway | ||
104 | - var link = newLink(scene,qqNginx, qqGateway2,"gray"); | ||
105 | - link.arrowsRadius = 10; | ||
106 | - } | ||
107 | - | ||
108 | - if('aws' == data.defaultDns){ | ||
109 | - var link = newFoldLink(scene,appNode, awsElb, 'dns','',5); | ||
110 | - link.arrowsRadius = 10; | ||
111 | - }else if('qq' == data.defaultDns){ | ||
112 | - var link = newFoldLink(scene,appNode, qqElb, 'dns','',5); | ||
113 | - link.arrowsRadius = 10; | ||
114 | - } | ||
115 | - | ||
116 | - //创建lua切换按钮 | ||
117 | - createLuaSwitchButton(data.luaType); | ||
118 | - | ||
119 | - //创建入口切换按钮 | ||
120 | - createDnsSwitchButton(data.luaType); | ||
121 | -}*/ | ||
122 | - | ||
123 | -/** | ||
124 | - * 展示画布 和 数据 | ||
125 | - * @param resp | ||
126 | - */ | ||
127 | function drawData(resp) { | 9 | function drawData(resp) { |
128 | var data = resp.data; | 10 | var data = resp.data; |
129 | 11 | ||
@@ -145,14 +27,14 @@ function drawData(resp) { | @@ -145,14 +27,14 @@ function drawData(resp) { | ||
145 | var link = newFoldLink(scene,appNode, askServer, '问询'); | 27 | var link = newFoldLink(scene,appNode, askServer, '问询'); |
146 | link.arrowsRadius = 10; | 28 | link.arrowsRadius = 10; |
147 | 29 | ||
148 | - var awsElb = newNode(scene,appNodeX+200,appNodeY+200,appNodeW,appNodeH,'awsElb'); | 30 | + var awsElb = newNode(scene,appNodeX+160,appNodeY+200,appNodeW,appNodeH,'awsElb'); |
149 | 31 | ||
150 | - var awsNginx = newNode(scene,appNodeX+200,appNodeY+300,appNodeW,appNodeH,'awsNginx'); | 32 | + var awsNginx = newNode(scene,appNodeX+165,appNodeY+300,appNodeW,appNodeH,'awsNginx'); |
151 | var link = newLink(scene,awsElb, awsNginx); | 33 | var link = newLink(scene,awsElb, awsNginx); |
152 | link.arrowsRadius = 10; | 34 | link.arrowsRadius = 10; |
153 | 35 | ||
154 | 36 | ||
155 | - var qqElb = newNode(scene,appNodeX+400,appNodeY+200,appNodeW,appNodeH,'qqElb'); | 37 | + var qqElb = newNode(scene,appNodeX+400-5,appNodeY+200,appNodeW,appNodeH,'qqElb'); |
156 | //var link = newFoldLink(scene,appNode, qqElb, '域名'); | 38 | //var link = newFoldLink(scene,appNode, qqElb, '域名'); |
157 | //link.arrowsRadius = 10; | 39 | //link.arrowsRadius = 10; |
158 | 40 | ||
@@ -160,7 +42,7 @@ function drawData(resp) { | @@ -160,7 +42,7 @@ function drawData(resp) { | ||
160 | var link = newLink(scene,qqElb, qqNginx); | 42 | var link = newLink(scene,qqElb, qqNginx); |
161 | link.arrowsRadius = 10; | 43 | link.arrowsRadius = 10; |
162 | 44 | ||
163 | - var awsGateway1 = newNode(scene,appNodeX+150,appNodeY+400,appNodeW,appNodeH,'awsGateway'); | 45 | + var awsGateway1 = newNode(scene,appNodeX+180,appNodeY+400,appNodeW,appNodeH,'awsGateway'); |
164 | //var awsGateway2 = newNode(scene,appNodeX+250,appNodeY+400,appNodeW,appNodeH,'awsGateway'); | 46 | //var awsGateway2 = newNode(scene,appNodeX+250,appNodeY+400,appNodeW,appNodeH,'awsGateway'); |
165 | 47 | ||
166 | 48 | ||
@@ -247,6 +129,7 @@ function drawData(resp) { | @@ -247,6 +129,7 @@ function drawData(resp) { | ||
247 | createDnsSwitchButton(data.luaType); | 129 | createDnsSwitchButton(data.luaType); |
248 | } | 130 | } |
249 | 131 | ||
132 | + | ||
250 | /** | 133 | /** |
251 | * 创建lua切换按钮 | 134 | * 创建lua切换按钮 |
252 | * @param luaType | 135 | * @param luaType |
@@ -616,6 +499,22 @@ function newNode(scene,x, y, w, h, text) { | @@ -616,6 +499,22 @@ function newNode(scene,x, y, w, h, text) { | ||
616 | var node = new JTopo.Node(text); | 499 | var node = new JTopo.Node(text); |
617 | node.setLocation(x, y); | 500 | node.setLocation(x, y); |
618 | node.setSize(w, h); | 501 | node.setSize(w, h); |
502 | + if("APP"==text){ | ||
503 | + node.setImage(contextPath + 'img/pstn/host.png', true); | ||
504 | + }else if("问询服务器"==text){ | ||
505 | + node.setImage(contextPath + 'img/pstn/terminal.png', true); | ||
506 | + }else if("awsElb"==text||"qqElb"==text){ | ||
507 | + node.setImage(contextPath + 'img/pstn/cloud.png', true); | ||
508 | + node.textPosition = 'Middle_Center';// 文字居中 | ||
509 | + }else if("awsNginx"==text||"qqNginx"==text){ | ||
510 | + node.setImage(contextPath + 'img/pstn/router2.png', true); | ||
511 | + }else if("awsGateway"==text||"qqGateway"==text){ | ||
512 | + node.setImage(contextPath + 'img/pstn/msc.png', true); | ||
513 | + node.alarm = ""; | ||
514 | + node.alarmColor = '0,255,0'; | ||
515 | + }else if("grayGateway"==text){ | ||
516 | + node.setImage(contextPath + 'img/pstn/msc.png', true); | ||
517 | + } | ||
619 | scene.add(node); | 518 | scene.add(node); |
620 | return node; | 519 | return node; |
621 | } | 520 | } |
-
Please register or login to post a comment