HTML fixes

main
Yasen Pramatarov 2025-02-28 13:50:54 +02:00
parent 921f310ac1
commit e2daf22ad7
2 changed files with 125 additions and 127 deletions

View File

@ -1,13 +1,15 @@
<!-- log events --> <!-- log events -->
<div class="container-fluid mt-2"> <div class="container-fluid mt-4">
<div class="row mb-4"> <div class="row mb-4">
<div class="col-md-6 mb-5"> <div class="col-md-6">
<h2 class="mb-0">Log events</h2> <h2 class="mb-0">Log events</h2>
<small>events recorded in the Jilo monitoring platform</small> <small>events recorded in the Jilo monitoring platform</small>
</div> </div>
<div class="row mb-4"> </div>
<ul class="nav nav-tabs mb-3">
<!-- Tabs navigation -->
<ul class="nav nav-tabs mb-4">
<li class="nav-item"> <li class="nav-item">
<a class="nav-link <?= $scope === 'user' ? 'active' : '' ?>" href="?page=logs&tab=user"> <a class="nav-link <?= $scope === 'user' ? 'active' : '' ?>" href="?page=logs&tab=user">
Logs for current user Logs for current user
@ -25,27 +27,32 @@
<!-- logs filter --> <!-- logs filter -->
<div class="card mb-3"> <div class="card mb-3">
<div class="card-body"> <div class="card-body">
<form method="get" action="" class="row g-3 align-items-end"> <form method="GET" action="" class="row g-3 align-items-end">
<input type="hidden" name="page" value="logs"> <input type="hidden" name="page" value="logs">
<input type="hidden" name="tab" value="<?= htmlspecialchars($scope) ?>"> <input type="hidden" name="tab" value="<?= htmlspecialchars($scope) ?>">
<div class="col-md-3"> <div class="col-md-3">
<label for="from_time" class="form-label">From date</label> <label for="from_time" class="form-label">From date</label>
<input type="date" class="form-control" id="from_time" name="from_time" value="<?= htmlspecialchars($_REQUEST['from_time'] ?? '') ?>"> <input type="date" class="form-control" id="from_time" name="from_time" value="<?= htmlspecialchars($_REQUEST['from_time'] ?? '') ?>">
</div> </div>
<div class="col-md-3"> <div class="col-md-3">
<label for="until_time" class="form-label">Until date</label> <label for="until_time" class="form-label">Until date</label>
<input type="date" class="form-control" id="until_time" name="until_time" value="<?= htmlspecialchars($_REQUEST['until_time'] ?? '') ?>"> <input type="date" class="form-control" id="until_time" name="until_time" value="<?= htmlspecialchars($_REQUEST['until_time'] ?? '') ?>">
</div> </div>
<?php if ($scope === 'system') { ?> <?php if ($scope === 'system') { ?>
<div class="col-md-2"> <div class="col-md-2">
<label for="id" class="form-label">User ID</label> <label for="id" class="form-label">User ID</label>
<input type="text" class="form-control" id="id" name="id" value="<?= htmlspecialchars($_REQUEST['id'] ?? '') ?>" placeholder="Enter user ID"> <input type="text" class="form-control" id="id" name="id" value="<?= htmlspecialchars($_REQUEST['id'] ?? '') ?>" placeholder="Enter user ID">
</div> </div>
<?php } ?> <?php } ?>
<div class="col-md"> <div class="col-md">
<label for="message" class="form-label">Message</label> <label for="message" class="form-label">Message</label>
<input type="text" class="form-control" id="message" name="message" value="<?= htmlspecialchars($_REQUEST['message'] ?? '') ?>" placeholder="Search in log messages"> <input type="text" class="form-control" id="message" name="message" value="<?= htmlspecialchars($_REQUEST['message'] ?? '') ?>" placeholder="Search in log messages">
</div> </div>
<div class="col-md-auto"> <div class="col-md-auto">
<button type="submit" class="btn btn-primary me-2"> <button type="submit" class="btn btn-primary me-2">
<i class="fas fa-search me-2"></i>Search <i class="fas fa-search me-2"></i>Search
@ -99,6 +106,4 @@
<?php } ?> <?php } ?>
</div> </div>
</div> </div>
</div>
</div>
<!-- /log events --> <!-- /log events -->

View File

@ -18,26 +18,24 @@ $range = 2;
<?php if ($totalPages > 1): ?> <?php if ($totalPages > 1): ?>
<nav aria-label="Page navigation" class="mt-4"> <nav aria-label="Page navigation" class="mt-4">
<ul class="pagination justify-content-center d-flex flex-row gap-1"> <ul class="pagination justify-content-center d-flex flex-row gap-1">
<!-- First page --> <!-- First page -->
<?php if ($currentPage > 1): ?> <?php if ($currentPage > 1): ?>
<li class="page-item"> <li class="page-item">
<a class="page-link" href="<?= htmlspecialchars($app_root . '?page=' . $page . $params) ?>">First</a> <a class="page-link" href="<?= htmlspecialchars($app_root . '?page=' . $page . $params) ?>">First</a>
</li> </li>
<li class="page-item"> <li class="page-item">
<a class="page-link" href="<?= htmlspecialchars($app_root . '?page=' . $page . ($currentPage > 1 ? '&page_num=' . ($currentPage - 1) : '') . $params) ?>">«</a> <a class="page-link" href="<?= htmlspecialchars($app_root . '?page=' . $page . ($currentPage > 1 ? '&page_num=' . ($currentPage - 1) : '') . $params) ?>">«</a>
</li> </li>
<?php else: ?> <?php else: ?>
<li class="page-item disabled"> <li class="page-item disabled">
<span class="page-link">First</span> <span class="page-link">First</span>
</li> </li>
<li class="page-item disabled"> <li class="page-item disabled">
<span class="page-link">«</span> <span class="page-link">«</span>
</li> </li>
<?php endif; ?> <?php endif; ?>
<!-- Page numbers --> <!-- Page numbers -->
<?php <?php
for ($i = 1; $i <= $totalPages; $i++) { for ($i = 1; $i <= $totalPages; $i++) {
// Show first, last, current page, 2 pages before and after current, and step pages (10, 20, etc.) // Show first, last, current page, 2 pages before and after current, and step pages (10, 20, etc.)
if ($i === 1 || if ($i === 1 ||
@ -50,36 +48,31 @@ $range = 2;
($i % 10 === 0 && $i > 10) ($i % 10 === 0 && $i > 10)
) { ?> ) { ?>
<li class="page-item <?= $i === (int)$currentPage ? 'active' : '' ?>"> <li class="page-item <?= $i === (int)$currentPage ? 'active' : '' ?>">
<a class="page-link" href="<?= htmlspecialchars($app_root . '?page=' . $page . ($i > 1 ? '&page_num=' . $i : '') . $params) ?>"> <a class="page-link" href="<?= htmlspecialchars($app_root . '?page=' . $page . ($i > 1 ? '&page_num=' . $i : '') . $params) ?>"><?= $i ?></a>
<?= $i ?>
</a>
</li> </li>
<?php <?php } elseif ($i === $currentPage - 3 || $i === $currentPage + 3) { ?>
} elseif ($i === $currentPage - 3 || $i === $currentPage + 3) {
?>
<li class="page-item disabled"> <li class="page-item disabled">
<span class="page-link">...</span> <span class="page-link">...</span>
</li> </li>
<?php <?php } ?>
} <?php } ?>
} ?>
<!-- Last page --> <!-- Last page -->
<?php if ($currentPage < $totalPages): ?> <?php if ($currentPage < $totalPages): ?>
<li class="page-item"> <li class="page-item">
<a class="page-link" href="<?= htmlspecialchars($app_root . '?page=' . $page . '&page_num=' . ($currentPage + 1) . $params) ?>">»</a> <a class="page-link" href="<?= htmlspecialchars($app_root . '?page=' . $page . '&page_num=' . ($currentPage + 1) . $params) ?>">»</a>
</li> </li>
<li class="page-item"> <li class="page-item">
<a class="page-link" href="<?= htmlspecialchars($app_root . '?page=' . $page . '&page_num=' . $totalPages . $params) ?>">Last</a> <a class="page-link" href="<?= htmlspecialchars($app_root . '?page=' . $page . '&page_num=' . $totalPages . $params) ?>">Last</a>
</li> </li>
<?php else: ?> <?php else: ?>
<li class="page-item disabled"> <li class="page-item disabled">
<span class="page-link">»</span> <span class="page-link">»</span>
</li> </li>
<li class="page-item disabled"> <li class="page-item disabled">
<span class="page-link">Last</span> <span class="page-link">Last</span>
</li> </li>
<?php endif; ?> <?php endif; ?>
</ul> </ul>
</nav> </nav>
<?php endif; ?> <?php endif; ?>