| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- {% extends "base.html" %}
- {% block title %}Paramètres{% endblock %}
- {% block content %}
- <div class="max-w-xl">
- <h1 class="text-xl font-bold text-gray-900 mb-6">Paramètres</h1>
- <form method="post" class="space-y-6">
- <div class="bg-white rounded-xl border border-gray-200 p-6 space-y-4">
- <h2 class="text-sm font-semibold text-gray-700 uppercase tracking-wide">Serveur SMTP</h2>
- <div class="grid grid-cols-3 gap-3">
- <div class="col-span-2">
- <label class="block text-sm font-medium text-gray-700 mb-1">Hôte SMTP</label>
- <input type="text" name="smtp_host" value="{{ cfg.smtp_host }}"
- placeholder="smtp.exemple.fr"
- class="w-full border border-gray-300 rounded-lg px-3 py-2 text-sm font-mono focus:outline-none focus:ring-2 focus:ring-blue-500">
- </div>
- <div>
- <label class="block text-sm font-medium text-gray-700 mb-1">Port</label>
- <input type="number" name="smtp_port" min="1" max="65535"
- value="{{ cfg.smtp_port or 587 }}"
- class="w-full border border-gray-300 rounded-lg px-3 py-2 text-sm font-mono focus:outline-none focus:ring-2 focus:ring-blue-500">
- </div>
- </div>
- <div class="grid grid-cols-2 gap-3">
- <div>
- <label class="block text-sm font-medium text-gray-700 mb-1">Utilisateur</label>
- <input type="text" name="smtp_user" value="{{ cfg.smtp_user }}"
- placeholder="user@exemple.fr"
- class="w-full border border-gray-300 rounded-lg px-3 py-2 text-sm font-mono focus:outline-none focus:ring-2 focus:ring-blue-500">
- </div>
- <div>
- <label class="block text-sm font-medium text-gray-700 mb-1">Mot de passe</label>
- <input type="password" name="smtp_password" value="{{ cfg.smtp_password }}"
- placeholder="••••••••"
- class="w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500">
- </div>
- </div>
- <div class="grid grid-cols-2 gap-3">
- <div>
- <label class="block text-sm font-medium text-gray-700 mb-1">Expéditeur (From)</label>
- <input type="email" name="smtp_from" value="{{ cfg.smtp_from }}"
- placeholder="backup@exemple.fr"
- class="w-full border border-gray-300 rounded-lg px-3 py-2 text-sm font-mono focus:outline-none focus:ring-2 focus:ring-blue-500">
- <p class="text-xs text-gray-400 mt-1">Si vide, utilise l'utilisateur SMTP.</p>
- </div>
- <div>
- <label class="block text-sm font-medium text-gray-700 mb-1">Destinataire (To)</label>
- <input type="email" name="smtp_to" value="{{ cfg.smtp_to }}"
- placeholder="admin@exemple.fr"
- class="w-full border border-gray-300 rounded-lg px-3 py-2 text-sm font-mono focus:outline-none focus:ring-2 focus:ring-blue-500">
- </div>
- </div>
- <div class="flex items-center gap-6">
- <label class="flex items-center gap-2">
- <input type="checkbox" name="smtp_tls" value="1"
- {% if cfg.smtp_tls == '1' %}checked{% endif %}
- class="rounded border-gray-300 text-blue-600">
- <span class="text-sm font-medium text-gray-700">STARTTLS</span>
- </label>
- <label class="flex items-center gap-2">
- <input type="checkbox" name="smtp_ssl" value="1"
- {% if cfg.smtp_ssl == '1' %}checked{% endif %}
- class="rounded border-gray-300 text-blue-600">
- <span class="text-sm font-medium text-gray-700">SSL/TLS direct (port 465)</span>
- </label>
- </div>
- </div>
- <div class="bg-white rounded-xl border border-gray-200 p-6 space-y-3">
- <h2 class="text-sm font-semibold text-gray-700 uppercase tracking-wide">Déclenchement</h2>
- <label class="flex items-center gap-2">
- <input type="checkbox" name="notify_on_error" value="1"
- {% if cfg.notify_on_error != '0' %}checked{% endif %}
- class="rounded border-gray-300 text-blue-600">
- <span class="text-sm font-medium text-gray-700">Notifier en cas d'erreur</span>
- </label>
- <label class="flex items-center gap-2">
- <input type="checkbox" name="notify_on_success" value="1"
- {% if cfg.notify_on_success == '1' %}checked{% endif %}
- class="rounded border-gray-300 text-blue-600">
- <span class="text-sm font-medium text-gray-700">Notifier en cas de succès</span>
- </label>
- </div>
- <div class="flex gap-3 flex-wrap">
- <button type="submit" name="action" value="save"
- class="bg-blue-600 hover:bg-blue-700 text-white px-5 py-2 rounded-lg font-medium text-sm transition">
- Enregistrer
- </button>
- <button type="submit" name="action" value="test_smtp"
- class="bg-white hover:bg-gray-50 text-gray-700 border border-gray-300 px-5 py-2 rounded-lg font-medium text-sm transition">
- Envoyer un email de test
- </button>
- </div>
- </form>
- </div>
- {% endblock %}
|