Bugfixes and tooltips for full-calc ui.
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 49s

This commit is contained in:
MaxJa4
2024-01-25 15:36:19 +01:00
parent acf756765b
commit 7338d34765
2 changed files with 18 additions and 12 deletions

View File

@@ -38,11 +38,11 @@ func GetScoreByPlayerID(c *gin.Context) {
case 200: case 200:
c.String(200, fmt.Sprintf("%.2f", score)) c.String(200, fmt.Sprintf("%.2f", score))
case 404: case 404:
c.String(200, "<i class=\"bi bi-person-x-fill me-2 text-danger fs-5\" style=\"margin-left: 0.69rem;\"></i>") c.String(200, "<i class=\"bi bi-person-x-fill me-2 text-danger fs-5\" style=\"margin-left: 0.69rem;\" data-bs-action=\"tooltip\" data-bs-title=\"Spieler nicht gefunden\"></i>")
case 503, 504: case 503, 504:
c.String(statusCode, "<i class=\"bi bi-cloud-slash-fill me-2 text-danger fs-5\" style=\"margin-left: 0.69rem;\"></i>") c.String(statusCode, "<i class=\"bi bi-cloud-slash-fill me-2 text-danger fs-5\" style=\"margin-left: 0.69rem;\"data-bs-action=\"tooltip\" data-bs-title=\"Tracker nicht erreichbar\"></i>")
default: default:
c.String(statusCode, "<i class=\"bi bi-exclamation-circle-fill me-2 text-danger fs-5\" style=\"margin-left: 0.69rem;\"></i>") c.String(statusCode, "<i class=\"bi bi-exclamation-circle-fill me-2 text-danger fs-5\" style=\"margin-left: 0.69rem;\" data-bs-action=\"tooltip\" data-bs-title=\"Unbekannter Fehler\"></i>")
utils.Logger.Warnf("[SCORE] Invalid request! Player: %s, Score: %f", player.Name, score) utils.Logger.Warnf("[SCORE] Invalid request! Player: %s, Score: %f", player.Name, score)
} }
} }

View File

@@ -23,19 +23,19 @@
</div> </div>
<div class="row justify-content-center"> <div class="row justify-content-center">
<div class="col-3 text-center fs-5 me-4 ps-0"> <div class="col-3 text-center fs-5 me-4 ps-0">
<img src="../static/icons/average.svg" alt="Avg" class="img-fluid me-1 align-top" style="height: 1.8rem; filter: invert(0.85);"/> <img src="../static/icons/average.svg" alt="Avg" class="img-fluid me-1 align-top" style="height: 1.8rem; filter: invert(0.85);" data-bs-action="tooltip" data-bs-title="Durchschnitt Heim-Team" />
<span id="home-avg-score" class="text-warning"> <span id="home-avg-score" class="text-warning">
<i class="spinner-grow spinner-grow-sm text-secondary align-baseline mx-2" role="status"></i> <i class="spinner-grow spinner-grow-sm text-secondary align-baseline mx-2" role="status"></i>
</span> </span>
</div> </div>
<div class="col-2 text-center fs-5"> <div class="col-2 text-center fs-5">
<i class="bi bi-plus-slash-minus me-2"></i> <i class="bi bi-plus-slash-minus me-2" data-bs-action="tooltip" data-bs-title="Differenz der Durchschnitte" ></i>
<span id="diff-score" class="text-warning"> <span id="diff-score" class="text-warning">
<i class="spinner-grow spinner-grow-sm text-secondary align-baseline mx-2" role="status"></i> <i class="spinner-grow spinner-grow-sm text-secondary align-baseline mx-2" role="status"></i>
</span> </span>
</div> </div>
<div class="col-3 text-center fs-5 ms-4 pe-0"> <div class="col-3 text-center fs-5 ms-4 pe-0">
<img src="../static/icons/average.svg" alt="Avg" class="img-fluid me-1 align-top" style="height: 1.8rem; filter: invert(0.85);"/> <img src="../static/icons/average.svg" alt="Avg" class="img-fluid me-1 align-top" style="height: 1.8rem; filter: invert(0.85);" data-bs-action="tooltip" data-bs-title="Durchschnitt Gegner-Team" />
<span id="opp-avg-score" class="text-warning"> <span id="opp-avg-score" class="text-warning">
<i class="spinner-grow spinner-grow-sm text-secondary align-baseline mx-2" role="status"></i> <i class="spinner-grow spinner-grow-sm text-secondary align-baseline mx-2" role="status"></i>
</span> </span>
@@ -47,7 +47,7 @@
<div class="progress w-100" style="height: 30px;" id="fullCalcProgressbar" role="progressbar"> <div class="progress w-100" style="height: 30px;" id="fullCalcProgressbar" role="progressbar">
<div class="progress-bar progress-bar-striped progress-bar-animated" style="width: 0">Lade...</div> <div class="progress-bar progress-bar-striped progress-bar-animated" style="width: 0">Lade...</div>
</div> </div>
<button type="submit" name="submit" class="btn btn-lg btn-outline-primary" onclick="downloadScreenshot()" hidden> <button type="submit" name="submit" class="btn btn-lg btn-outline-primary" onclick="downloadScreenshot()" data-bs-action="tooltip" data-bs-title="Als Bild herunterladen" hidden>
<i class="bi bi-download"></i> <i class="bi bi-download"></i>
</button> </button>
</div> </div>
@@ -85,6 +85,8 @@
score.innerHTML = text; score.innerHTML = text;
if (!isNaN(parseFloat(text))) if (!isNaN(parseFloat(text)))
score.previousElementSibling.hidden = false; score.previousElementSibling.hidden = false;
else
initTooltips(score);
return text; return text;
}); });
} }
@@ -239,7 +241,7 @@
} }
function cleanupStatistic(statisticField) { function cleanupStatistic(statisticField) {
if (statisticField.innerHTML === spinnerGrow) if (statisticField.innerHTML.trim() === spinnerGrow)
statisticField.innerHTML = dash; statisticField.innerHTML = dash;
} }
@@ -299,11 +301,15 @@
Promise.all(promises).then(_ => { Promise.all(promises).then(_ => {
let liItems = homeClanResults.querySelectorAll('li'); let liItems = homeClanResults.querySelectorAll('li');
liItems[liItems.length - 1].classList.remove('border-bottom'); if (liItems.length > 1) {
liItems[liItems.length - 2].classList.remove('border-bottom'); liItems[liItems.length - 1].classList.remove('border-bottom');
liItems[liItems.length - 2].classList.remove('border-bottom');
}
liItems = oppClanResults.querySelectorAll('li'); liItems = oppClanResults.querySelectorAll('li');
liItems[liItems.length - 1].classList.remove('border-bottom'); if (liItems.length > 1) {
liItems[liItems.length - 2].classList.remove('border-bottom'); liItems[liItems.length - 1].classList.remove('border-bottom');
liItems[liItems.length - 2].classList.remove('border-bottom');
}
setSquadNumbers(); setSquadNumbers();