Fixes log levels displaying
parent
d886bcf755
commit
fd835dd058
|
@ -115,5 +115,8 @@ $username = $userObject->getUserDetails($userId)[0]['username'];
|
|||
// Get any new feedback messages
|
||||
include dirname(__FILE__, 4) . '/app/helpers/feedback.php';
|
||||
|
||||
// Load plugin helpers
|
||||
include PLUGIN_LOGS_PATH . 'helpers/logs_view_helper.php';
|
||||
|
||||
// Display messages list
|
||||
include PLUGIN_LOGS_PATH . 'views/logs.php';
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
<?php
|
||||
|
||||
function getLogLevelClass($level) {
|
||||
switch (strtolower($level)) {
|
||||
case 'emergency': return 'text-danger fw-bold';
|
||||
case 'alert': return 'text-danger';
|
||||
case 'critical': return 'text-warning fw-bold';
|
||||
case 'error': return 'text-warning';
|
||||
case 'warning': return 'text-warning';
|
||||
case 'notice': return 'text-primary';
|
||||
case 'info': return 'text-info';
|
||||
case 'debug': return 'text-muted';
|
||||
default: return 'text-body'; // fallback normal text
|
||||
}
|
||||
}
|
|
@ -93,7 +93,7 @@
|
|||
<td style="white-space: nowrap;"><?= $row['userID'] ? '<strong>' . htmlspecialchars($row['username'] . " ({$row['userID']})") . '</strong>' : '<span class="text-muted font-weight-normal small">SYSTEM</span>' ?></td>
|
||||
<?php } ?>
|
||||
<td style="white-space: nowrap;"><span class="text-muted"><?= date('d M Y H:i', strtotime($row['time'])) ?></span></td>
|
||||
<td style="white-space: nowrap;"><?= htmlspecialchars($row['log level']) ?></td>
|
||||
<td style="white-space: nowrap;"><span class="<?= getLogLevelClass($row['log level']) ?>"><?= htmlspecialchars($row['log level']) ?></span></td>
|
||||
<td style="width: 100%; word-break: break-word;"><?= htmlspecialchars($row['log message']) ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
|
|
Loading…
Reference in New Issue