Simplify builds.html parameter handling

This commit is contained in:
Stéphane Bidoul 2021-11-30 18:45:24 +01:00
parent 534e343c73
commit b873d09d22
No known key found for this signature in database
GPG key ID: BCAB2555446B5B92

View file

@ -80,12 +80,7 @@
function connect() { function connect() {
console.log("connecting...") console.log("connecting...")
const repo = new URLSearchParams(window.location.search).get("repo"); var url = `/api/v1/build-events${window.location.search}`
const target_branch = new URLSearchParams(window.location.search).get("target_branch");
var url = `/api/v1/build-events?repo=${repo}`
if (target_branch) {
url += `&target_branch=${target_branch}`
}
evtSource = new EventSource(url); evtSource = new EventSource(url);
evtSource.onopen = onopen; evtSource.onopen = onopen;
evtSource.onmessage = onmessage; evtSource.onmessage = onmessage;