380 lines
12 KiB
HTML
380 lines
12 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="pl" class="{% if session.get('dark_mode', True) %}dark-mode{% endif %}">
|
||
<head>
|
||
<meta charset="UTF-8" />
|
||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||
<title>Backup RouterOS</title>
|
||
<!-- Bootstrap CSS -->
|
||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
||
|
||
<style>
|
||
/* Poprawa kontrastu dla form-text w trybie ciemnym */
|
||
.dark-mode .form-text {
|
||
color: #ccc !important;
|
||
}
|
||
/* Ogólne style trybu ciemnego */
|
||
.dark-mode body {
|
||
background-color: #121212;
|
||
color: #ffffff;
|
||
}
|
||
.dark-mode a,
|
||
.dark-mode a:hover {
|
||
color: #ddd;
|
||
}
|
||
|
||
/* Nawigacja i menu */
|
||
.dark-mode .navbar,
|
||
.dark-mode .navbar-nav,
|
||
.dark-mode .dropdown-menu {
|
||
background-color: #333 !important;
|
||
color: #fff;
|
||
}
|
||
.dark-mode .navbar-nav .nav-link {
|
||
color: #ddd !important;
|
||
}
|
||
.dark-mode .navbar-nav .nav-link:hover {
|
||
color: #fff !important;
|
||
}
|
||
/* Nowa reguła dla elementów dropdown po najechaniu */
|
||
.dark-mode .dropdown-item:hover,
|
||
.dark-mode .dropdown-item:focus,
|
||
.dark-mode .dropdown-item.active {
|
||
background-color: #444 !important;
|
||
color: #fff !important;
|
||
}
|
||
|
||
/* Tabele */
|
||
.dark-mode .table {
|
||
background-color: #333 !important;
|
||
border-color: #444;
|
||
}
|
||
.dark-mode .table thead th {
|
||
background-color: #444;
|
||
color: #fff;
|
||
border: 1px solid #555;
|
||
}
|
||
.dark-mode .table tbody td {
|
||
color: #ddd;
|
||
border: 1px solid #555;
|
||
}
|
||
html.dark-mode table.table thead th {
|
||
background-color: #444 !important;
|
||
color: #fff !important;
|
||
border: 1px solid #555 !important;
|
||
}
|
||
html.dark-mode table.table tbody td {
|
||
background-color: #333 !important;
|
||
color: #ddd !important;
|
||
border: 1px solid #555 !important;
|
||
}
|
||
/* Pola formularzy */
|
||
.dark-mode input,
|
||
.dark-mode textarea,
|
||
.dark-mode select {
|
||
background-color: #333;
|
||
color: #fff;
|
||
border: 1px solid #555;
|
||
}
|
||
.dark-mode ::placeholder {
|
||
color: #ccc;
|
||
}
|
||
|
||
/* Przyciski - poprawiony kontrast dla btn-warning */
|
||
.dark-mode .btn-warning {
|
||
background-color: #d39e00;
|
||
border-color: #b38600;
|
||
color: #fff;
|
||
}
|
||
.dark-mode .btn-secondary {
|
||
background-color: #444;
|
||
border-color: #555;
|
||
color: #fff;
|
||
}
|
||
|
||
/* Bloki (np. zawartość kontenera, karty) */
|
||
.dark-mode .block, .dark-mode .card {
|
||
background-color: #171717;
|
||
color: #fff;
|
||
}
|
||
|
||
/* Stopka */
|
||
.dark-mode footer {
|
||
background-color: #1e1e1e !important;
|
||
color: #fff !important;
|
||
}
|
||
footer {
|
||
background-color: #f8f9fa;
|
||
color: #212529;
|
||
}
|
||
|
||
/* Alerty – pozostają bez zmian */
|
||
.diff-add { color: green; }
|
||
.diff-rem { color: red; }
|
||
|
||
/* Dodatkowe nadpisanie styli diff2html w trybie ciemnym */
|
||
.dark-mode .d2h-wrapper,
|
||
.dark-mode .d2h-file-header,
|
||
.dark-mode .d2h-file-info,
|
||
.dark-mode .d2h-file-diff,
|
||
.dark-mode .d2h-diff-table,
|
||
.dark-mode .d2h-code-line,
|
||
.dark-mode .d2h-code-line-ctn,
|
||
.dark-mode .d2h-code-side-linenumber {
|
||
background-color: #333 !important;
|
||
color: #ddd !important;
|
||
border-color: #444 !important;
|
||
}
|
||
|
||
/* Style trybu ciemnego dla modala */
|
||
.dark-mode .modal-content {
|
||
background-color: #333;
|
||
color: #ddd;
|
||
border: none;
|
||
}
|
||
.dark-mode .modal-header,
|
||
.dark-mode .modal-footer {
|
||
border-color: #444;
|
||
}
|
||
.dark-mode .modal-title {
|
||
color: #fff;
|
||
}
|
||
.dark-mode .btn-close {
|
||
filter: invert(1);
|
||
}
|
||
|
||
/* Niestandardowy styl dla trybu jasnego – ciemniejsze, szare menu */
|
||
.navbar-light.bg-custom-light {
|
||
background-color: #dcdcdc !important;
|
||
}
|
||
|
||
.dark-mode .dataTables_wrapper .dataTables_paginate .paginate_button {
|
||
background-color: #333 !important;
|
||
color: #fff !important;
|
||
border: 1px solid #555 !important;
|
||
}
|
||
.dark-mode .dataTables_wrapper .dataTables_paginate .paginate_button.current,
|
||
.dark-mode .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
|
||
background-color: #444 !important;
|
||
color: #fff !important;
|
||
}
|
||
html.dark-mode .dataTables_wrapper .pagination .page-link {
|
||
background-color: #333 !important;
|
||
color: #fff !important;
|
||
border: 1px solid #555 !important;
|
||
}
|
||
html.dark-mode .dataTables_wrapper .pagination .page-item.active .page-link,
|
||
html.dark-mode .dataTables_wrapper .pagination .page-link:hover {
|
||
background-color: #444 !important;
|
||
color: #fff !important;
|
||
}
|
||
html.dark-mode .dataTables_wrapper .dataTables_info,
|
||
html.dark-mode .dataTables_wrapper .dataTables_length,
|
||
html.dark-mode .dataTables_wrapper .dataTables_filter {
|
||
color: #fff !important;
|
||
}
|
||
.dark-mode input:focus,
|
||
.dark-mode textarea:focus,
|
||
.dark-mode select:focus {
|
||
background-color: #333 !important;
|
||
color: #fff !important;
|
||
border-color: #555 !important;
|
||
box-shadow: none !important;
|
||
}
|
||
.dark-mode .btn-secondary:hover {
|
||
background-color: #555 !important;
|
||
border-color: #888888 !important;
|
||
color: #fff !important;
|
||
}
|
||
.dark-mode .btn-warning:hover {
|
||
background-color: #e6aa00 !important;
|
||
border-color: #c98f00 !important;
|
||
color: #fff !important;
|
||
}
|
||
.dark-mode .btn-outline-dark:hover {
|
||
background-color: #444 !important;
|
||
border-color: #888888 !important;
|
||
color: #fff !important;
|
||
}
|
||
|
||
.btn-logout {
|
||
color: #fff;
|
||
}
|
||
|
||
html, body {
|
||
height: 100%;
|
||
overflow: hidden; /* Uniknięcie przewijania na dużych ekranach */
|
||
}
|
||
|
||
.container {
|
||
display: flex;
|
||
justify-content: center;
|
||
align-items: center;
|
||
min-height: 100vh;
|
||
}
|
||
|
||
.full-height-row {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
min-height: calc(100vh - 56px);
|
||
}
|
||
</style>
|
||
|
||
{% block head %}{% endblock %}
|
||
</head>
|
||
<body>
|
||
<nav class="navbar navbar-expand-lg {% if session.get('dark_mode', True) %}navbar-dark bg-dark{% else %}navbar-light bg-custom-light{% endif %} mb-4">
|
||
<div class="container-fluid">
|
||
<a href="{{ url_for('dashboard') }}" class="navbar-brand">Backup RouterOS</a>
|
||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNavDropdown"
|
||
aria-controls="navbarNavDropdown" aria-expanded="false" aria-label="Toggle navigation">
|
||
<span class="navbar-toggler-icon"></span>
|
||
</button>
|
||
<div class="collapse navbar-collapse" id="navbarNavDropdown">
|
||
{% if session.get('user_id') %}
|
||
<ul class="navbar-nav me-auto">
|
||
<!-- Dashboard -->
|
||
<li class="nav-item">
|
||
<a class="nav-link" href="{{ url_for('dashboard') }}">Dashboard</a>
|
||
</li>
|
||
<!-- Urządzenia dropdown -->
|
||
<li class="nav-item dropdown">
|
||
<a class="nav-link dropdown-toggle" href="#" id="devicesDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
|
||
Urządzenia
|
||
</a>
|
||
<ul class="dropdown-menu" aria-labelledby="devicesDropdown">
|
||
<li><a class="dropdown-item" href="/routers">Lista</a></li>
|
||
<li><a class="dropdown-item" href="/routers/add">Dodaj nowe</a></li>
|
||
</ul>
|
||
</li>
|
||
<!-- Diff -->
|
||
<li class="nav-item">
|
||
<a class="nav-link" href="/diff_selector">Diff</a>
|
||
</li>
|
||
<!-- Wszystkie pliki -->
|
||
<li class="nav-item">
|
||
<a class="nav-link" href="/all_files">Wszystkie pliki</a>
|
||
</li>
|
||
<!-- Logi -->
|
||
<li class="nav-item">
|
||
<a class="nav-link" href="/logs">Logi</a>
|
||
</li>
|
||
<!-- Ustawienia dropdown -->
|
||
<li class="nav-item dropdown">
|
||
<a class="nav-link dropdown-toggle" href="#" id="settingsDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
|
||
Ustawienia
|
||
</a>
|
||
<ul class="dropdown-menu" aria-labelledby="settingsDropdown">
|
||
<li><a class="dropdown-item" href="/settings">Główne</a></li>
|
||
<li><a class="dropdown-item" href="/advanced_schedule">Harmonogram</a></li>
|
||
</ul>
|
||
</li>
|
||
</ul>
|
||
{% endif %}
|
||
<ul class="navbar-nav ms-auto align-items-center">
|
||
<!-- Przełącznik trybu ciemnego -->
|
||
<li class="nav-item me-2">
|
||
<form action="{{ url_for('toggle_dark_mode') }}" method="GET" class="d-flex align-items-center">
|
||
<div class="form-check form-switch mb-0">
|
||
<input class="form-check-input" type="checkbox" id="darkModeSwitch" onchange="this.form.submit()" {% if session.get('dark_mode', True) %}checked{% endif %}>
|
||
<label class="form-check-label" for="darkModeSwitch">Tryb ciemny</label>
|
||
</div>
|
||
</form>
|
||
</li>
|
||
{% if session.get('user_id') %}
|
||
<!-- Opcje dla zalogowanego użytkownika -->
|
||
<li class="nav-item">
|
||
<a class="nav-link btn btn-alert ms-2 btn-logout" href="{{ url_for('change_password') }}">Zmień hasło</a>
|
||
</li>
|
||
<li class="nav-item">
|
||
<a class="nav-link btn btn-danger ms-2 btn-logout" href="{{ url_for('logout') }}">Wyloguj</a>
|
||
</li>
|
||
{% else %}
|
||
<!-- Opcje logowania i rejestracji dla niezalogowanych -->
|
||
<li class="nav-item">
|
||
<a class="nav-link btn btn-success ms-2" href="{{ url_for('login') }}">Zaloguj się</a>
|
||
</li>
|
||
<li class="nav-item">
|
||
<a class="nav-link btn btn-primary ms-2" href="{{ url_for('register') }}">Zarejestruj się</a>
|
||
</li>
|
||
{% endif %}
|
||
</ul>
|
||
</div>
|
||
</div>
|
||
</nav>
|
||
|
||
<div class="container">
|
||
{% with messages = get_flashed_messages() %}
|
||
{% if messages %}
|
||
<div class="alert alert-info">
|
||
{% for msg in messages %}
|
||
<div>{{ msg }}</div>
|
||
{% endfor %}
|
||
</div>
|
||
{% endif %}
|
||
{% endwith %}
|
||
|
||
{% block content %}{% endblock %}
|
||
</div>
|
||
|
||
<!-- Modal Test Połączenia -->
|
||
<div class="modal fade" id="testConnectionModal" tabindex="-1" aria-labelledby="testConnectionModalLabel" aria-hidden="true">
|
||
<div class="modal-dialog modal-lg">
|
||
<div class="modal-content">
|
||
<div class="modal-header">
|
||
<h5 class="modal-title" id="testConnectionModalLabel">Test Połączenia</h5>
|
||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Zamknij"></button>
|
||
</div>
|
||
<div class="modal-body" id="testConnectionModalBody">
|
||
<!-- Zawartość zostanie załadowana przez AJAX -->
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<footer class="footer py-3 mt-auto">
|
||
<div class="container text-center">
|
||
<span>© 2025 Mateusz Gruszczyński, linuxiarz.pl</span>
|
||
</div>
|
||
</footer>
|
||
|
||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
||
<script>
|
||
function ajaxExport(router_id) {
|
||
fetch("/router/" + router_id + "/export", {
|
||
method: "POST",
|
||
headers: {"X-Requested-With": "XMLHttpRequest"}
|
||
})
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
if(data.status === "success"){
|
||
alert("Eksport wykonany: " + data.message);
|
||
} else {
|
||
alert("Błąd eksportu: " + data.message);
|
||
}
|
||
})
|
||
.catch(error => {
|
||
console.error("Błąd AJAX:", error);
|
||
alert("Wystąpił błąd.");
|
||
});
|
||
}
|
||
</script>
|
||
<script>
|
||
function openTestConnectionModal(routerId) {
|
||
fetch('/router/' + routerId + '/test_connection?modal=1')
|
||
.then(response => response.text())
|
||
.then(html => {
|
||
document.getElementById('testConnectionModalBody').innerHTML = html;
|
||
var myModal = new bootstrap.Modal(document.getElementById('testConnectionModal'));
|
||
myModal.show();
|
||
})
|
||
.catch(error => {
|
||
console.error("Błąd ładowania modalu: ", error);
|
||
alert("Wystąpił błąd podczas ładowania danych.");
|
||
});
|
||
}
|
||
</script>
|
||
{% block scripts %}{% endblock %}
|
||
</body>
|
||
</html>
|