Add repo link to single build page
This commit is contained in:
parent
301fec8860
commit
da4a545a00
1 changed files with 6 additions and 1 deletions
|
|
@ -13,6 +13,7 @@
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<runboat-build id="build"></runboat-build>
|
<runboat-build id="build"></runboat-build>
|
||||||
|
<p>Other builds for <a href="" id="repolink">this repo</a>.</p>
|
||||||
<div id="footer">
|
<div id="footer">
|
||||||
{{ footer_html }}
|
{{ footer_html }}
|
||||||
{{ additional_footer_html }}
|
{{ additional_footer_html }}
|
||||||
|
|
@ -26,7 +27,11 @@
|
||||||
const evtSource = new EventSource(`/api/v1/build-events?build_name=${buildName}`);
|
const evtSource = new EventSource(`/api/v1/build-events?build_name=${buildName}`);
|
||||||
evtSource.onmessage = function(event) {
|
evtSource.onmessage = function(event) {
|
||||||
var oEvent = JSON.parse(event.data);
|
var oEvent = JSON.parse(event.data);
|
||||||
buildElement.build = oEvent.event == "upd" ? oEvent.build : {};
|
const build = oEvent.build;
|
||||||
|
buildElement.build = oEvent.event == "upd" ? build : {};
|
||||||
|
const repolinkElement = document.getElementById("repolink");
|
||||||
|
repolinkElement.href = `./builds.html?repo=${build.repo}`;
|
||||||
|
repolinkElement.text = build.repo;
|
||||||
}
|
}
|
||||||
// TODO: evtSource error handling
|
// TODO: evtSource error handling
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue