deshboard

This commit is contained in:
Fred Tempez 2023-08-07 20:28:38 +02:00
parent da1d28da2a
commit e4717f0e6d
2 changed files with 89 additions and 0 deletions

View File

@ -0,0 +1,35 @@
<?php
/**
* This file is part of Zwii.
* For full copyright and license information, please see the LICENSE
* file that was distributed with this source code.
*
* @author Rémi Jean <remi.jean@outlook.com>
* @copyright Copyright (C) 2008-2018, Rémi Jean
* @author Frédéric Tempez <frederic.tempez@outlook.com>
* @copyright Copyright (C) 2018-2023, Frédéric Tempez
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
* @link http://zwiicms.fr/
*/
class dashboard extends common
{
public static $actions = [
'index' => self::GROUP_ADMIN,
];
/**
* Dashboard
*/
public function index()
{
// Valeurs en sortie
$this->addOutput([
'title' => helper::translate('Tableau de bord'),
'view' => 'index'
]);
}
}

View File

@ -0,0 +1,54 @@
<?php echo template::formOpen('dashboard'); ?>
<div class="row">
<div class="col1">
<?php echo template::button('dashboardFormBack', [
'class' => 'buttonGrey',
'href' => helper::baseUrl(false),
'value' => template::ico('home')
]); ?>
</div>
</div>
<div class="row">
<div class="col12">
<?php echo 'Version de PHP : ' . phpversion(); ?>
<?php
$extensions = get_loaded_extensions();
echo '<p>Extensions activées :</p>';
foreach ($extensions as $extension) {
echo $extension . ' - ';
}
?>
<?php
$serverSoftware = $_SERVER['SERVER_SOFTWARE'];
echo '<p>';
if (stripos($serverSoftware, 'apache') !== false) {
echo 'Serveur web : Apache';
} elseif (stripos($serverSoftware, 'nginx') !== false) {
echo 'Serveur web : Nginx';
} elseif (stripos($serverSoftware, 'tomcat') !== false) {
echo 'Serveur web : Tomcat';
} else {
echo 'Serveur web non identifié : ' . $serverSoftware;
}
echo '</p>';
?>
<?php
echo 'Mémoire utilisée : ' . memory_get_usage() . ' octets</p>';
echo 'Pic de mémoire utilisée : ' . memory_get_peak_usage() . ' octets</p>';
?>
<?php
$loadAverage = sys_getloadavg();
echo 'Charge moyenne (1 min / 5 min / 15 min) : ' . implode(' / ', $loadAverage) . '</P>';
?>
<?php
$diskSpace = shell_exec('df -h'); // Linux example
echo 'Espace disque :</p>' . $diskSpace;
?>
</div>
</div>