From 0d83286d9cb3f0e0736a3e968e0695e03162eabc Mon Sep 17 00:00:00 2001 From: Kevin Reynolds Date: Mon, 29 Apr 2024 12:44:52 -0400 Subject: [PATCH] ugh --- labapp/app/templates/base.html | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/labapp/app/templates/base.html b/labapp/app/templates/base.html index 81764dd..2ef567b 100644 --- a/labapp/app/templates/base.html +++ b/labapp/app/templates/base.html @@ -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); @@ -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 = ""; }); }