Add dashboard URL to Peers page

This commit is contained in:
phl0 2016-07-29 14:41:28 +02:00
parent 8300a3f044
commit abc0f9e9bf
No known key found for this signature in database
GPG Key ID: 48EA1E640798CA9A
1 changed files with 27 additions and 2 deletions

View File

@ -1,3 +1,20 @@
<?php
$Result = @fopen($CallingHome['ServerURL']."?do=GetReflectorList", "r");
if (!$Result) die("HEUTE GIBTS KEIN BROT");
$INPUT = "";
while (!feof ($Result)) {
$INPUT .= fgets ($Result, 1024);
}
fclose($Result);
$XML = new ParseXML();
$Reflectorlist = $XML->GetElement($INPUT, "reflectorlist");
$Reflectors = $XML->GetAllElements($Reflectorlist, "reflector");
?>
<table class="listingtable">
<tr>
<th width="25">#</th>
@ -25,8 +42,16 @@ for ($i=0;$i<$Reflector->PeerCount();$i++) {
echo '
<tr height="30" bgcolor="'.$odd.'" onMouseOver="this.bgColor=\'#FFFFCA\';" onMouseOut="this.bgColor=\''.$odd.'\';">
<td align="center">'.($i+1).'</td>
<td>'.$Reflector->Peers[$i]->GetCallSign().'</td>
<td align="center">'.($i+1).'</td>';
$Name = $Reflector->Peers[$i]->GetCallSign();
for ($j=1;$j<count($Reflectors);$j++) {
if ($Name === $XML->GetElement($Reflectors[$j], "name")) {
$URL = $XML->GetElement($Reflectors[$j], "dashboardurl");
break;
}
}
echo '
<td><a href="'.$URL.'" target="_blank" class="listinglink" title="Visit the Dashboard of&nbsp;'.$Name.'">'.$Name.'</a></td>
<td>'.date("d.m.Y H:i", $Reflector->Peers[$i]->GetLastHeardTime()).'</td>
<td>'.FormatSeconds(time()-$Reflector->Peers[$i]->GetConnectTime()).' s</td>
<td align="center">'.$Reflector->Peers[$i]->GetProtocol().'</td>