-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex_data.html
2334 lines (1991 loc) · 147 KB
/
index_data.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<html>
<head>
<title>canvas test</title>
<link type="text/css" rel="stylesheet" href="base.css" />
<link type="text/css" href="_network_topology.css" />
<script type="text/javascript" src="jquery-3.2.1.js"></script>
<script type="text/javascript" src="jtopo-0.4.8-min.js"></script>
<script type="text/javascript">
function drawPhysicaltopology() {
var self = this;
var data_tmp = {"new_server_rack_list":[],"origin_switch_link_list":[{"link_details":[{"color":"#2E8B57","createtime":"2017-09-16 13:36:30","id":"10.100.218.15","locchassisid":"6c:ae:8b:e7:4b:00","locportid":"11","locportiddesc":"11","locportindex":"11","locsysname":"G8052-2","remchassisid":"a0:36:9f:8f:c0:7c","remportid":"a0:36:9f:8f:c0:7f","remportiddesc":"eth4","remportindex":"","remsysname":"node-2","status":"1","updatetime":"2017-10-08 01:31:12"},{"color":"#2E8B57","createtime":"2017-09-16 13:36:30","id":"10.100.218.15","locchassisid":"6c:ae:8b:e7:4b:00","locportid":"18","locportiddesc":"18","locportindex":"18","locsysname":"G8052-2","remchassisid":"a0:36:9f:8f:ba:e0","remportid":"a0:36:9f:8f:ba:e2","remportiddesc":"eth2","remportindex":"","remsysname":"node-5","status":"1","updatetime":"2017-10-08 01:31:12"},{"color":"#2E8B57","createtime":"2017-09-16 13:36:30","id":"10.100.218.15","locchassisid":"6c:ae:8b:e7:4b:00","locportid":"1","locportiddesc":"1","locportindex":"1","locsysname":"G8052-2","remchassisid":"08:17:f4:a3:3b:00","remportid":"2","remportiddesc":"2","remportindex":"2","remsysname":"G8052-3","status":"1","updatetime":"2017-10-08 01:31:12"},{"color":"#2E8B57","createtime":"2017-09-16 13:36:30","id":"10.100.218.15","locchassisid":"6c:ae:8b:e7:4b:00","locportid":"19","locportiddesc":"19","locportindex":"19","locsysname":"G8052-2","remchassisid":"a0:36:9f:8f:c0:7c","remportid":"a0:36:9f:8f:c0:7e","remportiddesc":"eth3","remportindex":"","remsysname":"node-2","status":"1","updatetime":"2017-10-08 01:31:12"},{"color":"#2E8B57","createtime":"2017-09-16 13:36:30","id":"10.100.218.15","locchassisid":"6c:ae:8b:e7:4b:00","locportid":"9","locportiddesc":"9","locportindex":"9","locsysname":"G8052-2","remchassisid":"a0:36:9f:8f:c0:54","remportid":"a0:36:9f:8f:c0:57","remportiddesc":"eth4","remportindex":"","remsysname":"node-4","status":"1","updatetime":"2017-10-08 01:31:12"},{"color":"#2E8B57","createtime":"2017-09-16 13:36:30","id":"10.100.218.15","locchassisid":"6c:ae:8b:e7:4b:00","locportid":"22","locportiddesc":"22","locportindex":"22","locsysname":"G8052-2","remchassisid":"a0:36:9f:8f:c0:bc","remportid":"a0:36:9f:8f:c0:be","remportiddesc":"eth3","remportindex":"","remsysname":"node-3","status":"1","updatetime":"2017-10-08 01:31:12"},{"color":"#2E8B57","createtime":"2017-09-16 13:36:30","id":"10.100.218.15","locchassisid":"6c:ae:8b:e7:4b:00","locportid":"8","locportiddesc":"8","locportindex":"8","locsysname":"G8052-2","remchassisid":"a0:36:9f:8f:ba:e0","remportid":"a0:36:9f:8f:ba:e3","remportiddesc":"eth3","remportindex":"","remsysname":"node-5","status":"1","updatetime":"2017-10-08 01:31:12"},{"color":"#2E8B57","createtime":"2017-09-16 13:36:30","id":"10.100.218.15","locchassisid":"6c:ae:8b:e7:4b:00","locportid":"20","locportiddesc":"20","locportindex":"20","locsysname":"G8052-2","remchassisid":"a0:36:9f:8f:bc:d0","remportid":"a0:36:9f:8f:bc:d2","remportiddesc":"eth2","remportindex":"","remsysname":"node-1","status":"1","updatetime":"2017-10-08 01:31:12"},{"color":"#2E8B57","createtime":"2017-09-16 13:36:30","id":"10.100.218.15","locchassisid":"6c:ae:8b:e7:4b:00","locportid":"14","locportiddesc":"14","locportindex":"14","locsysname":"G8052-2","remchassisid":"a0:36:9f:8f:bc:d0","remportid":"a0:36:9f:8f:bc:d3","remportiddesc":"eth4","remportindex":"","remsysname":"node-1","status":"1","updatetime":"2017-10-08 01:31:12"},{"color":"#2E8B57","createtime":"2017-09-16 13:36:30","id":"10.100.218.15","locchassisid":"6c:ae:8b:e7:4b:00","locportid":"12","locportiddesc":"12","locportindex":"12","locsysname":"G8052-2","remchassisid":"a0:36:9f:8f:c0:bc","remportid":"a0:36:9f:8f:c0:bf","remportiddesc":"eth4","remportindex":"","remsysname":"node-3","status":"1","updatetime":"2017-10-08 01:31:12"},{"color":"#2E8B57","createtime":"2017-09-16 13:36:30","id":"10.100.218.15","locchassisid":"6c:ae:8b:e7:4b:00","locportid":"2","locportiddesc":"2","locportindex":"2","locsysname":"G8052-2","remchassisid":"a4:8c:db:2c:18:00","remportid":"1","remportiddesc":"1","remportindex":"1","remsysname":"G8052-1","status":"1","updatetime":"2017-10-08 01:31:12"},{"color":"#2E8B57","createtime":"2017-09-16 13:36:30","id":"10.100.218.15","locchassisid":"6c:ae:8b:e7:4b:00","locportid":"17","locportiddesc":"17","locportindex":"17","locsysname":"G8052-2","remchassisid":"a0:36:9f:8f:c0:54","remportid":"a0:36:9f:8f:c0:56","remportiddesc":"eth3","remportindex":"","remsysname":"node-4","status":"1","updatetime":"2017-10-08 01:31:12"},{"color":"#2E8B57","createtime":"2017-09-16 13:36:30","id":"10.100.218.15","locchassisid":"6c:ae:8b:e7:4b:00","locportid":"51","locportiddesc":"XGE3","locportindex":"51","locsysname":"G8052-2","remchassisid":"a8:97:dc:27:77:00","remportid":"3/4","remportiddesc":"3/4","remportindex":"9","remsysname":"G8332","status":"1","updatetime":"2017-10-08 01:31:12"}],"switch_ip":"10.100.218.15"},{"link_details":[{"color":"#2E8B57","createtime":"2017-09-16 13:36:30","id":"10.100.218.7","locchassisid":"00:00:00:00:00:00","locportid":"Ethernet1/1","locportiddesc":"Ethernet1/1","locportindex":"436207616","locsysname":"switch.lenovo.com","remchassisid":"08:17:f4:a3:3b:00","remportid":"22","remportiddesc":"22","remportindex":"22","remsysname":"G8052-3","status":"1","updatetime":"2017-10-08 01:31:12"}],"switch_ip":"10.100.218.7"},{"link_details":[{"color":"#2E8B57","createtime":"2017-09-16 13:36:29","id":"10.100.218.6","locchassisid":"a8:97:dc:27:77:00","locportid":"3/4","locportiddesc":"3/4","locportindex":"9","locsysname":"G8332","remchassisid":"6c:ae:8b:e7:4b:00","remportid":"51","remportiddesc":"XGE3","remportindex":"51","remsysname":"G8052-2","status":"1","updatetime":"2017-10-08 01:31:12"},{"color":"#2E8B57","createtime":"2017-09-16 13:36:29","id":"10.100.218.6","locchassisid":"a8:97:dc:27:77:00","locportid":"3/3","locportiddesc":"3/3","locportindex":"8","locsysname":"G8332","remchassisid":"08:17:f4:a3:3b:00","remportid":"49","remportiddesc":"XGE1","remportindex":"49","remsysname":"G8052-3","status":"1","updatetime":"2017-10-08 01:31:12"},{"color":"red","createtime":"2017-09-16 13:36:29","id":"10.100.218.6","locchassisid":"a8:97:dc:27:77:00","locportid":"MGT","locportiddesc":"MGT","locportindex":"127","locsysname":"G8332","remchassisid":"08:17:f4:a3:3b:00","remportid":"38","remportiddesc":"38","remportindex":"38","remsysname":"G8052-3","status":"1","updatetime":"2017-10-08 01:31:12"},{"color":"red","createtime":"2017-09-16 13:36:29","id":"10.100.218.6","locchassisid":"a8:97:dc:27:77:00","locportid":"2/4","locportiddesc":"2/4","locportindex":"5","locsysname":"G8332","remchassisid":"a0:36:9f:8f:c0:7c","remportid":"90:e2:ba:9d:93:68","remportiddesc":"eth2","remportindex":"","remsysname":"node-2","status":"1","updatetime":"2017-10-08 01:31:12"},{"color":"red","createtime":"2017-09-16 13:36:29","id":"10.100.218.6","locchassisid":"a8:97:dc:27:77:00","locportid":"3/1","locportiddesc":"3/1","locportindex":"6","locsysname":"G8332","remchassisid":"a4:8c:db:2c:18:00","remportid":"51","remportiddesc":"XGE3","remportindex":"51","remsysname":"G8052-1","status":"1","updatetime":"2017-10-08 01:31:12"}],"switch_ip":"10.100.218.6"},{"link_details":[{"color":"#5E5E5E","createtime":"2017-09-16 13:36:29","id":"10.100.218.10","locchassisid":"a4:8c:db:99:47:00","locportid":"Ethernet1/43","locportiddesc":"Ethernet1/43","locportindex":"20","locsysname":"G8272-1","remchassisid":"a0:36:9f:8f:c0:54","remportid":"90:e2:ba:9d:94:ac","remportiddesc":"eth2","remportindex":"","remsysname":"node-4","status":"1","updatetime":"2017-10-08 01:31:12"},{"color":"#5E5E5E","createtime":"2017-09-16 13:36:29","id":"10.100.218.10","locchassisid":"a4:8c:db:99:47:00","locportid":"mgmt0","locportiddesc":"mgmt0","locportindex":"3","locsysname":"G8272-1","remchassisid":"08:17:f4:a3:3b:00","remportid":"37","remportiddesc":"37","remportindex":"37","remsysname":"G8052-3","status":"1","updatetime":"2017-10-08 01:31:12"},{"color":"#5E5E5E","createtime":"2017-09-16 13:36:29","id":"10.100.218.10","locchassisid":"a4:8c:db:99:47:00","locportid":"Ethernet1/36","locportiddesc":"Ethernet1/36","locportindex":"410036","locsysname":"G8272-1","remchassisid":"a0:36:9f:8f:bc:d0","remportid":"90:e2:ba:9d:93:34","remportiddesc":"eth3","remportindex":"","remsysname":"node-1","status":"1","updatetime":"2017-10-08 01:31:12"},{"color":"#5E5E5E","createtime":"2017-09-16 13:36:29","id":"10.100.218.10","locchassisid":"a4:8c:db:99:47:00","locportid":"Ethernet1/46","locportiddesc":"Ethernet1/46","locportindex":"410046","locsysname":"G8272-1","remchassisid":"a0:36:9f:8f:c0:bc","remportid":"90:e2:ba:9d:96:94","remportiddesc":"eth2","remportindex":"","remsysname":"node-3","status":"1","updatetime":"2017-10-08 01:31:12"}],"switch_ip":"10.100.218.10"},{"link_details":[{"color":"#5E5E5E","createtime":"2017-09-16 13:36:30","id":"10.100.218.3","locchassisid":"a4:8c:db:2c:18:00","locportid":"51","locportiddesc":"XGE3","locportindex":"51","locsysname":"G8052-1","remchassisid":"a8:97:dc:27:77:00","remportid":"3/1","remportiddesc":"3/1","remportindex":"6","remsysname":"G8332","status":"1","updatetime":"2017-10-08 01:31:12"},{"color":"#5E5E5E","createtime":"2017-09-16 13:36:30","id":"10.100.218.3","locchassisid":"a4:8c:db:2c:18:00","locportid":"1","locportiddesc":"1","locportindex":"1","locsysname":"G8052-1","remchassisid":"6c:ae:8b:e7:4b:00","remportid":"2","remportiddesc":"2","remportindex":"2","remsysname":"G8052-2","status":"1","updatetime":"2017-10-08 01:31:12"}],"switch_ip":"10.100.218.3"},{"link_details":[{"color":"#5E5E5E","createtime":"2017-09-16 13:36:30","id":"10.100.218.8","locchassisid":"08:17:f4:a3:3b:00","locportid":"16","locportiddesc":"16","locportindex":"16","locsysname":"G8052-3","remchassisid":"a0:36:9f:8f:bc:d0","remportid":"a0:36:9f:8f:bc:d1","remportiddesc":"eth1","remportindex":"","remsysname":"node-1","status":"1","updatetime":"2017-10-08 01:31:12"},{"color":"#5E5E5E","createtime":"2017-09-16 13:36:30","id":"10.100.218.8","locchassisid":"08:17:f4:a3:3b:00","locportid":"7","locportiddesc":"7","locportindex":"7","locsysname":"G8052-3","remchassisid":"a0:36:9f:8f:bc:d0","remportid":"a0:36:9f:8f:bc:d0","remportiddesc":"eth0","remportindex":"","remsysname":"node-1","status":"1","updatetime":"2017-10-08 01:31:12"},{"color":"#5E5E5E","createtime":"2017-09-16 13:36:29","id":"10.100.218.8","locchassisid":"08:17:f4:a3:3b:00","locportid":"20","locportiddesc":"20","locportindex":"20","locsysname":"G8052-3","remchassisid":"a0:36:9f:8f:c0:bc","remportid":"a0:36:9f:8f:c0:bd","remportiddesc":"eth1","remportindex":"","remsysname":"node-3","status":"1","updatetime":"2017-10-08 01:31:12"},{"color":"#5E5E5E","createtime":"2017-09-16 13:36:30","id":"10.100.218.8","locchassisid":"08:17:f4:a3:3b:00","locportid":"22","locportiddesc":"22","locportindex":"22","locsysname":"G8052-3","remchassisid":"00:00:00:00:00:00","remportid":"Ethernet1/1","remportiddesc":"Ethernet1/1","remportindex":"436207616","remsysname":"switch.lenovo.com","status":"1","updatetime":"2017-10-08 01:31:12"},{"color":"#5E5E5E","createtime":"2017-09-16 13:36:30","id":"10.100.218.8","locchassisid":"08:17:f4:a3:3b:00","locportid":"2","locportiddesc":"2","locportindex":"2","locsysname":"G8052-3","remchassisid":"6c:ae:8b:e7:4b:00","remportid":"1","remportiddesc":"1","remportindex":"1","remsysname":"G8052-2","status":"1","updatetime":"2017-10-08 01:31:12"},{"color":"#5E5E5E","createtime":"2017-09-16 13:36:30","id":"10.100.218.8","locchassisid":"08:17:f4:a3:3b:00","locportid":"38","locportiddesc":"38","locportindex":"38","locsysname":"G8052-3","remchassisid":"a8:97:dc:27:77:00","remportid":"MGT","remportiddesc":"MGT","remportindex":"127","remsysname":"G8332","status":"1","updatetime":"2017-10-08 01:31:12"},{"color":"#5E5E5E","createtime":"2017-09-16 13:36:29","id":"10.100.218.8","locchassisid":"08:17:f4:a3:3b:00","locportid":"10","locportiddesc":"10","locportindex":"10","locsysname":"G8052-3","remchassisid":"a0:36:9f:8f:c0:7c","remportid":"a0:36:9f:8f:c0:7c","remportiddesc":"eth0","remportindex":"","remsysname":"node-2","status":"1","updatetime":"2017-10-08 01:31:12"},{"color":"#5E5E5E","createtime":"2017-09-16 13:36:30","id":"10.100.218.8","locchassisid":"08:17:f4:a3:3b:00","locportid":"8","locportiddesc":"8","locportindex":"8","locsysname":"G8052-3","remchassisid":"a0:36:9f:8f:c0:54","remportid":"a0:36:9f:8f:c0:54","remportiddesc":"eth0","remportindex":"","remsysname":"node-4","status":"1","updatetime":"2017-10-08 01:31:12"},{"color":"#5E5E5E","createtime":"2017-09-16 13:36:30","id":"10.100.218.8","locchassisid":"08:17:f4:a3:3b:00","locportid":"17","locportiddesc":"17","locportindex":"17","locsysname":"G8052-3","remchassisid":"a0:36:9f:8f:ba:e0","remportid":"a0:36:9f:8f:ba:e1","remportiddesc":"eth1","remportindex":"","remsysname":"node-5","status":"1","updatetime":"2017-10-08 01:31:12"},{"color":"#5E5E5E","createtime":"2017-09-16 13:36:30","id":"10.100.218.8","locchassisid":"08:17:f4:a3:3b:00","locportid":"18","locportiddesc":"18","locportindex":"18","locsysname":"G8052-3","remchassisid":"a0:36:9f:8f:c0:54","remportid":"a0:36:9f:8f:c0:55","remportiddesc":"eth1","remportindex":"","remsysname":"node-4","status":"1","updatetime":"2017-10-08 01:31:12"},{"color":"#5E5E5E","createtime":"2017-09-16 13:36:30","id":"10.100.218.8","locchassisid":"08:17:f4:a3:3b:00","locportid":"19","locportiddesc":"19","locportindex":"19","locsysname":"G8052-3","remchassisid":"a0:36:9f:8f:c0:7c","remportid":"a0:36:9f:8f:c0:7d","remportiddesc":"eth1","remportindex":"","remsysname":"node-2","status":"1","updatetime":"2017-10-08 01:31:12"},{"color":"#5E5E5E","createtime":"2017-09-16 13:36:30","id":"10.100.218.8","locchassisid":"08:17:f4:a3:3b:00","locportid":"49","locportiddesc":"XGE1","locportindex":"49","locsysname":"G8052-3","remchassisid":"a8:97:dc:27:77:00","remportid":"3/3","remportiddesc":"3/3","remportindex":"8","remsysname":"G8332","status":"1","updatetime":"2017-10-08 01:31:12"},{"color":"#5E5E5E","createtime":"2017-09-16 13:36:30","id":"10.100.218.8","locchassisid":"08:17:f4:a3:3b:00","locportid":"37","locportiddesc":"37","locportindex":"37","locsysname":"G8052-3","remchassisid":"a4:8c:db:99:47:00","remportid":"mgmt0","remportiddesc":"mgmt0","remportindex":"3","remsysname":"G8272-1","status":"1","updatetime":"2017-10-08 01:31:12"},{"color":"#5E5E5E","createtime":"2017-09-16 13:36:30","id":"10.100.218.8","locchassisid":"08:17:f4:a3:3b:00","locportid":"3","locportiddesc":"3","locportindex":"3","locsysname":"G8052-3","remchassisid":"a0:36:9f:8f:ba:e0","remportid":"a0:36:9f:8f:ba:e0","remportiddesc":"eth0","remportindex":"","remsysname":"node-5","status":"1","updatetime":"2017-10-08 01:31:12"},{"color":"#5E5E5E","createtime":"2017-09-16 13:36:30","id":"10.100.218.8","locchassisid":"08:17:f4:a3:3b:00","locportid":"5","locportiddesc":"5","locportindex":"5","locsysname":"G8052-3","remchassisid":"a0:36:9f:8f:c0:bc","remportid":"a0:36:9f:8f:c0:bc","remportiddesc":"eth0","remportindex":"","remsysname":"node-3","status":"1","updatetime":"2017-10-08 01:31:12"}],"switch_ip":"10.100.218.8"}],"selection":"0","server_rack_list":[{"serverlist":[{"active_port_details":[{"eth_name":"eth2","remchassisid":"a4:8c:db:99:47:00","remsysname":"G8272-1"},{"eth_name":"eth4","remchassisid":"6c:ae:8b:e7:4b:00","remsysname":"G8052-2"},{"eth_name":"eth3","remchassisid":"6c:ae:8b:e7:4b:00","remsysname":"G8052-2"},{"eth_name":"eth1","remchassisid":"08:17:f4:a3:3b:00","remsysname":"G8052-3"},{"eth_name":"eth0","remchassisid":"08:17:f4:a3:3b:00","remsysname":"G8052-3"}],"chassisid":"a0:36:9f:8f:c0:bc","createtime":"2017-09-16 13:36:29","id":"a98010daa0:36:9f:8f:c0:bc","ip":"192.168.166.5","oid":"74113f51-6331-4590-bcc6-6818073b50ab","portinfo":null,"status":"1","sysdescr":"CentOS Linux 7 (Core) Linux 3.10.0-514.26.2.el7.len.x86_64 #1 SMP Wed Jul 26 03:58:53 EDT 2017 x86_64","sysname":"node-3","updatetime":"2017-10-08 01:31:12"},{"active_port_details":[{"eth_name":"eth2","remchassisid":"a4:8c:db:99:47:00","remsysname":"G8272-1"},{"eth_name":"eth3","remchassisid":"6c:ae:8b:e7:4b:00","remsysname":"G8052-2"},{"eth_name":"eth4","remchassisid":"6c:ae:8b:e7:4b:00","remsysname":"G8052-2"},{"eth_name":"eth1","remchassisid":"08:17:f4:a3:3b:00","remsysname":"G8052-3"},{"eth_name":"eth0","remchassisid":"08:17:f4:a3:3b:00","remsysname":"G8052-3"}],"chassisid":"a0:36:9f:8f:c0:54","createtime":"2017-09-16 13:36:29","id":"a98017b0a0:36:9f:8f:c0:54","ip":"192.168.166.6","oid":"c5b210ff-f105-4dc9-a827-af9110a88c10","portinfo":null,"status":"1","sysdescr":"CentOS Linux 7 (Core) Linux 3.10.0-514.26.2.el7.len.x86_64 #1 SMP Wed Jul 26 03:58:53 EDT 2017 x86_64","sysname":"node-4","updatetime":"2017-10-08 01:31:12"}],"tuplelist":[{"eth_name":"eth2","remchassisid":"a4:8c:db:99:47:00","remsysname":"G8272-1"},{"eth_name":"eth4","remchassisid":"6c:ae:8b:e7:4b:00","remsysname":"G8052-2"},{"eth_name":"eth3","remchassisid":"6c:ae:8b:e7:4b:00","remsysname":"G8052-2"},{"eth_name":"eth1","remchassisid":"08:17:f4:a3:3b:00","remsysname":"G8052-3"},{"eth_name":"eth0","remchassisid":"08:17:f4:a3:3b:00","remsysname":"G8052-3"}]},{"serverlist":[{"active_port_details":[{"eth_name":"eth3","remchassisid":"a4:8c:db:99:47:00","remsysname":"G8272-1"},{"eth_name":"eth2","remchassisid":"6c:ae:8b:e7:4b:00","remsysname":"G8052-2"},{"eth_name":"eth4","remchassisid":"6c:ae:8b:e7:4b:00","remsysname":"G8052-2"},{"eth_name":"eth1","remchassisid":"08:17:f4:a3:3b:00","remsysname":"G8052-3"},{"eth_name":"eth0","remchassisid":"08:17:f4:a3:3b:00","remsysname":"G8052-3"}],"chassisid":"a0:36:9f:8f:bc:d0","createtime":"2017-09-16 13:36:29","id":"a9801436a0:36:9f:8f:bc:d0","ip":"192.168.166.3","oid":"b0d6d7d1-5003-46ac-b737-e2c45d4a9df1","portinfo":null,"status":"1","sysdescr":"CentOS Linux 7 (Core) Linux 3.10.0-514.26.2.el7.len.x86_64 #1 SMP Wed Jul 26 03:58:53 EDT 2017 x86_64","sysname":"node-1","updatetime":"2017-10-08 01:31:12"}],"tuplelist":[{"eth_name":"eth3","remchassisid":"a4:8c:db:99:47:00","remsysname":"G8272-1"},{"eth_name":"eth2","remchassisid":"6c:ae:8b:e7:4b:00","remsysname":"G8052-2"},{"eth_name":"eth4","remchassisid":"6c:ae:8b:e7:4b:00","remsysname":"G8052-2"},{"eth_name":"eth1","remchassisid":"08:17:f4:a3:3b:00","remsysname":"G8052-3"},{"eth_name":"eth0","remchassisid":"08:17:f4:a3:3b:00","remsysname":"G8052-3"}]},{"serverlist":[{"active_port_details":[{"eth_name":"eth2","remchassisid":"6c:ae:8b:e7:4b:00","remsysname":"G8052-2"},{"eth_name":"eth3","remchassisid":"6c:ae:8b:e7:4b:00","remsysname":"G8052-2"},{"eth_name":"eth1","remchassisid":"08:17:f4:a3:3b:00","remsysname":"G8052-3"},{"eth_name":"eth0","remchassisid":"08:17:f4:a3:3b:00","remsysname":"G8052-3"}],"chassisid":"a0:36:9f:8f:ba:e0","createtime":"2017-09-16 13:36:29","id":"a9801ab2a0:36:9f:8f:ba:e0","ip":"192.168.166.7","oid":"dedf071a-2f85-4a92-852a-0397b70e0750","portinfo":null,"status":"1","sysdescr":"CentOS Linux 7 (Core) Linux 3.10.0-514.26.2.el7.len.x86_64 #1 SMP Wed Jul 26 03:58:53 EDT 2017 x86_64","sysname":"node-5","updatetime":"2017-10-08 01:31:12"}],"tuplelist":[{"eth_name":"eth2","remchassisid":"6c:ae:8b:e7:4b:00","remsysname":"G8052-2"},{"eth_name":"eth3","remchassisid":"6c:ae:8b:e7:4b:00","remsysname":"G8052-2"},{"eth_name":"eth1","remchassisid":"08:17:f4:a3:3b:00","remsysname":"G8052-3"},{"eth_name":"eth0","remchassisid":"08:17:f4:a3:3b:00","remsysname":"G8052-3"}]},{"serverlist":[{"active_port_details":[{"eth_name":"eth2","remchassisid":"a8:97:dc:27:77:00","remsysname":"G8332"},{"eth_name":"eth4","remchassisid":"6c:ae:8b:e7:4b:00","remsysname":"G8052-2"},{"eth_name":"eth3","remchassisid":"6c:ae:8b:e7:4b:00","remsysname":"G8052-2"},{"eth_name":"eth0","remchassisid":"08:17:f4:a3:3b:00","remsysname":"G8052-3"},{"eth_name":"eth1","remchassisid":"08:17:f4:a3:3b:00","remsysname":"G8052-3"}],"chassisid":"a0:36:9f:8f:c0:7c","createtime":"2017-09-16 13:36:29","id":"a9801e18a0:36:9f:8f:c0:7c","ip":"192.168.166.4","oid":"eeaccb97-a462-45c7-8832-4805c857b40b","portinfo":null,"status":"1","sysdescr":"CentOS Linux 7 (Core) Linux 3.10.0-514.26.2.el7.len.x86_64 #1 SMP Wed Jul 26 03:58:53 EDT 2017 x86_64","sysname":"node-2","updatetime":"2017-10-08 01:31:12"}],"tuplelist":[{"eth_name":"eth2","remchassisid":"a8:97:dc:27:77:00","remsysname":"G8332"},{"eth_name":"eth4","remchassisid":"6c:ae:8b:e7:4b:00","remsysname":"G8052-2"},{"eth_name":"eth3","remchassisid":"6c:ae:8b:e7:4b:00","remsysname":"G8052-2"},{"eth_name":"eth0","remchassisid":"08:17:f4:a3:3b:00","remsysname":"G8052-3"},{"eth_name":"eth1","remchassisid":"08:17:f4:a3:3b:00","remsysname":"G8052-3"}]}],"success":true,"switch_list":[{"chassisid":"a4:8c:db:99:47:00","createtime":"2017-09-16 13:36:29","id":"a97e3242a4:8c:db:99:47:00","ip":"10.100.218.10","ipv6":null,"oid":"3b94dc67-5627-4ae0-ad8f-320f8191c3e9","portinfo":"unknown","status":"1","sysdescr":"Lanovo RackSwitch G8272, LANOVO NOS version 10.4.2.0","sysname":"G8272-1","updatetime":"2017-10-08 01:31:12"},{"chassisid":"6c:ae:8b:e7:4b:00","createtime":"2017-09-16 13:36:29","id":"a97e368e6c:ae:8b:e7:4b:00","ip":"10.100.218.15","ipv6":null,"oid":"67bb6b4c-2096-40f6-b370-5ce2e857064d","portinfo":"48GE+4XGE","status":"1","sysdescr":"Lenovo RackSwitch G8052, flash image: version 8.4.1, boot image: version 8.4.1","sysname":"G8052-2","updatetime":"2017-10-08 01:31:12"},{"chassisid":"a8:97:dc:27:77:00","createtime":"2017-09-16 13:36:29","id":"a97e38aaa8:97:dc:27:77:00","ip":"10.100.218.6","ipv6":null,"oid":"8ab11f36-f615-47b2-b835-b64da29f91cf","portinfo":"32QXGE","status":"1","sysdescr":"Lenovo RackSwitch G8332, flash image: version 8.4.1, boot image: version 8.4.1","sysname":"G8332","updatetime":"2017-10-08 01:31:12"},{"chassisid":"a4:8c:db:2c:18:00","createtime":"2017-09-16 13:36:29","id":"a97e3a6ca4:8c:db:2c:18:00","ip":"10.100.218.3","ipv6":null,"oid":"a528984a-f1e8-4845-9d77-1252c2364669","portinfo":"48GE+4XGE","status":"1","sysdescr":"Lenovo RackSwitch G8052, flash image: version 8.4.1, boot image: version 8.4.1","sysname":"G8052-1","updatetime":"2017-10-08 01:31:12"},{"chassisid":"00:00:00:00:00:00","createtime":"2017-09-16 13:36:29","id":"a97e3c0600:00:00:00:00:00","ip":"10.100.218.7","ipv6":null,"oid":"b900cb44-5f9a-4bb7-b9fc-961cd8a4f34c","portinfo":"unknown","status":"1","sysdescr":"Cisco Nexus Operating System (NX-OS) Software 7.0(3)I4(5)=TAC support: http://www.cisco.com/tac=Copyright (c) 2002-2016, Cisco Systems, Inc. All rights reserved.","sysname":"switch.lenovo.com","updatetime":"2017-10-08 01:31:12"},{"chassisid":"08:17:f4:a3:3b:00","createtime":"2017-09-16 13:36:29","id":"a97e3d8208:17:f4:a3:3b:00","ip":"10.100.218.8","ipv6":null,"oid":"c4022ae3-369c-4391-b75c-3971eb77f87a","portinfo":"48GE+4XGE","status":"1","sysdescr":"Lenovo RackSwitch G8052, flash image: version 8.4.1, boot image: version 8.4.1","sysname":"G8052-3","updatetime":"2017-10-08 01:31:12"}]};
//var data = JSON.parse(data_tmp);
var data = data_tmp;
function gettext(text){
return text;
}
//鼠标移动到交换机弹出框信息
function switch_popup_handler(event, switch_details){
document.getElementById("contextmenu").style.display = "block";
document.getElementById("table").style.display = "block";
document.getElementById("foot").style.display = "block";
document.getElementById("tBody").style.display = "none";
var div = document.getElementById("contextmenu");
var movey = event.target.y;
var movex = event.target.x;
div.style.top = movey + 60 + "px";
div.style.left = movex - 50 + "px";
var bl = document.getElementById("tb")
var x = bl.createCaption();
for (var i = bl.rows.length - 1; i >= 0; i--) {
bl.deleteRow(i);
}
var row = bl.insertRow(bl.rows.length);
var row1 = bl.insertRow(bl.rows.length);
var row2 = bl.insertRow(bl.rows.length);
var cell1 = row.insertCell(row.cells.length);
var cell2 = row.insertCell(row.cells.length);
var cell3 = row1.insertCell(row1.cells.length);
var cell4 = row1.insertCell(row1.cells.length);
var cell5 = row2.insertCell(row2.cells.length);
var cell6 = row2.insertCell(row2.cells.length);
x.innerHTML = switch_details["sysname"];
cell1.innerHTML = gettext("ip:");
cell2.innerHTML = switch_details["ip"];
cell3.innerHTML = gettext("chassisid:");
cell4.innerHTML = switch_details["chassisid"];
cell5.innerHTML = gettext("sysname:");
cell6.innerHTML = switch_details["sysname"];
document.getElementById("m_title").innerHTML = gettext("manage the switch");
document.getElementById("link").innerHTML = "»" + gettext("view switch details");
document.getElementById("login").innerHTML = gettext("login the switch");
document.getElementById("login").style.width = "115px";
document.getElementById("shut").style.display = "none";
document.getElementById("restart").style.display = "none";
var switch_id_fordetails = switch_details["oid"];
var switch_login = switch_details["id"];
document.getElementById("link").onclick = function () {
(new switchDetailAction()).open(switch_details['ip'], switch_id_fordetails);
}
document.getElementById("login").onclick = function () {
(new switchLoginAction()).open([{'id': switch_login}]);
}
$("#contextmenu").show();
/*
$("#contextmenu").css({
top: event.target.y + 60,
left:event.target.x
}).show();
$("#contextmenu").css({
top: event.target.y + 60,
left:event.target.x
}).show();
*/
}
//鼠标移动到host‘s node时,弹出框显示详情
function server_popup_handler(event, server_details, conf_switch_lists){
var switch_list = conf_switch_lists.switch_list;
var origin_switch_link_list = conf_switch_lists.origin_switch_link_list;
document.getElementById("contextmenu").style.display = "block";
document.getElementById("table").style.display = "block";
document.getElementById("foot").style.display = "block";
document.getElementById("tBody").style.display = "block";
var bl = document.getElementById("tb");
var x = bl.createCaption();
var tBody = document.getElementById("tBody");
var x2 = document.getElementById("m_title");
for (var i = bl.rows.length - 1; i >= 0; i--) {
bl.deleteRow(i);
}
;
for (var i = tBody.rows.length - 1; i >= 0; i--) {
tBody.deleteRow(i);
}
var row = bl.insertRow(bl.rows.length);
var row1 = bl.insertRow(bl.rows.length);
var row2 = bl.insertRow(bl.rows.length);
var cell1 = row.insertCell(row.cells.length);
var cell2 = row.insertCell(row.cells.length);
var cell3 = row1.insertCell(row1.cells.length);
var cell4 = row1.insertCell(row1.cells.length);
var cell5 = row2.insertCell(row2.cells.length);
var cell6 = row2.insertCell(row2.cells.length);
x.innerHTML = server_details["sysname"];
cell1.innerHTML = "  " + gettext("ip:");
cell2.innerHTML = server_details["ip"];
cell3.innerHTML = "  " + gettext("chassisid:");
cell4.innerHTML = server_details["chassisid"];
cell5.innerHTML = "  " + gettext("sysname:");
cell6.innerHTML = server_details["sysname"];
//document.getElementById("m_title").innerHTML = gettext("manage the server");
var row21 = tBody.insertRow(tBody.rows.length);
var cell21 = row21.insertCell(row21.cells.length);
var cell22 = row21.insertCell(row21.cells.length);
var cell23 = row21.insertCell(row21.cells.length);
var cell24 = row21.insertCell(row21.cells.length);
var cell25 = row21.insertCell(row21.cells.length);
var cell26 = row21.insertCell(row21.cells.length);
x2.innerHTML = gettext("manage the server");
cell21.innerHTML = "  " + gettext("server") + gettext("port");
//cell22.innerHTML = "           " + gettext("traffic status") + "          ";
cell23.innerHTML = gettext("Switch Name") + "          ";
cell24.innerHTML = "  " + gettext("switch port") + "        ";
//cell25.innerHTML = "  " + gettext("traffic details") + "    ";
cell26.innerHTML = "  " + gettext("link status") + "    ";
for (var cd = 0; cd < server_details['active_port_details'].length; cd++) {
for (var j = 0; j < switch_list.length; j++) {
if (server_details["active_port_details"][cd]["remchassisid"] == switch_list[j]["chassisid"]) {
var row22 = tBody.insertRow(tBody.rows.length);
var cell31 = row22.insertCell(row22.cells.length);
var cell32 = row22.insertCell(row22.cells.length);
var cell33 = row22.insertCell(row22.cells.length);
var cell34 = row22.insertCell(row22.cells.length);
var cell35 = row22.insertCell(row22.cells.length);
var cell36 = row22.insertCell(row22.cells.length);
cell31.innerHTML = "            " + server_details['active_port_details'][cd]["eth_name"];
cell33.innerHTML = server_details['active_port_details'][cd]["remsysname"];
if (server_details['status'] == "1" || server_details['status'] == 1) {
cell36.innerHTML = "  " + "active";
}
if (server_details['status'] == "3" || server_details['status'] == 3) {
cell36.innerHTML = "  " + "offline";
}
for (var k = 0; k < origin_switch_link_list.length; k++) {
if (switch_list[j]["ip"] == origin_switch_link_list[k]["switch_ip"]) {
for (var z = 0; z < origin_switch_link_list[k]["link_details"].length; z++) {
if (server_details["chassisid"] == origin_switch_link_list[k]["link_details"][z]["remchassisid"] && origin_switch_link_list[k]["link_details"][z]["remportiddesc"] == server_details["active_port_details"][cd]["eth_name"]) {
//cell32.innerHTML = "  " + '<div class="portStatus"style="border-right:90px solid' + origin_switch_link_list[k]["link_details"][z]["color"] + ';border-bottom:2px solid' + origin_switch_link_list[k]["link_details"][z]["color"] + ';margin-bottom:10px;"></div>';
var portindex = origin_switch_link_list[k]["link_details"][z]["locportindex"];
if (origin_switch_link_list[k]["link_details"][z]["color"] == "#5E5E5E") {
//cell35.innerHTML = "   " + gettext("no details");
} else {
var inputlink = "/horizon/admin/traffic/" + switch_list[j]["ip"] + "|input|" + portindex + "/detail/";
var outputlink = "/horizon/admin/traffic/" + switch_list[j]["ip"] + "|output|" + portindex + "/detail/";
var inTrafficData = {
queryType: 'realtime',
ip: switch_list[j]["ip"],
locportindex: portindex
};
//cell35.innerHTML = ' <a class="traficinputDetail" style="text-decoration:underline" href="javascript:void(0);">' + gettext("input") + '</a>' + "  " + ' <a style="text-decoration:underline" class="traficoutputDetail" href="javascript:void(0);">' + gettext("output") + '</a>' + "          ";
cell35.onclick = function (event) {
event = event || window.event;
var ele = event.target;
if ($(ele).attr('class') == 'traficinputDetail') {
inTrafficData.direction = 'input';
(new lenovoTrafficsAction()).openDetail(inTrafficData);
} else if ($(ele).attr('class') == 'traficoutputDetail') {
inTrafficData.direction = 'output';
(new lenovoTrafficsAction()).openDetail(inTrafficData);
}
};
}
}
for (var p = 0; p < origin_switch_link_list.length; p++) {
if (switch_list[j]["ip"] == origin_switch_link_list[p]["switch_ip"]) {
for (var q = 0; q < origin_switch_link_list[p]["link_details"].length; q++) {
if (origin_switch_link_list[p]["link_details"][q]["remchassisid"] == server_details["chassisid"] && origin_switch_link_list[p]["link_details"][q]["remportiddesc"] == server_details['active_port_details'][cd]["eth_name"]) {
cell34.innerHTML = "  " + origin_switch_link_list[p]["link_details"][q]["locportiddesc"] + "     ";
}
}
}
}
;
}
}
}
}
}
}
document.getElementById("link").innerHTML = "»" + gettext("view server details");
document.getElementById("restart").style.display = "block";
document.getElementById("restart").style.width = "50px";
document.getElementById("restart").style.height = "30px";
document.getElementById("restart").innerHTML = gettext("Reboot");
document.getElementById("login").style.width = "40px";
document.getElementById("login").style.height = "30px";
document.getElementById("login").style.display = "block";
document.getElementById("shut").style.display = "none";
document.getElementById("login").innerHTML = gettext("login");
var div = document.getElementById("contextmenu");
var movey = event.target.y;
var movex = event.target.x;
div.style.top = movey + 32 + "px";
div.style.left = movex - 50 + "px";
var str = RndNum(8);
//document.getElementById("link").href = "/horizon/admin/host/" + str + server_details["chassisid"].substring(0, 2) + "%3A" + server_details["chassisid"].substring(3, 5) + "%3A" + server_details["chassisid"].substring(6, 8) + "%3A" + server_details["chassisid"].substring(9, 11) + "%3A" + server_details["chassisid"].substring(12, 14) + "%3A" + server_details["chassisid"].substring(15, 17) + "/detail/";
var hoet_id_fordetail = server_details["oid"];
var hoet_id_forlogin = server_details["id"];
document.getElementById("link").onclick = function () {
(new createhostDetailAction()).open(hoet_id_fordetail, server_details["sysname"]);
}
document.getElementById("login").onclick = function () {
(new hostLoginAction()).open([{'id': hoet_id_forlogin}]);
}
document.getElementById("shut").onclick = function () {
window.location.href = "/horizon/admin/host/" + str + server_details["chassisid"].substring(0, 2) + "%3A" + server_details["chassisid"].substring(3, 5) + "%3A" + server_details["chassisid"].substring(6, 8) + "%3A" + server_details["chassisid"].substring(9, 11) + "%3A" + server_details["chassisid"].substring(12, 14) + "%3A" + server_details["chassisid"].substring(15, 17) + "/shutdownhost/";
}
document.getElementById("restart").onclick = function () {
(new hostRebootAction()).open([{'id': hoet_id_forlogin}]);
}
$("#contextmenu").show();
}
//鼠标双击交换机连接机架的连线时的弹出框
function line_switch_to_server_popup_click(event, conf){
var connectmessage = conf.details;
var status = conf.status;
var colorgray = 0;
//var e = document.all ? window.event : arguments[0] ? arguments[0] : event;
var e = event;
document.getElementById("contextmenu").style.display = "block";
document.getElementById("table").style.display = "none";
document.getElementById("foot").style.display = "none";
var div = document.getElementById("contextmenu");
div.style.top = e.layerY + 8 + "px" ;
div.style.left = e.layerX + 8 - 100 + "px" ;
var bl = document.getElementById("tb")
var x = bl.createCaption();
for (var i = bl.rows.length - 1; i >= 0; i--) {
bl.deleteRow(i);
}
x.innerHTML = gettext("connected switch:") + connectmessage[0]["sysname"];
var row = bl.insertRow(bl.rows.length);
var row1 = bl.insertRow(bl.rows.length);
var cell1 = row.insertCell(row.cells.length);
var cell2 = row.insertCell(row.cells.length);
var cell3 = row.insertCell(row.cells.length);
var cell7 = row.insertCell(row.cells.length);
var cell8 = row.insertCell(row.cells.length);
var cell20 = row.insertCell(row.cells.length);
cell1.innerHTML = gettext("server name") + "   ";
cell2.innerHTML = "  " + gettext("server") + gettext("port") + "      ";
cell3.innerHTML = gettext("switch port") + "          ";
//cell7.innerHTML = gettext("traffic details") + "    ";
//cell8.innerHTML = gettext("traffic status") + "      ";
cell20.innerHTML = gettext("link status") + "      ";
for (var i = 0; i < connectmessage[0]["racklist"]["serverlist"].length; i++) {
var row1 = bl.insertRow(bl.rows.length);
var cell4 = row1.insertCell(row1.cells.length);
var cell5 = row1.insertCell(row1.cells.length);
var cell6 = row1.insertCell(row1.cells.length);
var cell9 = row1.insertCell(row1.cells.length);
var cell10 = row1.insertCell(row1.cells.length);
var cell21 = row1.insertCell(row1.cells.length);
cell4.innerHTML = connectmessage[0]["racklist"]["serverlist"][i]["sysname"];
cell5.innerHTML = "  " + connectmessage[0]["tuplelist"]["eth_name"];
//if (parseInt(connectmessage[0]["racklist"]["serverlist"][i]['status']) == 1) {
// cell21.innerHTML = "  " + "active";
//}
//if (parseInt(connectmessage[0]["racklist"]["serverlist"][i]['status'] == 3)) {
// cell21.innerHTML = "  " + "offline";
//}
if(status == 0){
cell21.innerHTML = "  " + "active";
}
if(status == 1){
cell21.innerHTML = "  " + "offline";
}
for (var k = 0; k < origin_switch_link_list.length; k++) {
if (connectmessage[0]["switch_ip"] == origin_switch_link_list[k]["switch_ip"]) {
for (var z = 0; z < origin_switch_link_list[k]["link_details"].length; z++) {
if (connectmessage[0]["racklist"]["serverlist"][i]["chassisid"] == origin_switch_link_list[k]["link_details"][z]["remchassisid"]) {
var portindex = origin_switch_link_list[k]["link_details"][z]["locportindex"];
//cell10.innerHTML = '<div class="status"style="left:5px;width: 10px; height: 10px;background: ' + origin_switch_link_list[k]["link_details"][z]["color"] + ';-moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px;"></div>';
if (colorgray == 1) {
//cell9.innerHTML = " " + gettext("no details");
} else {
var inputlink = "/horizon/admin/traffic/" + connectmessage[0]["switch_ip"] + "|input|" + portindex + "/detail/";
var outputlink = "/horizon/admin/traffic/" + connectmessage[0]["switch_ip"] + "|output|" + portindex + "/detail/"
var inTrafficData = {
queryType: 'realtime',
ip: connectmessage[0]["switch_ip"],
locportindex: portindex
};
//cell9.innerHTML = ' <a class="traficinputDetail" style="text-decoration:underline" href="javascript:void(0);">' + gettext("input") + '</a>' + "  " + ' <a style="text-decoration:underline" class="traficoutputDetail" href="javascript:void(0);">' + gettext("output") + '</a>' + "          ";
cell9.onclick = function (event) {
event = event || window.event;
var ele = event.target;
if ($(ele).attr('class') == 'traficinputDetail') {
inTrafficData.direction = 'input';
(new lenovoTrafficsAction()).openDetail(inTrafficData);
} else if ($(ele).attr('class') == 'traficoutputDetail') {
inTrafficData.direction = 'output';
(new lenovoTrafficsAction()).openDetail(inTrafficData);
}
}
}
}
}
}
}
for (var p = 0; p < origin_switch_link_list.length; p++) {
if (connectmessage[0]["switch_ip"] == origin_switch_link_list[p]["switch_ip"]) {
for (var q = 0; q < origin_switch_link_list[p]["link_details"].length; q++) {
if (origin_switch_link_list[p]["link_details"][q]["remchassisid"] == connectmessage[0]["racklist"]["serverlist"][i]["chassisid"] && origin_switch_link_list[p]["link_details"][q]["remportiddesc"] == connectmessage[0]["tuplelist"]["eth_name"]) {
if ($(e.target).attr('stroke-dasharray') == "8,6,2,6" && parseInt(origin_switch_link_list[p]["link_details"][q]["status"]) == 3 || $(e.target).attr('stroke-dasharray') !== "8,6,2,6" && parseInt(origin_switch_link_list[p]["link_details"][q]["status"]) == 1) {
//( hover = dotted_line && origin_switch_status = 3) or (hover=solid_line && origin_switch_status = 1 )
cell6.innerHTML = origin_switch_link_list[p]["link_details"][q]["locportiddesc"] + "     ";
break;
}
}
}
}
}
if (!cell6.innerHTML) {
bl.deleteRow(bl.rows.length - 1);
}
}
$("#contextmenu").show();
}
//鼠标双击交换机连接交换机的连线时的弹出框
function line_switch_to_switch_popup_click(event, conf){
var connectmessage = conf.details;
var e = event;/*document.all ? window.event : arguments[0] ? arguments[0] : event;*/
document.getElementById("contextmenu").style.display = "block";
document.getElementById("table").style.display = "none";
document.getElementById("foot").style.display = "none";
var div = document.getElementById("contextmenu");
var movey = event.offsetTop;
var movex = event.offsetLeft;
div.style.top = e.layerY + 8 + "px" ;
div.style.left = e.layerX + 8 - 100 + "px" ;
var bl = document.getElementById("tb");
var x = bl.createCaption();
for (var i = bl.rows.length - 1; i >= 0; i--) {
bl.deleteRow(i);
}
var row = bl.insertRow(bl.rows.length);
var row1 = bl.insertRow(bl.rows.length);
var row2 = bl.insertRow(bl.rows.length);
var row3 = bl.insertRow(bl.rows.length);
var row4 = bl.insertRow(bl.rows.length);
var cell1 = row.insertCell(row.cells.length);
var cell2 = row.insertCell(row.cells.length);
var cell3 = row1.insertCell(row1.cells.length);
var cell4 = row1.insertCell(row1.cells.length);
var cell5 = row2.insertCell(row2.cells.length);
var cell6 = row2.insertCell(row2.cells.length);
var cell7 = row3.insertCell(row3.cells.length);
var cell8 = row3.insertCell(row3.cells.length);
var cell9 = row4.insertCell(row4.cells.length);
var cell10 = row4.insertCell(row4.cells.length);
x.innerHTML = gettext("link details");
cell1.innerHTML = gettext("src_switch:");
cell2.innerHTML = connectmessage[0]["src_switch"];
cell3.innerHTML = gettext("src_port:");
cell4.innerHTML = connectmessage[0]["src_port"];
cell5.innerHTML = gettext("dst_switch:");
cell6.innerHTML = connectmessage[0]["dst_switch"];
cell7.innerHTML = gettext("dst_port:");
cell8.innerHTML = connectmessage[0]["dst_port"];
//cell9.innerHTML = gettext("traffic details:");
if (connectmessage[0]["link_details"]["color"] == "#5E5E5E") {
//cell10.innerHTML = gettext("no details");
;
} else {
/* var inputlink = "/horizon/admin/traffic/" + connectmessage[0]["link_details"]["id"] + "|input|" + connectmessage[0]["link_details"]["locportindex"] + "/detail/";
var outputlink = "/horizon/admin/traffic/" + connectmessage[0]["link_details"]["id"] + "|output|" + connectmessage[0]["link_details"]["locportindex"] + "/detail/";
cell10.innerHTML = ' <a style="text-decoration:underline" href=' + inputlink + '> ' + gettext("input") + '</a>' + "  " + ' <a style="text-decoration:underline" href=' + outputlink + '>' + gettext("output") + '</a>';*/
var inTrafficData = {
queryType: 'realtime',
ip: connectmessage[0]['link_details']["id"],
locportindex: connectmessage[0]["link_details"]["locportindex"]
};
//cell9.innerHTML = ' <a class="traficinputDetail" style="text-decoration:underline" href="javascript:void(0);">' + gettext("input") + '</a>' + "  " + ' <a style="text-decoration:underline" class="traficoutputDetail" href="javascript:void(0);">' + gettext("output") + '</a>' + "          ";
cell9.onclick = function (event) {
event = event || window.event;
var ele = event.target;
if ($(ele).attr('class') == 'traficinputDetail') {
inTrafficData.direction = 'input';
(new lenovoTrafficsAction()).openDetail(inTrafficData);
} else if ($(ele).attr('class') == 'traficoutputDetail') {
inTrafficData.direction = 'output';
(new lenovoTrafficsAction()).openDetail(inTrafficData);
}
}
}
$("#contextmenu").show();
}
function switch_popup_mouseover(node, details){
node.mouseover(function(event){
switch_popup_handler(event, details);
});
node.mouseout(function(event){
$("#contextmenu").hide();
});
node.mousedrag(function(event){
$("#contextmenu").hide();
});
}
function line_popup_switch_to_switch_click(node, conf){
node.dbclick(function(event){
line_switch_to_switch_popup_click(event, conf);
});
node.mouseout(function(event){
$("#contextmenu").hide();
});
}
function line_popup_switch_to_server_click(node, conf){
node.dbclick(function(event){
line_switch_to_server_popup_click(event, conf);
});
node.mouseout(function(event){
$("#contextmenu").hide();
});
}
function server_popup_mouseover(node, details, conf_switch_lists){
var hoet_id_fordetail = details['oid'];
node.click(function () {
(new createhostDetailAction()).open(hoet_id_fordetail,details['sysname'] );
});
node.mouseover(function(event){
server_popup_handler(event, details, conf_switch_lists);
});
node.mouseout(function(event){
$("#contextmenu").hide();
});
node.mousedrag(function(event){
$("#contextmenu").hide();
});
}
var LINKLINE_NAME_TO = "linkline_top";
var LINKLINE_NAME_FROM = "linkline_bottom";
function get_container_child_to(container){
for (var child in container.childs){
if (container.childs[child].text == LINKLINE_NAME_TO)
return container.childs[child];
}
return null;
}
function get_container_child_from(container){
for (var child in container.childs){
if (container.childs[child].text == LINKLINE_NAME_FROM)
return container.childs[child];
}
return null;
}
function draw_rack_lamplet(scene, container, conf){
var text_node = new JTopo.Node();
text_node.fillColor = conf.fillcolor;
text_node.setBound(conf.x, conf.y, conf.w, conf.h);
//text_node.borderRadius = 8;
text_node.dragable = 0;
text_node.alpha = 1;
text_node.visible = 1;
text_node.zIndex = 89;
text_node.showSelected = 0;
scene.add(text_node);
container.add(text_node);
}
function create_rack_outer_ring(scene, name, count, conf){
var container_obj = new JTopo.Container();
container_obj.layout = JTopo.layout.GridLayout(0, 1);
container_obj.alpha = 1;
container_obj.text = name;
container_obj.font = "13px bold Consolas";
container_obj.fontColor = "0,0,0";
container_obj.fillColor = "234,232,232";
container_obj.setBound(conf.x, conf.y, conf.w, conf.h);
container_obj.borderRadius = 8;
container_obj.borderWidth= 2;
container_obj.borderColor= "142,157,173";
container_obj.zIndex = 88;
container_obj.childDragble = 0;
container_obj.showSelected = 0;
container_obj.shadow= 0;
scene.add(container_obj);
return container_obj;
}
function create_rack_server(scene, container_rack, name, conf_switch_lists, server_details, conf){
//create the server
var container_server = new JTopo.Container();
container_server.layout = JTopo.layout.GridLayout(0, 4);
container_server.alpha = 0;
//container_server.text = name;
container_server.textPosition = "Middle_Left";
container_server.textOffsetY = 0;
container_server.font = "11px Consolas";
container_server.fontColor = "0,0,0";
container_server.fillColor = "188,211,229";
container_server.borderWidth= conf.borderwidth;
container_server.borderColor= conf.bordercolor;
//container_server.borderRadius = 5;
container_server.showSelected = false;
container_server.zIndex = 90;
//container_server.scaleX = -2;
container_server.shadow = 0;
//container_server.nodetype = "host";
container_server.setBound(conf.x, conf.y, conf.w, conf.h);
//add some mouse event
server_popup_mouseover(container_server, server_details, conf_switch_lists);
scene.add(container_server);
var container_server_dummy = new JTopo.Container();
container_server_dummy.layout = JTopo.layout.GridLayout(0, 4);
container_server_dummy.alpha = 1;
container_server_dummy.text = name;
container_server_dummy.textPosition = "Middle_Left";
container_server_dummy.textOffsetY = 0;
container_server_dummy.font = "11px Consolas";
container_server_dummy.fontColor = "0,0,0";
container_server_dummy.fillColor = "188,211,229";
container_server_dummy.borderWidth= conf.borderwidth;
container_server_dummy.borderColor= conf.bordercolor;
container_server_dummy.borderRadius = 5;
container_server_dummy.showSelected = false;
container_server_dummy.zIndex = 89;
//container_server.scaleX = -2;
container_server_dummy.shadow = 0;
container_server_dummy.nodetype = "host";
container_server_dummy.setBound(conf.x, conf.y, conf.w, conf.h);
scene.add(container_server_dummy);
container_rack.add(container_server_dummy);
container_rack.add(container_server);
//create connect line node
var text_node = new JTopo.Node(LINKLINE_NAME_TO);
text_node.textPosition = "Middle_Center";
text_node.textOffsetY = 0;
text_node.font = "11px bold Consolas";
text_node.fillColor = "143,188,143";
text_node.setBound(conf.x, conf.y, conf.w, 45);
text_node.borderRadius = 8;
text_node.borderWidth= 2;
text_node.dragable = 0;
text_node.alpha = 1;
text_node.visible = 0;
text_node.zIndex = 81;
scene.add(text_node);
container_rack.add(text_node);
return container_server;
}
function RndNum(n) {
var rnd = "";
for (var i = 0; i < n; i++) rnd += Math.floor(Math.random() * 10);
return rnd;
}
function server(cxt, container_rack, x, y, name, conf_switch_lists, server_details) {
var str = RndNum(8);
var names, container_server;
if (name.length > 7) {
names = name.substring(0, 5) + "...";
} else {
names = name;
}
if (server_details["status"] == 1) {
var conf={'x':x,
'y':y + 8,
'w':85,
'h':28,
'borderwidth':3,
'bordercolor': "170,193,214"
};
container_server = create_rack_server(scene, container_rack, names, conf_switch_lists, server_details, conf);
}
if (server_details["status"] == 3) {
var conf={'x':x,
'y':y + 8,
'w':85,
'h':28,
'borderwidth':1,
'bordercolor': "142,170,193"
};
container_server = create_rack_server(scene, container_rack, names, conf_switch_lists, server_details, conf);
}
var portlist = [];
var c = 0;
for (var i = 0; i < server_details["active_port_details"].length; i++) {
if (server_details["active_port_details"][i]["eth_name"].substring(0, 3) == "eth") {
var port = parseInt(server_details["active_port_details"][i]["eth_name"].substring(3, 4));
} else {
var port = c;
c++;
}
portlist.push(port);
for (var j = 0; j < switch_list.length; j++) {
if (server_details["active_port_details"][i]["remchassisid"] == switch_list[j]["chassisid"]) {
for (var p = 0; p < origin_switch_link_list.length; p++) {
if (switch_list[j]["ip"] == origin_switch_link_list[p]["switch_ip"]) {
for (var q = 0; q < origin_switch_link_list[p]["link_details"].length; q++) {
if (server_details["chassisid"] == origin_switch_link_list[p]["link_details"][q]["remchassisid"] && origin_switch_link_list[p]["link_details"][q]["remportiddesc"] == server_details["active_port_details"][i]["eth_name"]) {
if (port < 4) {
var conf = {'x':(x + 50 + (port * 6) + 1),
'y': (y + 5 + 4 + 4),
'w': 4,
'h': 4,
'fillcolor': hex_to_rgb(origin_switch_link_list[p]["link_details"][q]["color"])
};
//create the server's lamplet
draw_rack_lamplet(scene, container_server, conf);
} else {
var conf = {'x':(x + 50 + ((port - 4) * 6) + 1),
'y': (y + 10 + 9 + 4 + 4),
'w': 4,
'h': 4,
'fillcolor': hex_to_rgb(origin_switch_link_list[p]["link_details"][q]["color"])
};
//create the server's lamplet
draw_rack_lamplet(scene, container_server, conf);
}
}
}
}
}
}
}
}
for (var m = 0; m < 4; m++) {
var id = 0;
for (var t = 0; t < portlist.length; t++) {
if (m == portlist[t]) {
id = 1;
}
}
if (id == 0) {
var conf = {'x': (x + 50 + (m * 6) + 1),
'y': y + 5 + 4 + 4,
'w': 4,
'h': 4,
'fillcolor': "139,137,137"
};
//create the server's lamplet
draw_rack_lamplet(scene, container_server, conf);
var conf = {'x': x + 50,
'y': y + 10 + 3 + 4 + 4,
'w': 26,
'h': 2,
'fillcolor': "18,18,23"
};
//create the server's lamplet
draw_rack_lamplet(scene, container_server, conf);
}
}
for (var m = 0; m < 4; m++) {
var id = 0;
for (var t = 0; t < portlist.length; t++) {
if (m == portlist[t] - 4) {
id = 1;
}
}
if (id == 0) {
var conf = {'x': (x + 50 + (m * 6) + 1),
'y': (y + 10 + 9 + 4 + 4),
'w': 4,
'h': 4,
'fillcolor': "139,137,137"
};
//create the server's lamplet
draw_rack_lamplet(scene, container_server, conf);
var conf = {'x': (x + 50),
'y': (y + 10 + 3 + 4 + 4),
'w': 26,
'h': 2,
'fillcolor': "18,18,23"
};
//create the server's lamplet
draw_rack_lamplet(scene, container_server, conf);
}
}
}
function create_rack(scene, count, x, y, serverlist, tuplelist, conf_switch_lists){
var container_rack = null;
var rack_h = 60 * MAX_RACK_SERVER;
if (count % 10 == 0) {
var conf = {'x': x,
'y': y,
'w': (98 * (parseInt(count / 10))),
'h': rack_h
};
container_rack = create_rack_outer_ring(scene, gettext("logical rack") + rackcount, count, conf);
} else {
if (count < 10) {
var conf = {'x':x,
'y': y,
'w': (100 * (parseInt(count / 10) + 1)),
'h': rack_h
};
container_rack = create_rack_outer_ring(scene, gettext("logical rack") + rackcount, count, conf);
} else {
var conf = {'x':x,
'y': y,
'w': (98 * (parseInt(count / 10) + 1)),
'h': rack_h
};
container_rack = create_rack_outer_ring(scene, gettext("logical rack") + rackcount, count, conf);
}
}
if (count % 12 == 0) {
for (var k = 0; k < count; k++) {
server(scene, container_rack, x + 8, y + k * 40 + 2, serverlist[count]["sysname"].substring(0, 8), conf_switch_lists, serverlist[count]);
}
}
else {
for (var t = 0; t <= parseInt(count / 10) - 1; t++) {
server(scene, container_rack, x + 8 + 95 * t, y + i * 40 + 2, serverlist[10 * t + i]["sysname"].substring(0, 8), conf_switch_lists, serverlist[10 * t + i]);
}
for (var j = 0; j < count % 10; j++) {
server(scene, container_rack, x + 8 + 95 * parseInt(count / 10), y + j * 40 + 2, serverlist[10 * t + j]["sysname"].substring(0, 8), conf_switch_lists, serverlist[10 * t + j]);
}
}
rackcount = rackcount + 1;
return container_rack;
}
const SWITCH_WIDTH = 72, SWITCH_HEIGHT = 62;
function create_switch(scene, switch_details, x, y, w, h, floor1_number, floor2_number, floor1){
var container_fillcolor = "230,230,250";
var container_obj = new JTopo.Container();
container_obj.layout = JTopo.layout.GridLayout(0, 1);
container_obj.alpha = 0;
container_obj.text= switch_details["sysname"];
container_obj.font = "13px bold Consolas";
container_obj.fontColor = "0,0,0";
container_obj.fillColor = container_fillcolor;
container_obj.setBound(x, y, w, h);
container_obj.borderRadius = 20;
container_obj.shadow = 0;
container_obj.zIndex = 30;
switch_popup_mouseover(container_obj, switch_details);
scene.add(container_obj);
/*create the dummy container*/
var container_obj_1 = new JTopo.Container();
//container_obj_1.layout = JTopo.layout.GridLayout(2, 1);
container_obj_1.alpha = 1;
container_obj_1.text=switch_details["sysname"];
container_obj_1.font = "13px bold Consolas";
container_obj_1.fontColor = "0,0,0";
container_obj_1.fillColor = container_fillcolor;
container_obj_1.setBound(x, y, w, h);
container_obj_1.borderRadius = 20;
container_obj_1.shadow = 0;
container_obj_1.zIndex = 19;
scene.add(container_obj_1);
container_obj_1.add(container_obj);
/*create img_node*/
var img_node = new JTopo.Node();
var lenvel = 0;
for (var n = 0; n < floor1.length; n++) {
if (switch_details["sysname"] == floor1[n].switch_details["sysname"]) {
lenvel = 1;
break;
}
}
if (lenvel == 1) {
number = floor1_number;
var img_path = "dashboard/img/img_topology/switch1.png";
var sw_color = "0,88,176";
} else {
number = floor2_number;
var img_path = "dashboard/img/img_topology/switch2.png";
var sw_color = "30,124,200";
}
//img_node.setImage(window.STATIC_URL + img_path);
img_node.fillColor = sw_color;
img_node.borderRadius = 10;
//img_node.borderWidth = 2;
//img_node.borderColor = "255,255,255";
img_node.shadow = 1;
img_node.text = number;
img_node.textPosition = "Middle_Center";
img_node.textOffsetY = -19;
img_node.font = "30px Consolas";
img_node.scaleX = 1;
img_node.zIndex = 29;
img_node.setBound(x, y, SWITCH_WIDTH, SWITCH_HEIGHT);
scene.add(img_node);
container_obj.add(img_node);
var flag = 0;
var sysname = switch_details["sysdescr"].toLowerCase();
var arrName = ['lenovo', 'cisco', 'huawei', 'h3c', 'dcn', 'juniper'];
for (var a = 0; a < arrName.length; a++) {
if (sysname.indexOf(arrName[a]) > -1) {
arrName[a] = arrName[a][0].toUpperCase() + arrName[a].substring(1, arrName[a].length);
var brand = arrName[a];
flag = 1;
break;
}
}
/*create text_node*/
var text_node = new JTopo.Node(brand);
text_node.alpha = flag;
//text_node.setSize(68, 15);
text_node.textPosition = "Middle_Center";
text_node.textOffsetY = -9;
text_node.font = "12px bold Consolas";
text_node.fillColor = "35,24,21";
text_node.setBound(x+7, y+(SWITCH_HEIGHT * 0.75), SWITCH_WIDTH - 12, 15);
text_node.borderRadius = 8;
text_node.zIndex = 29;
text_node.showSelected = false;
scene.add(text_node);
container_obj.add(text_node);
/*create link_node*/
var link_node = new JTopo.Node(LINKLINE_NAME_TO);
//link_node.setSize(62, 15);
link_node.textPosition = "Middle_Center";
link_node.textOffsetY = -3;
link_node.font = "15px bold Consolas";
link_node.fillColor = "35,24,21";
link_node.zIndex = 14;
link_node.setBound(x, y+(SWITCH_HEIGHT * 0.1), SWITCH_WIDTH - 4, 15);
link_node.borderRadius = 8;
link_node.alpha = 0;
scene.add(link_node);
container_obj.add(link_node);
/*create link_node*/
var link_node = new JTopo.Node(LINKLINE_NAME_FROM);
//link_node.setSize(62, 15);
link_node.textPosition = "Middle_Center";
link_node.textOffsetY = -3;
link_node.font = "15px bold Consolas";
link_node.fillColor = "35,24,21";
link_node.zIndex = 12;
link_node.setBound(x, y+(SWITCH_HEIGHT * 0.7), SWITCH_WIDTH - 4, 10);
link_node.borderRadius = 8;
link_node.alpha = 0;
scene.add(link_node);
container_obj.add(link_node);
return container_obj;
}
function linkline_switch_to_server(scene, node_from, node_to, conf){
var origin_switch_link_list = conf.origin_switch_link_list;
var connectmessage = conf.details;
var colorred = 0;
var coloryellow = 0;