Merge pull request #28 from tituspijean/update-badge

Update badge and summary URLs
This commit is contained in:
Kayou 2021-10-19 22:32:21 +02:00 committed by GitHub
commit 8e63987832
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

2
run.py
View file

@ -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
}

View file

@ -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) {