This repository has been archived on 2024-03-03. You can view files and clone it, but cannot push or open issues or pull requests.
minifaas/ui/js/minifass.js

27 lines
790 B
JavaScript

function getVersion() {
fetch('/api/version')
.then(function(response) {
return response.json();
})
.then(function(version) {
document.getElementById("version").innerHTML = "v" + version.version;
});
}
function runctnr() {
document.getElementById("btnlaunch").disabled = true;
document.getElementById("btnlaunchspinner").style.display = "inline-block";
fetch('/api/run')
.then(function(response) {
document.getElementById("btnlaunch").disabled = false;
document.getElementById("btnlaunchspinner").style.display = "none";
return response.text();
})
.then(function(logs) {
document.getElementById("logs").textContent = logs;
document.getElementById("logs-card").style.display = "block";
})
return false;
}