fix in js
This commit is contained in:
parent
fe5e0e6374
commit
54b7d62e72
@ -63,6 +63,8 @@
|
||||
</footer>
|
||||
|
||||
<!-- Bootstrap JS -->
|
||||
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
||||
{% block extra_scripts %}{% endblock %}
|
||||
</body>
|
||||
</html>
|
||||
|
@ -1,7 +1,8 @@
|
||||
{% extends "base.html" %}
|
||||
{% block title %}Logi - Aplikacja Updatera{% endblock %}
|
||||
{% block extra_head %}
|
||||
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.13.1/css/jquery.dataTables.min.css">
|
||||
<!-- Dołącz styl CSS biblioteki Vanilla‑DataTables -->
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/vanilla-datatables@latest/dist/vanilla-dataTables.min.css">
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
<h2>Logi</h2>
|
||||
@ -31,34 +32,34 @@
|
||||
<td>{{ log.timestamp.strftime('%Y-%m-%d %H:%M:%S') }}</td>
|
||||
<td>
|
||||
{% if log.device_id %}
|
||||
<a href="{{ url_for('device_detail', device_id=log.device.id) }}">
|
||||
{{ log.device.name if log.device.name else "Urządzenie #" ~ log.device.id }}
|
||||
</a>
|
||||
<a href="{{ url_for('device_detail', device_id=log.device.id) }}">
|
||||
{{ log.device.name if log.device.name else "Urządzenie #" ~ log.device.id }}
|
||||
</a>
|
||||
{% else %}
|
||||
Ogólne
|
||||
Ogólne
|
||||
{% endif %}
|
||||
</td>
|
||||
<td><pre style="white-space: pre-wrap;">{{ log.message }}</pre></td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr>
|
||||
<td colspan="3" class="text-center">Brak logów.</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<!-- Dodanie bibliotek DataTables i inicjalizacja -->
|
||||
<script src="https://code.jquery.com/jquery-3.5.1.js"></script>
|
||||
<script src="https://cdn.datatables.net/1.13.1/js/jquery.dataTables.min.js"></script>
|
||||
<script>
|
||||
$(document).ready( function () {
|
||||
$('#logsTable').DataTable({
|
||||
"order": [[0, "desc"]],
|
||||
"language": {
|
||||
"url": "//cdn.datatables.net/plug-ins/1.13.1/i18n/Polish.json"
|
||||
{% endblock %}
|
||||
{% block extra_scripts %}
|
||||
<!-- Dołącz skrypt biblioteki Vanilla‑DataTables -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/vanilla-datatables@latest/dist/vanilla-dataTables.min.js"></script>
|
||||
<script>
|
||||
// Inicjalizacja Vanilla‑DataTables dla tabeli logów
|
||||
const dataTable = new DataTable("#logsTable", {
|
||||
searchable: true,
|
||||
sortable: true,
|
||||
perPage: 10,
|
||||
labels: {
|
||||
placeholder: "Szukaj...", // placeholder dla pola wyszukiwania
|
||||
perPage: "{select} wpisów na stronę", // etykieta przy wyborze liczby wierszy
|
||||
noRows: "Brak logów.", // komunikat, gdy tabela jest pusta
|
||||
info: "Wyświetlono {start} - {end} z {rows} logów" // tekst z informacją o paginacji
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
Loading…
x
Reference in New Issue
Block a user