autofixes

This commit is contained in:
Dennis Eichhorn 2020-08-30 20:13:11 +02:00
parent 461686f20e
commit f5b46788db
6 changed files with 33 additions and 30 deletions

View File

@ -27,6 +27,8 @@ use phpOMS\Stdlib\Base\Enum;
abstract class PermissionState extends Enum
{
public const DASHBOARD = 1;
public const LOG = 2;
public const SECURITY = 3;
}

View File

@ -34,7 +34,7 @@ echo $this->getData('nav')->render(); ?>
<div class="row">
<div class="col-xs-12 col-md-6">
<section class="box wf-100">
<header><h1><?= $this->getHtml('Logs') ?></h1></header>
<header><h1><?= $this->getHtml('Logs'); ?></h1></header>
<div class="inner">
<table class="list w-100">
@ -43,50 +43,50 @@ echo $this->getData('nav')->render(); ?>
<td><i class="fa fa-anchor"></i>
<td class="wf-100"><?= $this->printHtml((int) $this->request->getData('id') ?? 0); ?>
<tr>
<td><?= $this->getHtml('Time') ?>
<td><?= $this->getHtml('Time'); ?>
<td><i class="fa fa-clock-o"></i>
<td><?= $this->printHtml($log['datetime']); ?>
<tr>
<td><?= $this->getHtml('Uri') ?>
<td><?= $this->getHtml('Uri'); ?>
<td><i class="fa fa-globe"></i>
<td><?= $this->printHtml($log['path']); ?>
<tr>
<td><?= $this->getHtml('Source') ?>
<td><?= $this->getHtml('Source'); ?>
<td><i class="fa fa-wifi"></i>
<td><?= $this->printHtml($log['ip']); ?>
<tr>
<td><?= $this->getHtml('Level') ?>
<td><?= $this->getHtml('Level'); ?>
<td>
<i class="fa fa-<?= $this->printHtml(\in_array($log['level'], ['notice', 'info', 'debug']) ? 'info-circle' : 'warning'); ?>"></i>
<td><?= $this->printHtml($log['level']); ?>
<tr>
<td><?= $this->getHtml('Message') ?>
<td><?= $this->getHtml('Message'); ?>
<td><i class="fa fa-commenting"></i>
<td><?= $this->printHtml($log['message']); ?>
<tr>
<td><?= $this->getHtml('File') ?>
<td><?= $this->getHtml('File'); ?>
<td><i class="fa fa-file"></i>
<td><?= $this->printHtml($log['file']); ?>
<tr>
<td><?= $this->getHtml('Line') ?>
<td><?= $this->getHtml('Line'); ?>
<td><i class="fa fa-commenting"></i>
<td><?= $this->printHtml($log['line']); ?>
<tr>
<td><?= $this->getHtml('Version') ?>
<td><?= $this->getHtml('Version'); ?>
<td><i class="fa fa-pencil"></i>
<td><?= $this->printHtml($log['version']); ?>
<tr>
<td><?= $this->getHtml('OS') ?>
<td><?= $this->getHtml('OS'); ?>
<td><i class="fa fa-laptop"></i>
<td><?= $this->printHtml($log['os']); ?>
<tr>
<td colspan="3"><?= $this->getHtml('Backtrace') ?>
<td colspan="3"><?= $this->getHtml('Backtrace'); ?>
<tr>
<td colspan="3">
<pre><?= $this->printHtml(\json_encode($log['backtrace'], \JSON_PRETTY_PRINT)); ?></pre>
<tr>
<td colspan="3" style="padding-top: 10px"><a tabindex="0" class="button" target="_blank"
href="https://gitreports.com/issue/Orange-Management/Orange-Management/?name=Guest&issue_title=<?= $this->printHtml(\urlencode($log['message'])); ?>&details=<?= $this->printHtml(\urlencode($details)); ?>"><?= $this->getHtml('Report') ?></a>
href="https://gitreports.com/issue/Orange-Management/Orange-Management/?name=Guest&issue_title=<?= $this->printHtml(\urlencode($log['message'])); ?>&details=<?= $this->printHtml(\urlencode($details)); ?>"><?= $this->getHtml('Report'); ?></a>
</table>
</div>
</section>

View File

