feature: Add basic template and wire up single domain list

This commit is contained in:
Keith Solomon
2025-05-27 19:05:06 -05:00
parent 1c6e96e94c
commit cfba9672ef
3 changed files with 16 additions and 1496 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -53,12 +53,10 @@ router.get('/domain/:domain', async function (req, res, next) {
return res.status(400).send('Error fetching site: ' + error.message);
}
console.log('Site found:', sites);
if (!sites || sites.length === 0) {
return res.status(404).send('Site not found');
} else {
res.json(sites[0]); // Return the first match
res.render('sites', { title: 'Playwright Testing Dashboard', sites: sites });
}
});

15
views/sites.ejs Normal file
View File

@@ -0,0 +1,15 @@
<%- include('header'); -%>
<article class="container mx-auto py-4 min-h-[70dvh]">
<h2>Welcome to <%= title %></h2>
<%- include('add-form'); -%>
<h2 class="text-25px font-bold mt-8">Your Tests</h2>
<div class="mt-8">
<%- include('domain-cards', { data: sites }); -%>
</div>
</article>
<%- include('footer'); -%>