Преглед изворни кода

fix: colonne Transfert du dashboard distingue SSH / HTTP / Local

- Relation remote_instance ajoutée sur Job (db.py)
- Badge "SSH · nom" violet pour rsync, "HTTP · nom" bleu pour chunked,
  "Local" gris si aucun transfert ; tooltip avec l'URL/chemin distant

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Cédric Hansen пре 1 месец
родитељ
комит
3c03183bd2
2 измењених фајлова са 4 додато и 1 уклоњено
  1. 1 0
      sources/db.py
  2. 3 1
      sources/templates/dashboard_local.html

+ 1 - 0
sources/db.py

@@ -53,6 +53,7 @@ class Job(db.Model):
     core_only = db.Column(db.Boolean, default=False)
     destination_id = db.Column(db.Integer, db.ForeignKey("destinations.id"), nullable=True)
     remote_instance_id = db.Column(db.Integer, db.ForeignKey("remote_instances.id"), nullable=True)
+    remote_instance = db.relationship("RemoteInstance", foreign_keys=[remote_instance_id], lazy="joined")
     created_at = db.Column(db.DateTime, default=datetime.utcnow)
     updated_at = db.Column(db.DateTime, default=datetime.utcnow, onupdate=datetime.utcnow)
 

+ 3 - 1
sources/templates/dashboard_local.html

@@ -96,7 +96,9 @@
               </td>
               <td class="px-6 py-4">
                 {% if job.destination %}
-                  <span class="bg-violet-50 text-violet-700 text-xs px-2 py-0.5 rounded font-medium">{{ job.destination.name }}</span>
+                  <span class="bg-violet-50 text-violet-700 text-xs px-2 py-0.5 rounded font-medium" title="{{ job.destination.remote_str }}">SSH · {{ job.destination.name }}</span>
+                {% elif job.remote_instance %}
+                  <span class="bg-blue-50 text-blue-700 text-xs px-2 py-0.5 rounded font-medium" title="{{ job.remote_instance.url }}">HTTP · {{ job.remote_instance.name }}</span>
                 {% else %}
                   <span class="bg-gray-100 text-gray-500 text-xs px-2 py-0.5 rounded">Local</span>
                 {% endif %}