|
10 | 10 | <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> |
11 | 11 | </div> |
12 | 12 | <div class="modal-body"> |
13 | | - <?php foreach( $t->content->routes as $r ): ?> |
14 | | - <table class="table table-striped text-monospace" style="font-size: 14px;"> |
15 | | - <tbody> |
16 | | - <tr> |
17 | | - <td> |
18 | | - <b>Network</b> |
19 | | - </td> |
20 | | - <td> |
21 | | - <?= $r->network ?> |
22 | | - </td> |
23 | | - </tr> |
24 | | - <tr> |
25 | | - <td> |
26 | | - <b>Gateway</b> |
27 | | - </td> |
28 | | - <td> |
29 | | - <?= $r->gateway ?> |
30 | | - |
31 | | - <?php if( $r->primary ): ?> |
32 | | - <span class="badge badge-success"> |
33 | | - PRIMARY |
34 | | - </span> |
35 | | - <?php else: ?> |
36 | | - <span class="badge badge-warning"> |
37 | | - NOT PRIMARY |
38 | | - </span> |
39 | | - <?php endif; ?> |
40 | | - </td> |
41 | | - </tr> |
42 | | - <tr> |
43 | | - <td> |
44 | | - <b>From Protocol</b> |
45 | | - </td> |
46 | | - <td> |
47 | | - <?= $r->from_protocol ?> |
48 | | - </td> |
49 | | - </tr> |
50 | | - <tr> |
51 | | - <td> |
52 | | - <b>Age</b> |
53 | | - </td> |
54 | | - <td> |
55 | | - <?= isset( $r->age ) && $r->age ? date( "Y-m-d H:i:s", strtotime( $r->age ) ) : '' ?> |
56 | | - </td> |
57 | | - </tr> |
58 | | - <tr> |
59 | | - <td> |
60 | | - <b>Metric</b> |
61 | | - </td> |
62 | | - <td> |
63 | | - <?= $r->metric ?> |
64 | | - </td> |
65 | | - </tr> |
66 | | - <tr> |
67 | | - <td> |
68 | | - <b>Type</b> |
69 | | - </td> |
70 | | - <td> |
71 | | - <?= implode( ' ', $r->type ) ?> |
72 | | - </td> |
73 | | - </tr> |
74 | | - <?php if (isset( $r->bgp->as_path )): ?> |
| 13 | + <?php if( isset( $t->content->routes ) ): ?> |
| 14 | + <?php foreach( $t->content->routes as $r ): ?> |
| 15 | + <table class="table table-striped text-monospace" style="font-size: 14px;"> |
| 16 | + <tbody> |
75 | 17 | <tr> |
76 | 18 | <td> |
77 | | - <b>BGP :: AS Path</b> |
| 19 | + <b>Network</b> |
78 | 20 | </td> |
79 | 21 | <td> |
80 | | - <?= implode( ' ', $r->bgp->as_path ) ?> |
| 22 | + <?= $r->network ?> |
81 | 23 | </td> |
82 | 24 | </tr> |
83 | | - <?php endif; ?> |
84 | | - <?php if (isset( $r->bgp->next_hop )): ?> |
85 | 25 | <tr> |
86 | 26 | <td> |
87 | | - <b>BGP :: Next Hop</b> |
| 27 | + <b>Gateway</b> |
88 | 28 | </td> |
89 | 29 | <td> |
90 | | - <?= $r->bgp->next_hop ?> |
| 30 | + <?= $r->gateway ?> |
| 31 | + |
| 32 | + <?php if( $r->primary ): ?> |
| 33 | + <span class="badge badge-success"> |
| 34 | + PRIMARY |
| 35 | + </span> |
| 36 | + <?php else: ?> |
| 37 | + <span class="badge badge-warning"> |
| 38 | + NOT PRIMARY |
| 39 | + </span> |
| 40 | + <?php endif; ?> |
91 | 41 | </td> |
92 | 42 | </tr> |
93 | | - <?php endif; ?> |
94 | | - <?php if (isset( $r->bgp->med )): ?> |
95 | 43 | <tr> |
96 | 44 | <td> |
97 | | - <b>BGP :: MED</b> |
| 45 | + <b>From Protocol</b> |
98 | 46 | </td> |
99 | 47 | <td> |
100 | | - <?= $r->bgp->med ?> |
| 48 | + <?= $r->from_protocol ?> |
101 | 49 | </td> |
102 | 50 | </tr> |
103 | | - <?php endif; ?> |
104 | | - <?php if (isset( $r->bgp->local_pref )): ?> |
105 | 51 | <tr> |
106 | 52 | <td> |
107 | | - <b>BGP :: Local Pref</b> |
| 53 | + <b>Age</b> |
108 | 54 | </td> |
109 | 55 | <td> |
110 | | - <?= $r->bgp->local_pref ?> |
| 56 | + <?= isset( $r->age ) && $r->age ? date( "Y-m-d H:i:s", strtotime( $r->age ) ) : '' ?> |
111 | 57 | </td> |
112 | 58 | </tr> |
113 | | - <?php endif; ?> |
114 | | - <?php if (isset( $r->bgp->atomic_aggr )): ?> |
115 | 59 | <tr> |
116 | 60 | <td> |
117 | | - <b>BGP :: Atomic Aggr</b> |
| 61 | + <b>Metric</b> |
118 | 62 | </td> |
119 | 63 | <td> |
120 | | - <?= $r->bgp->atomic_aggr ?> |
| 64 | + <?= $r->metric ?> |
121 | 65 | </td> |
122 | 66 | </tr> |
123 | | - <?php endif; ?> |
124 | | - <?php if (isset( $r->bgp->aggregator )): ?> |
125 | 67 | <tr> |
126 | 68 | <td> |
127 | | - <b>BGP :: Aggregator</b> |
| 69 | + <b>Type</b> |
128 | 70 | </td> |
129 | 71 | <td> |
130 | | - <?= $r->bgp->aggregator ?> |
| 72 | + <?= implode( ' ', $r->type ) ?> |
131 | 73 | </td> |
132 | 74 | </tr> |
133 | | - <?php endif; ?> |
134 | | - <?php if (isset( $r->bgp->communities )): ?> |
135 | | - <tr> |
136 | | - <td> |
137 | | - <b>BGP :: Communities</b> |
138 | | - </td> |
139 | | - <td> |
140 | | - <?php foreach( $r->bgp->communities as $c ): ?> |
141 | | - <tt><?= implode(':',$c) ?></tt> |
142 | | - |
143 | | - <?php if( $cinfo = $t->bird()->translateBgpCommunity( implode(':',$c) ) ): ?> |
144 | | - <span class="badge badge-<?= $cinfo[1] ?>"><?= $cinfo[0] ?></span> |
145 | | - <?php endif; ?> |
146 | | - <br> |
147 | | - <?php endforeach; ?> |
148 | | - </td> |
149 | | - </tr> |
150 | | - <?php endif; ?> |
151 | | - <?php if (isset( $r->bgp->large_communities )): ?> |
152 | | - <tr> |
153 | | - <td> |
154 | | - <b>BGP :: Large Communities</b> |
155 | | - </td> |
156 | | - <td> |
157 | | - <?php foreach( $r->bgp->large_communities as $c ): ?> |
158 | | - <tt><?= implode(':',$c) ?></tt> |
159 | | - |
160 | | - <?php if( $t->lg->router()->asn === $c[0] ): ?> |
161 | | - <?php if( $lcinfo = $t->bird()->translateBgpFilteringLargeCommunity( ':' . $c[1] . ':' . $c[2] ) ): ?> |
162 | | - <span class="badge badge-<?= $lcinfo[1] ?>"><?= $lcinfo[0] ?></span> |
| 75 | + <?php if (isset( $r->bgp->as_path )): ?> |
| 76 | + <tr> |
| 77 | + <td> |
| 78 | + <b>BGP :: AS Path</b> |
| 79 | + </td> |
| 80 | + <td> |
| 81 | + <?= implode( ' ', $r->bgp->as_path ) ?> |
| 82 | + </td> |
| 83 | + </tr> |
| 84 | + <?php endif; ?> |
| 85 | + <?php if (isset( $r->bgp->next_hop )): ?> |
| 86 | + <tr> |
| 87 | + <td> |
| 88 | + <b>BGP :: Next Hop</b> |
| 89 | + </td> |
| 90 | + <td> |
| 91 | + <?= $r->bgp->next_hop ?> |
| 92 | + </td> |
| 93 | + </tr> |
| 94 | + <?php endif; ?> |
| 95 | + <?php if (isset( $r->bgp->med )): ?> |
| 96 | + <tr> |
| 97 | + <td> |
| 98 | + <b>BGP :: MED</b> |
| 99 | + </td> |
| 100 | + <td> |
| 101 | + <?= $r->bgp->med ?> |
| 102 | + </td> |
| 103 | + </tr> |
| 104 | + <?php endif; ?> |
| 105 | + <?php if (isset( $r->bgp->local_pref )): ?> |
| 106 | + <tr> |
| 107 | + <td> |
| 108 | + <b>BGP :: Local Pref</b> |
| 109 | + </td> |
| 110 | + <td> |
| 111 | + <?= $r->bgp->local_pref ?> |
| 112 | + </td> |
| 113 | + </tr> |
| 114 | + <?php endif; ?> |
| 115 | + <?php if (isset( $r->bgp->atomic_aggr )): ?> |
| 116 | + <tr> |
| 117 | + <td> |
| 118 | + <b>BGP :: Atomic Aggr</b> |
| 119 | + </td> |
| 120 | + <td> |
| 121 | + <?= $r->bgp->atomic_aggr ?> |
| 122 | + </td> |
| 123 | + </tr> |
| 124 | + <?php endif; ?> |
| 125 | + <?php if (isset( $r->bgp->aggregator )): ?> |
| 126 | + <tr> |
| 127 | + <td> |
| 128 | + <b>BGP :: Aggregator</b> |
| 129 | + </td> |
| 130 | + <td> |
| 131 | + <?= $r->bgp->aggregator ?> |
| 132 | + </td> |
| 133 | + </tr> |
| 134 | + <?php endif; ?> |
| 135 | + <?php if (isset( $r->bgp->communities )): ?> |
| 136 | + <tr> |
| 137 | + <td> |
| 138 | + <b>BGP :: Communities</b> |
| 139 | + </td> |
| 140 | + <td> |
| 141 | + <?php foreach( $r->bgp->communities as $c ): ?> |
| 142 | + <tt><?= implode(':',$c) ?></tt> |
| 143 | + |
| 144 | + <?php if( $cinfo = $t->bird()->translateBgpCommunity( implode(':',$c) ) ): ?> |
| 145 | + <span class="badge badge-<?= $cinfo[1] ?>"><?= $cinfo[0] ?></span> |
163 | 146 | <?php endif; ?> |
164 | | - <?php endif; ?> |
165 | | - |
166 | | - <br> |
167 | | - <?php endforeach; ?> |
168 | | - </td> |
169 | | - </tr> |
170 | | - <?php endif; ?> |
171 | | - </tbody> |
172 | | - </table> |
173 | | - <br><br> |
174 | | -<?php endforeach; ?> |
| 147 | + <br> |
| 148 | + <?php endforeach; ?> |
| 149 | + </td> |
| 150 | + </tr> |
| 151 | + <?php endif; ?> |
| 152 | + <?php if (isset( $r->bgp->large_communities )): ?> |
| 153 | + <tr> |
| 154 | + <td> |
| 155 | + <b>BGP :: Large Communities</b> |
| 156 | + </td> |
| 157 | + <td> |
| 158 | + <?php foreach( $r->bgp->large_communities as $c ): ?> |
| 159 | + <tt><?= implode(':',$c) ?></tt> |
| 160 | + |
| 161 | + <?php if( $t->lg->router()->asn === $c[0] ): ?> |
| 162 | + <?php if( $lcinfo = $t->bird()->translateBgpFilteringLargeCommunity( ':' . $c[1] . ':' . $c[2] ) ): ?> |
| 163 | + <span class="badge badge-<?= $lcinfo[1] ?>"><?= $lcinfo[0] ?></span> |
| 164 | + <?php endif; ?> |
| 165 | + <?php endif; ?> |
| 166 | + |
| 167 | + <br> |
| 168 | + <?php endforeach; ?> |
| 169 | + </td> |
| 170 | + </tr> |
| 171 | + <?php endif; ?> |
| 172 | + </tbody> |
| 173 | + </table> |
| 174 | + <br><br> |
| 175 | + <?php endforeach; ?> |
| 176 | + <?php endif; ?> |
175 | 177 | </div> |
176 | 178 | <div class="modal-footer"> |
177 | 179 | <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button> |
|
0 commit comments