Can define volumes to collect artifacts
This commit is contained in:
parent
d2a49e5740
commit
e3a911cd05
6 changed files with 149 additions and 10 deletions
|
|
@ -23,6 +23,14 @@
|
|||
it's ID is <code id="jobid"></code>
|
||||
</div>
|
||||
|
||||
<div id="volumes-card" class="mb-3 card" style="display: none;">
|
||||
<h5 class="card-header">
|
||||
Volumes
|
||||
</h5>
|
||||
<div id="volumes" class="list-group">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="logs-card" class="mb-3 card" style="display: none;">
|
||||
<h5 class="card-header">
|
||||
Here is your container logs output:
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue