From b891ab065ead5e2f90e2744f08c43e4c1d3bf4fb Mon Sep 17 00:00:00 2001 From: tituspijean Date: Mon, 4 Oct 2021 07:32:10 +0200 Subject: [PATCH] Update badge and summary URLs --- run.py | 2 ++ templates/job.html | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/run.py b/run.py index 0affdb0..e7a680e 100644 --- a/run.py +++ b/run.py @@ -945,6 +945,7 @@ async def html_job(request, job_id): job_url = app.config.BASE_URL + app.url_for("html_job", job_id=job.id) badge_url = app.config.BASE_URL + app.url_for("api_badge_job", job_id=job.id) shield_badge_url = f"https://img.shields.io/endpoint?url={badge_url}" + summary_url = app.config.BASE_URL + "/summary/" + str(job.id) + ".png" return { "job": job, @@ -952,6 +953,7 @@ async def html_job(request, job_id): 'job_url': job_url, 'badge_url': badge_url, 'shield_badge_url': shield_badge_url, + 'summary_url': summary_url, 'relative_path_to_root': '../', 'path': request.path } diff --git a/templates/job.html b/templates/job.html index 70ce1ef..a7824fa 100644 --- a/templates/job.html +++ b/templates/job.html @@ -103,7 +103,7 @@ // Clipboard API not available return } - const text = "[![Test Badge](https://img.shields.io/endpoint?url=https://ci.pijean.ovh/ci/api/job/<{ job.id }>/badge)](https://ci.pijean.ovh/ci/job/<{ job.id }>)" + const text = "[![Test Badge](https://img.shields.io/endpoint?url=<{ badge_url }>)](<{ job_url }>)\n[![](<{ summary_url }>)](<{ job_url }>)" try { await navigator.clipboard.writeText(text) } catch (err) {