From b2a73203ed49db90fc3ab2b3df35a6c4410962e3 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Tue, 8 Aug 2023 20:55:42 +0200 Subject: [PATCH] Introduit le tableau de bord sans le publier --- core/module/dashboard/dashboard.php | 15 +++++ core/module/dashboard/view/index/index.php | 78 +++++++++++----------- 2 files changed, 54 insertions(+), 39 deletions(-) diff --git a/core/module/dashboard/dashboard.php b/core/module/dashboard/dashboard.php index dd2bd27a..e2f4e6a9 100644 --- a/core/module/dashboard/dashboard.php +++ b/core/module/dashboard/dashboard.php @@ -20,11 +20,26 @@ class dashboard extends common 'index' => self::GROUP_ADMIN, ]; + + + public static $infos = []; + /** * Dashboard */ public function index() { + + self::$infos['webserver'] = $_SERVER['SERVER_SOFTWARE']; + self::$infos['php']['version'] = phpversion(); + self::$infos['php']['extension'] = get_loaded_extensions(); + + self::$infos['system']['memory'] = memory_get_usage() . ' octets'; + self::$infos['system']['peek'] = 'Pic de mémoire utilisée : ' . memory_get_peak_usage() . ' octets'; + + $loadAverage = sys_getloadavg(); + self::$infos['system']['charge'] = 'Charge moyenne (1 min / 5 min / 15 min) : ' . implode(' / ', $loadAverage) . '

'; + // Valeurs en sortie $this->addOutput([ 'title' => helper::translate('Tableau de bord'), diff --git a/core/module/dashboard/view/index/index.php b/core/module/dashboard/view/index/index.php index 8d092987..cd2b8e52 100644 --- a/core/module/dashboard/view/index/index.php +++ b/core/module/dashboard/view/index/index.php @@ -10,45 +10,45 @@
- - Extensions activées :

'; - foreach ($extensions as $extension) { - echo $extension . ' - '; - } - ?> - '; - 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 '

'; - ?> - - '; - echo 'Pic de mémoire utilisée : ' . memory_get_peak_usage() . ' octets

'; - ?> - - '; - ?> - - ' . $diskSpace; - ?> +
+

+ +

+
+
+

+ +

+

+ +

+
+
+

+ +

+

+ +

+
+
+
+
+

+ +

+

+ +

+

+ +

+

+ +

+
+
+
\ No newline at end of file