settings.html 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. {% extends "base.html" %}
  2. {% block title %}Paramètres{% endblock %}
  3. {% block content %}
  4. <div class="max-w-xl">
  5. <h1 class="text-xl font-bold text-gray-900 mb-6">Paramètres</h1>
  6. <form method="post" class="space-y-6">
  7. <div class="bg-white rounded-xl border border-gray-200 p-6 space-y-4">
  8. <h2 class="text-sm font-semibold text-gray-700 uppercase tracking-wide">Serveur SMTP</h2>
  9. <div class="grid grid-cols-3 gap-3">
  10. <div class="col-span-2">
  11. <label class="block text-sm font-medium text-gray-700 mb-1">Hôte SMTP</label>
  12. <input type="text" name="smtp_host" value="{{ cfg.smtp_host }}"
  13. placeholder="smtp.exemple.fr"
  14. 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">
  15. </div>
  16. <div>
  17. <label class="block text-sm font-medium text-gray-700 mb-1">Port</label>
  18. <input type="number" name="smtp_port" min="1" max="65535"
  19. value="{{ cfg.smtp_port or 587 }}"
  20. 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">
  21. </div>
  22. </div>
  23. <div class="grid grid-cols-2 gap-3">
  24. <div>
  25. <label class="block text-sm font-medium text-gray-700 mb-1">Utilisateur</label>
  26. <input type="text" name="smtp_user" value="{{ cfg.smtp_user }}"
  27. placeholder="user@exemple.fr"
  28. 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">
  29. </div>
  30. <div>
  31. <label class="block text-sm font-medium text-gray-700 mb-1">Mot de passe</label>
  32. <input type="password" name="smtp_password" value="{{ cfg.smtp_password }}"
  33. placeholder="••••••••"
  34. 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">
  35. </div>
  36. </div>
  37. <div class="grid grid-cols-2 gap-3">
  38. <div>
  39. <label class="block text-sm font-medium text-gray-700 mb-1">Expéditeur (From)</label>
  40. <input type="email" name="smtp_from" value="{{ cfg.smtp_from }}"
  41. placeholder="backup@exemple.fr"
  42. 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">
  43. <p class="text-xs text-gray-400 mt-1">Si vide, utilise l'utilisateur SMTP.</p>
  44. </div>
  45. <div>
  46. <label class="block text-sm font-medium text-gray-700 mb-1">Destinataire (To)</label>
  47. <input type="email" name="smtp_to" value="{{ cfg.smtp_to }}"
  48. placeholder="admin@exemple.fr"
  49. 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">
  50. </div>
  51. </div>
  52. <div class="flex items-center gap-6">
  53. <label class="flex items-center gap-2">
  54. <input type="checkbox" name="smtp_tls" value="1"
  55. {% if cfg.smtp_tls == '1' %}checked{% endif %}
  56. class="rounded border-gray-300 text-blue-600">
  57. <span class="text-sm font-medium text-gray-700">STARTTLS</span>
  58. </label>
  59. <label class="flex items-center gap-2">
  60. <input type="checkbox" name="smtp_ssl" value="1"
  61. {% if cfg.smtp_ssl == '1' %}checked{% endif %}
  62. class="rounded border-gray-300 text-blue-600">
  63. <span class="text-sm font-medium text-gray-700">SSL/TLS direct (port 465)</span>
  64. </label>
  65. </div>
  66. </div>
  67. <div class="bg-white rounded-xl border border-gray-200 p-6 space-y-3">
  68. <h2 class="text-sm font-semibold text-gray-700 uppercase tracking-wide">Déclenchement</h2>
  69. <label class="flex items-center gap-2">
  70. <input type="checkbox" name="notify_on_error" value="1"
  71. {% if cfg.notify_on_error != '0' %}checked{% endif %}
  72. class="rounded border-gray-300 text-blue-600">
  73. <span class="text-sm font-medium text-gray-700">Notifier en cas d'erreur</span>
  74. </label>
  75. <label class="flex items-center gap-2">
  76. <input type="checkbox" name="notify_on_success" value="1"
  77. {% if cfg.notify_on_success == '1' %}checked{% endif %}
  78. class="rounded border-gray-300 text-blue-600">
  79. <span class="text-sm font-medium text-gray-700">Notifier en cas de succès</span>
  80. </label>
  81. </div>
  82. <div class="flex gap-3 flex-wrap">
  83. <button type="submit" name="action" value="save"
  84. class="bg-blue-600 hover:bg-blue-700 text-white px-5 py-2 rounded-lg font-medium text-sm transition">
  85. Enregistrer
  86. </button>
  87. <button type="submit" name="action" value="test_smtp"
  88. 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">
  89. Envoyer un email de test
  90. </button>
  91. </div>
  92. </form>
  93. </div>
  94. {% endblock %}