-
Notifications
You must be signed in to change notification settings - Fork 0
/
peers.php
85 lines (85 loc) · 4.2 KB
/
peers.php
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
<?php require_once('inc/header.php');?>
<div class="container-fluid pt-4">
<div class="row">
<div class="col-md-6">
<div class="card text-white bg-dark mb-3 h-100">
<div class="card-header">BGP IPv6 Peers</div>
<div class="card-body">
<table class="table table-hover">
<thead>
<tr>
<th scope="col" style="width: 0.133333%;"> </th>
<th scope="col">Name</th>
<th scope="col">AS</th>
<th scope="col">Last state changed</th>
<th scope="col">Status</th>
<th scope="col">State</th>
</tr>
</thead>
<tbody>
<?php require_once("inc/get_peers.php");
if($resultv6){
foreach($protocolsv6 as $peer){
$dateraw = strtotime($peer['state_changed']);
if((time()-(60*60*24)) < $dateraw) {$date = $peer['state_changed'];}else{$date = date('Y-m-d',$dateraw);}
echo '<tr>';
if($peer['state'] == "up") {echo '<td class="table-success"></td>';}else{echo '<td class="table-danger"></td>';}
echo '<th scope="row">'.$peer['protocol'].'</th>';
echo '<td><a href="https://explorer.burble.com/#/aut-num/AS'.$peer['neighbor_as'].'">'.$peer['neighbor_as'].'</a></td>';
echo '<td>'.$date.'</td>';
echo '<td>'.$peer['state'].'</td>';
echo '<td>'.$peer['connection'].'</td></tr>';
}
} else {
echo "Birdwatcher currently not available";
}
?>
</tbody>
</table>
<?php if($resultv6){ echo 'Total IPv6 Peers: '.count($protocolsv6); } ?>
</div>
<div class="card-footer text-muted"><?php echo "Cached at ".$cached_at;?></div>
</div>
</div>
<div class="col-md-6">
<div class="card text-white bg-dark mb-3 h-100">
<div class="card-header">BGP IPv4 Peers</div>
<div class="card-body">
<table class="table table-hover">
<thead>
<tr>
<th scope="col" style="width: 0.133333%;"> </th>
<th scope="col">Name</th>
<th scope="col">AS</th>
<th scope="col">Last state changed</th>
<th scope="col">Status</th>
<th scope="col">State</th>
</tr>
</thead>
<tbody>
<?php require_once("inc/get_peers.php");
if($resultv4){
foreach($protocolsv4 as $peer){
$dateraw = strtotime($peer['state_changed']);
if((time()-(60*60*24)) < $dateraw) {$date = $peer['state_changed'];}else{$date = date('Y-m-d',$dateraw);}
echo '<tr>';
if($peer['state'] == "up") {echo '<td class="table-success"></td>';}else{echo '<td class="table-danger"></td>';}
echo '<th scope="row">'.$peer['protocol'].'</th>';
echo '<td><a href="https://explorer.burble.com/#/aut-num/AS'.$peer['neighbor_as'].'">'.$peer['neighbor_as'].'</a></td>';
echo '<td>'.$date.'</td>';
echo '<td>'.$peer['state'].'</td>';
echo '<td>'.$peer['connection'].'</td></tr>';
}
} else {
echo "Birdwatcher currently not available";}
?>
</tbody>
</table>
<?php if($resultv4){ echo 'Total IPv4 Peers: '.count($protocolsv4); } ?>
</div>
<div class="card-footer text-muted"><?php echo "Cached at ".$cached_at;?></div>
</div>
</div>
</div>
</div>
<?php require_once('inc/footer.php');?>