Bläddra i källkod

feat: afficher l'app_id YunoHost sous le nom du job (dashboard, historique, archives)

Bump version 1.2~ynh1

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Cedric Hansen 2 veckor sedan
förälder
incheckning
94260c75d0

+ 1 - 1
manifest.toml

@@ -4,7 +4,7 @@ name = "Backup Manager"
 description.en = "Centralized backup manager for YunoHost"
 description.fr = "Gestionnaire de sauvegardes centralisé pour YunoHost"
 
-version = "1.1~ynh1"
+version = "1.2~ynh1"
 
 maintainers = []
 

+ 7 - 0
sources/blueprints/jobs.py

@@ -181,11 +181,18 @@ def archives():
         size_bytes = file_stats[name]["size_bytes"] or None
         run = runs_by_archive.get(name)
         job = jobs_by_id.get(run.job_id) if run else None
+        app_id = None
+        if job and job.type == "ynh_app" and job.config_json:
+            try:
+                app_id = json.loads(job.config_json).get("app_id")
+            except Exception:
+                pass
         items.append({
             "name": name,
             "type": job.type if job else "",
             "job_name": job.name if job else "—",
             "job_id": job.id if job else None,
+            "app_id": app_id,
             "last_status": run.status if run else None,
             "run_at": run.started_at if run else None,
             "size_bytes": size_bytes,

+ 3 - 0
sources/templates/archives.html

@@ -75,6 +75,9 @@
             {% else %}
               {{ item.job_name }}
             {% endif %}
+            {% if item.app_id %}
+              <br><span class="font-mono text-xs text-gray-400">{{ item.app_id }}</span>
+            {% endif %}
           </td>
           <td class="px-6 py-3 text-xs text-gray-500 whitespace-nowrap">
             {% if item.run_at %}{{ item.run_at.strftime('%d/%m/%Y %H:%M') }}

+ 9 - 1
sources/templates/dashboard_local.html

@@ -85,7 +85,15 @@
               <td class="px-4 py-4">
                 <input type="checkbox" class="job-checkbox rounded border-gray-300 text-blue-600" value="{{ job.id }}">
               </td>
-              <td class="px-6 py-4 font-medium text-gray-900">{{ job.name }}</td>
+              <td class="px-6 py-4">
+                <span class="font-medium text-gray-900">{{ job.name }}</span>
+                {% if job.type == 'ynh_app' and job.config_json %}
+                  {% set _cfg = job.config_json | fromjson %}
+                  {% if _cfg.get('app_id') %}
+                    <br><span class="font-mono text-xs text-gray-400">{{ _cfg.get('app_id') }}</span>
+                  {% endif %}
+                {% endif %}
+              </td>
               <td class="px-6 py-4">
                 <span class="bg-gray-100 text-gray-600 text-xs px-2 py-0.5 rounded font-mono">
                   {{ job.type }}

+ 9 - 1
sources/templates/job_history.html

@@ -4,7 +4,15 @@
 {% block content %}
 <div class="mb-6 flex items-center gap-4">
   <a href="{{ url_for('jobs.index') }}" class="text-gray-400 hover:text-gray-600 text-sm">← Dashboard</a>
-  <h1 class="text-xl font-bold text-gray-900">{{ job.name }}</h1>
+  <div>
+    <h1 class="text-xl font-bold text-gray-900">{{ job.name }}</h1>
+    {% if job.type == 'ynh_app' and job.config_json %}
+      {% set _cfg = job.config_json | fromjson %}
+      {% if _cfg.get('app_id') %}
+        <span class="font-mono text-xs text-gray-400">{{ _cfg.get('app_id') }}</span>
+      {% endif %}
+    {% endif %}
+  </div>
   <span class="bg-gray-100 text-gray-600 text-xs px-2 py-0.5 rounded font-mono">{{ job.type }}</span>
   <span class="text-gray-400 text-sm font-mono">{{ job.cron_expr }}</span>
 </div>

+ 1 - 1
v3/apps.json

@@ -16,7 +16,7 @@
         "packaging_format": 2,
         "id": "backupmanager",
         "name": "Backup Manager",
-        "version": "1.1~ynh1",
+        "version": "1.2~ynh1",
         "description": {
           "en": "Centralized backup manager for YunoHost",
           "fr": "Gestionnaire de sauvegardes centralisé pour YunoHost"