make mode updated by ajax
This commit is contained in:
parent
4982146762
commit
be58ad46fa
5 changed files with 10 additions and 5 deletions
4
ajax.php
4
ajax.php
|
@ -11,6 +11,10 @@ $logLinesMMDVM = getMMDVMLog();
|
|||
$reverseLogLinesMMDVM = $logLinesMMDVM;
|
||||
array_multisort($reverseLogLinesMMDVM,SORT_DESC);
|
||||
//$lastHeard = $_SESSION['lastHeard'];
|
||||
if ($_GET['section'] == "mode") {
|
||||
$mode = getActualMode(getLastHeard($reverseLogLinesMMDVM, TRUE), $mmdvmconfigs);
|
||||
echo $mode;
|
||||
}
|
||||
if ($_GET['section'] == "lastHeard") {
|
||||
$lastHeard = getLastHeard($reverseLogLinesMMDVM, FALSE);
|
||||
echo '{"data": '.json_encode($lastHeard)."}";
|
||||
|
|
|
@ -328,7 +328,7 @@ function getActualMode($metaLastHeard, $mmdvmconfigs) {
|
|||
if (startsWith($mode, "DMR")) {
|
||||
$mode = "DMR";
|
||||
}
|
||||
if ($listElem[6] ==="") {
|
||||
if ($listElem[7] ==="") {
|
||||
return $mode;
|
||||
} else {
|
||||
$now = new DateTime();
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
</tr>
|
||||
<?php
|
||||
echo"<tr>";
|
||||
echo"<td>".getActualMode($lastHeard, $mmdvmconfigs)."</td>";
|
||||
echo"<td id=\"mode\">".getActualMode($lastHeard, $mmdvmconfigs)."</td>";
|
||||
echo"<td>".getActualLink($reverseLogLinesMMDVM, "D-Star")."</td>";
|
||||
echo"<td>".getYSFReflectorById(getActualLink($reverseLogLinesYSFGateway, "YSF"), $activeYSFReflectors)."</td>";
|
||||
echo"<td>".getActualLink($reverseLogLinesMMDVM, "DMR Slot 1")."</td>";
|
||||
|
|
|
@ -44,8 +44,8 @@ function doXMLHTTPRequest(scriptname, elem) {
|
|||
xmlhttp.send();
|
||||
}
|
||||
|
||||
function refreshInQSOAndLastHeardList() {
|
||||
doXMLHTTPRequest("txinfo.php","txline");
|
||||
function refreshMode() {
|
||||
doXMLHTTPRequest("ajax.php?section=mode","mode");
|
||||
}
|
||||
|
||||
var transmitting = false;
|
||||
|
@ -65,6 +65,7 @@ function loadXMLDoc() {
|
|||
xmlhttp.send();
|
||||
|
||||
var timeout = window.setTimeout("loadXMLDoc()", 1000);
|
||||
refreshMode();
|
||||
}
|
||||
loadXMLDoc();
|
||||
</script>
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
<?php
|
||||
define("VERSION", "20161009-2");
|
||||
define("VERSION", "20161009-3");
|
||||
?>
|
||||
|
|
Loading…
Reference in a new issue