diff options
| author | Andrew Lee <andrew@alee14.me> | 2025-01-11 18:02:05 -0500 |
|---|---|---|
| committer | Andrew Lee <andrew@alee14.me> | 2025-01-11 18:02:05 -0500 |
| commit | 7e65ae0e135098acad76b8081f34478b4efc077f (patch) | |
| tree | b7efc060fca4257a875a5a3e525e2733b6579040 /web/src/pages/index.astro | |
| parent | f5de90ba89146008af78c16e798e216efccf0c50 (diff) | |
| download | AleeBot-7e65ae0e135098acad76b8081f34478b4efc077f.tar.gz AleeBot-7e65ae0e135098acad76b8081f34478b4efc077f.tar.bz2 AleeBot-7e65ae0e135098acad76b8081f34478b4efc077f.zip | |
Cleaned up some code, author image now support attachments
Diffstat (limited to 'web/src/pages/index.astro')
| -rw-r--r-- | web/src/pages/index.astro | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/web/src/pages/index.astro b/web/src/pages/index.astro index b5c607d..8136402 100644 --- a/web/src/pages/index.astro +++ b/web/src/pages/index.astro @@ -2,12 +2,11 @@ import Layout from '../layouts/Layout.astro'; import { PendingQuotes } from '../components/Quotes'; -const version = await fetch('http://localhost:3000/api/version').then(res => res.json()); --- <Layout> <div class="container"> - <h1>AleeBot {version}</h1> + <h1 id="version">AleeBot</h1> <PendingQuotes client:load /> </div> </Layout> @@ -27,3 +26,19 @@ const version = await fetch('http://localhost:3000/api/version').then(res => res } </style> + +<script> + document.addEventListener('DOMContentLoaded', async () => { + try { + const version = await fetch('http://localhost:3000/api/version').then((res) => res.json()); + const versionElement = document.getElementById('version'); + if (versionElement) { + versionElement.textContent = `AleeBot ${version}`; + } else { + console.error('Element with ID "version" not found.'); + } + } catch (e) { + console.error('Failed to fetch version:', e); + } + }); +</script> |
