git status! RFACTOR TEMPLATE git status!
This commit is contained in:
@ -8,11 +8,12 @@
|
||||
<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 */
|
||||
/* 1) Poprawa kontrastu dla form-text w trybie ciemnym */
|
||||
.dark-mode .form-text {
|
||||
color: #ccc !important;
|
||||
}
|
||||
/* Ogólne style trybu ciemnego */
|
||||
|
||||
/* 2) Ogólne style trybu ciemnego */
|
||||
.dark-mode body {
|
||||
background-color: #121212;
|
||||
color: #ffffff;
|
||||
@ -21,8 +22,8 @@
|
||||
.dark-mode a:hover {
|
||||
color: #ddd;
|
||||
}
|
||||
|
||||
/* Nawigacja i menu */
|
||||
|
||||
/* 3) Nawigacja i menu w trybie ciemnym */
|
||||
.dark-mode .navbar,
|
||||
.dark-mode .navbar-nav,
|
||||
.dark-mode .dropdown-menu {
|
||||
@ -35,15 +36,15 @@
|
||||
.dark-mode .navbar-nav .nav-link:hover {
|
||||
color: #fff !important;
|
||||
}
|
||||
/* Nowa reguła dla elementów dropdown po najechaniu */
|
||||
/* Dropdown :hover, :focus, active */
|
||||
.dark-mode .dropdown-item:hover,
|
||||
.dark-mode .dropdown-item:focus,
|
||||
.dark-mode .dropdown-item.active {
|
||||
background-color: #444 !important;
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
/* Tabele */
|
||||
|
||||
/* 4) Tabele w trybie ciemnym */
|
||||
.dark-mode .table {
|
||||
background-color: #333 !important;
|
||||
border-color: #444;
|
||||
@ -67,7 +68,8 @@
|
||||
color: #ddd !important;
|
||||
border: 1px solid #555 !important;
|
||||
}
|
||||
/* Pola formularzy */
|
||||
|
||||
/* 5) Pola formularzy (input, select, textarea) w trybie ciemnym */
|
||||
.dark-mode input,
|
||||
.dark-mode textarea,
|
||||
.dark-mode select {
|
||||
@ -78,26 +80,42 @@
|
||||
.dark-mode ::placeholder {
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
/* Przyciski - poprawiony kontrast dla btn-warning */
|
||||
|
||||
/* 6) Przyciski w trybie ciemnym: .btn-warning, .btn-secondary, .btn-outline-dark */
|
||||
.dark-mode .btn-warning {
|
||||
background-color: #d39e00;
|
||||
border-color: #b38600;
|
||||
color: #fff;
|
||||
}
|
||||
.dark-mode .btn-warning:hover {
|
||||
background-color: #e6aa00 !important;
|
||||
border-color: #c98f00 !important;
|
||||
color: #fff !important;
|
||||
}
|
||||
.dark-mode .btn-secondary {
|
||||
background-color: #444;
|
||||
border-color: #555;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
/* Bloki (np. zawartość kontenera, karty) */
|
||||
.dark-mode .block, .dark-mode .card {
|
||||
.dark-mode .btn-secondary:hover {
|
||||
background-color: #555 !important;
|
||||
border-color: #888888 !important;
|
||||
color: #fff !important;
|
||||
}
|
||||
.dark-mode .btn-outline-dark:hover {
|
||||
background-color: #444 !important;
|
||||
border-color: #888888 !important;
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
/* 7) Karty i bloki w trybie ciemnym */
|
||||
.dark-mode .block,
|
||||
.dark-mode .card {
|
||||
background-color: #171717;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
/* Stopka */
|
||||
|
||||
/* 8) Stopka */
|
||||
.dark-mode footer {
|
||||
background-color: #1e1e1e !important;
|
||||
color: #fff !important;
|
||||
@ -106,12 +124,14 @@
|
||||
background-color: #f8f9fa;
|
||||
color: #212529;
|
||||
}
|
||||
|
||||
/* Alerty – pozostają bez zmian */
|
||||
.diff-add { color: green; }
|
||||
.diff-rem { color: red; }
|
||||
|
||||
/* Dodatkowe nadpisanie styli diff2html w trybie ciemnym */
|
||||
/* 9) Nadpisanie .card-header.bg-light w trybie ciemnym */
|
||||
.dark-mode .card-header.bg-light {
|
||||
background-color: #333 !important;
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
/* 10) Style diff2html w trybie ciemnym */
|
||||
.dark-mode .d2h-wrapper,
|
||||
.dark-mode .d2h-file-header,
|
||||
.dark-mode .d2h-file-info,
|
||||
@ -125,7 +145,7 @@
|
||||
border-color: #444 !important;
|
||||
}
|
||||
|
||||
/* Style trybu ciemnego dla modala */
|
||||
/* 11) Modal w trybie ciemnym */
|
||||
.dark-mode .modal-content {
|
||||
background-color: #333;
|
||||
color: #ddd;
|
||||
@ -142,11 +162,12 @@
|
||||
filter: invert(1);
|
||||
}
|
||||
|
||||
/* Niestandardowy styl dla trybu jasnego – ciemniejsze, szare menu */
|
||||
/* 12) Niestandardowy styl trybu jasnego – navbar */
|
||||
.navbar-light.bg-custom-light {
|
||||
background-color: #dcdcdc !important;
|
||||
}
|
||||
|
||||
/* 13) DataTables w trybie ciemnym */
|
||||
.dark-mode .dataTables_wrapper .dataTables_paginate .paginate_button {
|
||||
background-color: #333 !important;
|
||||
color: #fff !important;
|
||||
@ -180,48 +201,46 @@
|
||||
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;
|
||||
}
|
||||
|
||||
/* 14) Drobne poprawki przycisków wylogowania */
|
||||
.btn-logout {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
/* Ustawienia globalne */
|
||||
|
||||
/* 15) Główne ustawienia, flex layout */
|
||||
html, body {
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
body {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-height: 100vh;
|
||||
}
|
||||
/* Wrapper głównej zawartości, który rośnie, aby wypełnić przestrzeń */
|
||||
.wrapper {
|
||||
main.container {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
/* 16) Alerty (diff-add, diff-rem) – pozostawione bez zmian */
|
||||
.diff-add { color: green; }
|
||||
.diff-rem { color: red; }
|
||||
|
||||
.dark-mode .text-muted {
|
||||
color: #aaa !important; /* zamiast #aaa możesz wybrać #bbb, #ccc itp. */
|
||||
}
|
||||
|
||||
</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">
|
||||
<body class="d-flex flex-column">
|
||||
<!-- Navbar -->
|
||||
<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> -->
|
||||
<a href="/" class="navbar-brand">Backup RouterOS</a>
|
||||
<a href="/" 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>
|
||||
@ -267,18 +286,22 @@
|
||||
</li>
|
||||
</ul>
|
||||
{% endif %}
|
||||
|
||||
<!-- Prawa strona navbaru -->
|
||||
<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>
|
||||
<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 ms-1" for="darkModeSwitch" style="user-select:none;">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>
|
||||
@ -286,7 +309,6 @@
|
||||
<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>
|
||||
@ -298,20 +320,29 @@
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<div class="container">
|
||||
{% with messages = get_flashed_messages() %}
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Główna zawartość -->
|
||||
<main class="container mb-5">
|
||||
|
||||
|
||||
{% with messages = get_flashed_messages(with_categories=true) %}
|
||||
{% if messages %}
|
||||
<div class="alert alert-info">
|
||||
{% for msg in messages %}
|
||||
<div>{{ msg }}</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% for category, msg in messages %}
|
||||
{% set bs_cat = bootstrap_alert_category(category) %}
|
||||
<div class="alert alert-{{ bs_cat }} alert-dismissible fade show" role="alert">
|
||||
{{ msg }}
|
||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
|
||||
|
||||
{% block content %}{% endblock %}
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<!-- Modal Test Połączenia -->
|
||||
<div class="modal fade" id="testConnectionModal" tabindex="-1" aria-labelledby="testConnectionModalLabel" aria-hidden="true">
|
||||
@ -322,40 +353,25 @@
|
||||
<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 -->
|
||||
<!-- Zawartość ładowana przez AJAX -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Stopka -->
|
||||
<footer class="footer py-3 mt-auto">
|
||||
<div class="container text-center">
|
||||
<span>© 2025 Mateusz Gruszczyński, linuxiarz.pl</span>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<!-- Bootstrap Bundle JS -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
||||
|
||||
<!-- Dodatkowe skrypty -->
|
||||
<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>
|
||||
// Funkcja do wczytywania modalu testu połączenia
|
||||
function openTestConnectionModal(routerId) {
|
||||
fetch('/router/' + routerId + '/test_connection?modal=1')
|
||||
.then(response => response.text())
|
||||
@ -370,6 +386,7 @@
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
{% block scripts %}{% endblock %}
|
||||
</body>
|
||||
</html>
|
||||
|
Reference in New Issue
Block a user