2019-08-18 22:29:46 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
$hostname = $system->hostname();
|
|
|
|
$uptime = $system->uptime();
|
|
|
|
$cores = $system->processorCount();
|
|
|
|
|
|
|
|
// mem used
|
|
|
|
$memused = $system->usedMemory();
|
|
|
|
$memused_status = "primary";
|
|
|
|
if ($memused > 90) {
|
2019-11-08 08:41:55 +00:00
|
|
|
$memused_status = "danger";
|
2019-08-18 22:29:46 +00:00
|
|
|
} elseif ($memused > 75) {
|
2019-11-08 08:41:55 +00:00
|
|
|
$memused_status = "warning";
|
2019-08-18 22:29:46 +00:00
|
|
|
} elseif ($memused > 0) {
|
2019-11-08 08:41:55 +00:00
|
|
|
$memused_status = "success";
|
2019-08-18 22:29:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// cpu load
|
|
|
|
$cpuload = $system->systemLoadPercentage();
|
|
|
|
if ($cpuload > 90) {
|
2019-11-08 08:41:55 +00:00
|
|
|
$cpuload_status = "danger";
|
2019-08-18 22:29:46 +00:00
|
|
|
} elseif ($cpuload > 75) {
|
2019-11-08 08:41:55 +00:00
|
|
|
$cpuload_status = "warning";
|
2019-08-18 22:29:46 +00:00
|
|
|
} elseif ($cpuload > 0) {
|
2019-11-08 08:41:55 +00:00
|
|
|
$cpuload_status = "success";
|
2019-08-18 22:29:46 +00:00
|
|
|
}
|
|
|
|
|
2020-01-20 15:30:44 +00:00
|
|
|
// cpu temp
|
|
|
|
$cputemp = $system->systemTemperature();
|
|
|
|
if ($cputemp > 70) {
|
|
|
|
$cputemp_status = "danger";
|
|
|
|
} elseif ($cputemp > 50) {
|
|
|
|
$cputemp_status = "warning";
|
|
|
|
} else {
|
|
|
|
$cputemp_status = "success";
|
|
|
|
}
|
|
|
|
|
2019-08-18 22:29:46 +00:00
|
|
|
?>
|
|
|
|
<div class="row">
|
2019-10-15 09:17:29 +00:00
|
|
|
<div class="col-lg-12">
|
|
|
|
<div class="card">
|
2019-11-01 09:08:49 +00:00
|
|
|
<div class="card-header">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col">
|
|
|
|
<i class="fas fa-cube mr-2"></i><?php echo _("System"); ?>
|
|
|
|
</div>
|
|
|
|
</div><!-- /.row -->
|
|
|
|
</div><!-- /.card-header -->
|
2019-10-15 09:17:29 +00:00
|
|
|
<div class="card-body">
|
2019-11-08 08:41:55 +00:00
|
|
|
<?php $status->showMessages(); ?>
|
|
|
|
<form role="form" action="?page=system_info" method="POST">
|
|
|
|
<?php echo CSRFTokenFieldTag() ?>
|
|
|
|
<ul class="nav nav-tabs" role="tablist">
|
|
|
|
<li role="presentation" class="nav-item"><a class="nav-link active" id="systemtab" href="#system" aria-controls="system" role="tab" data-toggle="tab"><?php echo _("System"); ?></a></li>
|
|
|
|
<li role="presentation" class="nav-item"><a class="nav-link" id="languagetab" href="#language" aria-controls="language" role="tab" data-toggle="tab"><?php echo _("Language"); ?></a></li>
|
2019-11-10 22:14:07 +00:00
|
|
|
<li role="presentation" class="nav-item"><a class="nav-link" id="advancedtab" href="#advanced" aria-controls="advanced" role="tab" data-toggle="tab"><?php echo _("Advanced"); ?></a></li>
|
2019-11-08 08:41:55 +00:00
|
|
|
<li role="presentation" class="nav-item"><a class="nav-link" id="consoletab" href="#console" aria-controls="console" role="tab" data-toggle="tab"><?php echo _("Console"); ?></a></li>
|
|
|
|
</ul>
|
2019-08-18 22:29:46 +00:00
|
|
|
|
2019-11-08 08:41:55 +00:00
|
|
|
<div class="systemtabcontent tab-content">
|
|
|
|
<div role="tabpanel" class="tab-pane active" id="system">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-lg-6">
|
|
|
|
<h4 class="mt-3"><?php echo _("System Information"); ?></h4>
|
|
|
|
<div class="info-item"><?php echo _("Hostname"); ?></div><div><?php echo htmlspecialchars($hostname, ENT_QUOTES); ?></div>
|
|
|
|
<div class="info-item"><?php echo _("Pi Revision"); ?></div><div><?php echo htmlspecialchars(RPiVersion(), ENT_QUOTES); ?></div>
|
|
|
|
<div class="info-item"><?php echo _("Uptime"); ?></div><div><?php echo htmlspecialchars($uptime, ENT_QUOTES); ?></div>
|
|
|
|
<div class="mb-1"><?php echo _("Memory Used"); ?></div>
|
|
|
|
<div class="progress mb-2" style="height: 20px;">
|
|
|
|
<div class="progress-bar bg-<?php echo htmlspecialchars($memused_status, ENT_QUOTES); ?>"
|
|
|
|
role="progressbar" aria-valuenow="<?php echo htmlspecialchars($memused, ENT_QUOTES); ?>" aria-valuemin="0" aria-valuemax="100"
|
|
|
|
style="width: <?php echo htmlspecialchars($memused, ENT_QUOTES); ?>%"><?php echo htmlspecialchars($memused, ENT_QUOTES); ?>%
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="mb-1"><?php echo _("CPU Load"); ?></div>
|
2020-01-20 15:30:44 +00:00
|
|
|
<div class="progress mb-2" style="height: 20px;">
|
2019-11-08 08:41:55 +00:00
|
|
|
<div class="progress-bar bg-<?php echo htmlspecialchars($cpuload_status, ENT_QUOTES); ?>"
|
|
|
|
role="progressbar" aria-valuenow="<?php echo htmlspecialchars($cpuload, ENT_QUOTES); ?>" aria-valuemin="0" aria-valuemax="100"
|
|
|
|
style="width: <?php echo htmlspecialchars($cpuload, ENT_QUOTES); ?>%"><?php echo htmlspecialchars($cpuload, ENT_QUOTES); ?>%
|
|
|
|
</div>
|
2020-01-20 15:30:44 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="mb-1"><?php echo _("CPU Temp"); ?></div>
|
|
|
|
<div class="progress mb-4" style="height: 20px;">
|
|
|
|
<div class="progress-bar bg-<?php echo htmlspecialchars($cputemp_status, ENT_QUOTES); ?>"
|
|
|
|
role="progressbar" aria-valuenow="<?php echo htmlspecialchars($cputemp, ENT_QUOTES); ?>" aria-valuemin="0" aria-valuemax="100"
|
|
|
|
style="width: <?php echo htmlspecialchars(($cputemp*1.2), ENT_QUOTES); ?>%"><?php echo htmlspecialchars($cputemp, ENT_QUOTES); ?>°C
|
|
|
|
</div>
|
2019-11-08 08:41:55 +00:00
|
|
|
</div>
|
2019-08-18 22:29:46 +00:00
|
|
|
|
2019-11-08 08:41:55 +00:00
|
|
|
<form action="?page=system_info" method="POST">
|
|
|
|
<?php echo CSRFTokenFieldTag() ?>
|
2019-11-11 13:36:19 +00:00
|
|
|
<a href="?page=<?php echo $_GET['page'] ?>" class="btn btn-outline btn-primary"><i class="fas fa-sync-alt"></i> <?php echo _("Refresh") ?></a>
|
|
|
|
|
2019-11-08 08:41:55 +00:00
|
|
|
<?php if (!RASPI_MONITOR_ENABLED) : ?>
|
|
|
|
<input type="submit" class="btn btn-warning" name="system_reboot" value="<?php echo _("Reboot"); ?>" />
|
|
|
|
<input type="submit" class="btn btn-warning" name="system_shutdown" value="<?php echo _("Shutdown"); ?>" />
|
|
|
|
<?php endif ?>
|
2019-11-11 13:36:19 +00:00
|
|
|
</form>
|
2019-11-08 08:41:55 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2019-08-18 22:29:46 +00:00
|
|
|
|
2019-11-08 08:41:55 +00:00
|
|
|
<div role="tabpanel" class="tab-pane" id="language">
|
|
|
|
<h4 class="mt-3"><?php echo _("Language settings") ;?></h4>
|
|
|
|
<div class="row">
|
|
|
|
<div class="form-group col-md-6">
|
|
|
|
<label for="code"><?php echo _("Select a language"); ?></label>
|
|
|
|
<?php SelectorOptions('locale', $arrLocales, $_SESSION['locale']); ?>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<input type="submit" class="btn btn-outline btn-primary" name="SaveLanguage" value="<?php echo _("Save settings"); ?>" />
|
|
|
|
<a href="?page=<?php echo $_GET['page'] ?>" class="btn btn-outline btn-primary"><i class="fas fa-sync-alt"></i> <?php echo _("Refresh") ?></a>
|
|
|
|
</div>
|
2019-11-10 22:14:07 +00:00
|
|
|
|
|
|
|
<div role="tabpanel" class="tab-pane" id="advanced">
|
|
|
|
<h4 class="mt-3"><?php echo _("Advanced settings") ;?></h4>
|
|
|
|
<div class="row">
|
|
|
|
<div class="form-group col-md-6">
|
|
|
|
<label for="code"><?php echo _("Web server port") ;?></label>
|
|
|
|
<form action="?page=system_info" method="POST">
|
|
|
|
<?php echo CSRFTokenFieldTag() ?>
|
|
|
|
<?php if (!RASPI_MONITOR_ENABLED) : ?>
|
|
|
|
<input type="text" class="form-control" name="serverPort" value="<?php echo htmlspecialchars($ServerPort, ENT_QUOTES); ?>" />
|
|
|
|
<?php endif ?>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<input type="submit" class="btn btn-outline btn-primary" name="SaveServerPort" value="<?php echo _("Save settings"); ?>" />
|
2019-11-11 13:36:19 +00:00
|
|
|
<input type="submit" class="btn btn-warning" name="RestartLighttpd" value="<?php echo _("Restart lighttpd"); ?>" />
|
|
|
|
|
2019-11-10 22:14:07 +00:00
|
|
|
</div>
|
|
|
|
|
2019-11-08 08:41:55 +00:00
|
|
|
<div role="tabpanel" class="tab-pane" id="console">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-lg-12 mt-3">
|
|
|
|
<?php if (!RASPI_MONITOR_ENABLED) : ?>
|
|
|
|
<iframe src="includes/webconsole.php" class="webconsole"></iframe>
|
|
|
|
<?php endif ?>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div><!-- /.systemtabcontent -->
|
|
|
|
</form>
|
2019-10-15 09:17:29 +00:00
|
|
|
</div><!-- /.card-body -->
|
|
|
|
<div class="card-footer"></div>
|
|
|
|
</div><!-- /.card -->
|
|
|
|
</div><!-- /.col-lg-12 -->
|
2019-08-18 22:29:46 +00:00
|
|
|
</div><!-- /.row -->
|