1
0
mirror of https://github.com/ShaYmez/xlxd.git synced 2024-12-23 10:05:48 -05:00

Handle the case when a reflector dashboard URL is not found

This commit is contained in:
phl0 2016-07-29 17:49:58 +02:00
parent 0ed02a083c
commit a73b8734cb
No known key found for this signature in database
GPG Key ID: 48EA1E640798CA9A

View File

@ -44,14 +44,21 @@ for ($i=0;$i<$Reflector->PeerCount();$i++) {
<tr height="30" bgcolor="'.$odd.'" onMouseOver="this.bgColor=\'#FFFFCA\';" onMouseOut="this.bgColor=\''.$odd.'\';"> <tr height="30" bgcolor="'.$odd.'" onMouseOver="this.bgColor=\'#FFFFCA\';" onMouseOut="this.bgColor=\''.$odd.'\';">
<td align="center">'.($i+1).'</td>'; <td align="center">'.($i+1).'</td>';
$Name = $Reflector->Peers[$i]->GetCallSign(); $Name = $Reflector->Peers[$i]->GetCallSign();
$URL = '';
for ($j=1;$j<count($Reflectors);$j++) { for ($j=1;$j<count($Reflectors);$j++) {
if ($Name === $XML->GetElement($Reflectors[$j], "name")) { if ($Name === $XML->GetElement($Reflectors[$j], "name")) {
$URL = $XML->GetElement($Reflectors[$j], "dashboardurl"); $URL = $XML->GetElement($Reflectors[$j], "dashboardurl");
break; break;
} }
} }
if ($URL) {
echo '
<td><a href="'.$URL.'" target="_blank" class="listinglink" title="Visit the Dashboard of&nbsp;'.$Name.'">'.$Name.'</a></td>'
} else {
echo '
<td>'.$Name.'</td>'
}
echo ' 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>'.date("d.m.Y H:i", $Reflector->Peers[$i]->GetLastHeardTime()).'</td>
<td>'.FormatSeconds(time()-$Reflector->Peers[$i]->GetConnectTime()).' s</td> <td>'.FormatSeconds(time()-$Reflector->Peers[$i]->GetConnectTime()).' s</td>
<td align="center">'.$Reflector->Peers[$i]->GetProtocol().'</td> <td align="center">'.$Reflector->Peers[$i]->GetProtocol().'</td>