@ -22,19 +22,19 @@ echo $this->getData('nav')->render(); ?>
<div class="row">
<div class="box col-xs-12 wf-100">
<table class="default">
<caption><?= $this->getHtml('Logs') ?><i class="fa fa-download floatRight download btn"></i></caption>
<caption><?= $this->getHtml('Logs'); ?><i class="fa fa-download floatRight download btn"></i></caption>
<thead>
<tr>
<td><?= $this->getHtml('Timestamp') ?>
<td><?= $this->getHtml('Level') ?>
<td><?= $this->getHtml('Source') ?>
<td class="wf-100"><?= $this->getHtml('Message') ?>
<td><?= $this->getHtml('Timestamp'); ?>
<td><?= $this->getHtml('Level'); ?>
<td><?= $this->getHtml('Source'); ?>
<td class="wf-100"><?= $this->getHtml('Message'); ?>
<tfoot>
<tr>
<td colspan="5">
<tbody>
<?php foreach ($logs as $key => $value) :
$url = \phpOMS\Uri\UriFactory::build('{/prefix}admin/monitoring/logs/single?{?}&id=' . $key);?>
$url = \phpOMS\Uri\UriFactory::build('{/prefix}admin/monitoring/logs/single?{?}&id=' . $key); ?>
<tr>
<td><a href=<?= $this->printHtml($url); ?>><i class="fa fa-clock-o"></i> <?= $this->printHtml($value[0] ?? ''); ?></a>
<td><a href=<?= $this->printHtml($url); ?>><i class="fa fa-<?= $this->printHtml(\in_array($value[1], ['notice', 'info', 'debug']) ? 'info-circle' : 'warning'); ?>"></i> <?= $this->printHtml($value[1] ?? ''); ?></a>

View File

@ -28,13 +28,13 @@ echo $this->getData('nav')->render(); ?>
<div class="row">
<div class="box col-xs-12 wf-100">
<table class="default">
<caption><?= $this->getHtml('Files') ?><i class="fa fa-download floatRight download btn"></i></caption>
<caption><?= $this->getHtml('Files'); ?><i class="fa fa-download floatRight download btn"></i></caption>
<thead>
<tr>
<td class="wf-100"><?= $this->getHtml('File') ?>
<td><?= $this->getHtml('Unicode') ?>
<td><?= $this->getHtml('Deprecated') ?>
<td><?= $this->getHtml('Integrity') ?>
<td class="wf-100"><?= $this->getHtml('File'); ?>
<td><?= $this->getHtml('Unicode'); ?>
<td><?= $this->getHtml('Deprecated'); ?>
<td><?= $this->getHtml('Integrity'); ?>
<tbody>
<?php foreach ($files as $key => $file) : $source = \file_get_contents($file); ?>
<tr>

View File

@ -41,15 +41,15 @@ echo $this->getData('nav')->render(); ?>
<div class="col-xs-12">
<div class="box wf-100">
<table class="default">
<caption><?= $this->getHtml('Inspection') ?><i class="fa fa-download floatRight download btn"></i></caption>
<caption><?= $this->getHtml('Inspection'); ?><i class="fa fa-download floatRight download btn"></i></caption>
<thead>
<tr>
<td><?= $this->getHtml('Status') ?>
<td class="wf-100"><?= $this->getHtml('File') ?>
<td><?= $this->getHtml('Unicode') ?>
<td><?= $this->getHtml('Deprecated') ?>
<td><?= $this->getHtml('Modified') ?>
<td><?= $this->getHtml('Integrity') ?>
<td><?= $this->getHtml('Status'); ?>
<td class="wf-100"><?= $this->getHtml('File'); ?>
<td><?= $this->getHtml('Unicode'); ?>
<td><?= $this->getHtml('Deprecated'); ?>
<td><?= $this->getHtml('Modified'); ?>
<td><?= $this->getHtml('Integrity'); ?>
<tbody>
<?php
$files = Directory::listByExtension(__DIR__ . '/../../../../phpOMS/', 'php', 'tests(\/|\\\)');

View File

@ -20,6 +20,7 @@ namespace Modules\Monitoring\tests\Admin;
class AdminTest extends \PHPUnit\Framework\TestCase
{
protected const MODULE_NAME = 'Monitoring';
protected const URI_LOAD = '';
use \Modules\tests\ModuleTestTrait;