Add system time to System > Basic tab

This commit is contained in:
billz 2023-06-04 15:27:54 +00:00
parent 47cbd520d0
commit da091b9142
5 changed files with 14 additions and 0 deletions

View file

@ -40,6 +40,12 @@ class Sysinfo
return $uptime;
}
public function systime()
{
$systime = exec("date");
return $systime;
}
public function usedMemory()
{
$used = shell_exec("free -m | awk 'NR==2{ total=$2 ; used=$3 } END { print used/total*100}'");

View file

@ -138,6 +138,7 @@ function DisplaySystem(&$extraFooterScripts)
$cores = $system->processorCount();
$os = $system->operatingSystem();
$kernel = $system->kernelVersion();
$systime = $system->systime();
// mem used
$memused = $system->usedMemory();
@ -207,6 +208,7 @@ function DisplaySystem(&$extraFooterScripts)
"serverBind",
"hostname",
"uptime",
"systime",
"cores",
"os",
"kernel",

Binary file not shown.

View file

@ -737,6 +737,9 @@ msgstr "Pi Revision"
msgid "Uptime"
msgstr "Uptime"
msgid "System Time"
msgstr "System Time"
msgid "Memory Used"
msgstr "Memory Used"

View file

@ -25,6 +25,9 @@ include('includes/sysstats.php');
<div class="row mb-1">
<div class="info-item col-xs-3"><?php echo _("Uptime"); ?></div><div class="info-value col-xs-3"><?php echo htmlspecialchars($uptime, ENT_QUOTES); ?></div>
</div>
<div class="row mb-1">
<div class="info-item col-xs-3"><?php echo _("System Time"); ?></div><div class="info-value col-xs-3"><?php echo htmlspecialchars($systime, ENT_QUOTES); ?></div>
</div>
</div>
</div>
<div class="mb-1"><?php echo _("Memory Used"); ?></div>