first try of repeater info

This commit is contained in:
dg9vh 2016-05-02 17:36:19 +02:00
parent 322e599ade
commit 1d4b030f0b
3 changed files with 37 additions and 13 deletions

View file

@ -80,24 +80,50 @@ function getActualMode($logLines) {
function getActualLink($logLines, $mode) { function getActualLink($logLines, $mode) {
//M: 2016-05-02 07:04:10.504 D-Star link status set to "Verlinkt zu DCS002 S" //M: 2016-05-02 07:04:10.504 D-Star link status set to "Verlinkt zu DCS002 S"
//M: 2016-04-03 16:16:18.638 DMR Slot 2, received network voice header from 4000 to 2625094
//M: 2016-04-03 19:30:03.099 DMR Slot 2, received network voice header from 4020 to 2625094
array_multisort($logLines,SORT_DESC); array_multisort($logLines,SORT_DESC);
switch ($mode) { switch ($mode) {
case "D-Star": case "D-Star":
foreach ($logLines as $logLine) { foreach ($logLines as $logLine) {
if (strpos($logLine, "D-Star link status set to")) { if (strpos($logLine, "D-Star link status set to")) {
return substr($logLine, 54, strlen($logLine) - 56); return substr($logLine, 54, strlen($logLine) - 56);
} }
} }
return "not linked";
break; break;
case "DMR Slot 1": case "DMR Slot 1":
return "still to be implemented"; foreach ($logLines as $logLine) {
if(substr($logLine, 27, strpos($logLine,",") - 27) == "DMR Slot 1") {
$from = substr($logLine, strpos($logLine,"from") + 5, strpos($logLine,"to") - strpos($logLine,"from") - 6);
if (strlen($from) == 4 && startsWith($from,"4")) {
if ($from == "4000") {
return "not linked";
} else {
return $from;
}
}
}
}
return "not linked";
break; break;
case "DMR Slot 2": case "DMR Slot 2":
return "still to be implemented"; foreach ($logLines as $logLine) {
if(substr($logLine, 27, strpos($logLine,",") - 27) == "DMR Slot 2") {
$from = substr($logLine, strpos($logLine,"from") + 5, strpos($logLine,"to") - strpos($logLine,"from") - 6);
if (strlen($from) == 4 && startsWith($from,"4")) {
if ($from == "4000") {
return "not linked";
} else {
return $from;
}
}
}
}
return "not linked";
break; break;
} }
return "something went wrong!";
return "still to be implemented";
} }
//Some basic inits //Some basic inits

View file

@ -1,17 +1,17 @@
<div class="panel panel-default"> <div class="panel panel-default">
<!-- Standard-Panel-Inhalt --> <!-- Standard-Panel-Inhalt -->
<div class="panel-heading">Repeater Info</div> <div class="panel-heading">Repeater Info</div>
<!--<div class="panel-body"> <div class="panel-body">
<p>Put here some text</p> <p>Some Infos about link-states</p>
</div>--> </div>
<!-- Tabelle --> <!-- Tabelle -->
<table class="table"> <table class="table">
<tr> <tr>
<th>Actual Mode</th> <th>Actual Mode</th>
<th>D-Star linked to</th> <th>D-Star linked to</th>
<th>DMR TS1</th> <th>DMR TS1 linked to</th>
<th>DMR TS2</th> <th>DMR TS2 linked to</th>
</tr> </tr>
<?php <?php
echo"<tr>"; echo"<tr>";

View file

@ -12,10 +12,8 @@ include "include/functions.php";
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<!-- Das neueste kompilierte und minimierte CSS --> <!-- Das neueste kompilierte und minimierte CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<!-- Optionales Theme --> <!-- Optionales Theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">
<!-- Das neueste kompilierte und minimierte JavaScript --> <!-- Das neueste kompilierte und minimierte JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<title>MMDVM-Dashboard by DG9VH</title> <title>MMDVM-Dashboard by DG9VH</title>