This commit is contained in:
Mateusz Gruszczyński
2025-02-24 23:08:03 +01:00
parent 1efc3341b4
commit d1d0ccc311
38 changed files with 2251 additions and 1428 deletions

View File

@@ -1,33 +1,20 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>View Backup</title>
<style>
body { font-family: Arial, sans-serif; background: #f1f1f1; margin: 0; padding: 20px; }
.container { max-width: 800px; margin: auto; background: #fff; padding: 20px; border-radius: 8px; box-shadow: 0 0 10px #ccc; }
h1 { text-align: center; }
pre { background: #eee; padding: 10px; border-radius: 4px; overflow: auto; }
.links { text-align: center; margin-top: 20px; }
.links a { color: #007bff; text-decoration: none; margin: 0 10px; }
.links a:hover { text-decoration: underline; }
</style>
</head>
<body>
<div class="container">
<h1>Backup Preview</h1>
{% if host %}
<p><strong>Host:</strong> {{ host.hostname }} ({{ host.type }})</p>
{% else %}
<p><strong>Default configuration</strong></p>
{% endif %}
<p><strong>Description:</strong> {{ backup.description }}</p>
<p><strong>Created at:</strong> {{ backup.created_at }}</p>
<h2>Content:</h2>
<pre>{{ backup.content }}</pre>
<div class="links">
<a href="{{ url_for('backups') }}">Back to Backups</a>
</div>
</div>
</body>
</html>
{% extends "base.html" %}
{% block title %}Podgląd Backupu - /etc/hosts Manager{% endblock %}
{% block extra_css %}
{{ super() }}
<!-- Highlight.js CSS dla podświetlania składni -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.7.0/styles/default.min.css">
{% endblock %}
{% block content %}
<h2>Podgląd Backupu</h2>
<p><strong>Data:</strong> {{ backup.created_at.strftime("%Y-%m-%d %H:%M:%S") }}</p>
<p><strong>Opis:</strong> {{ backup.description }}</p>
<pre><code class="bash">{{ backup.content | e }}</code></pre>
<a href="{{ url_for('backups') }}" class="btn btn-secondary mt-3">Powrót do listy backupów</a>
{% endblock %}
{% block extra_js %}
{{ super() }}
<!-- Highlight.js JS dla podświetlania składni -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.7.0/highlight.min.js"></script>
<script>hljs.highlightAll();</script>
{% endblock %}