male zmoiany w css

This commit is contained in:
Mateusz Gruszczyński 2025-02-25 22:14:23 +01:00
parent ac2c9415c0
commit a8d00cc807

View File

@ -2,11 +2,16 @@
<html lang="pl" class="{% if session.get('dark_mode', True) %}dark-mode{% endif %}"> <html lang="pl" class="{% if session.get('dark_mode', True) %}dark-mode{% endif %}">
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<title>Backup RouterOS App</title> <meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Backup RouterOS</title>
<!-- Bootstrap CSS --> <!-- Bootstrap CSS -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet"> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
<style> <style>
/* Poprawa kontrastu dla form-text w trybie ciemnym */
.dark-mode .form-text {
color: #ccc !important;
}
/* Ogólne style trybu ciemnego */ /* Ogólne style trybu ciemnego */
.dark-mode body { .dark-mode body {
background-color: #121212; background-color: #121212;
@ -30,6 +35,13 @@
.dark-mode .navbar-nav .nav-link:hover { .dark-mode .navbar-nav .nav-link:hover {
color: #fff !important; 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 */ /* Tabele */
.dark-mode .table { .dark-mode .table {
@ -50,7 +62,6 @@
color: #fff !important; color: #fff !important;
border: 1px solid #555 !important; border: 1px solid #555 !important;
} }
html.dark-mode table.table tbody td { html.dark-mode table.table tbody td {
background-color: #333 !important; background-color: #333 !important;
color: #ddd !important; color: #ddd !important;
@ -91,6 +102,10 @@
background-color: #1e1e1e !important; background-color: #1e1e1e !important;
color: #fff !important; color: #fff !important;
} }
footer {
background-color: #f8f9fa;
color: #212529;
}
/* Alerty pozostają bez zmian */ /* Alerty pozostają bez zmian */
.diff-add { color: green; } .diff-add { color: green; }
@ -129,7 +144,7 @@
/* Niestandardowy styl dla trybu jasnego ciemniejsze, szare menu */ /* Niestandardowy styl dla trybu jasnego ciemniejsze, szare menu */
.navbar-light.bg-custom-light { .navbar-light.bg-custom-light {
background-color: #dcdcdc !important; /* Gainsboro nieco ciemniejszy szary odcień */ background-color: #dcdcdc !important;
} }
.dark-mode .dataTables_wrapper .dataTables_paginate .paginate_button { .dark-mode .dataTables_wrapper .dataTables_paginate .paginate_button {
@ -137,95 +152,123 @@
color: #fff !important; color: #fff !important;
border: 1px solid #555 !important; border: 1px solid #555 !important;
} }
.dark-mode .dataTables_wrapper .dataTables_paginate .paginate_button.current, .dark-mode .dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dark-mode .dataTables_wrapper .dataTables_paginate .paginate_button:hover { .dark-mode .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
background-color: #444 !important; background-color: #444 !important;
color: #fff !important; color: #fff !important;
} }
/* paginacja */
html.dark-mode .dataTables_wrapper .pagination .page-link { html.dark-mode .dataTables_wrapper .pagination .page-link {
background-color: #333 !important; background-color: #333 !important;
color: #fff !important; color: #fff !important;
border: 1px solid #555 !important; border: 1px solid #555 !important;
} }
html.dark-mode .dataTables_wrapper .pagination .page-item.active .page-link, html.dark-mode .dataTables_wrapper .pagination .page-item.active .page-link,
html.dark-mode .dataTables_wrapper .pagination .page-link:hover { html.dark-mode .dataTables_wrapper .pagination .page-link:hover {
background-color: #444 !important; background-color: #444 !important;
color: #fff !important; color: #fff !important;
} }
html.dark-mode .dataTables_wrapper .dataTables_info, html.dark-mode .dataTables_wrapper .dataTables_info,
html.dark-mode .dataTables_wrapper .dataTables_length, html.dark-mode .dataTables_wrapper .dataTables_length,
html.dark-mode .dataTables_wrapper .dataTables_filter { html.dark-mode .dataTables_wrapper .dataTables_filter {
color: #fff !important; color: #fff !important;
} }
/* pola w formularzach */
.dark-mode input:focus, .dark-mode input:focus,
.dark-mode textarea:focus, .dark-mode textarea:focus,
dark-mode select:focus { .dark-mode select:focus {
background-color: #333 !important; background-color: #333 !important;
color: #fff !important; color: #fff !important;
border-color: #555 !important; border-color: #555 !important;
box-shadow: none !important; box-shadow: none !important;
} }
.dark-mode .btn-secondary:hover { .dark-mode .btn-secondary:hover {
background-color: #555 !important; background-color: #555 !important;
border-color: #888888 !important; border-color: #888888 !important;
color: #fff !important; color: #fff !important;
} }
.dark-mode .btn-warning:hover { .dark-mode .btn-warning:hover {
background-color: #e6aa00 !important; background-color: #e6aa00 !important;
border-color: #c98f00 !important; border-color: #c98f00 !important;
color: #fff !important; color: #fff !important;
} }
.dark-mode .btn-outline-dark:hover { .dark-mode .btn-outline-dark:hover {
background-color: #444 !important; background-color: #444 !important;
border-color: #888888 !important; border-color: #888888 !important;
color: #fff !important; color: #fff !important;
} }
.btn-logout {
color: #fff;
}
</style>
</style>
<!-- Blok head umożliwiający dołączenie dodatkowych stylów -->
{% block head %}{% endblock %} {% block head %}{% endblock %}
</head> </head>
<body> <body>
<nav class="navbar navbar-expand {% if session.get('dark_mode', True) %}navbar-dark bg-dark{% else %}navbar-light bg-custom-light{% endif %} mb-4"> <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"> <div class="container-fluid">
<a href="{{ url_for('index') }}" class="navbar-brand">RouterOS Backup</a> <a href="{{ url_for('dashboard') }}" class="navbar-brand">Backup RouterOS</a>
<!-- Przełącznik trybu ciemnego umieszczony przed menu --> <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNavDropdown"
<form action="{{ url_for('toggle_dark_mode') }}" method="GET" class="d-flex align-items-center me-2"> aria-controls="navbarNavDropdown" aria-expanded="false" aria-label="Toggle navigation">
<div class="form-check form-switch mb-0"> <span class="navbar-toggler-icon"></span>
<input class="form-check-input" type="checkbox" id="darkModeSwitch" onchange="this.form.submit()" {% if session.get('dark_mode', True) %}checked{% endif %}> </button>
<label class="form-check-label" for="darkModeSwitch">Tryb ciemny</label> <div class="collapse navbar-collapse" id="navbarNavDropdown">
</div> <ul class="navbar-nav me-auto">
</form> <!-- Dashboard -->
{% set btn_class = "btn-secondary" if session.get('dark_mode', True) else "btn-outline-dark" %} <li class="nav-item">
<div class="d-flex align-items-center"> <a class="nav-link" href="{{ url_for('dashboard') }}">Dashboard</a>
{% if session.user_id %} </li>
<a href="{{ url_for('dashboard') }}" class="btn {{ btn_class }} me-2">Dashboard</a> <!-- Urządzenia dropdown -->
<a href="{{ url_for('routers_list') }}" class="btn {{ btn_class }} me-2">Urządzenia</a> <li class="nav-item dropdown">
<a href="{{ url_for('diff_selector') }}" class="btn {{ btn_class }} me-2">Diff selector</a> <a class="nav-link dropdown-toggle" href="#" id="devicesDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
<a href="{{ url_for('all_files') }}" class="btn {{ btn_class }} me-2">Wszystkie pliki</a> Urządzenia
<a href="{{ url_for('logs_page') }}" class="btn {{ btn_class }} me-2">Logi</a> </a>
<a href="{{ url_for('settings_view') }}" class="btn {{ btn_class }} me-2">Ustawienia</a> <ul class="dropdown-menu" aria-labelledby="devicesDropdown">
<a href="{{ url_for('advanced_schedule') }}" class="btn {{ btn_class }} me-2">Harmonogram</a> <li><a class="dropdown-item" href="/routers">Lista</a></li>
<a href="{{ url_for('change_password') }}" class="btn {{ btn_class }} me-2">Zmiana hasła</a> <li><a class="dropdown-item" href="/routers/add">Dodaj nowe</a></li>
<a href="{{ url_for('logout') }}" class="btn {{ btn_class }} me-2">Wyloguj</a> </ul>
{% else %} </li>
<a href="{{ url_for('login') }}" class="btn {{ btn_class }} me-2">Zaloguj</a> <!-- Diff -->
<a href="{{ url_for('register') }}" class="btn {{ btn_class }} me-2">Utwórz konto</a> <li class="nav-item">
{% endif %} <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>
<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>
<!-- Zmień hasło -->
<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>
<!-- Wyloguj -->
<li class="nav-item">
<a class="nav-link btn btn-danger ms-2 btn-logout" href="{{ url_for('logout') }}">Wyloguj</a>
</li>
</ul>
</div> </div>
</div> </div>
</nav> </nav>
@ -301,7 +344,6 @@
}); });
} }
</script> </script>
<!-- Blok scripts umożliwiający dołączenie dodatkowych skryptów -->
{% block scripts %}{% endblock %} {% block scripts %}{% endblock %}
</body> </body>
</html> </html>