refreshing link states via ajax now
This commit is contained in:
parent
6fbd3f993f
commit
e9a7e191e1
4 changed files with 69 additions and 5 deletions
28
ajax.php
28
ajax.php
|
@ -30,6 +30,34 @@ if ($_GET['section'] == "mode") {
|
|||
$mode = getActualMode(getLastHeard($reverseLogLinesMMDVM, TRUE), $mmdvmconfigs);
|
||||
echo $mode;
|
||||
}
|
||||
|
||||
if ($_GET['section'] == "dstarlink") {
|
||||
$link = getActualLink($reverseLogLinesMMDVM, "D-Star");
|
||||
echo $link;
|
||||
}
|
||||
|
||||
|
||||
if ($_GET['section'] == "ysflink") {
|
||||
$logLinesYSFGateway = getYSFGatewayLog();
|
||||
$reverseLogLinesYSFGateway = $logLinesYSFGateway;
|
||||
rsort($reverseLogLinesYSFGateway);
|
||||
$activeYSFReflectors = getActiveYSFReflectors();
|
||||
$link = getYSFReflectorById(getActualLink($reverseLogLinesYSFGateway, "YSF"), $activeYSFReflectors);
|
||||
echo $link;
|
||||
}
|
||||
|
||||
|
||||
if ($_GET['section'] == "dmr1link") {
|
||||
$link = getActualLink($reverseLogLinesMMDVM, "DMR Slot 1");
|
||||
echo $link;
|
||||
}
|
||||
|
||||
|
||||
if ($_GET['section'] == "dmr2link") {
|
||||
$link = getActualLink($reverseLogLinesMMDVM, "DMR Slot 2")."/". getActualReflector($reverseLogLinesMMDVM, "DMR Slot 2") ;
|
||||
echo $link;
|
||||
}
|
||||
|
||||
if ($_GET['section'] == "lastHeard") {
|
||||
$lastHeardList = getLastHeard($reverseLogLinesMMDVM, FALSE);
|
||||
$lastHeard = Array();
|
||||
|
|
|
@ -30,14 +30,14 @@
|
|||
echo"<tr>";
|
||||
echo"<td id=\"mode\">".getActualMode($lastHeard, $mmdvmconfigs)."</td>";
|
||||
if (getEnabled("D-Star", $mmdvmconfigs) == 1) {
|
||||
echo"<td>".getActualLink($reverseLogLinesMMDVM, "D-Star")."</td>";
|
||||
echo"<td id=\"dstarlink\">".getActualLink($reverseLogLinesMMDVM, "D-Star")."</td>";
|
||||
}
|
||||
if (getEnabled("System Fusion", $mmdvmconfigs) == 1) {
|
||||
echo"<td>".getYSFReflectorById(getActualLink($reverseLogLinesYSFGateway, "YSF"), $activeYSFReflectors)."</td>";
|
||||
echo"<td id=\"ysflink\">".getYSFReflectorById(getActualLink($reverseLogLinesYSFGateway, "YSF"), $activeYSFReflectors)."</td>";
|
||||
}
|
||||
if (getEnabled("DMR", $mmdvmconfigs) == 1) {
|
||||
echo"<td>".getActualLink($reverseLogLinesMMDVM, "DMR Slot 1")."</td>";
|
||||
echo"<td>".getActualLink($reverseLogLinesMMDVM, "DMR Slot 2")."/". getActualReflector($reverseLogLinesMMDVM, "DMR Slot 2") ."</td>";
|
||||
echo"<td id=\"dmr1link\">".getActualLink($reverseLogLinesMMDVM, "DMR Slot 1")."</td>";
|
||||
echo"<td id=\"dmr2link\">".getActualLink($reverseLogLinesMMDVM, "DMR Slot 2")."/". getActualReflector($reverseLogLinesMMDVM, "DMR Slot 2") ."</td>";
|
||||
}
|
||||
echo"</tr>\n";
|
||||
?>
|
||||
|
|
|
@ -55,6 +55,22 @@ function refreshMode() {
|
|||
doXMLHTTPRequest("ajax.php?section=mode","mode");
|
||||
}
|
||||
|
||||
function refreshDstarLink() {
|
||||
doXMLHTTPRequest("ajax.php?section=dstarlink","dstarlink");
|
||||
}
|
||||
|
||||
function refreshYSFLink() {
|
||||
doXMLHTTPRequest("ajax.php?section=ysflink","ysflink");
|
||||
}
|
||||
|
||||
function refreshDMR1Link() {
|
||||
doXMLHTTPRequest("ajax.php?section=dmr1link","dmr1link");
|
||||
}
|
||||
|
||||
function refreshDMR2Link() {
|
||||
doXMLHTTPRequest("ajax.php?section=dmr2link","dmr2link");
|
||||
}
|
||||
|
||||
var transmitting = false;
|
||||
function loadXMLDoc() {
|
||||
var xmlhttp;
|
||||
|
@ -73,6 +89,26 @@ function loadXMLDoc() {
|
|||
|
||||
var timeout = window.setTimeout("loadXMLDoc()", 1000);
|
||||
refreshMode();
|
||||
<?php
|
||||
if (getEnabled("D-Star", $mmdvmconfigs) == 1) {
|
||||
?>
|
||||
refreshDstarLink();
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
if (getEnabled("System Fusion", $mmdvmconfigs) == 1) {
|
||||
?>refreshYSFLink();
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
if (getEnabled("DMR", $mmdvmconfigs) == 1) {
|
||||
?>refreshDMR1Link();
|
||||
refreshDMR2Link();
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
}
|
||||
loadXMLDoc();
|
||||
</script>
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
<?php
|
||||
define("VERSION", "20170429-1 (".getGitVersion().")");
|
||||
define("VERSION", "20170507-1 (".getGitVersion().")");
|
||||
?>
|
||||
|
|
Loading…
Reference in a new issue