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,4 +1,5 @@
import { Html } from "@elysiajs/html"; import { Html } from "@elysiajs/html";
import { version } from "../../package.json";
export const BaseHtml = ({ export const BaseHtml = ({
children, children,
@ -35,6 +36,23 @@ export const BaseHtml = ({
/> />
<link rel="manifest" href={`${webroot}/site.webmanifest`} /> <link rel="manifest" href={`${webroot}/site.webmanifest`} />
</head> </head>
<body class="w-full bg-neutral-900 text-neutral-200">{children}</body> <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> </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
`} `}
> >