+
-
-
+
+
ΠΠΎΠ»ΠΈΡΠ΅ΡΡΠ²ΠΎ SMS
+
+
+
diff --git a/public/js/app.js b/public/js/app.js
index 6d4c9e4..312b09e 100644
--- a/public/js/app.js
+++ b/public/js/app.js
@@ -20,11 +20,16 @@ function smsruUpdateMessages() {
fetch('/api/v1.0/smsru_status')
.then(response => response.json())
.then(data => {
+ if (data.used_today === null) data.used_today = 0;
+
smsProgress.setAttribute('aria-valuenow', data.used_today);
smsProgress.setAttribute('aria-valuemax', data.total_free);
- smsProgress.setAttribute('style', `width: ${data.used_today / data.total_free * 100}%`);
+ if (data.used_today > 0) {
+ smsProgress.setAttribute('style', `width: ${data.total_free / data.used_today}%`);
+ }
+ else {
+ smsProgress.setAttribute('style', `width: 100%`);
+ }
smsProgress.innerText = `ΠΠΈΠΌΠΈΡ: ${data.used_today} ΠΈΠ· ${data.total_free}`;
});
-
- // console.log(smsProgress);
}