feat: show version in footer

Co-authored-by: thejjw <72130076+thejjw@users.noreply.github.com>
This commit is contained in:
C4illin 2025-05-23 23:11:54 +02:00
parent d9076bf42a
commit 9a49dedaca
2 changed files with 70 additions and 60 deletions

View file

@ -1,40 +1,58 @@
import { Html } from "@elysiajs/html"; import { Html } from "@elysiajs/html";
import { version } from "../../package.json";
export const BaseHtml = ({
children, export const BaseHtml = ({
title = "ConvertX", children,
webroot = "", title = "ConvertX",
}: { webroot = "",
children: JSX.Element; }: {
title?: string; children: JSX.Element;
webroot?: string; title?: string;
}) => ( webroot?: string;
<html lang="en"> }) => (
<head> <html lang="en">
<meta charset="UTF-8" /> <head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta charset="UTF-8" />
<meta name="webroot" content={webroot} /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title safe>{title}</title> <meta name="webroot" content={webroot} />
<link rel="stylesheet" href={`${webroot}/generated.css`} /> <title safe>{title}</title>
<link <link rel="stylesheet" href={`${webroot}/generated.css`} />
rel="apple-touch-icon" <link
sizes="180x180" rel="apple-touch-icon"
href={`${webroot}/apple-touch-icon.png`} sizes="180x180"
/> href={`${webroot}/apple-touch-icon.png`}
<link />
rel="icon" <link
type="image/png" rel="icon"
sizes="32x32" type="image/png"
href={`${webroot}/favicon-32x32.png`} sizes="32x32"
/> href={`${webroot}/favicon-32x32.png`}
<link />
rel="icon" <link
type="image/png" rel="icon"
sizes="16x16" type="image/png"
href={`${webroot}/favicon-16x16.png`} sizes="16x16"
/> href={`${webroot}/favicon-16x16.png`}
<link rel="manifest" href={`${webroot}/site.webmanifest`} /> />
</head> <link rel="manifest" href={`${webroot}/site.webmanifest`} />
<body class="w-full bg-neutral-900 text-neutral-200">{children}</body> </head>
</html> <body class="flex min-h-screen w-full flex-col bg-neutral-900 text-neutral-200">
); {children}
<footer class="w-full">
<div class="p-4 text-center text-sm text-neutral-500">
<span>Powered by </span>
<a
href="https://github.com/C4illin/ConvertX"
class={`
hover:text-accent-500
text-neutral-400
`}
>
ConvertX{" "}
</a>
<span safe>v{version || ""}</span>
</div>
</footer>
</body>
</html>
);

View file

@ -135,18 +135,6 @@ const app = new Elysia({
prefix: "", prefix: "",
}), }),
) )
.get("/test", () => {
return (
<html lang="en">
<head>
<title>Hello World</title>
</head>
<body>
<h1>Hello</h1>
</body>
</html>
);
})
.get("/setup", ({ redirect }) => { .get("/setup", ({ redirect }) => {
if (!FIRST_RUN) { if (!FIRST_RUN) {
return redirect(`${WEBROOT}/login`, 302); return redirect(`${WEBROOT}/login`, 302);
@ -156,7 +144,7 @@ const app = new Elysia({
<BaseHtml title="ConvertX | Setup" webroot={WEBROOT}> <BaseHtml title="ConvertX | Setup" webroot={WEBROOT}>
<main <main
class={` class={`
mx-auto w-full max-w-4xl px-2 mx-auto w-full max-w-4xl flex-1 px-2
sm:px-4 sm:px-4
`} `}
> >
@ -222,10 +210,11 @@ const app = new Elysia({
webroot={WEBROOT} webroot={WEBROOT}
accountRegistration={ACCOUNT_REGISTRATION} accountRegistration={ACCOUNT_REGISTRATION}
allowUnauthenticated={ALLOW_UNAUTHENTICATED} allowUnauthenticated={ALLOW_UNAUTHENTICATED}
hideHistory={HIDE_HISTORY}
/> />
<main <main
class={` class={`
w-full px-2 w-full flex-1 px-2
sm:px-4 sm:px-4
`} `}
> >
@ -357,7 +346,7 @@ const app = new Elysia({
/> />
<main <main
class={` class={`
w-full px-2 w-full flex-1 px-2
sm:px-4 sm:px-4
`} `}
> >
@ -502,10 +491,11 @@ const app = new Elysia({
accountRegistration={ACCOUNT_REGISTRATION} accountRegistration={ACCOUNT_REGISTRATION}
allowUnauthenticated={ALLOW_UNAUTHENTICATED} allowUnauthenticated={ALLOW_UNAUTHENTICATED}
hideHistory={HIDE_HISTORY} hideHistory={HIDE_HISTORY}
loggedIn
/> />
<main <main
class={` class={`
w-full px-2 w-full flex-1 px-2
sm:px-4 sm:px-4
`} `}
> >
@ -727,12 +717,14 @@ const app = new Elysia({
<> <>
<Header <Header
webroot={WEBROOT} webroot={WEBROOT}
accountRegistration={ACCOUNT_REGISTRATION}
allowUnauthenticated={ALLOW_UNAUTHENTICATED} allowUnauthenticated={ALLOW_UNAUTHENTICATED}
hideHistory={HIDE_HISTORY}
loggedIn loggedIn
/> />
<main <main
class={` class={`
w-full px-2 w-full flex-1 px-2
sm:px-4 sm:px-4
`} `}
> >
@ -1155,7 +1147,7 @@ const app = new Elysia({
/> />
<main <main
class={` class={`
w-full px-2 w-full flex-1 px-2
sm:px-4 sm:px-4
`} `}
> >
@ -1289,7 +1281,7 @@ const app = new Elysia({
/> />
<main <main
class={` class={`
w-full px-2 w-full flex-1 px-2
sm:px-4 sm:px-4
`} `}
> >
@ -1604,7 +1596,7 @@ const app = new Elysia({
/> />
<main <main
class={` class={`
w-full px-2 w-full flex-1 px-2
sm:px-4 sm:px-4
`} `}
> >