Skip to content

Commit

Permalink
js flailing
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Reynolds committed Apr 29, 2024
1 parent 8d90978 commit 1ada99b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions labapp/app/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
function fetchAndUpdateStatus() {
let cachedStatus = getCookie('statusCache');
if (cachedStatus) {
document.getElementById('statusText').textContent = cachedStatus;
document.getElementById('siteName').textContent = cachedStatus['site_name'];
} else {
fetch('/_ce_status')
.then(response => {
Expand All @@ -145,9 +145,9 @@
return response.json();
})
.then(data => {
document.getElementById('statusText').textContent = data.status;
document.getElementById('siteName').textContent = data['site_name]'];
// Cache the status in a cookie for 1 day
setCookie('statusCache', data.status, 1);
setCookie('statusCache', data.site_name, 1);
})
.catch(error => {
console.error('There was a problem with the fetch operation:', error);
Expand All @@ -163,7 +163,7 @@
});
</script>
<div class="status-box align-items-center bg-light p-2">
<p>Status: <strong id="statusText">Loading...</strong></p>
<p>Status: <strong id="siteName">Loading...</strong></p>
</div>
{% endif %}

Expand Down

0 comments on commit 1ada99b

Please sign in to comment.