feature: Incorporate new sites routes, add dummy favicon to stop 404 errors

This commit is contained in:
Keith Solomon
2025-05-27 18:51:15 -05:00
parent c133603e43
commit 1c6e96e94c
4 changed files with 35 additions and 43 deletions

1
public/favicon.ico Normal file
View File

@@ -0,0 +1 @@

View File

@@ -7,7 +7,6 @@
--font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
"Courier New", monospace;
--color-blue-400: oklch(70.7% 0.165 254.624);
--color-slate-300: oklch(86.9% 0.022 252.894);
--color-slate-900: oklch(20.8% 0.042 265.755);
--color-gray-200: oklch(92.8% 0.006 264.531);
--color-gray-400: oklch(70.7% 0.022 261.325);
@@ -22,7 +21,6 @@
--font-weight-normal: 400;
--font-weight-bold: 700;
--radius-sm: 0.25rem;
--ease-out: cubic-bezier(0, 0, 0.2, 1);
--ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
--default-transition-duration: 150ms;
--default-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
@@ -34,7 +32,6 @@
--color-success: oklch(64.01% 0.1751 146.7);
--color-info: oklch(0.55 0.0922 211.57);
--color-warning: oklch(84.42% 0.1722 84.93);
--text-18px: clamp(0.875rem, 0.9375vw, 1.9rem);
--text-25px: clamp(1.125rem, 1.3021vw, 2.2rem);
--h1: calc(var(--text-base) * 2.25);
--h2: calc(var(--text-base) * 1.75);
@@ -1469,11 +1466,6 @@
}
}
}
.drawer-content {
grid-column-start: 2;
grid-row-start: 1;
min-width: calc(0.25rem * 0);
}
.container {
width: 100%;
@media (width >= 40rem) {
@@ -2212,9 +2204,6 @@
.min-h-\[70dvh\] {
min-height: 70dvh;
}
.w-96 {
width: calc(var(--spacing) * 96);
}
.w-fit {
width: fit-content;
}
@@ -2265,9 +2254,6 @@
.resize {
resize: both;
}
.list-none {
list-style-type: none;
}
.grid-cols-1 {
grid-template-columns: repeat(1, minmax(0, 1fr));
}
@@ -2335,9 +2321,6 @@
.p-4 {
padding: calc(var(--spacing) * 4);
}
.px-4 {
padding-inline: calc(var(--spacing) * 4);
}
.px-8 {
padding-inline: calc(var(--spacing) * 8);
}
@@ -2347,9 +2330,6 @@
.text-center {
text-align: center;
}
.text-18px {
font-size: var(--text-18px);
}
.text-25px {
font-size: var(--text-25px);
}
@@ -2373,8 +2353,11 @@
.text-gray-800 {
color: var(--color-gray-800);
}
.text-slate-300 {
color: var(--color-slate-300);
.text-info-content {
color: var(--color-info-content);
}
.text-info-content\! {
color: var(--color-info-content) !important;
}
.text-white {
color: var(--color-white);
@@ -2406,10 +2389,6 @@
--tw-ease: var(--ease-in-out);
transition-timing-function: var(--ease-in-out);
}
.ease-out {
--tw-ease: var(--ease-out);
transition-timing-function: var(--ease-out);
}
.card-lg {
.card-body {
--card-p: 2rem;
@@ -2419,18 +2398,10 @@
--cardtitle-fs: 1.25rem;
}
}
.badge-info {
--badge-color: var(--color-info);
--badge-fg: var(--color-info-content);
}
.btn-info {
--btn-color: var(--color-info);
--btn-fg: var(--color-info-content);
}
.btn-primary {
--btn-color: var(--color-primary);
--btn-fg: var(--color-primary-content);
}
.hover\:text-gray-400 {
&:hover {
@media (hover: hover) {
@@ -2438,10 +2409,10 @@
}
}
}
.hover\:text-white {
.hover\:text-info-content\! {
&:hover {
@media (hover: hover) {
color: var(--color-white);
color: var(--color-info-content) !important;
}
}
}
@@ -2452,11 +2423,6 @@
}
}
}
.sm\:grid-cols-2 {
@media (width >= 40rem) {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
}
.md\:grid-cols-3 {
@media (width >= 48rem) {
grid-template-columns: repeat(3, minmax(0, 1fr));

View File

@@ -37,6 +37,31 @@ router.get('/:id', async function (req, res, next) {
}
});
/**
* GET site by domain name.
*
* Returns a specific site by its domain name in JSON format.
*/
router.get('/domain/:domain', async function (req, res, next) {
const domainName = req.params.domain;
let sites = null;
try {
sites = await siteModel.getByDomainName(domainName);
} catch (error) {
console.error('Error fetching site by domain name:', error);
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
}
});
/**
* POST create a new site.
*
@@ -59,7 +84,7 @@ router.post('/add', async function (req, res, next) {
if (!newSite) {
res.status(400).send('Error creating site');
} else {
res.redirect('/'); // status 304
res.status(201).json(newSite);
}
});

View File

@@ -41,7 +41,7 @@ data.forEach(item => {
</div>
<% }) %>
<div class="card-actions justify-end">
<a href="/sites/<%= domain %>" class="btn btn-info hover:text-white!">View All Tests</a>
<a href="/sites/domain/<%= domain %>" class="btn btn-info text-info-content! hover:text-info-content!">View All Tests</a>
</div>
</div>
</div>