diff --git a/static/index.html b/static/index.html index 82ce95b..3ab16ba 100644 --- a/static/index.html +++ b/static/index.html @@ -44,15 +44,23 @@ fetch(location.href + 'meta/ping') .then(res => res.text()) .then(text => { - document.querySelector('#lastChecked').textContent = new Date().toLocaleTimeString(); if (text === 'pong') { document.querySelector('#stateStr').textContent = '✅ Server is running!'; document.querySelector('#catIcon').textContent = '✅'; - } else { - document.querySelector('#stateStr').textContent = '❌ Server is down!'; - document.querySelector('#catIcon').textContent = '❌'; + } else { // Unknow response (? emoji + document.querySelector('#stateStr').textContent = '❓ Server is responding but unknown!'; + document.querySelector('#stateStr').append(document.createElement('br')); + document.querySelector('#stateStr').append(document.createTextNode('Response: ' + text)); + document.querySelector('#stateStr').style.color = '#333'; + document.querySelector('#catIcon').textContent = '❓'; + } - + }).catch(err => { + document.querySelector('#stateStr').textContent = '❌ Server is down!'; + document.querySelector('#catIcon').textContent = '❌'; + }).finally(() => { + const now = new Date(); + document.querySelector('#lastChecked').textContent = now.toLocaleTimeString(); }); }, 1000 * 1); @@ -97,7 +105,8 @@
-

The information below is about the current environment, not necessarily the version running.

+

The information below is about the current environment, not necessarily + the version running.