Skip to content

Commit

Permalink
ugh
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Reynolds committed Apr 29, 2024
1 parent 2c9eab3 commit 0d83286
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions labapp/app/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@
})
.then(data => {
if (!data.err) {
document.getElementById('statusText').textContent = `Site Name: ${data.site_name}, State: ${data.state}`;
document.getElementById('siteName').textContent = data.site_name;
document.getElementById('siteState').textContent = data.state;

// Expire the old cookies just before setting new ones
setCookie('siteNameCache', '', 0);
Expand All @@ -153,12 +154,14 @@
setCookie('stateCache', data.state, 1);
} else {
// Handle potential errors in data retrieval
document.getElementById('statusText').textContent = 'Error fetching status';
document.getElementById('siteName').textContent = "";
document.getElementById('siteState').textContent = "";
}
})
.catch(error => {
console.error('There was a problem with the fetch operation:', error);
document.getElementById('statusText').textContent = 'Error';
document.getElementById('siteName').textContent = "";
document.getElementById('siteState').textContent = "";
});
}

Expand Down

0 comments on commit 0d83286

Please sign in to comment.