|
|
@@ -5,6 +5,26 @@
|
|
|
<div class="max-w-xl">
|
|
|
<h1 class="text-xl font-bold text-gray-900 mb-6">Paramètres</h1>
|
|
|
|
|
|
+ <div class="bg-white rounded-xl border border-gray-200 p-6 space-y-3 mb-6">
|
|
|
+ <h2 class="text-sm font-semibold text-gray-700 uppercase tracking-wide">API — Token d'accès</h2>
|
|
|
+ <p class="text-xs text-gray-500">
|
|
|
+ Communiquez ce token aux autres instances BackupManager pour qu'elles puissent se connecter à celle-ci.
|
|
|
+ </p>
|
|
|
+ <div class="flex items-center gap-2">
|
|
|
+ <input type="text" id="api-token" readonly value="{{ api_token }}"
|
|
|
+ class="flex-1 border border-gray-200 bg-gray-50 rounded-lg px-3 py-2 text-sm font-mono text-gray-700 focus:outline-none select-all">
|
|
|
+ <button type="button" onclick="copyToken()"
|
|
|
+ class="shrink-0 bg-gray-100 hover:bg-gray-200 text-gray-700 text-xs px-3 py-2 rounded-lg border border-gray-200 transition">
|
|
|
+ Copier
|
|
|
+ </button>
|
|
|
+ </div>
|
|
|
+ {% if instance_url %}
|
|
|
+ <p class="text-xs text-gray-400">
|
|
|
+ URL de cette instance : <span class="font-mono">{{ instance_url }}</span>
|
|
|
+ </p>
|
|
|
+ {% endif %}
|
|
|
+ </div>
|
|
|
+
|
|
|
<form method="post" class="space-y-6">
|
|
|
|
|
|
<div class="bg-white rounded-xl border border-gray-200 p-6 space-y-4">
|
|
|
@@ -104,4 +124,15 @@
|
|
|
|
|
|
</form>
|
|
|
</div>
|
|
|
+
|
|
|
+<script>
|
|
|
+function copyToken() {
|
|
|
+ const input = document.getElementById('api-token');
|
|
|
+ navigator.clipboard.writeText(input.value).then(() => {
|
|
|
+ const btn = event.target;
|
|
|
+ btn.textContent = 'Copié !';
|
|
|
+ setTimeout(() => btn.textContent = 'Copier', 2000);
|
|
|
+ });
|
|
|
+}
|
|
|
+</script>
|
|
|
{% endblock %}
|