destinations.html 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. {% extends "base.html" %}
  2. {% block title %}Destinations{% endblock %}
  3. {% block content %}
  4. <div class="flex items-center justify-between mb-6">
  5. <h1 class="text-xl font-bold text-gray-900">Destinations de transfert</h1>
  6. <a href="{{ url_for('dest.destination_new') }}"
  7. class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-lg text-sm font-medium transition">
  8. + Nouvelle destination
  9. </a>
  10. </div>
  11. {% if not destinations %}
  12. <div class="bg-white rounded-xl border border-gray-200 px-6 py-12 text-center text-gray-400">
  13. <p class="text-lg">Aucune destination configurée.</p>
  14. <p class="text-sm mt-2">Les archives sont conservées localement uniquement.</p>
  15. <a href="{{ url_for('dest.destination_new') }}" class="mt-4 inline-block text-blue-600 hover:underline text-sm">
  16. Configurer une première destination →
  17. </a>
  18. </div>
  19. {% else %}
  20. <div class="space-y-4">
  21. {% for dest in destinations %}
  22. <div class="bg-white rounded-xl border border-gray-200 shadow-sm p-5">
  23. <div class="flex items-start justify-between gap-4">
  24. <div class="space-y-1 min-w-0">
  25. <div class="flex items-center gap-2">
  26. <span class="font-semibold text-gray-900">{{ dest.name }}</span>
  27. {% if dest.enabled %}
  28. <span class="bg-green-100 text-green-700 text-xs px-2 py-0.5 rounded-full font-medium">actif</span>
  29. {% else %}
  30. <span class="bg-gray-100 text-gray-500 text-xs px-2 py-0.5 rounded-full font-medium">inactif</span>
  31. {% endif %}
  32. </div>
  33. <p class="text-sm font-mono text-gray-600">
  34. {{ dest.user }}@{{ dest.host }}:{{ dest.port }} → {{ dest.remote_path }}
  35. </p>
  36. {% if dest.jobs %}
  37. <p class="text-xs text-gray-400">
  38. Utilisée par : {{ dest.jobs | map(attribute='name') | join(', ') }}
  39. </p>
  40. {% endif %}
  41. </div>
  42. <div class="flex items-center gap-2 shrink-0">
  43. <form method="post" action="{{ url_for('dest.destination_test', dest_id=dest.id) }}">
  44. <button type="submit" class="btn-secondary btn-sm">Tester</button>
  45. </form>
  46. <a href="{{ url_for('dest.destination_edit', dest_id=dest.id) }}"
  47. class="btn-secondary btn-sm">Éditer</a>
  48. <form method="post" action="{{ url_for('dest.destination_delete', dest_id=dest.id) }}"
  49. onsubmit="return confirm('Supprimer la destination « {{ dest.name }} » ?')">
  50. <button type="submit" class="btn-danger btn-icon-sm">✕</button>
  51. </form>
  52. </div>
  53. </div>
  54. </div>
  55. {% endfor %}
  56. </div>
  57. {% endif %}
  58. {% endblock %}