feat: put out descriptive message if everything okay
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
This commit is contained in:
parent
c8ecd4a809
commit
7167d275b6
@ -51,19 +51,32 @@
|
||||
|
||||
var savicSuiteRoyaleDim = new Dimensions(1, 0.5, 1);
|
||||
|
||||
function getResultFromChecks(checks) {
|
||||
console.log(checks.length)
|
||||
if (Object.keys(checks).length > 0) {
|
||||
const ul = document.createElement('ul');
|
||||
for (const key in checks) {
|
||||
const li = document.createElement('li');
|
||||
li.textContent = `❌` + checks[key];
|
||||
ul.appendChild(li);
|
||||
}
|
||||
return ul;
|
||||
} else {
|
||||
const p = document.createElement('p');
|
||||
p.innerHTML = "✅ Der Käfig erfüllt alle Kriterien!"
|
||||
return p;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function update() {
|
||||
var failed_checks = cageCheck(savicSuiteRoyaleDim, ratSlider.value, fullFloorNum.value);
|
||||
var resultsDiv = document.getElementById("resultsDiv");
|
||||
resultsDiv.innerHTML = `<strong>Ergebnis</strong>`;
|
||||
|
||||
const ul = document.createElement('ul');
|
||||
for (const key in failed_checks) {
|
||||
const li = document.createElement('li');
|
||||
li.textContent = failed_checks[key];
|
||||
ul.appendChild(li);
|
||||
}
|
||||
const result = getResultFromChecks(failed_checks);
|
||||
|
||||
resultsDiv.appendChild(ul);
|
||||
resultsDiv.appendChild(result);
|
||||
}
|
||||
|
||||
|
||||
@ -82,6 +95,7 @@
|
||||
input.value = value + 1;
|
||||
update();
|
||||
}
|
||||
|
||||
update();
|
||||
</script>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user