|
@@ -30,8 +30,9 @@ def index():
|
|
|
for j in jobs
|
|
for j in jobs
|
|
|
}
|
|
}
|
|
|
instances = RemoteInstance.query.order_by(RemoteInstance.name).all()
|
|
instances = RemoteInstance.query.order_by(RemoteInstance.name).all()
|
|
|
|
|
+ ynh_app_labels = {a["id"]: a.get("label", "") for a in get_ynh_apps()}
|
|
|
return render_template("dashboard_local.html", jobs=jobs, last_runs=last_runs,
|
|
return render_template("dashboard_local.html", jobs=jobs, last_runs=last_runs,
|
|
|
- instances=instances)
|
|
|
|
|
|
|
+ instances=instances, ynh_app_labels=ynh_app_labels)
|
|
|
|
|
|
|
|
|
|
|
|
|
# --- CRUD Jobs ----------------------------------------------------------------
|
|
# --- CRUD Jobs ----------------------------------------------------------------
|
|
@@ -153,7 +154,8 @@ def job_toggle(job_id):
|
|
|
def job_history(job_id):
|
|
def job_history(job_id):
|
|
|
job = db.get_or_404(Job, job_id)
|
|
job = db.get_or_404(Job, job_id)
|
|
|
runs = Run.query.filter_by(job_id=job_id).order_by(Run.started_at.desc()).limit(100).all()
|
|
runs = Run.query.filter_by(job_id=job_id).order_by(Run.started_at.desc()).limit(100).all()
|
|
|
- return render_template("job_history.html", job=job, runs=runs)
|
|
|
|
|
|
|
+ ynh_app_labels = {a["id"]: a.get("label", "") for a in get_ynh_apps()} if job.type == "ynh_app" else {}
|
|
|
|
|
+ return render_template("job_history.html", job=job, runs=runs, ynh_app_labels=ynh_app_labels)
|
|
|
|
|
|
|
|
|
|
|
|
|
# --- Navigateur d'archives ----------------------------------------------------
|
|
# --- Navigateur d'archives ----------------------------------------------------
|
|
@@ -176,15 +178,20 @@ def archives():
|
|
|
runs_by_archive[run.archive_name] = run
|
|
runs_by_archive[run.archive_name] = run
|
|
|
jobs_by_id = {j.id: j for j in Job.query.all()}
|
|
jobs_by_id = {j.id: j for j in Job.query.all()}
|
|
|
|
|
|
|
|
|
|
+ ynh_app_labels = {a["id"]: a.get("label", "") for a in get_ynh_apps()}
|
|
|
|
|
+
|
|
|
items = []
|
|
items = []
|
|
|
for name in sorted_names:
|
|
for name in sorted_names:
|
|
|
size_bytes = file_stats[name]["size_bytes"] or None
|
|
size_bytes = file_stats[name]["size_bytes"] or None
|
|
|
run = runs_by_archive.get(name)
|
|
run = runs_by_archive.get(name)
|
|
|
job = jobs_by_id.get(run.job_id) if run else None
|
|
job = jobs_by_id.get(run.job_id) if run else None
|
|
|
app_id = None
|
|
app_id = None
|
|
|
|
|
+ app_label = None
|
|
|
if job and job.type == "ynh_app" and job.config_json:
|
|
if job and job.type == "ynh_app" and job.config_json:
|
|
|
try:
|
|
try:
|
|
|
app_id = json.loads(job.config_json).get("app_id")
|
|
app_id = json.loads(job.config_json).get("app_id")
|
|
|
|
|
+ if app_id:
|
|
|
|
|
+ app_label = ynh_app_labels.get(app_id, "")
|
|
|
except Exception:
|
|
except Exception:
|
|
|
pass
|
|
pass
|
|
|
items.append({
|
|
items.append({
|
|
@@ -193,6 +200,7 @@ def archives():
|
|
|
"job_name": job.name if job else "—",
|
|
"job_name": job.name if job else "—",
|
|
|
"job_id": job.id if job else None,
|
|
"job_id": job.id if job else None,
|
|
|
"app_id": app_id,
|
|
"app_id": app_id,
|
|
|
|
|
+ "app_label": app_label,
|
|
|
"last_status": run.status if run else None,
|
|
"last_status": run.status if run else None,
|
|
|
"run_at": run.started_at if run else None,
|
|
"run_at": run.started_at if run else None,
|
|
|
"size_bytes": size_bytes,
|
|
"size_bytes": size_bytes,
|