From ea2cea573e39048d9f163e495c2ddfb3453e2add Mon Sep 17 00:00:00 2001 From: jude Date: Sun, 30 Jul 2023 19:17:44 +0100 Subject: [PATCH] Bump ver. Round failure rate. --- Cargo.lock | 2 +- Cargo.toml | 2 +- web/static/js/admin.js | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3a25a99..8231a1b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2217,7 +2217,7 @@ checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78" [[package]] name = "reminder-rs" -version = "1.6.28" +version = "1.6.29" dependencies = [ "base64 0.21.2", "chrono", diff --git a/Cargo.toml b/Cargo.toml index 74d16b0..40be9a1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "reminder-rs" -version = "1.6.28" +version = "1.6.29" authors = ["Jude Southworth "] edition = "2021" license = "AGPL-3.0 only" diff --git a/web/static/js/admin.js b/web/static/js/admin.js index e6ee1ec..096942c 100644 --- a/web/static/js/admin.js +++ b/web/static/js/admin.js @@ -14,12 +14,12 @@ document.addEventListener("DOMContentLoaded", () => { (iv, frame) => iv + frame.count, 0 ); + let rate = historyFailed / (historySent + historyFailed); + let formatted = Math.round(rate * 10000) / 100; document.querySelector("#historySent").textContent = historySent; document.querySelector("#historyFailed").textContent = historyFailed; - document.querySelector("#failRate").textContent = `${ - (historyFailed / (historySent + historyFailed)) * 100 - }%`; + document.querySelector("#failRate").textContent = `${formatted}%`; new Chart(document.getElementById("schedule"), { type: "bar",