Adding git report functionality

This commit is contained in:
Dennis Eichhorn 2015-12-21 11:12:54 +01:00
parent 31567e65d4
commit af7016a227
3 changed files with 21 additions and 2 deletions

View File

@ -21,6 +21,15 @@ $log = $this->app->logger->getByLine((int) $this->request->getData(
$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">
@ -36,13 +45,18 @@ echo $this->getData('nav')->render(); ?>
<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>
<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']; ?>
@ -69,6 +83,9 @@ echo $this->getData('nav')->render(); ?>
<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>

View File

@ -47,7 +47,7 @@ echo $this->getData('nav')->render(); ?>
<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[6] ?? ''; ?></a>
<td><a href=<?= $url; ?>><i class="fa fa-commenting"></i> <?= $value[7] ?? ''; ?></a>
<?php endforeach;
if (!isset($key)) : ?>
<tr>

View File

@ -42,11 +42,13 @@ $MODLANG['Monitoring'] = [
'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',
];