MMDVMHost-Dashboard/index.php

172 lines
6.4 KiB
PHP
Raw Normal View History

2016-04-30 15:38:12 +02:00
<?php
//session_start();
/*
$time = microtime();
$time = explode(' ', $time);
$time = $time[1] + $time[0];
$start = $time;*/
header("Cache-Control: no-cache, must-revalidate");
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
2016-05-10 21:50:33 +02:00
// do not touch this includes!!! Never ever!!!
2016-04-30 15:38:12 +02:00
include "config/config.php";
2016-04-30 19:33:41 +02:00
include "include/tools.php";
startStopwatch();
showLapTime("Start of page");
2016-04-30 15:38:12 +02:00
include "include/functions.php";
include "include/init.php";
include "version.php";
2016-04-30 15:38:12 +02:00
?>
<!doctype html>
2016-07-13 15:07:23 +02:00
<html lang="en">
2016-04-30 15:38:12 +02:00
<head>
<meta charset="utf-8">
2016-06-24 18:59:05 +02:00
<meta name="viewport" content="width=device-width, initial-scale=0.6,maximum-scale=1, user-scalable=yes">
2016-06-23 21:17:09 +02:00
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.3/jquery.min.js"></script>
2016-04-30 15:38:12 +02:00
<!-- Das neueste kompilierte und minimierte CSS -->
2016-09-15 20:30:41 +02:00
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/latest/css/bootstrap.min.css">
2016-04-30 15:38:12 +02:00
<!-- Optionales Theme -->
2016-09-15 20:30:41 +02:00
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/latest/css/bootstrap-theme.min.css">
2016-04-30 15:38:12 +02:00
<!-- Das neueste kompilierte und minimierte JavaScript -->
2016-09-15 20:30:41 +02:00
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/latest/js/bootstrap.min.js"></script>
2016-07-13 15:07:23 +02:00
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.12/css/jquery.dataTables.min.css">
2016-06-24 23:12:23 +02:00
<script type="text/javascript" src="https://cdn.datatables.net/1.10.12/js/jquery.dataTables.min.js"></script>
2016-07-13 15:07:23 +02:00
<style>
.nowrap {
white-space:nowrap
}
</style>
2016-05-09 22:39:47 +02:00
<title><?php echo getCallsign($mmdvmconfigs) ?> - MMDVM-Dashboard by DG9VH</title>
2016-04-30 15:38:12 +02:00
</head>
<body>
<div class="page-header" style="position:relative;">
<h1><small>MMDVM-Dashboard by DG9VH for <?php
if (getConfigItem("General", "Duplex", $mmdvmconfigs) == "1") {
echo "Repeater";
} else {
echo "Hotspot";
}
?>:</small> <?php echo getCallsign($mmdvmconfigs) ?></h1>
<h4>MMDVMHost by G4KLX Version: <?php echo getMMDVMHostVersion() ?></h4>
<?php
2016-10-09 17:20:06 +02:00
if (LOGO !== "") {
?>
2016-09-28 23:05:50 +02:00
<div id="Logo" style="position:absolute;top:-43px;right:10px;"><img src="<?php echo LOGO ?>" width="250px" style="width:250px; border-radius:10px;box-shadow:2px 2px 2px #808080; padding:1px;background:#FFFFFF;border:1px solid #808080;" border="0" hspace="10" vspace="10" align="absmiddle"></div>
<?php
}
?>
2016-04-30 15:38:12 +02:00
</div>
<?php
if (defined("ENABLEMANAGEMENT")) {
?>
2016-06-24 21:12:11 +02:00
<button onclick="window.location.href='./scripts/log.php'" type="button" class="btn btn-default navbar-btn"><span class="glyphicon glyphicon-folder-open" aria-hidden="true"></span>&nbsp;View Log</button>
<button onclick="window.location.href='./scripts/rebootmmdvm.php'" type="button" class="btn btn-default navbar-btn"><span class="glyphicon glyphicon-refresh" aria-hidden="true"></span>&nbsp;Reboot MMDVMHost</button>
<button onclick="window.location.href='./scripts/reboot.php'" type="button" class="btn btn-default navbar-btn"><span class="glyphicon glyphicon-repeat" aria-hidden="true"></span>&nbsp;Reboot System</button>
<button onclick="window.location.href='./scripts/halt.php'" type="button" class="btn btn-default navbar-btn"><span class="glyphicon glyphicon-off" aria-hidden="true"></span>&nbsp;ShutDown System</button>
2016-04-30 15:38:12 +02:00
<?php
}
checkSetup();
2016-05-10 21:50:33 +02:00
// Here you can feel free to disable info-sections by commenting out with // before include
include "include/txinfo.php";
showLapTime("txinfo");
2016-04-30 19:33:41 +02:00
include "include/sysinfo.php";
showLapTime("sysinfo");
2016-06-28 16:31:59 +02:00
include "include/disk.php";
showLapTime("disk");
2016-05-02 10:19:08 +02:00
include "include/repeaterinfo.php";
showLapTime("repeaterinfo");
2016-05-09 22:39:47 +02:00
include "include/modes.php";
showLapTime("modes");
include "include/lh_ajax.php";
showLapTime("lh_ajax");
include "include/localtx_ajax.php";
showLapTime("localtx_ajax");
2016-06-11 22:38:54 +02:00
if (defined("ENABLEYSFGATEWAY")) {
include "include/ysfgatewayinfo.php";
showLapTime("ysfgatewayinfo");
}
2016-04-30 15:38:12 +02:00
?>
<div class="panel panel-info">
<?php
$datum = date("Y-m-d");
$uhrzeit = date("H:i:s");
echo "MMDVMHost-Dashboard V ".VERSION." | Last Reload $datum, $uhrzeit";
/*$time = microtime();
$time = explode(' ', $time);
$time = $time[1] + $time[0];
$finish = $time;
$total_time = round(($finish - $start), 4);*/
echo '<!--Page generated in '.getLapTime().' seconds.-->';
?> |
<?php
if (!isset($_GET['stoprefresh'])) {
echo '<a href="?stoprefresh">stop refreshing</a>';
} else {
echo '<a href=".">start refreshing</a>';
}
?>
| get your own at: <a href="https://github.com/dg9vh/MMDVMHost-Dashboard">https://github.com/dg9vh/MMDVMHost-Dashboard</a>
2016-04-30 15:38:12 +02:00
</div>
2016-06-24 23:39:37 +02:00
<script>
$(document).ready(function(){
2016-06-25 00:04:28 +02:00
var lastHeardT = $('#lastHeard').dataTable( {
"aaSorting": [[0,'desc']],
"ajax": '<?php
$protocol = "http";
if ((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') || $_SERVER['SERVER_PORT'] == 443)
$protocol = "https";
echo $protocol."://";
$base_dir = __DIR__; // Absolute path to your installation, ex: /var/www/mywebsite
$doc_root = preg_replace("!${_SERVER['SCRIPT_NAME']}$!", '', $_SERVER['SCRIPT_FILENAME']); # ex: /var/www
echo $_SERVER['HTTP_HOST'].preg_replace("!^${doc_root}!", '', $base_dir) ?>/ajax.php?section=lastHeard',
"deferRender": true
2016-06-24 23:39:37 +02:00
} );
<?php
if (!isset($_GET['stoprefresh'])) {
?>
setInterval( function () {
lastHeardT.api().ajax.reload( );
}, <?php echo REFRESHAFTER * 1000 ?> );
<?php
}
?>
2016-06-25 00:04:28 +02:00
var localTxT = $('#localTx').dataTable( {
"aaSorting": [[0,'desc']],
"ajax": '<?php
$protocol = "http";
if ((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') || $_SERVER['SERVER_PORT'] == 443)
$protocol = "https";
echo $protocol."://";
$base_dir = __DIR__; // Absolute path to your installation, ex: /var/www/mywebsite
$doc_root = preg_replace("!${_SERVER['SCRIPT_NAME']}$!", '', $_SERVER['SCRIPT_FILENAME']); # ex: /var/www
echo $_SERVER['HTTP_HOST'].preg_replace("!^${doc_root}!", '', $base_dir) ?>/ajax.php?section=localTx',
"deferRender": true
2016-06-24 23:39:37 +02:00
} );
<?php
if (!isset($_GET['stoprefresh'])) {
?>
setInterval( function () {
localTxT.api().ajax.reload( );
}, <?php echo REFRESHAFTER * 1000 ?> );
<?php
}
?>
2016-07-06 17:53:29 +02:00
var ysfGatewaysT = $('#ysfGateways').dataTable( {
"aaSorting": [[0,'asc']]
} );
2016-06-24 23:39:37 +02:00
});
</script>
<noscript>
For full functionality of this site it is necessary to enable JavaScript.
Here are the <a href="http://www.enable-javascript.com/" target="_blank">
instructions how to enable JavaScript in your web browser</a>.
</noscript>
2016-04-30 15:38:12 +02:00
</body>
</html>
<?php
showLapTime("End of Page");
?>