diff --git a/Controller/BackendController.php b/Controller/BackendController.php index 1c20ca1..d77e86c 100755 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -47,6 +47,8 @@ final class BackendController extends Controller $view->setTemplate('/Modules/Monitoring/Theme/Backend/monitoring-dashboard'); $view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1000706001, $request, $response)); + $view->setData('logger', $this->app->logger); + return $view; } @@ -68,6 +70,8 @@ final class BackendController extends Controller $view->setTemplate('/Modules/Monitoring/Theme/Backend/monitoring-logs'); $view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1000706001, $request, $response)); + $view->setData('logger', $this->app->logger); + return $view; } @@ -89,6 +93,8 @@ final class BackendController extends Controller $view->setTemplate('/Modules/Monitoring/Theme/Backend/monitoring-logs-single'); $view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1000706001, $request, $response)); + $view->setData('logger', $this->app->logger); + return $view; } diff --git a/Theme/Backend/monitoring-dashboard.tpl.php b/Theme/Backend/monitoring-dashboard.tpl.php index d875539..2367122 100755 --- a/Theme/Backend/monitoring-dashboard.tpl.php +++ b/Theme/Backend/monitoring-dashboard.tpl.php @@ -12,54 +12,57 @@ */ declare(strict_types=1); -$logs = $this->app->logger->countLogs(); -$penetrators = $this->app->logger->getHighestPerpetrator(); +use phpOMS\System\SystemUtils; + +$logger = $this->getData('logger'); +$logs = $logger->countLogs(); +$penetrators = $logger->getHighestPerpetrator(); echo $this->getData('nav')->render(); ?>
| = $this->getHtml('OS'); ?> | = $this->printHtml(\php_uname('s')); ?> |
| = $this->getHtml('Version'); ?> | = $this->printHtml(\php_uname('v')); ?> |
| = $this->getHtml('Release'); ?> | = $this->printHtml(\php_uname('r')); ?> - |
| = $this->getHtml('RAMUsage'); ?> | = $this->printHtml(\memory_get_usage(true) / (1024 * 1024)); ?> MB + |
| = $this->getHtml('RAMUsage'); ?> | = $this->printHtml((string) (\memory_get_usage(true) / (1024 * 1024))); ?> MB |
| = $this->getHtml('MemoryLimit'); ?> | = $this->printHtml(\ini_get('memory_limit')); ?> - |
| = $this->getHtml('SystemRAM'); ?> | = $this->printHtml(\phpOMS\System\SystemUtils::getRAM() / (1024)); ?> MB - |
| = $this->getHtml('CPUUsage'); ?> | = $this->printHtml(\phpOMS\System\SystemUtils::getCpuUsage()); ?>% + |
| = $this->getHtml('SystemRAM'); ?> | = $this->printHtml((string) (SystemUtils::getRAM() / (1024))); ?> MB + |
| = $this->getHtml('CPUUsage'); ?> | = $this->printHtml((string) SystemUtils::getCpuUsage()); ?>% |
| = $this->getHtml('Emergencies'); ?> | = $this->printHtml($logs['emergency'] ?? 0); ?> - |
| = $this->getHtml('Criticals'); ?> | = $this->printHtml($logs['critical'] ?? 0); ?> - |
| = $this->getHtml('Errors'); ?> | = $this->printHtml($logs['error'] ?? 0); ?> - |
| = $this->getHtml('Warnings'); ?> | = $this->printHtml($logs['warning'] ?? 0); ?> - |
| = $this->getHtml('Alerts'); ?> | = $this->printHtml($logs['alert'] ?? 0); ?> - |
| = $this->getHtml('Notices'); ?> | = $this->printHtml($logs['notice'] ?? 0); ?> - |
| = $this->getHtml('Info'); ?> | = $this->printHtml($logs['info'] ?? 0); ?> - |
| = $this->getHtml('Debug'); ?> | = $this->printHtml($logs['debug'] ?? 0); ?> - |
| = $this->getHtml('Total'); ?> | = $this->printHtml(\array_sum($logs)); ?> + |
| = $this->getHtml('Emergencies'); ?> | = $this->printHtml((string) ($logs['emergency'] ?? 0)); ?> + |
| = $this->getHtml('Criticals'); ?> | = $this->printHtml((string) ($logs['critical'] ?? 0)); ?> + |
| = $this->getHtml('Errors'); ?> | = $this->printHtml((string) ($logs['error'] ?? 0)); ?> + |
| = $this->getHtml('Warnings'); ?> | = $this->printHtml((string) ($logs['warning'] ?? 0)); ?> + |
| = $this->getHtml('Alerts'); ?> | = $this->printHtml((string) ($logs['alert'] ?? 0)); ?> + |
| = $this->getHtml('Notices'); ?> | = $this->printHtml((string) ($logs['notice'] ?? 0)); ?> + |
| = $this->getHtml('Info'); ?> | = $this->printHtml((string) ($logs['info'] ?? 0)); ?> + |
| = $this->getHtml('Debug'); ?> | = $this->printHtml((string) ($logs['debug'] ?? 0)); ?> + |
| = $this->getHtml('Total'); ?> | = $this->printHtml((string) \array_sum($logs)); ?> |
| = $this->getHtml('Timestamp'); ?> - | = $this->getHtml('Level'); ?> - | = $this->getHtml('Source'); ?> - | = $this->getHtml('Message'); ?> - | |
| - | ||||
| printHtml($url); ?>> = $this->printHtml($value[0] ?? ''); ?> - | printHtml($url); ?>> = $this->printHtml($value[1] ?? ''); ?> - | printHtml($url); ?>> = $this->printHtml($value[2] ?? ''); ?> - | printHtml($url); ?>> = $this->printHtml($value[7] ?? ''); ?> - - | |
| - - | ||||
| = $this->getHtml('Timestamp'); ?> + | = $this->getHtml('Level'); ?> + | = $this->getHtml('Source'); ?> + | = $this->getHtml('Message'); ?> + |
| printHtml($url); ?>> = $this->printHtml($value[0] ?? ''); ?> + | printHtml($url); ?>> = $this->printHtml($value[1] ?? ''); ?> + | printHtml($url); ?>> = $this->printHtml($value[2] ?? ''); ?> + | printHtml($url); ?>> = $this->printHtml($value[7] ?? ''); ?> + + |
| + + | |||
| = $this->getHtml('DisabledFunctions'); ?> | = PhpCode::isDisabled(PhpCode::$disabledFunctions) ? $this->getHtml('OK') : $this->getHtml('NG'); ?>
@@ -38,74 +64,125 @@ echo $this->getData('nav')->render(); ?>
-
-
|