destinations.html 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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"
  45. class="bg-gray-50 hover:bg-gray-100 text-gray-700 text-xs px-3 py-1.5 rounded border border-gray-200 transition">
  46. Tester
  47. </button>
  48. </form>
  49. <a href="{{ url_for('dest.destination_edit', dest_id=dest.id) }}"
  50. class="bg-gray-50 hover:bg-gray-100 text-gray-700 text-xs px-3 py-1.5 rounded border border-gray-200 transition">
  51. Éditer
  52. </a>
  53. <form method="post" action="{{ url_for('dest.destination_delete', dest_id=dest.id) }}"
  54. onsubmit="return confirm('Supprimer la destination « {{ dest.name }} » ?')">
  55. <button type="submit"
  56. class="text-red-300 hover:text-red-600 text-xs px-2 py-1.5 rounded hover:bg-red-50 transition">
  57. </button>
  58. </form>
  59. </div>
  60. </div>
  61. </div>
  62. {% endfor %}
  63. </div>
  64. {% endif %}
  65. {% endblock %}