Added modes-info and MMDVMHost-Version
This commit is contained in:
parent
60e82d8c91
commit
84e4e56188
|
@ -1,9 +1,10 @@
|
||||||
<?php
|
<?php
|
||||||
date_default_timezone_set('UTC');
|
date_default_timezone_set('UTC');
|
||||||
define("REPEATERCALLSIGN", "DG9VH");
|
|
||||||
define("MMDVMLOGPATH", "/mnt/ramdisk/"); // hint: add trailing / !!!
|
define("MMDVMLOGPATH", "/mnt/ramdisk/"); // hint: add trailing / !!!
|
||||||
define("MMDVMLOGPREFIX", "MMDVM");
|
define("MMDVMLOGPREFIX", "MMDVM");
|
||||||
define("MMDVMLOGFILE", MMDVMLOGPATH . MMDVMLOGPREFIX . "-" . date("Y-m-d") . ".log");
|
define("MMDVMLOGFILE", MMDVMLOGPATH . MMDVMLOGPREFIX . "-" . date("Y-m-d") . ".log");
|
||||||
|
define("MMDVMINIPATH", "/opt/mmdvm/"); // hint: add trailing / !!!
|
||||||
|
define("MMDVMHOSTPATH", "/opt/mmdvm/"); // hint: add trailing / !!!
|
||||||
|
|
||||||
// enter exact path to your log files.
|
// enter exact path to your log files.
|
||||||
// If your Linux is a MARYLAND-DSTAR-Image, this paths would work.
|
// If your Linux is a MARYLAND-DSTAR-Image, this paths would work.
|
||||||
|
|
|
@ -1,4 +1,51 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
function getMMDVMHostVersion() {
|
||||||
|
$filename = MMDVMHOSTPATH . "MMDVMHost";
|
||||||
|
if (file_exists($filename)) {
|
||||||
|
return date("Y-m-d", filectime($filename));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function getMMDVMConfig() {
|
||||||
|
$mmdvmconfigs = array();
|
||||||
|
if ($configs = fopen(MMDVMINIPATH."MMDVM.ini", 'r')) {
|
||||||
|
while ($config = fgets($configs)) {
|
||||||
|
array_push($mmdvmconfigs, substr($config, 0, -1));
|
||||||
|
}
|
||||||
|
fclose($configs);
|
||||||
|
}
|
||||||
|
return $mmdvmconfigs;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getCallsign($mmdvmconfigs) {
|
||||||
|
foreach ($mmdvmconfigs as $config) {
|
||||||
|
$pos = strpos($config, "Callsign");
|
||||||
|
if ($pos !== false) {
|
||||||
|
return substr($config, 9);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function getEnabled ($mode, $mmdvmconfigs) {
|
||||||
|
$modepos = array_search($mode,$mmdvmconfigs);
|
||||||
|
while(strpos($mmdvmconfigs[$modepos],"Enable") === false ) {
|
||||||
|
$modepos++;
|
||||||
|
}
|
||||||
|
return substr($mmdvmconfigs[$modepos], 7);
|
||||||
|
}
|
||||||
|
|
||||||
|
function showMode($mode, $mmdvmconfigs) {
|
||||||
|
?>
|
||||||
|
<td><span class="label <?php
|
||||||
|
if (getEnabled("[" . $mode . "]", $mmdvmconfigs) == 1) {
|
||||||
|
echo "label-success"; } else {
|
||||||
|
echo "label-danger";
|
||||||
|
}
|
||||||
|
?>"><?php echo $mode ?></span></td>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
|
||||||
function getLog() {
|
function getLog() {
|
||||||
// Open Logfile and copy loglines into LogLines-Array()
|
// Open Logfile and copy loglines into LogLines-Array()
|
||||||
$logLines = array();
|
$logLines = array();
|
||||||
|
@ -256,5 +303,6 @@ function getActualLink($logLines, $mode) {
|
||||||
}
|
}
|
||||||
|
|
||||||
//Some basic inits
|
//Some basic inits
|
||||||
|
$mmdvmconfigs = getMMDVMConfig();
|
||||||
$logLines = getLog();
|
$logLines = getLog();
|
||||||
?>
|
?>
|
17
include/modes.php
Normal file
17
include/modes.php
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
<div class="panel panel-default">
|
||||||
|
<!-- Standard-Panel-Inhalt -->
|
||||||
|
<div class="panel-heading">Enabled Modes</div>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Tabelle -->
|
||||||
|
<table class="table">
|
||||||
|
<tr>
|
||||||
|
<?php showMode("DMR", $mmdvmconfigs);?>
|
||||||
|
<?php showMode("DMR Network", $mmdvmconfigs);?>
|
||||||
|
<?php showMode("D-Star", $mmdvmconfigs);?>
|
||||||
|
<?php showMode("D-Star Network", $mmdvmconfigs);?>
|
||||||
|
<?php showMode("System Fusion", $mmdvmconfigs);?>
|
||||||
|
<?php showMode("System Fusion Network", $mmdvmconfigs);?>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
|
@ -21,15 +21,17 @@ include "include/functions.php";
|
||||||
<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><?php echo REPEATERCALLSIGN?> - MMDVM-Dashboard by DG9VH</title>
|
<title><?php echo getCallsign($mmdvmconfigs) ?> - MMDVM-Dashboard by DG9VH</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="page-header">
|
<div class="page-header">
|
||||||
<h1><small>MMDVM-Dashboard by DG9VH for Repeater:</small> <?php echo REPEATERCALLSIGN?></h1>
|
<h1><small>MMDVM-Dashboard by DG9VH for Repeater:</small> <?php echo getCallsign($mmdvmconfigs) ?></h1>
|
||||||
|
<h4>MMDVMHost v<?php echo getMMDVMHostVersion() ?> by G4KLX</h4>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
include "include/sysinfo.php";
|
include "include/sysinfo.php";
|
||||||
include "include/repeaterinfo.php";
|
include "include/repeaterinfo.php";
|
||||||
|
include "include/modes.php";
|
||||||
include "include/lh.php";
|
include "include/lh.php";
|
||||||
?>
|
?>
|
||||||
<div class="panel panel-info">
|
<div class="panel panel-info">
|
||||||
|
|
Loading…
Reference in a new issue