Admin tpl flexbox implementation

This commit is contained in:
Dennis Eichhorn 2017-01-28 19:56:13 +01:00
parent b4e1fcdb27
commit fb371e61a6
2 changed files with 76 additions and 66 deletions

View File

@ -18,48 +18,56 @@ $penetrators = $this->app->logger->getHighestPerpetrator();
echo $this->getData('nav')->render(); ?> echo $this->getData('nav')->render(); ?>
<section class="box w-33 floatLeft"> <div class="row">
<header><h1><?= $this->getText('System') ?></h1></header> <div class="col-xs-12 col-md-4">
<div class="inner"> <section class="box wf-100">
<table class="list wf-100"> <header><h1><?= $this->getText('System') ?></h1></header>
<tbody> <div class="inner">
<tr><td><?= $this->getText('OS') ?><td><?= php_uname('s'); ?> <table class="list wf-100">
<tr><td><?= $this->getText('Version') ?><td><?= php_uname('v'); ?> <tbody>
<tr><td><?= $this->getText('Release') ?><td><?= php_uname('r'); ?> <tr><td><?= $this->getText('OS') ?><td><?= php_uname('s'); ?>
<tr><td><?= $this->getText('RAMUsage') ?><td><?= memory_get_usage(true)/(1024*1024); ?> MB <tr><td><?= $this->getText('Version') ?><td><?= php_uname('v'); ?>
<tr><td><?= $this->getText('MemoryLimit') ?><td><?= ini_get('memory_limit'); ?> <tr><td><?= $this->getText('Release') ?><td><?= php_uname('r'); ?>
<tr><td><?= $this->getText('SystemRAM') ?><td><?= \phpOMS\System\SystemUtils::getRAM()/(1024); ?> MB <tr><td><?= $this->getText('RAMUsage') ?><td><?= memory_get_usage(true)/(1024*1024); ?> MB
<tr><td><?= $this->getText('CPUUsage') ?><td><?= \phpOMS\System\SystemUtils::getCpuUsage(); ?>% <tr><td><?= $this->getText('MemoryLimit') ?><td><?= ini_get('memory_limit'); ?>
</table> <tr><td><?= $this->getText('SystemRAM') ?><td><?= \phpOMS\System\SystemUtils::getRAM()/(1024); ?> MB
<tr><td><?= $this->getText('CPUUsage') ?><td><?= \phpOMS\System\SystemUtils::getCpuUsage(); ?>%
</table>
</div>
</section>
</div> </div>
</section>
<section class="box w-33 floatLeft"> <div class="col-xs-12 col-md-4">
<header><h1><?= $this->getText('Logs') ?></h1></header> <section class="box wf-100">
<div class="inner"> <header><h1><?= $this->getText('Logs') ?></h1></header>
<table class="list wf-100"> <div class="inner">
<tbody> <table class="list wf-100">
<tr><td><?= $this->getText('Emergencies') ?><td><?= $logs['emergency'] ?? 0; ?> <tbody>
<tr><td><?= $this->getText('Criticals') ?><td><?= $logs['critical'] ?? 0; ?> <tr><td><?= $this->getText('Emergencies') ?><td><?= $logs['emergency'] ?? 0; ?>
<tr><td><?= $this->getText('Errors') ?><td><?= $logs['error'] ?? 0; ?> <tr><td><?= $this->getText('Criticals') ?><td><?= $logs['critical'] ?? 0; ?>
<tr><td><?= $this->getText('Warnings') ?><td><?= $logs['warning'] ?? 0; ?> <tr><td><?= $this->getText('Errors') ?><td><?= $logs['error'] ?? 0; ?>
<tr><td><?= $this->getText('Alerts') ?><td><?= $logs['alert'] ?? 0; ?> <tr><td><?= $this->getText('Warnings') ?><td><?= $logs['warning'] ?? 0; ?>
<tr><td><?= $this->getText('Notices') ?><td><?= $logs['notice'] ?? 0; ?> <tr><td><?= $this->getText('Alerts') ?><td><?= $logs['alert'] ?? 0; ?>
<tr><td><?= $this->getText('Info') ?><td><?= $logs['info'] ?? 0; ?> <tr><td><?= $this->getText('Notices') ?><td><?= $logs['notice'] ?? 0; ?>
<tr><td><?= $this->getText('Debug') ?><td><?= $logs['debug'] ?? 0; ?> <tr><td><?= $this->getText('Info') ?><td><?= $logs['info'] ?? 0; ?>
<tr><td><?= $this->getText('Total') ?><td><?= array_sum($logs); ?> <tr><td><?= $this->getText('Debug') ?><td><?= $logs['debug'] ?? 0; ?>
</table> <tr><td><?= $this->getText('Total') ?><td><?= array_sum($logs); ?>
</table>
</div>
</section>
</div> </div>
</section>
<section class="box w-33 floatLeft"> <div class="col-xs-12 col-md-4">
<header><h1><?= $this->getText('Penetrators') ?></h1></header> <section class="box wf-100">
<div class="inner"> <header><h1><?= $this->getText('Penetrators') ?></h1></header>
<table class="list wf-100"> <div class="inner">
<tbody> <table class="list wf-100">
<?php foreach($penetrators as $ip => $count) : ?> <tbody>
<tr><td><?= $ip; ?><td><?= $count; ?> <?php foreach($penetrators as $ip => $count) : ?>
<?php endforeach; ?> <tr><td><?= $ip; ?><td><?= $count; ?>
</table> <?php endforeach; ?>
</table>
</div>
</section>
</div> </div>
</section> </div>

