From 1c41f91e0fa5cdabe007b3c08937894b44b9d871 Mon Sep 17 00:00:00 2001 From: LX3JL Date: Fri, 4 Mar 2016 10:57:08 +0100 Subject: [PATCH] db 2.1.6 --- dashboard/changes.txt | 12 ++++++++++ dashboard/index.php | 41 +++++++++++++++++++-------------- dashboard/pgs/config.inc.php | 44 ++++++++++++++++++++++++++++++++++++ dashboard/pgs/peers.php | 32 +++++++++++++++++++++----- dashboard/pgs/repeaters.php | 30 ++++++++++++++++++++---- dashboard/pgs/users.php | 28 +++++++++++++++++------ 6 files changed, 152 insertions(+), 35 deletions(-) create mode 100644 dashboard/pgs/config.inc.php mode change 100755 => 100644 dashboard/pgs/users.php diff --git a/dashboard/changes.txt b/dashboard/changes.txt index 15eaa66..090e724 100644 --- a/dashboard/changes.txt +++ b/dashboard/changes.txt @@ -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 diff --git a/dashboard/index.php b/dashboard/index.php index 2b53adb..8151c52 100644 --- a/dashboard/index.php +++ b/dashboard/index.php @@ -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 XLX Reflector Dashboard - + function ReloadPage() { - document.location.href = "./index.php"; - } - - - + setTimeout(ReloadPage, '.$PageOptions['PageRefreshDelay'].');'; + } + echo ' + + '; + } +?>
XLX Multiprotocol Gateway Reflector -
 XLX vGetElement($FILECONTENT, "Version"); ?> - Dashboard v2.1.5  /  Service uptime:  XLX vGetElement($FILECONTENT, "Version"); ?> - Dashboard v  /  Service uptime: -
dvc@rlx.lu
+
diff --git a/dashboard/pgs/config.inc.php b/dashboard/pgs/config.inc.php new file mode 100644 index 0000000..027d668 --- /dev/null +++ b/dashboard/pgs/config.inc.php @@ -0,0 +1,44 @@ + diff --git a/dashboard/pgs/peers.php b/dashboard/pgs/peers.php index 20fd00b..3b8ea77 100644 --- a/dashboard/pgs/peers.php +++ b/dashboard/pgs/peers.php @@ -5,8 +5,14 @@ Last Heard Linked for Protocol - Module - IP + ModuleIP'; +} + +?> PeerCount();$i++) { '.date("d.m.Y H:i", $Reflector->Peers[$i]->GetLastHeardTime()).' '.FormatSeconds(time()-$Reflector->Peers[$i]->GetConnectTime()).' s '.$Reflector->Peers[$i]->GetProtocol().' - '.$Reflector->Peers[$i]->GetLinkedModule().' - '.$Reflector->Peers[$i]->GetIP().' - '; - if ($i == 99) { $i = $Reflector->PeerCount()+1; } + '.$Reflector->Peers[$i]->GetLinkedModule().''; + if ($PageOptions['PeerPage']['IPModus'] != 'HideIP') { + echo ' + '; + $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 ''.$Reflector->Peers[$i]->GetIP().''; + } + } + echo ''; + } + echo ' + '; + if ($i == $PageOptions['PeerPage']['LimitTo']) { $i = $Reflector->PeerCount()+1; } } ?> diff --git a/dashboard/pgs/repeaters.php b/dashboard/pgs/repeaters.php index f868be0..905c1b6 100644 --- a/dashboard/pgs/repeaters.php +++ b/dashboard/pgs/repeaters.php @@ -7,8 +7,14 @@ Last Heard Linked for Protocol - Module - IP + ModuleIP'; +} + +?> NodeCount();$i++) { '.date("d.m.Y H:i", $Reflector->Nodes[$i]->GetLastHeardTime()).' '.FormatSeconds(time()-$Reflector->Nodes[$i]->GetConnectTime()).' s '.$Reflector->Nodes[$i]->GetProtocol().' - '.$Reflector->Nodes[$i]->GetLinkedModule().' - '.$Reflector->Nodes[$i]->GetIP().' + '.$Reflector->Nodes[$i]->GetLinkedModule().''; + if ($PageOptions['RepeatersPage']['IPModus'] != 'HideIP') { + echo ' + '; + $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 ''; + } + echo ' '; - if ($i == 99) { $i = $Reflector->NodeCount()+1; } + if ($i == $PageOptions['RepeatersPage']['LimitTo']) { $i = $Reflector->NodeCount()+1; } } ?> diff --git a/dashboard/pgs/users.php b/dashboard/pgs/users.php old mode 100755 new mode 100644 index bdd820b..b914390 --- a/dashboard/pgs/users.php +++ b/dashboard/pgs/users.php @@ -58,17 +58,30 @@ for ($i=0;$i<$Reflector->StationCount();$i++) { '; $Modules = $Reflector->GetModules(); for ($i=0;$i + + '; + + } + else { echo ' - '; + + + '; + } } echo ' -'; for ($i=0;$i -
'.$PageOptions['ModuleNames'][$Modules[$i]]; + if (trim($PageOptions['ModuleNames'][$Modules[$i]]) != "") { + echo '
'; + } + echo $Modules[$i].'
'.$Modules[$i].'
'.$Modules[$i].'
'; +
'; $odd = ""; $UserCheckedArray = array(); @@ -91,13 +104,14 @@ for ($i=0;$iGetSuffixOfRepeater($Users[$j], $Modules[$i]); } - echo ' + echo ' + '; $UserCheckedArray[] = $Users[$j]; } echo ' -
'.$Displayname.'
+ '; }