diff --git a/webui/index.html b/webui/index.html index b379779..6e1a208 100644 --- a/webui/index.html +++ b/webui/index.html @@ -15,7 +15,7 @@

Uncomplicated Alert Receiver

- Nothing received yet + Never updated GitHub Logo diff --git a/webui/js/main.js b/webui/js/main.js index a7fbdfa..a154bc1 100644 --- a/webui/js/main.js +++ b/webui/js/main.js @@ -41,6 +41,9 @@ function fetchAlertList () { } renderLastUpdated(res) + }).catch(error => { + document.getElementById('last-updated').textContent = 'Fetch error' + document.getElementById('last-updated').classList.add('critical') }) } @@ -55,12 +58,14 @@ function renderLastUpdated (res) { if (deltaLastUpdated < -100) { document.getElementById('last-updated').classList.add('critical') - } else if (deltaLastUpdated > 0) { document.getElementById('last-updated').classList.add('info') } else { document.getElementById('last-updated').classList.remove('critical') } + } else if (res.LastUpdated === 0) { + document.getElementById('last-updated').textContent = 'Nothing received yet' + document.getElementById('last-updated').classList.add('critical') } }