mirror of
https://github.com/ShaYmez/xlxd.git
synced 2024-12-23 01:55:49 -05:00
db 2.1.6
This commit is contained in:
parent
a190fcd8c6
commit
1c41f91e0f
@ -1,3 +1,15 @@
|
||||
xlx db v2.1.6
|
||||
|
||||
With this version of the dashboard, serveral parameters
|
||||
are free configurable.
|
||||
Changes are made in "config.inc.php"
|
||||
|
||||
- "config.inc.php"
|
||||
- "index.php"
|
||||
- "users.php"
|
||||
- "peers.php
|
||||
- "repeaters.php"
|
||||
|
||||
xlx db v2.1.5
|
||||
|
||||
- "class.node.php" added "get prefix
|
||||
|
@ -3,16 +3,15 @@
|
||||
$FILE = "/var/log/xlxd.xml";
|
||||
$PID = "/var/log/xlxd.pid";
|
||||
|
||||
require_once("./pgs/functions.php");
|
||||
if (file_exists("./pgs/functions.php")) { require_once("./pgs/functions.php"); } else { die("functions.php does not exist."); }
|
||||
if (file_exists("./pgs/config.inc.php")) { require_once("./pgs/config.inc.php"); } else { die("config.inc.php does not exist."); }
|
||||
|
||||
if (!class_exists('ParseXML')) require_once("./pgs/class.parsexml.php");
|
||||
if (!class_exists('Node')) require_once("./pgs/class.node.php");
|
||||
if (!class_exists('xReflector')) require_once("./pgs/class.reflector.php");
|
||||
if (!class_exists('Station')) require_once("./pgs/class.station.php");
|
||||
if (!class_exists('Peer')) require_once("./pgs/class.peer.php");
|
||||
|
||||
|
||||
//if (!isset($_GET['show'])) { $_GET['show'] == ''; }
|
||||
|
||||
if (!@file_exists($FILE) && (!@is_readable($FILE))) die("xlxd.xml does not exist or is not readable");
|
||||
|
||||
$handle = fopen($FILE, 'r');
|
||||
@ -62,25 +61,33 @@ for ($i=0;$i<count($tmpPeers);$i++) {
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||
<title>XLX Reflector Dashboard</title>
|
||||
<link rel="stylesheet" type="text/css" href="./css/layout.css">
|
||||
<link rel="icon" href="./favicon.ico" type="image/vnd.microsoft.icon">
|
||||
<link rel="icon" href="./favicon.ico" type="image/vnd.microsoft.icon"><?php
|
||||
|
||||
if ($PageOptions['PageRefreshActive']) {
|
||||
echo '
|
||||
<script>
|
||||
|
||||
function ReloadPage() {
|
||||
document.location.href = "./index.php<?php if (isset($_GET['show'])) { echo '?show='.$_GET['show']; } ?>";
|
||||
}
|
||||
<?php
|
||||
|
||||
if (!isset($_GET['show']) || (($_GET['show'] != 'liveircddb') && ($_GET['show'] != 'liveccs'))) {
|
||||
document.location.href = "./index.php';
|
||||
if (isset($_GET['show'])) {
|
||||
echo '?show='.$_GET['show'];
|
||||
}
|
||||
echo '";
|
||||
}';
|
||||
|
||||
if (!isset($_GET['show']) || (($_GET['show'] != 'liveircddb') && ($_GET['show'] != 'liveccs'))) {
|
||||
echo '
|
||||
setTimeout(ReloadPage, 10000);';
|
||||
}
|
||||
?>
|
||||
|
||||
</script>
|
||||
setTimeout(ReloadPage, '.$PageOptions['PageRefreshDelay'].');';
|
||||
}
|
||||
echo '
|
||||
|
||||
</script>';
|
||||
}
|
||||
?>
|
||||
</head>
|
||||
<body>
|
||||
<div id="top"><img src="./img/header.jpg" alt="XLX Multiprotocol Gateway Reflector" style="margin-top:15px;" />
|
||||
<br /> XLX<?php echo $ServiceName; ?> v<?php echo $XML->GetElement($FILECONTENT, "Version"); ?> - Dashboard v2.1.5 / Service uptime: <?php
|
||||
<br /> XLX<?php echo $ServiceName; ?> v<?php echo $XML->GetElement($FILECONTENT, "Version"); ?> - Dashboard v<?php echo $PageOptions['DashboardVersion']; ?> / Service uptime: <?php
|
||||
if (file_exists($PID) && is_readable($PID)) {
|
||||
echo FormatSeconds(time()-filectime($PID));
|
||||
}
|
||||
@ -109,7 +116,7 @@ for ($i=0;$i<count($tmpPeers);$i++) {
|
||||
|
||||
?>
|
||||
|
||||
<div style="width:100%;text-align:center;margin-top:50px;"><a href="mailto:dvc@rlx.lu" style="font-family:verdana;color:#000000;font-size:12pt;text-decoration:none;">dvc@rlx.lu</a></div>
|
||||
<div style="width:100%;text-align:center;margin-top:50px;"><a href="mailto:<?php echo $PageOptions['ContactEmail']; ?>" style="font-family:verdana;color:#000000;font-size:12pt;text-decoration:none;"><?php echo $PageOptions['ContactEmail']; ?></a></div>
|
||||
|
||||
</div>
|
||||
|
||||
|
44
dashboard/pgs/config.inc.php
Normal file
44
dashboard/pgs/config.inc.php
Normal file
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
/*
|
||||
Set IPModus in Repeaters or Peer variable to show,
|
||||
modify or hide the IP address.
|
||||
Possible values for IPModus
|
||||
|
||||
HideIP
|
||||
ShowFullIP
|
||||
ShowLast1ByteOfIP
|
||||
ShowLast2ByteOfIP
|
||||
ShowLast3ByteOfIP
|
||||
|
||||
*/
|
||||
|
||||
|
||||
$PageOptions = array();
|
||||
|
||||
$PageOptions['ContactEmail'] = 'dvc@rlx.lu'; // Support E-Mail address
|
||||
|
||||
$PageOptions['DashboardVersion'] = '2.1.6'; // Dashboard Version
|
||||
|
||||
$PageOptions['PageRefreshActive'] = true; // Activate automatic refresh
|
||||
$PageOptions['PageRefreshDelay'] = '10000'; // Wait time in miliseconds
|
||||
|
||||
|
||||
$PageOptions['RepeatersPage'] = array();
|
||||
$PageOptions['RepeatersPage']['LimitTo'] = 99; // Number of Repeaters to show
|
||||
$PageOptions['RepeatersPage']['IPModus'] = 'ShowFullIP'; // See possible options above
|
||||
$PageOptions['RepeatersPage']['MasqueradeCharacter'] = '*'; // Character used for masquerade
|
||||
|
||||
|
||||
$PageOptions['PeerPage'] = array();
|
||||
$PageOptions['PeerPage']['LimitTo'] = 99; // Number of peers to show
|
||||
$PageOptions['PeerPage']['IPModus'] = 'ShowFullIP'; // See possible options above
|
||||
$PageOptions['PeerPage']['MasqueradeCharacter'] = '*'; // Character used for masquerade
|
||||
|
||||
|
||||
$PageOptions['ModuleNames'] = array(); // Module nomination
|
||||
$PageOptions['ModuleNames']['A'] = 'International';
|
||||
$PageOptions['ModuleNames']['B'] = 'Regional';
|
||||
$PageOptions['ModuleNames']['C'] = 'National';
|
||||
$PageOptions['ModuleNames']['D'] = '';
|
||||
|
||||
?>
|
@ -5,8 +5,14 @@
|
||||
<th width="154">Last Heard</th>
|
||||
<th width="156">Linked for</th>
|
||||
<th width="90">Protocol</th>
|
||||
<th width="67">Module</th>
|
||||
<th width="130">IP</th>
|
||||
<th width="67">Module</th><?php
|
||||
|
||||
if ($PageOptions['PeerPage']['IPModus'] != 'HideIP') {
|
||||
echo '
|
||||
<th width="125">IP</th>';
|
||||
}
|
||||
|
||||
?>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
@ -24,10 +30,24 @@ for ($i=0;$i<$Reflector->PeerCount();$i++) {
|
||||
<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>
|
||||
<td align="center">'.$Reflector->Peers[$i]->GetLinkedModule().'</td>
|
||||
<td><a href="http://'.$Reflector->Peers[$i]->GetIP().'" target="_blank" style="text-decoration:none;color:#000000;">'.$Reflector->Peers[$i]->GetIP().'</a></td>
|
||||
</tr>';
|
||||
if ($i == 99) { $i = $Reflector->PeerCount()+1; }
|
||||
<td align="center">'.$Reflector->Peers[$i]->GetLinkedModule().'</td>';
|
||||
if ($PageOptions['PeerPage']['IPModus'] != 'HideIP') {
|
||||
echo '
|
||||
<td>';
|
||||
$Bytes = explode(".", $Reflector->Peers[$i]->GetIP());
|
||||
if ($Bytes !== false && count($Bytes) == 4) {
|
||||
switch ($PageOptions['PeerPage']['IPModus']) {
|
||||
case 'ShowLast1ByteOfIP' : echo $PageOptions['PeerPage']['MasqueradeCharacter'].'.'.$PageOptions['PeerPage']['MasqueradeCharacter'].'.'.$PageOptions['PeerPage']['MasqueradeCharacter'].'.'.$Bytes[3]; break;
|
||||
case 'ShowLast2ByteOfIP' : echo $PageOptions['PeerPage']['MasqueradeCharacter'].'.'.$PageOptions['PeerPage']['MasqueradeCharacter'].'.'.$Bytes[2].'.'.$Bytes[3]; break;
|
||||
case 'ShowLast3ByteOfIP' : echo $PageOptions['PeerPage']['MasqueradeCharacter'].'.'.$Bytes[1].'.'.$Bytes[2].'.'.$Bytes[3]; break;
|
||||
default : echo '<a href="http://'.$Reflector->Peers[$i]->GetIP().'" target="_blank" style="text-decoration:none;color:#000000;">'.$Reflector->Peers[$i]->GetIP().'</a>';
|
||||
}
|
||||
}
|
||||
echo '</td>';
|
||||
}
|
||||
echo '
|
||||
</tr>';
|
||||
if ($i == $PageOptions['PeerPage']['LimitTo']) { $i = $Reflector->PeerCount()+1; }
|
||||
}
|
||||
|
||||
?>
|
||||
|
@ -7,8 +7,14 @@
|
||||
<th width="150">Last Heard</th>
|
||||
<th width="150">Linked for</th>
|
||||
<th width="90">Protocol</th>
|
||||
<th width="65">Module</th>
|
||||
<th width="125">IP</th>
|
||||
<th width="65">Module</th><?php
|
||||
|
||||
if ($PageOptions['RepeatersPage']['IPModus'] != 'HideIP') {
|
||||
echo '
|
||||
<th width="125">IP</th>';
|
||||
}
|
||||
|
||||
?>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
@ -53,10 +59,24 @@ for ($i=0;$i<$Reflector->NodeCount();$i++) {
|
||||
<td>'.date("d.m.Y H:i", $Reflector->Nodes[$i]->GetLastHeardTime()).'</td>
|
||||
<td>'.FormatSeconds(time()-$Reflector->Nodes[$i]->GetConnectTime()).' s</td>
|
||||
<td>'.$Reflector->Nodes[$i]->GetProtocol().'</td>
|
||||
<td align="center">'.$Reflector->Nodes[$i]->GetLinkedModule().'</td>
|
||||
<td>'.$Reflector->Nodes[$i]->GetIP().'</td>
|
||||
<td align="center">'.$Reflector->Nodes[$i]->GetLinkedModule().'</td>';
|
||||
if ($PageOptions['RepeatersPage']['IPModus'] != 'HideIP') {
|
||||
echo '
|
||||
<td>';
|
||||
$Bytes = explode(".", $Reflector->Nodes[$i]->GetIP());
|
||||
if ($Bytes !== false && count($Bytes) == 4) {
|
||||
switch ($PageOptions['RepeatersPage']['IPModus']) {
|
||||
case 'ShowLast1ByteOfIP' : echo $PageOptions['RepeatersPage']['MasqueradeCharacter'].'.'.$PageOptions['RepeatersPage']['MasqueradeCharacter'].'.'.$PageOptions['RepeatersPage']['MasqueradeCharacter'].'.'.$Bytes[3]; break;
|
||||
case 'ShowLast2ByteOfIP' : echo $PageOptions['RepeatersPage']['MasqueradeCharacter'].'.'.$PageOptions['RepeatersPage']['MasqueradeCharacter'].'.'.$Bytes[2].'.'.$Bytes[3]; break;
|
||||
case 'ShowLast3ByteOfIP' : echo $PageOptions['RepeatersPage']['MasqueradeCharacter'].'.'.$Bytes[1].'.'.$Bytes[2].'.'.$Bytes[3]; break;
|
||||
default : echo $Reflector->Nodes[$i]->GetIP();
|
||||
}
|
||||
}
|
||||
echo '</td>';
|
||||
}
|
||||
echo '
|
||||
</tr>';
|
||||
if ($i == 99) { $i = $Reflector->NodeCount()+1; }
|
||||
if ($i == $PageOptions['RepeatersPage']['LimitTo']) { $i = $Reflector->NodeCount()+1; }
|
||||
}
|
||||
|
||||
?>
|
||||
|
28
dashboard/pgs/users.php
Executable file → Normal file
28
dashboard/pgs/users.php
Executable file → Normal file
@ -58,17 +58,30 @@ for ($i=0;$i<$Reflector->StationCount();$i++) {
|
||||
|
||||
<table class="listingtable">
|
||||
<?php
|
||||
echo '
|
||||
<tr>';
|
||||
|
||||
$Modules = $Reflector->GetModules();
|
||||
for ($i=0;$i<count($Modules);$i++) {
|
||||
|
||||
if (isset($PageOptions['ModuleNames'][$Modules[$i]])) {
|
||||
echo '
|
||||
<tr>
|
||||
<th>'.$PageOptions['ModuleNames'][$Modules[$i]];
|
||||
if (trim($PageOptions['ModuleNames'][$Modules[$i]]) != "") {
|
||||
echo '<br />';
|
||||
}
|
||||
echo $Modules[$i].'</th>
|
||||
</tr>';
|
||||
|
||||
}
|
||||
else {
|
||||
echo '
|
||||
<th>'.$Modules[$i].'</th>';
|
||||
<tr>
|
||||
<th>'.$Modules[$i].'</th>
|
||||
</tr>';
|
||||
}
|
||||
}
|
||||
|
||||
echo '
|
||||
</tr>
|
||||
<tr bgcolor="#FFFFFF" style="padding:0px;">';
|
||||
|
||||
for ($i=0;$i<count($Modules);$i++) {
|
||||
@ -77,7 +90,7 @@ for ($i=0;$i<count($Modules);$i++) {
|
||||
echo '
|
||||
<td valign="top" style="border:0px;padding:0px;">
|
||||
|
||||
<table width="100" border="0" style="padding:0px;margin:0px;">';
|
||||
<table width="100" border="0" style="padding:0px;margin:0px;">';
|
||||
$odd = "";
|
||||
|
||||
$UserCheckedArray = array();
|
||||
@ -91,13 +104,14 @@ for ($i=0;$i<count($Modules);$i++) {
|
||||
else {
|
||||
$Displayname = $Users[$j].'-'.$Reflector->GetSuffixOfRepeater($Users[$j], $Modules[$i]);
|
||||
}
|
||||
echo '<tr height="25" bgcolor="'.$odd.'" onMouseOver="this.bgColor=\'#FFFFCA\';" onMouseOut="this.bgColor=\''.$odd.'\';">
|
||||
echo '
|
||||
<tr height="25" bgcolor="'.$odd.'" onMouseOver="this.bgColor=\'#FFFFCA\';" onMouseOut="this.bgColor=\''.$odd.'\';">
|
||||
<td valign="top" style="border-bottom:1px #C1DAD7 solid;"><a href="http://www.aprs.fi/'.$Displayname.'" class="pl" target="_blank">'.$Displayname.'</a> </td>
|
||||
</tr>';
|
||||
$UserCheckedArray[] = $Users[$j];
|
||||
}
|
||||
echo '
|
||||
</table>
|
||||
</table>
|
||||
|
||||
</td>';
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user