Can define volumes to collect artifacts

This commit is contained in:
nemunaire 2021-05-02 19:27:30 +02:00
commit e3a911cd05
6 changed files with 149 additions and 10 deletions

View file

@ -46,6 +46,8 @@ function fetchLogs() {
ws.onclose = function (evt) {
console.log("Connection closed.");
fetchVolumes()
current_job = null;
document.getElementById("btnlaunch").disabled = false;
@ -53,3 +55,25 @@ function fetchLogs() {
document.getElementById("started-alert").style.display = "none";
};
}
function fetchVolumes() {
fetch('/api/jobs/' + current_job + '/volumes')
.then(function(response) {
return response.json();
})
.then(function(data) {
document.getElementById("volumes").innerHTML = "";
for (const i in data) {
let a = document.createElement("a");
a.className = "list-group-item list-group-item-action";
a.href = "/artifacts" + data[i];
a.innerText = data[i];
document.getElementById("volumes").appendChild(a);
}
if (data.length > 0) {
document.getElementById("volumes-card").style.display = "block";
}
})
}