restore_confirm.html 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. {% extends "base.html" %}
  2. {% block title %}Restaurer — {{ archive_name }}{% endblock %}
  3. {% block content %}
  4. <div class="max-w-2xl">
  5. <div class="mb-6">
  6. <a href="{{ url_for('jobs.index') }}" class="text-gray-400 hover:text-gray-600 text-sm">← Dashboard</a>
  7. </div>
  8. <div class="bg-white rounded-xl border border-gray-200 shadow-sm p-6 space-y-5">
  9. <div>
  10. <h1 class="text-xl font-bold text-gray-900">Confirmer la restauration</h1>
  11. <p class="text-sm text-gray-500 mt-1">Cette opération écrase les fichiers en place.</p>
  12. </div>
  13. <div class="bg-gray-50 rounded-lg p-4 space-y-2 text-sm">
  14. <div class="flex justify-between">
  15. <span class="text-gray-500">Archive</span>
  16. <span class="font-mono font-medium text-gray-800">{{ archive_name }}</span>
  17. </div>
  18. {% if info %}
  19. <div class="flex justify-between">
  20. <span class="text-gray-500">Type</span>
  21. <span class="bg-gray-100 text-gray-600 text-xs px-2 py-0.5 rounded font-mono">{{ info.get('type', '—') }}</span>
  22. </div>
  23. {% if info.get('source_path') %}
  24. <div class="flex justify-between">
  25. <span class="text-gray-500">Chemin</span>
  26. <span class="font-mono text-gray-800">{{ info.get('source_path') }}</span>
  27. </div>
  28. {% endif %}
  29. {% if info.get('database') %}
  30. <div class="flex justify-between">
  31. <span class="text-gray-500">Base de données</span>
  32. <span class="font-mono text-gray-800">{{ info.get('database') }}</span>
  33. </div>
  34. {% endif %}
  35. <div class="flex justify-between">
  36. <span class="text-gray-500">Créée le</span>
  37. <span class="text-gray-700">{{ info.get('created_at', '—') }}</span>
  38. </div>
  39. <div class="flex justify-between">
  40. <span class="text-gray-500">Instance source</span>
  41. <span class="text-gray-700">{{ info.get('instance_name', '—') }}</span>
  42. </div>
  43. {% else %}
  44. <p class="text-gray-400 italic">Métadonnées indisponibles.</p>
  45. {% endif %}
  46. </div>
  47. {% set restore = info.get('restore', {}) if info else {} %}
  48. {% if restore %}
  49. <div class="space-y-2">
  50. <p class="text-sm font-semibold text-gray-700">Actions de restauration :</p>
  51. <ul class="text-sm text-gray-600 space-y-1 pl-4">
  52. {% if restore.get('system_user') %}
  53. <li class="flex items-center gap-2">
  54. <span class="text-green-500">✓</span>
  55. Création utilisateur système <code class="bg-gray-100 px-1 rounded text-xs">{{ restore.system_user.name }}</code>
  56. (si inexistant)
  57. </li>
  58. {% endif %}
  59. {% if restore.get('permissions') %}
  60. <li class="flex items-center gap-2">
  61. <span class="text-green-500">✓</span>
  62. Permissions :
  63. {% if restore.permissions.get('owner') %}<code class="bg-gray-100 px-1 rounded text-xs">chown {{ restore.permissions.owner }}</code>{% endif %}
  64. {% if restore.permissions.get('mode') %}<code class="bg-gray-100 px-1 rounded text-xs">chmod {{ restore.permissions.mode }}</code>{% endif %}
  65. </li>
  66. {% endif %}
  67. {% if restore.get('systemd_service') %}
  68. <li class="flex items-center gap-2">
  69. <span class="text-green-500">✓</span>
  70. Service systemd <code class="bg-gray-100 px-1 rounded text-xs">{{ restore.systemd_service.name }}</code>
  71. activé et démarré
  72. </li>
  73. {% endif %}
  74. {% for cmd in restore.get('post_restore_commands', []) %}
  75. <li class="flex items-center gap-2">
  76. <span class="text-blue-500">→</span>
  77. <code class="bg-gray-100 px-1 rounded text-xs">{{ cmd }}</code>
  78. </li>
  79. {% endfor %}
  80. </ul>
  81. </div>
  82. {% endif %}
  83. <div class="bg-amber-50 border border-amber-200 rounded-lg px-4 py-3 text-sm text-amber-800">
  84. ⚠ Les fichiers existants dans le chemin de destination seront <strong>écrasés</strong>.
  85. Cette action ne peut pas être annulée.
  86. </div>
  87. <form method="post" class="flex gap-3">
  88. <button type="submit"
  89. class="bg-red-600 hover:bg-red-700 text-white px-5 py-2 rounded-lg font-medium text-sm transition">
  90. Confirmer la restauration
  91. </button>
  92. <a href="{{ url_for('jobs.index') }}"
  93. 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">
  94. Annuler
  95. </a>
  96. </form>
  97. </div>
  98. </div>
  99. {% endblock %}