mirror of
https://github.com/Karaka-Management/oms-Monitoring.git
synced 2026-01-19 12:08:40 +00:00
Case fix!
This commit is contained in:
parent
c56853876a
commit
99fe23d325
20
Theme/Backend/Lang/Navigation.en.lang.php
Normal file
20
Theme/Backend/Lang/Navigation.en.lang.php
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
/**
|
||||
* Orange Management
|
||||
*
|
||||
* PHP Version 7.0
|
||||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright 2013 Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
$MODLANG['Navigation'] = [
|
||||
'List' => 'List',
|
||||
'Logs' => 'Logs',
|
||||
'Monitoring' => 'Monitoring',
|
||||
];
|
||||
18
Theme/Backend/Lang/api.en.lang.php
Normal file
18
Theme/Backend/Lang/api.en.lang.php
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
/**
|
||||
* Orange Management
|
||||
*
|
||||
* PHP Version 7.0
|
||||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright 2013 Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
$MODLANG[1] = [
|
||||
'i:ModuleInstalled' => 'Installation of the module {$1} was successful.',
|
||||
];
|
||||
54
Theme/Backend/Lang/en.lang.php
Normal file
54
Theme/Backend/Lang/en.lang.php
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
<?php
|
||||
/**
|
||||
* Orange Management
|
||||
*
|
||||
* PHP Version 7.0
|
||||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright 2013 Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
$MODLANG['Monitoring'] = [
|
||||
'Alerts' => 'Alerts',
|
||||
'All' => 'All',
|
||||
'Backtrace' => 'Backtrace',
|
||||
'CPUUsage' => 'CPU Usage',
|
||||
'Created' => 'Created',
|
||||
'CreatedBy' => 'Created By',
|
||||
'Criticals' => 'Criticals',
|
||||
'Debug' => 'Debug',
|
||||
'Description' => 'Description',
|
||||
'DiskUsage' => 'DiskUsage',
|
||||
'Emergencies' => 'Emergencies',
|
||||
'Errors' => 'Errors',
|
||||
'Exception' => 'Exception',
|
||||
'File' => 'File',
|
||||
'Info' => 'Info',
|
||||
'Level' => 'Level',
|
||||
'Line' => 'Line',
|
||||
'Logs' => 'Logs',
|
||||
'MemoryLimit' => 'Memory Limit',
|
||||
'Message' => 'Message',
|
||||
'Notices' => 'Notices',
|
||||
'Status' => 'Status',
|
||||
'System' => 'System',
|
||||
'Total' => 'Total',
|
||||
'OS' => 'OS',
|
||||
'Penetrators' => 'Penetrators',
|
||||
'RAMUsage' => 'RAM Usage',
|
||||
'Release' => 'Release',
|
||||
'Report' => 'Report',
|
||||
'Source' => 'Source',
|
||||
'SystemRAM' => 'System RAM',
|
||||
'Theme' => 'Theme',
|
||||
'Time' => 'Time',
|
||||
'Timestamp' => 'Timestamp',
|
||||
'Uri' => 'Uri',
|
||||
'Version' => 'Version',
|
||||
'Warnings' => 'Warnings',
|
||||
];
|
||||
66
Theme/Backend/monitoring-dashboard.tpl.php
Normal file
66
Theme/Backend/monitoring-dashboard.tpl.php
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
<?php
|
||||
/**
|
||||
* Orange Management
|
||||
*
|
||||
* PHP Version 7.0
|
||||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright 2013 Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
$logs = $this->app->logger->countLogs();
|
||||
$penetrators = $this->app->logger->getHighestPerpetrator();
|
||||
|
||||
echo $this->getData('nav')->render(); ?>
|
||||
|
||||
<section class="box w-33 floatLeft">
|
||||
<h1><?= $this->l11n->lang['Monitoring']['System'] ?></h1>
|
||||
<div class="inner">
|
||||
<table class="list wf-100">
|
||||
<tbody>
|
||||
<tr><td><?= $this->l11n->lang['Monitoring']['OS'] ?><td><?= php_uname('s'); ?>
|
||||
<tr><td><?= $this->l11n->lang['Monitoring']['Version'] ?><td><?= php_uname('v'); ?>
|
||||
<tr><td><?= $this->l11n->lang['Monitoring']['Release'] ?><td><?= php_uname('r'); ?>
|
||||
<tr><td><?= $this->l11n->lang['Monitoring']['RAMUsage'] ?><td><?= memory_get_usage(true)/(1024*1024); ?> MB
|
||||
<tr><td><?= $this->l11n->lang['Monitoring']['MemoryLimit'] ?><td><?= ini_get('memory_limit'); ?>
|
||||
<tr><td><?= $this->l11n->lang['Monitoring']['SystemRAM'] ?><td><?= \phpOMS\Utils\SystemUtils::getRAM()/(1024); ?> MB
|
||||
<tr><td><?= $this->l11n->lang['Monitoring']['CPUUsage'] ?><td><?= \phpOMS\Utils\SystemUtils::getCpuUsage(); ?>%
|
||||
<tr><td><?= $this->l11n->lang['Monitoring']['DiskUsage'] ?><td><?= round(\phpOMS\Utils\SystemUtils::getFolderSize(ROOT_PATH)/1000000, 0); ?> MB
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="box w-33 floatLeft">
|
||||
<h1><?= $this->l11n->lang['Monitoring']['Logs'] ?></h1>
|
||||
<div class="inner">
|
||||
<table class="list wf-100">
|
||||
<tbody>
|
||||
<tr><td><?= $this->l11n->lang['Monitoring']['Emergencies'] ?><td><?= $logs['emergency'] ?? 0; ?>
|
||||
<tr><td><?= $this->l11n->lang['Monitoring']['Criticals'] ?><td><?= $logs['critical'] ?? 0; ?>
|
||||
<tr><td><?= $this->l11n->lang['Monitoring']['Errors'] ?><td><?= $logs['error'] ?? 0; ?>
|
||||
<tr><td><?= $this->l11n->lang['Monitoring']['Warnings'] ?><td><?= $logs['warning'] ?? 0; ?>
|
||||
<tr><td><?= $this->l11n->lang['Monitoring']['Alerts'] ?><td><?= $logs['alert'] ?? 0; ?>
|
||||
<tr><td><?= $this->l11n->lang['Monitoring']['Notices'] ?><td><?= $logs['notice'] ?? 0; ?>
|
||||
<tr><td><?= $this->l11n->lang['Monitoring']['Info'] ?><td><?= $logs['info'] ?? 0; ?>
|
||||
<tr><td><?= $this->l11n->lang['Monitoring']['Debug'] ?><td><?= $logs['debug'] ?? 0; ?>
|
||||
<tr><td><?= $this->l11n->lang['Monitoring']['Total'] ?><td><?= array_sum($logs); ?>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="box w-33 floatLeft">
|
||||
<h1><?= $this->l11n->lang['Monitoring']['Penetrators'] ?></h1>
|
||||
<div class="inner">
|
||||
<table class="list wf-100">
|
||||
<tbody>
|
||||
<?php foreach($penetrators as $ip => $count) : ?>
|
||||
<tr><td><?= $ip; ?><td><?= $count; ?>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
91
Theme/Backend/monitoring-logs-single.tpl.php
Normal file
91
Theme/Backend/monitoring-logs-single.tpl.php
Normal file
|
|
@ -0,0 +1,91 @@
|
|||
<?php
|
||||
/**
|
||||
* Orange Management
|
||||
*
|
||||
* PHP Version 7.0
|
||||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright 2013 Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
/**
|
||||
* @var \phpOMS\Views\View $this
|
||||
*/
|
||||
|
||||
$log = $this->app->logger->getByLine((int) $this->request->getData('id') ?? 1);
|
||||
$temp = trim($log['backtrace']);
|
||||
$log['backtrace'] = json_decode($temp, true);
|
||||
|
||||
$details = '* Uri: `' . trim($log['path']) . "`\n"
|
||||
. '* Level: `' . trim($log['level']) . "`\n"
|
||||
. '* Message: `' . trim($log['message']) . "`\n"
|
||||
. '* File: `' . trim($log['file']) . "`\n"
|
||||
. '* Line: `' . trim($log['line']) . "`\n"
|
||||
. '* Version: `' . trim($log['version']) . "`\n"
|
||||
. '* OS: `' . trim($log['os']) . "`\n\n"
|
||||
. "Backtrace: \n\n```\n" . json_encode($log['backtrace'], JSON_PRETTY_PRINT);
|
||||
|
||||
echo $this->getData('nav')->render(); ?>
|
||||
|
||||
<section class="box w-100">
|
||||
<h1><?= $this->l11n->lang['Monitoring']['Logs']; ?></h1>
|
||||
|
||||
<div class="inner">
|
||||
<table class="list w-100">
|
||||
<tr>
|
||||
<td><?= $this->l11n->lang[0]['ID']; ?>
|
||||
<td><i class="fa fa-anchor"></i>
|
||||
<td class="wf-100"><?= (int) $this->request->getData('id') ?? 0; ?>
|
||||
<tr>
|
||||
<td><?= $this->l11n->lang['Monitoring']['Time']; ?>
|
||||
<td><i class="fa fa-clock-o"></i>
|
||||
<td><?= $log['datetime']; ?>
|
||||
<tr>
|
||||
<td><?= $this->l11n->lang['Monitoring']['Uri']; ?>
|
||||
<td><i class="fa fa-globe"></i>
|
||||
<td><?= $log['path']; ?>
|
||||
<tr>
|
||||
<td><?= $this->l11n->lang['Monitoring']['Source']; ?>
|
||||
<td><i class="fa fa-wifi"></i>
|
||||
<td><?= $log['ip']; ?>
|
||||
<tr>
|
||||
<td><?= $this->l11n->lang['Monitoring']['Level']; ?>
|
||||
<td>
|
||||
<i class="fa fa-<?= in_array($log['level'], ['notice', 'info', 'debug']) ? 'info-circle' : 'warning'; ?>"></i>
|
||||
<td><?= $log['level']; ?>
|
||||
<tr>
|
||||
<td><?= $this->l11n->lang['Monitoring']['Message']; ?>
|
||||
<td><i class="fa fa-commenting"></i>
|
||||
<td><?= $log['message']; ?>
|
||||
<tr>
|
||||
<td><?= $this->l11n->lang['Monitoring']['File']; ?>
|
||||
<td><i class="fa fa-file"></i>
|
||||
<td><?= $log['file']; ?>
|
||||
<tr>
|
||||
<td><?= $this->l11n->lang['Monitoring']['Line']; ?>
|
||||
<td><i class="fa fa-commenting"></i>
|
||||
<td><?= $log['line']; ?>
|
||||
<tr>
|
||||
<td><?= $this->l11n->lang['Monitoring']['Version']; ?>
|
||||
<td><i class="fa fa-pencil"></i>
|
||||
<td><?= $log['version']; ?>
|
||||
<tr>
|
||||
<td><?= $this->l11n->lang['Monitoring']['OS']; ?>
|
||||
<td><i class="fa fa-laptop"></i>
|
||||
<td><?= $log['os']; ?>
|
||||
<tr>
|
||||
<td colspan="3"><?= $this->l11n->lang['Monitoring']['Backtrace']; ?>
|
||||
<tr>
|
||||
<td colspan="3">
|
||||
<pre><?= json_encode($log['backtrace'], JSON_PRETTY_PRINT); ?></pre>
|
||||
<tr>
|
||||
<td colspan="3" style="padding-top: 10px"><a class="button" target="_blank"
|
||||
href="https://gitreports.com/issue/Orange-Management/Orange-Management/?name=Guest&issue_title=<?= urlencode($log['message']); ?>&details=<?= urlencode($details); ?>"><?= $this->l11n->lang['Monitoring']['Report']; ?></a>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
57
Theme/Backend/monitoring-logs.tpl.php
Normal file
57
Theme/Backend/monitoring-logs.tpl.php
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
<?php
|
||||
/**
|
||||
* Orange Management
|
||||
*
|
||||
* PHP Version 7.0
|
||||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright 2013 Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
/**
|
||||
* @var \phpOMS\Views\View $this
|
||||
*/
|
||||
|
||||
$footerView = new \Web\Views\Lists\PaginationView($this->app, $this->request, $this->response);
|
||||
$footerView->setTemplate('/Web/Templates/Lists/Footer/PaginationBig');
|
||||
|
||||
$footerView->setPages(0 / 25);
|
||||
$footerView->setPage(1);
|
||||
$footerView->setResults(0);
|
||||
|
||||
$logs = array_reverse($this->app->logger->get(25), true);
|
||||
|
||||
echo $this->getData('nav')->render(); ?>
|
||||
|
||||
<section class="box w-100">
|
||||
<table class="table">
|
||||
<caption><?= $this->l11n->lang['Monitoring']['Logs']; ?></caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<td><?= $this->l11n->lang['Monitoring']['Timestamp']; ?>
|
||||
<td><?= $this->l11n->lang['Monitoring']['Level']; ?>
|
||||
<td><?= $this->l11n->lang['Monitoring']['Source']; ?>
|
||||
<td class="wf-100"><?= $this->l11n->lang['Monitoring']['Message']; ?>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="5"><?= $footerView->render(); ?>
|
||||
<tbody>
|
||||
<?php foreach ($logs as $key => $value) :
|
||||
$url = \phpOMS\Uri\UriFactory::build('/{/lang}/backend/admin/monitoring/logs/single?id=' . $key);?>
|
||||
<tr>
|
||||
<td><a href=<?= $url; ?>><i class="fa fa-clock-o"></i> <?= $value[0] ?? ''; ?></a>
|
||||
<td><a href=<?= $url; ?>><i class="fa fa-<?= in_array($value[1], ['notice', 'info', 'debug']) ? 'info-circle' : 'warning'; ?>"></i> <?= $value[1] ?? ''; ?></a>
|
||||
<td><a href=<?= $url; ?>><i class="fa fa-wifi"></i> <?= $value[2] ?? ''; ?></a>
|
||||
<td><a href=<?= $url; ?>><i class="fa fa-commenting"></i> <?= $value[7] ?? ''; ?></a>
|
||||
<?php endforeach;
|
||||
if (!isset($key)) : ?>
|
||||
<tr>
|
||||
<td colspan="4">
|
||||
<?php endif; ?>
|
||||
</table>
|
||||
</section>
|
||||
Loading…
Reference in New Issue
Block a user