View File

@ -28,30 +28,32 @@ $logs = array_reverse($this->app->logger->get(25), true);
echo $this->getData('nav')->render(); ?> echo $this->getData('nav')->render(); ?>
<div class="box w-100"> <div class="row">
<table class="table"> <div class="box col-xs-12 wf-100">
<caption><?= $this->getText('Logs'); ?></caption> <table class="table">
<thead> <caption><?= $this->getText('Logs'); ?></caption>
<tr> <thead>
<td><?= $this->getText('Timestamp'); ?> <tr>
<td><?= $this->getText('Level'); ?> <td><?= $this->getText('Timestamp'); ?>
<td><?= $this->getText('Source'); ?> <td><?= $this->getText('Level'); ?>
<td class="wf-100"><?= $this->getText('Message'); ?> <td><?= $this->getText('Source'); ?>
<tfoot> <td class="wf-100"><?= $this->getText('Message'); ?>
<tr> <tfoot>
<td colspan="5"><?= $footerView->render(); ?> <tr>
<tbody> <td colspan="5"><?= $footerView->render(); ?>
<?php foreach ($logs as $key => $value) : <tbody>
$url = \phpOMS\Uri\UriFactory::build('/{/lang}/backend/admin/monitoring/logs/single?id=' . $key);?> <?php foreach ($logs as $key => $value) :
<tr> $url = \phpOMS\Uri\UriFactory::build('/{/lang}/backend/admin/monitoring/logs/single?id=' . $key);?>
<td><a href=<?= $url; ?>><i class="fa fa-clock-o"></i> <?= $value[0] ?? ''; ?></a> <tr>
<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-clock-o"></i> <?= $value[0] ?? ''; ?></a>
<td><a href=<?= $url; ?>><i class="fa fa-wifi"></i> <?= $value[2] ?? ''; ?></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-commenting"></i> <?= $value[7] ?? ''; ?></a> <td><a href=<?= $url; ?>><i class="fa fa-wifi"></i> <?= $value[2] ?? ''; ?></a>
<?php endforeach; <td><a href=<?= $url; ?>><i class="fa fa-commenting"></i> <?= $value[7] ?? ''; ?></a>
if (!isset($key)) : ?> <?php endforeach;
<tr> if (!isset($key)) : ?>
<td colspan="4"> <tr>
<?php endif; ?> <td colspan="4">
</table> <?php endif; ?>
</table>
</div>
</div> </div>