routeros_backup/templates/settings.html
2025-02-28 16:26:27 +01:00

93 lines
4.3 KiB
HTML

{% extends "base.html" %}
{% block content %}
<div class="container my-4">
<div class="card border-0 shadow-sm">
<div class="card-header bg-light">
<h4 class="mb-0">Ustawienia globalne</h4>
</div>
<div class="card-body">
<form method="POST">
<!-- Sekcja Pushover -->
<div class="mb-4">
<h5 class="mb-3">Powiadomienia - Pushover</h5>
<div class="mb-3">
<label for="pushover_token" class="form-label">Pushover Token</label>
<input type="text" class="form-control" id="pushover_token" name="pushover_token" value="{{ settings.pushover_token }}">
</div>
<div class="mb-3">
<label for="pushover_userkey" class="form-label">Pushover User Key</label>
<input type="text" class="form-control" id="pushover_userkey" name="pushover_userkey" value="{{ settings.pushover_userkey }}">
</div>
<div class="form-check">
<input type="checkbox" class="form-check-input" id="notify_failures_only" name="notify_failures_only" value="True" {% if settings.notify_failures_only %}checked{% endif %}>
<label class="form-check-label" for="notify_failures_only">Wysyłaj powiadomienia tylko o błędach</label>
</div>
</div>
<hr>
<!-- Sekcja SMTP -->
<div class="mb-4">
<h5 class="mb-3">Powiadomienia - SMTP (e-mail)</h5>
<div class="form-check mb-3">
<input type="checkbox" class="form-check-input" id="smtp_notifications_enabled" name="smtp_notifications_enabled" {% if settings.smtp_notifications_enabled %}checked{% endif %}>
<label class="form-check-label" for="smtp_notifications_enabled">Włącz powiadomienia SMTP</label>
</div>
<div class="mb-3">
<label for="smtp_host" class="form-label">SMTP Host</label>
<input type="text" class="form-control" id="smtp_host" name="smtp_host" value="{{ settings.smtp_host }}">
</div>
<div class="mb-3">
<label for="smtp_port" class="form-label">SMTP Port</label>
<input type="number" class="form-control" id="smtp_port" name="smtp_port" value="{{ settings.smtp_port }}">
</div>
<div class="mb-3">
<label for="smtp_login" class="form-label">SMTP Login / Adres</label>
<input type="text" class="form-control" id="smtp_login" name="smtp_login" value="{{ settings.smtp_login }}">
</div>
<div class="mb-3">
<label for="smtp_password" class="form-label">SMTP Hasło</label>
<input type="password" class="form-control" id="smtp_password" name="smtp_password" value="{{ settings.smtp_password }}">
</div>
<div class="mb-3">
<label for="recipient_email" class="form-label">Adres e-mail docelowy</label>
<input type="email" class="form-control" id="recipient_email" name="recipient_email" value="{{ settings.recipient_email }}">
</div>
</div>
<hr>
<!-- Sekcja globalnego klucza SSH -->
<div class="mb-4">
<h5 class="mb-3">Globalny klucz SSH</h5>
<label for="global_ssh_key" class="form-label">
Wklej wraz z <code>-----BEGIN RSA PRIVATE KEY-----</code> i <code>-----END RSA PRIVATE KEY-----</code>
</label>
<textarea class="form-control" id="global_ssh_key" name="global_ssh_key" rows="4">{{ settings.global_ssh_key }}</textarea>
</div>
<div class="d-grid">
<button type="submit" class="btn btn-primary btn-lg">Zapisz ustawienia</button>
</div>
</form>
<!-- Przycisk do testowania powiadomień -->
<div class="mt-4 text-center">
<form method="POST" action="{{ url_for('test_email') }}" class="d-inline">
<button type="submit" class="btn btn-info">Testuj wysyłkę e-mail</button>
</form>
<form method="POST" action="{{ url_for('test_pushover') }}" class="d-inline ms-2">
<button type="submit" class="btn btn-warning">Testuj powiadomienie Pushover</button>
</form>
</div>
</div>
<div class="card-footer text-center">
<p class="mb-0">
Ustawienia harmonogramu i retencji:
<a href="{{ url_for('advanced_schedule') }}">Zaawansowane ustawienia</a>
</p>
</div>
</div>
</div>
{% endblock %}