jilo-web/app/templates/logs-list.php

74 lines
3.0 KiB
PHP
Raw Permalink Normal View History

2025-01-18 11:17:32 +00:00
<!-- log events -->
<div class="container-fluid mt-2">
<div class="row mb-4">
<div class="col">
<h2 class="mb-3"><?= htmlspecialchars($widget['title']) ?></h2>
<ul class="nav nav-tabs mb-3">
<li class="nav-item">
<a class="nav-link <?= $widget['scope'] === 'user' ? 'active' : '' ?>" href="?page=logs&tab=user">
Logs for current user
</a>
</li>
<?php if ($widget['has_system_access']) { ?>
<li class="nav-item">
<a class="nav-link <?= $widget['scope'] === 'system' ? 'active' : '' ?>" href="?page=logs&tab=system">
Logs for all users
2024-09-16 14:09:37 +00:00
</a>
2025-01-18 11:17:32 +00:00
</li>
2024-09-16 14:09:37 +00:00
<?php } ?>
2025-01-18 11:17:32 +00:00
</ul>
<?php if ($widget['filter'] === true) {
include '../app/templates/logs-filter.php';
} ?>
2024-09-16 14:09:37 +00:00
2025-01-18 11:17:32 +00:00
<!-- widget "<?= htmlspecialchars($widget['name']) ?>" -->
<div class="collapse show" id="collapse<?= htmlspecialchars($widget['name']) ?>">
2024-09-16 14:09:37 +00:00
<?php if ($time_range_specified) { ?>
2025-01-18 11:17:32 +00:00
<div class="alert alert-info m-3">
<i class="fas fa-calendar-alt me-2"></i>Time period: <strong><?= htmlspecialchars($from_time) ?> - <?= htmlspecialchars($until_time) ?></strong>
</div>
2024-09-16 14:09:37 +00:00
<?php } ?>
2025-01-18 11:17:32 +00:00
<div class="mb-5">
2024-09-16 14:09:37 +00:00
<?php if ($widget['full'] === true) { ?>
2025-01-18 11:17:32 +00:00
<div class="table-responsive">
<table class="table table-hover align-middle mb-0">
<thead class="table-light">
2024-09-16 14:09:37 +00:00
<tr>
2025-01-18 11:17:32 +00:00
<?php if ($widget['scope'] === 'system') { ?>
<th>Username (id)</th>
<?php } ?>
<th>Time</th>
<th>Log message</th>
2024-09-16 14:09:37 +00:00
</tr>
</thead>
<tbody>
<?php foreach ($widget['table_records'] as $row) { ?>
<tr>
2025-01-18 11:17:32 +00:00
<?php if ($widget['scope'] === 'system') { ?>
<td><strong><?= htmlspecialchars($row['username']) ?> (<?= htmlspecialchars($row['userID']) ?>)</strong></td>
<?php } ?>
<td><span class="text-muted"><?= date('d M Y H:i', strtotime($row['time'])) ?></span></td>
<td><?= htmlspecialchars($row['log message']) ?></td>
2024-09-16 14:09:37 +00:00
</tr>
<?php } ?>
</tbody>
</table>
2025-01-18 11:17:32 +00:00
</div>
2024-09-16 14:09:37 +00:00
<?php
if ($widget['pagination'] === true) {
include '../app/templates/pagination.php';
}
?>
<?php } else { ?>
2025-01-18 11:17:32 +00:00
<div class="alert alert-info m-3">
<i class="fas fa-info-circle me-2"></i>No log entries found for the specified criteria.
2024-09-16 14:09:37 +00:00
</div>
2025-01-18 11:17:32 +00:00
<?php } ?>
2024-09-16 14:09:37 +00:00
</div>
2025-01-18 11:17:32 +00:00
</div>
</div>
</div>
</div>
<!-- /log events -->