Permalink
Browse files

Add local speedtest server number to NEMS Server Overview

  • Loading branch information...
NEMS Linux
NEMS Linux committed Dec 16, 2018
1 parent 2188edd commit 81098ee71fe17e380fd66786aa4effe1d014db6b
Showing with 15 additions and 0 deletions.
  1. +15 −0 info/index.php
@@ -32,6 +32,19 @@
$platform = ver('platform');
exec('/usr/local/share/nems/nems-scripts/speedtest --list',$servernum_tmp);
if (is_array($servernum_tmp)) {
foreach ($servernum_tmp as $line) {
$tmp = explode(')',$line);
if (intval($tmp[0]) > 0) {
$speedtestservers[] = array(
'num'=>intval($tmp[0]),
);
break; // we only need one
}
}
}
?>

<div class="container" style="margin-top: 100px; padding-bottom: 100px;">
@@ -48,6 +61,8 @@
<p style="padding:4px 6px; color: #aaa !important;"><b>Number of Services:</b> <span class="nems-green"><?= shell_exec('/usr/local/bin/nems-info services'); ?></span></p>
<p style="padding:4px 6px; color: #aaa !important;"><b>Authorized for Cloud:</b> <span class="nems-green"><?php if (shell_exec('/usr/local/bin/nems-info cloudauth') == 1) echo 'Yes'; else echo 'No'; ?></span></p>

<p style="padding:4px 6px; color: #aaa !important;"><b>Local Speedtest Server Number:</b> <span class="nems-green"><?= $speedtestservers[0]['num'] ?></span></p>

<?php
if (isset($statlog) && is_array($statlog)) {
echo '<p style="padding:4px 6px; color: #aaa !important;"><b>NEMS Anonymous Stats:</b><br />This anonymous data helps me understand how NEMS servers are performing. In the interest of transparency and so you know exactly what is being sent, here is a log of the most recent data your server shared (the dataset is always the same, though the numbers may change):<br /><pre>' . print_r($statlog,true) . '</pre><span style="color:#aaa">This data is sent to the NEMS API via an encrypted connection and stored anonymously. You may read more about this <a href="https://docs.nemslinux.com/anonymous_stats" target="_blank">in the NEMS Documentation</a>.<br />You can see the full log at /var/log/nems/stats.log</span></p>';

0 comments on commit 81098ee

Please sign in to comment.