git status! RFACTOR TEMPLATE git status!
This commit is contained in:
@ -1,17 +1,17 @@
|
||||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
<div class="text-end mb-3">
|
||||
{% if current_view == 'v1' %}
|
||||
<a href="{{ url_for('router_details', router_id=router.id, view='v2') }}" class="btn btn-outline-secondary">Przełącz na widok v2</a>
|
||||
{% else %}
|
||||
<a href="{{ url_for('router_details', router_id=router.id, view='v1') }}" class="btn btn-outline-secondary">Przełącz na widok v1</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="container my-4">
|
||||
<!-- Informacje o routerze -->
|
||||
<div class="card shadow-sm mb-4">
|
||||
<div class="card-header">
|
||||
<h2 class="mb-0">Router: {{ router.name }}</h2>
|
||||
<div class="mb-3 text-end">
|
||||
{% if current_view == 'v1' %}
|
||||
<a href="{{ url_for('router_details', router_id=router.id, view='v2') }}" class="btn btn-outline-secondary">Przełącz na widok v2</a>
|
||||
{% else %}
|
||||
<a href="{{ url_for('router_details', router_id=router.id, view='v1') }}" class="btn btn-outline-secondary">Przełącz na widok v1</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="card border-0 shadow-sm mb-4">
|
||||
<div class="card-header bg-light">
|
||||
<h4 class="mb-0">Router: {{ router.name }}</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<p>
|
||||
@ -20,7 +20,6 @@
|
||||
<strong>SSH User:</strong> {{ router.ssh_user }}
|
||||
</p>
|
||||
<div class="d-flex flex-wrap gap-2">
|
||||
<!-- Mniejsze przyciski górne -->
|
||||
<form action="{{ url_for('router_export', router_id=router.id) }}" method="POST" class="d-inline">
|
||||
<button type="submit" class="btn btn-primary btn-sm">Wykonaj /export</button>
|
||||
</form>
|
||||
@ -35,16 +34,21 @@
|
||||
<!-- Zakładki z backupami -->
|
||||
<ul class="nav nav-tabs" id="routerTab" role="tablist">
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link active" id="export-tab" data-bs-toggle="tab" data-bs-target="#export" type="button" role="tab" aria-controls="export" aria-selected="true">Pliki /export</button>
|
||||
<button class="nav-link active" id="export-tab" data-bs-toggle="tab" data-bs-target="#export" type="button" role="tab" aria-controls="export" aria-selected="true">
|
||||
Pliki /export
|
||||
</button>
|
||||
</li>
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link" id="binary-tab" data-bs-toggle="tab" data-bs-target="#binary" type="button" role="tab" aria-controls="binary" aria-selected="false">Pliki binarne</button>
|
||||
<button class="nav-link" id="binary-tab" data-bs-toggle="tab" data-bs-target="#binary" type="button" role="tab" aria-controls="binary" aria-selected="false">
|
||||
Pliki binarne
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content" id="routerTabContent">
|
||||
<!-- Zakładka /export -->
|
||||
<div class="tab-pane fade show active" id="export" role="tabpanel" aria-labelledby="export-tab">
|
||||
<div class="card mt-3 shadow-sm">
|
||||
<div class="card mt-3 shadow-sm border-0">
|
||||
<div class="card-body">
|
||||
{% if export_backups %}
|
||||
<!-- Formularz masowych akcji dla eksportów -->
|
||||
@ -55,68 +59,68 @@
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
<!-- Tabela z eksportami -->
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-striped">
|
||||
<thead class="table-dark">
|
||||
<tr>
|
||||
<th style="width: 3%;"><input type="checkbox" id="select_all_export"></th>
|
||||
<th>Nazwa pliku</th>
|
||||
<th>Rozmiar</th>
|
||||
<th>Data</th>
|
||||
<th>Diff</th>
|
||||
<th>Pobierz</th>
|
||||
<th>Podgląd</th>
|
||||
<th>Wyślij mailem</th>
|
||||
<th>Usuń</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for b in export_backups %}
|
||||
<tr>
|
||||
<td>
|
||||
<input type="checkbox" name="backup_id" value="{{ b.id }}" form="export_mass_actions_form">
|
||||
</td>
|
||||
<td>{{ b.file_path|basename }}</td>
|
||||
<td>{{ b.file_path|filesize }}</td>
|
||||
<td>{{ b.created_at.strftime("%Y-%m-%d %H:%M:%S") }}</td>
|
||||
<td>
|
||||
{% if loop.index0 > 0 %}
|
||||
<a href="{{ url_for('diff_view', backup_id1=b.id, backup_id2=export_backups[0].id) }}" class="btn btn-sm btn-info">Diff</a>
|
||||
{% else %}
|
||||
<small>Brak nowszego</small>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
<a href="{{ url_for('download_file', filename=b.file_path|basename) }}" class="btn btn-info btn-sm" title="Pobierz">
|
||||
<i class="bi bi-download"></i>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="{{ url_for('view_export', backup_id=b.id) }}" class="btn btn-outline-primary btn-sm" title="Podgląd">
|
||||
<i class="bi bi-eye"></i>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<form action="{{ url_for('send_by_email', backup_id=b.id) }}" method="POST" class="d-inline">
|
||||
<input type="hidden" name="next" value="{{ url_for('router_details', router_id=router.id) }}">
|
||||
<button type="submit" class="btn btn-primary btn-sm" title="Wyślij mailem">
|
||||
<i class="bi bi-envelope"></i>
|
||||
</button>
|
||||
</form>
|
||||
</td>
|
||||
<td>
|
||||
<form action="{{ url_for('delete_backup', backup_id=b.id) }}" method="POST" class="d-inline" onsubmit="return confirm('Na pewno usunąć backup?');">
|
||||
<input type="hidden" name="next" value="{{ url_for('router_details', router_id=router.id) }}">
|
||||
<button type="submit" class="btn btn-danger btn-sm" title="Usuń">
|
||||
<i class="bi bi-trash"></i>
|
||||
</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="table table-bordered table-striped align-middle">
|
||||
<thead class="table-dark">
|
||||
<tr>
|
||||
<th style="width: 3%;"><input type="checkbox" id="select_all_export"></th>
|
||||
<th>Nazwa pliku</th>
|
||||
<th>Rozmiar</th>
|
||||
<th>Data</th>
|
||||
<th>Diff</th>
|
||||
<th>Pobierz</th>
|
||||
<th>Podgląd</th>
|
||||
<th>Wyślij mailem</th>
|
||||
<th>Usuń</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for b in export_backups %}
|
||||
<tr>
|
||||
<td>
|
||||
<input type="checkbox" name="backup_id" value="{{ b.id }}" form="export_mass_actions_form">
|
||||
</td>
|
||||
<td>{{ b.file_path|basename }}</td>
|
||||
<td>{{ b.file_path|filesize }}</td>
|
||||
<td>{{ b.created_at.strftime("%Y-%m-%d %H:%M:%S") }}</td>
|
||||
<td>
|
||||
{% if loop.index0 > 0 %}
|
||||
<a href="{{ url_for('diff_view', backup_id1=b.id, backup_id2=export_backups[0].id) }}" class="btn btn-sm btn-info">Diff</a>
|
||||
{% else %}
|
||||
<small>Brak nowszego</small>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
<a href="{{ url_for('download_file', filename=b.file_path|basename) }}" class="btn btn-info btn-sm" title="Pobierz">
|
||||
<i class="bi bi-download"></i>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="{{ url_for('view_export', backup_id=b.id) }}" class="btn btn-outline-primary btn-sm" title="Podgląd">
|
||||
<i class="bi bi-eye"></i>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<form action="{{ url_for('send_by_email', backup_id=b.id) }}" method="POST" class="d-inline">
|
||||
<input type="hidden" name="next" value="{{ url_for('router_details', router_id=router.id) }}">
|
||||
<button type="submit" class="btn btn-primary btn-sm" title="Wyślij mailem">
|
||||
<i class="bi bi-envelope"></i>
|
||||
</button>
|
||||
</form>
|
||||
</td>
|
||||
<td>
|
||||
<form action="{{ url_for('delete_backup', backup_id=b.id) }}" method="POST" class="d-inline" onsubmit="return confirm('Na pewno usunąć backup?');">
|
||||
<input type="hidden" name="next" value="{{ url_for('router_details', router_id=router.id) }}">
|
||||
<button type="submit" class="btn btn-danger btn-sm" title="Usuń">
|
||||
<i class="bi bi-trash"></i>
|
||||
</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% else %}
|
||||
<p class="text-muted">Brak plików /export.</p>
|
||||
@ -124,9 +128,10 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Zakładka backupów binarnych -->
|
||||
<div class="tab-pane fade" id="binary" role="tabpanel" aria-labelledby="binary-tab">
|
||||
<div class="card mt-3 shadow-sm">
|
||||
<div class="card mt-3 shadow-sm border-0">
|
||||
<div class="card-body">
|
||||
{% if binary_backups %}
|
||||
<!-- Formularz masowych akcji dla backupów binarnych -->
|
||||
@ -137,64 +142,63 @@
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
<!-- Tabela z backupami binarnymi -->
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-striped">
|
||||
<thead class="table-dark">
|
||||
<tr>
|
||||
<th style="width: 3%;"><input type="checkbox" id="select_all_binary"></th>
|
||||
<th>Nazwa pliku</th>
|
||||
<th>Rozmiar</th>
|
||||
<th>Data</th>
|
||||
<th>Pobierz</th>
|
||||
<th>Wgraj do routera</th>
|
||||
<th>Wyślij mailem</th>
|
||||
<th>Usuń</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for b in binary_backups %}
|
||||
<tr>
|
||||
<td>
|
||||
<input type="checkbox" name="backup_id" value="{{ b.id }}" form="binary_mass_actions_form">
|
||||
</td>
|
||||
<td>
|
||||
<!-- Dodaj tooltip z sumą kontrolną -->
|
||||
<span data-bs-toggle="tooltip" title="Checksum: {{ b.checksum }}">{{ b.file_path|basename }}</span>
|
||||
</td>
|
||||
<td>{{ b.file_path|filesize }}</td>
|
||||
<td>{{ b.created_at.strftime("%Y-%m-%d %H:%M:%S") }}</td>
|
||||
<td>
|
||||
<a href="{{ url_for('download_file', filename=b.file_path|basename) }}" class="btn btn-info btn-sm" title="Pobierz">
|
||||
<i class="bi bi-download"></i>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<form action="{{ url_for('upload_backup', router_id=router.id, backup_id=b.id) }}" method="POST" class="d-inline">
|
||||
<button type="submit" class="btn btn-secondary btn-sm" title="Wgraj do routera">
|
||||
<i class="bi bi-upload"></i>
|
||||
</button>
|
||||
</form>
|
||||
</td>
|
||||
<td>
|
||||
<form action="{{ url_for('send_by_email', backup_id=b.id) }}" method="POST" class="d-inline">
|
||||
<button type="submit" class="btn btn-primary btn-sm" title="Wyślij mailem">
|
||||
<i class="bi bi-envelope"></i>
|
||||
</button>
|
||||
</form>
|
||||
</td>
|
||||
<td>
|
||||
<form action="{{ url_for('delete_backup', backup_id=b.id) }}" method="POST" class="d-inline" onsubmit="return confirm('Na pewno usunąć backup?');">
|
||||
<input type="hidden" name="next" value="{{ url_for('router_details', router_id=router.id) }}">
|
||||
<button type="submit" class="btn btn-danger btn-sm" title="Usuń">
|
||||
<i class="bi bi-trash"></i>
|
||||
</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="table table-bordered table-striped align-middle">
|
||||
<thead class="table-dark">
|
||||
<tr>
|
||||
<th style="width: 3%;"><input type="checkbox" id="select_all_binary"></th>
|
||||
<th>Nazwa pliku</th>
|
||||
<th>Rozmiar</th>
|
||||
<th>Data</th>
|
||||
<th>Pobierz</th>
|
||||
<th>Wgraj do routera</th>
|
||||
<th>Wyślij mailem</th>
|
||||
<th>Usuń</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for b in binary_backups %}
|
||||
<tr>
|
||||
<td>
|
||||
<input type="checkbox" name="backup_id" value="{{ b.id }}" form="binary_mass_actions_form">
|
||||
</td>
|
||||
<td>
|
||||
<span data-bs-toggle="tooltip" title="Checksum: {{ b.checksum }}">{{ b.file_path|basename }}</span>
|
||||
</td>
|
||||
<td>{{ b.file_path|filesize }}</td>
|
||||
<td>{{ b.created_at.strftime("%Y-%m-%d %H:%M:%S") }}</td>
|
||||
<td>
|
||||
<a href="{{ url_for('download_file', filename=b.file_path|basename) }}" class="btn btn-info btn-sm" title="Pobierz">
|
||||
<i class="bi bi-download"></i>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<form action="{{ url_for('upload_backup', router_id=router.id, backup_id=b.id) }}" method="POST" class="d-inline">
|
||||
<button type="submit" class="btn btn-secondary btn-sm" title="Wgraj do routera">
|
||||
<i class="bi bi-upload"></i>
|
||||
</button>
|
||||
</form>
|
||||
</td>
|
||||
<td>
|
||||
<form action="{{ url_for('send_by_email', backup_id=b.id) }}" method="POST" class="d-inline">
|
||||
<button type="submit" class="btn btn-primary btn-sm" title="Wyślij mailem">
|
||||
<i class="bi bi-envelope"></i>
|
||||
</button>
|
||||
</form>
|
||||
</td>
|
||||
<td>
|
||||
<form action="{{ url_for('delete_backup', backup_id=b.id) }}" method="POST" class="d-inline" onsubmit="return confirm('Na pewno usunąć backup?');">
|
||||
<input type="hidden" name="next" value="{{ url_for('router_details', router_id=router.id) }}">
|
||||
<button type="submit" class="btn btn-danger btn-sm" title="Usuń">
|
||||
<i class="bi bi-trash"></i>
|
||||
</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% else %}
|
||||
<p class="text-muted">Brak plików binarnych.</p>
|
||||
@ -216,7 +220,7 @@ document.getElementById('select_all_binary').addEventListener('change', function
|
||||
checkboxes.forEach(cb => cb.checked = e.target.checked);
|
||||
});
|
||||
|
||||
// Inicjalizacja zakładek Bootstrap (jeśli nie są już inicjowane globalnie)
|
||||
// Inicjalizacja zakładek Bootstrap
|
||||
var triggerTabList = [].slice.call(document.querySelectorAll('#routerTab button'));
|
||||
triggerTabList.forEach(function (triggerEl) {
|
||||
var tabTrigger = new bootstrap.Tab(triggerEl);
|
||||
@ -226,7 +230,7 @@ triggerTabList.forEach(function (triggerEl) {
|
||||
});
|
||||
});
|
||||
|
||||
// Inicjalizacja tooltipów Bootstrap
|
||||
// Inicjalizacja tooltipów
|
||||
var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'));
|
||||
tooltipTriggerList.forEach(function (tooltipTriggerEl) {
|
||||
new bootstrap.Tooltip(tooltipTriggerEl);
|
||||
|
Reference in New Issue
Block a user